Browse Source

Merge branch 'v3.0-dev-before' into v3.0

snow 1 year ago
parent
commit
a5dd30f8a1

+ 1 - 1
src/layout/components/Navbar.vue

@@ -50,7 +50,7 @@
         />
       </el-tooltip>
       <el-tooltip
-        v-if="device !== 'mobile' && Number(currentLevel) !== 3"
+        v-if="device !== 'mobile'"
         placement="bottom"
         content="登录采销数据统计"
       >

+ 16 - 2
src/views/netOrderEntry/netOrderEnter/addEdit.vue

@@ -406,6 +406,7 @@ const defaultData = {
   tax: ""
 };
 
+
 export default {
   name: "Terrace",
   mixins: [resToken, companyHelper],
@@ -423,6 +424,19 @@ export default {
       }
     };
 
+    const validateCode = (rule, value, callback) => {
+      const len = value.length
+        if (value === '') {
+          callback(new Error('PO编号能为空!'))
+        } else if (len < 0 || len > 255) {
+          callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+        } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
+          callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+        } else {
+          callback()
+        }
+    }
+
     return {
       loading: false,
       detailLoading: false,
@@ -501,8 +515,8 @@ export default {
         poCode: [
           {
             required: true,
-            message: "请输入PO编号",
-            trigger: "blur"
+            trigger: "blur",
+            validator:validateCode
           }
         ],
         khNo: [

+ 29 - 0
src/views/netOrderEntry/prestoreRecordingOrders/importTemplateModal.vue

@@ -134,6 +134,23 @@ export default {
         return verification;
       }
       return verification;
+    },
+       /* 校验导入的购买方列表编码(开头必须为KH) **/
+    validatePoCode(value, row) {
+      const verification = createFieldVerification();
+      const len = value.length
+        if (value === '') {
+          verification.isValid = false;
+          verification.message = `第 ${row} 行,平台订单编号不能为空`;
+        } else if (len < 0 || len > 255) {
+          verification.isValid = false;
+          verification.message = `第 ${row} 行,平台订单编号仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!`;
+        } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
+          verification.isValid = false;
+          verification.message = `第 ${row} 行,平台订单编号仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!`;
+        } 
+
+      return verification;
     },
     formatDate2(serialNumber, format = "-", mao = ":") {
       var timestamp = (serialNumber - 25569 - 8 / 24) * 86400 * 1000; // 转换为时间戳
@@ -330,6 +347,18 @@ export default {
             }
           }
 
+          if(field === PROPERTYS.PO_CODE){
+            verification = this.validatePoCode(tableItem[field], index);
+            if (!verification.isValid) {
+              MessageBox({
+                type: "warning",
+                title: "数据填写错误",
+                message: verification.message
+              });
+              return false;
+            }
+          }
+
           if (field === PROPERTYS.COMPANY_NO) {
             verification = this.validateCompanyNo(tableItem[field], index);
             if (!verification.isValid) {

+ 5 - 0
src/views/sellOut/salesOrder/columns.js

@@ -31,6 +31,11 @@ export default [
     label: '销售单价',
     width: '110'
   },
+  {
+    prop: 'platform_order',
+    label:'平台订单号',
+    width: '140'
+  },
   {
     prop: 'total_price',
     label: '总价',

+ 17 - 0
src/views/sellOut/salesOrder/components/addForm.vue

@@ -771,6 +771,23 @@ export default {
       },
       rulesThis: this.rules,
       rules: {
+        platform_order:[
+          {
+            trigger: 'change',
+            validator:(rule, value, callback) => {
+              const len = value.length
+              if (value === '' || !value) {
+                callback()
+              } else if (len < 0 || len > 255) {
+                callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+              } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
+                callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+              } else {
+                callback()
+              }
+            }
+          }
+        ],
         managerid: [
           {
             required: true,

+ 4 - 1
src/views/sellOut/salesOrder/index.vue

@@ -199,12 +199,13 @@
                 >
                   <el-select
                     v-model="select"
-                    style="width: 100px"
+                    style="width: 120px"
                     slot="prepend"
                     placeholder="关键字类型"
                     @change="searchList"
                   >
                     <el-option label="订单编号" value="orderCode"></el-option>
+                    <el-option label="平台订单编号" value="platform_order"></el-option>
                     <el-option label="商品名称" value="good_name"></el-option>
                     <el-option label="创建人" value="apply_name"></el-option>
                     <el-option label="创建人部门" value="company_name"></el-option>
@@ -609,6 +610,8 @@ export default {
       this.loading = true;
       this.parmValue.orderCode = this.select === "orderCode" ? this.input : "";
       this.parmValue.good_name = this.select === "good_name" ? this.input : "";
+      this.parmValue.platform_order = this.select === 'platform_order' ? this.input : "";
+      
       this.parmValue.apply_name =
         this.select === "apply_name" ? this.input : "";
       this.parmValue.company_name =

+ 14 - 1
src/views/sellOut/salesOrder/setPartial.vue

@@ -80,6 +80,19 @@ export default {
   mixins: [resToken],
   props: ['showModel', 'sitem'],
   data() {
+    const validateCode = (rule, value, callback) => {
+      const len = value.length
+        if (value === '') {
+          callback(new Error('平台编号不能为空!'))
+        } else if (len < 0 || len > 255) {
+          callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+        } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
+          callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+        } else {
+          callback()
+        }
+    }
+
     return {
       loading: false,
       title: '添加单位',
@@ -102,7 +115,7 @@ export default {
           { required: true, message: '请选择承诺回款时间', trigger: 'change' }
         ],
         platform_order: [
-          { required: true, message: '请输入平台订单号', trigger: 'blur' }
+          { required: true, trigger: 'blur',validator: validateCode }
         ],
         workNo: [
           { required: true, message: '请输入其他单号', trigger: 'blur' }

+ 20 - 0
src/views/sellOut/zixunOrder/components/buyGoodModal.vue

@@ -605,6 +605,20 @@ export default {
         }
       }
     };
+
+    const validateCode = (rule, value, callback) => {
+      const len = value.length
+        if (value === '' || !value) {
+          callback()
+        } else if (len < 0 || len > 255) {
+          callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+        } else if (/^(?=.*[A-Z])(?=.*\d)[A-Z\d]+(?:,[A-Z\d]+)*$/.test(value) == false) {
+          callback(new Error('仅支持大写字母数字组合,多个编号使用逗号分隔(0~255位)!'))
+        } else {
+          callback()
+        }
+    }
+
     return {
       loading: false,
       total_price: "0",
@@ -670,6 +684,12 @@ export default {
       manager_name: "",
       rulesThis: this.rules,
       rules: {
+        platform_order:[
+        {
+            trigger: "change",
+            validator:validateCode
+          }
+        ],
         goodtype: [
           {
             required: true,