Forráskód Böngészése

快递数量手动修改

sunchengjie 11 hónapja
szülő
commit
fb16352e69
1 módosított fájl, 11 hozzáadás és 1 törlés
  1. 11 1
      src/pages/new/storage.vue

+ 11 - 1
src/pages/new/storage.vue

@@ -36,7 +36,7 @@
                     </template>
                 </van-field>
 
-                <van-field value="1" name="expressQuantity" placeholder="请输入快递数量" label="快递数量" readonly />
+                <van-field v-model="object.expressNum" name="expressQuantity" placeholder="请输入快递数量" label="快递数量" />
 
                 <van-field readonly clickable name="shelfInformation" label="货架信息" :value="object.value4"
                     placeholder="请选择货架" @click="shelf = true" :rules="[{ required: true }]" />
@@ -124,6 +124,7 @@ export default {
             onGroupObject: {},//点击后映射的参数
             GeLogisticsList: [],//存放快递公司
             object: {
+                expressNum: 1,//快递数量
                 remark: '',
                 radio: '文件',
                 payMoney: '',//应付金额
@@ -139,6 +140,7 @@ export default {
             shelfs: [], //收发室
             shelf: false, //收发室
             pattern: /^\d*\.?\d+$/, // 有问题
+            regex: /^[1-9]\d*$/,
             floorId: '',
             shelfsss: [],//
             getPrintersList: [],//打印机获取数据
@@ -252,6 +254,12 @@ export default {
 
         // 提交
         async onSubmit(values) {
+            if (!this.regex.test(this.object.expressNum)) {
+                this.$toast('快递数量不能为0以下或小数')
+                throw '快递数量不能为0以下或小数'
+            }
+            console.log(!this.regex.test(this.object.expressNum))
+
             if (this.checkbox == true) {
                 if (!this.pattern.test(this.object.payMoney)) {
                     this.$toast('到付金额只能输入数字')
@@ -280,6 +288,7 @@ export default {
                 value.senderDepartmentId = this.expressInfo.send_dept_name
             }
             const _params = { ...params, ...value, departmentId: this.onGroupObject.departmentName }
+            console.log(_params, ' _params===========')
             const res = await appSaveExpressRecord(_params, { emulateJSON: true, loading: true })
             this.value14 = this.object.value4
             if (res.msg == 'success') {
@@ -291,6 +300,7 @@ export default {
                 this.isPrint = false;
                 this.expressInfo = {};
                 this.object = {
+                    expressNum: 1,
                     remark: '',
                     radio: '文件',
                     payMoney: '',