snow 2 jaren geleden
bovenliggende
commit
5458b6f2c5

File diff suppressed because it is too large
+ 0 - 0
dist/static/js/0.js


+ 1 - 0
src/mixins/privateField.js

@@ -15,6 +15,7 @@ const privateField = {
     isDisplayPrivateField(type) {
       const vm = this
       const { isSupertube, originLevel, private_field } = vm
+      console.log(isSupertube)
       if (isSupertube) return true
       if (originLevel === '3' && type === '1') return true
       if (originLevel === '2' && private_field && private_field.includes(type)) return true

+ 13 - 31
src/views/netOrderEntry/prestoreRecordingOrders/importTemplateModal.vue

@@ -169,16 +169,14 @@ export default {
       return verification
     },
     /* 校验导入的税率、数量、采购单价、销售单价是否为数字 **/
-    validateDateField(dateFields) {
-      const verification = createFieldVerification()
-      dateFields.forEach((date, index) => {
-        if (!(/^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/.test(date))) {
-          verification.isValid = false
-          verification.message = `第${Number(index)}行,发货日期不能为空,且必须为日期格式`
-          return verification
-        }
-      })
-      return verification
+    validateDateField(value) {
+      // const verification = createFieldVerification()
+      // if (!(/^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/.test(value))) {
+      //   verification.isValid = false
+      //   verification.message = `第${Number(index)}行,发货日期不能为空,且必须为日期格式`
+      //   return verification
+      // }
+      return /^\d{4}-\d{1,2}-\d{1,2}\s\d{1,2}:\d{1,2}:\d{1,2}$/.test(value)
     },
     validateRequiredField(field, value, row) {
       const verification = createFieldVerification()
@@ -204,26 +202,6 @@ export default {
     },
     /* 校验导入的数据 **/
     validateFields(tableData = []) {
-      // const mapTableFieldToTableData = {}
-      // for (const tableItem of tableData) {
-      //   const propertys = Object.keys(tableItem)
-      //   for (const property of propertys) {
-      //     const value = tableItem[property]
-      //     if (!mapTableFieldToTableData[property]) mapTableFieldToTableData[property] = []
-      //     mapTableFieldToTableData[property].push(value)
-      //   }
-      // }
-      // return this.handleNotValidFields(
-      //   () => this.validateRequiredField(helper.write(mapTableFieldToTableData, requiredFields)),
-      //   () => this.validateIntNumberField(helper.write(mapTableFieldToTableData, intNumberFields)),
-      //   () => this.validateNumberField(helper.write(mapTableFieldToTableData, numberFields)),
-      //   () => this.validateDateField(mapTableFieldToTableData[PROPERTYS.SEND_TIME]),
-      //   () => this.validateMobile(mapTableFieldToTableData[PROPERTYS.MOBILE]),
-      //   () => this.validateKhNo(mapTableFieldToTableData[PROPERTYS.CUSTOMER_NO]),
-      //   () => this.validateCompanyNo(mapTableFieldToTableData[PROPERTYS.COMPANY_NO]),
-      //   () => this.validateSupplierNo(mapTableFieldToTableData[PROPERTYS.SUPPLIER_NO])
-      // )
-
       let verification = null
       for (const row in tableData) {
         if (row === 'remove') {
@@ -320,7 +298,10 @@ export default {
         Object.keys(tableItem).forEach(field => {
           let target = ''
           if (field === PROPERTYS.SEND_TIME) {
-            target = this.formatDate2(tableItem[PROPERTYS.SEND_TIME])
+            console.log(tableItem[PROPERTYS.SEND_TIME])
+            target = this.validateDateField(tableItem[PROPERTYS.SEND_TIME])
+              ? tableItem[PROPERTYS.SEND_TIME]
+              : this.formatDate2(tableItem[PROPERTYS.SEND_TIME])
           } else {
             target = tableItem[field] ? String(tableItem[field]).trim() : ''
           }
@@ -336,6 +317,7 @@ export default {
 
       const list = this.tableData.map(tableItem => requsetFields.reduce((prev, currentKey) => ({
         ...prev,
+        workCode: '',
         [currentKey]: tableItem[currentKey]
       }), {}))
 

+ 71 - 65
src/views/netOrderEntry/prestoreRecordingOrders/template.js

@@ -8,22 +8,23 @@ const mapTemplateToTable = {
   '二级品类ID': 'cat_id2',
   '三级品类ID': 'cat_id',
   '商品单位ID': 'good_unit',
+  '商品名称': 'good_name',
+  '销售单价': 'sale_price',
+  '数量': 'good_num',
+  '销售总额': 'good_total',
   '税率': 'good_tax',
-  '单据号': 'workCode',
+  '采购单价': 'cgd_price',
+  '采购毛利率': 'cgd_tax',
   'PO编号': 'poCode',
   '收货人': 'contactor',
   '联系电话': 'mobile',
-  '发货时间': 'sendtime',
   '联系地址': 'addr',
-  '商品名称': 'good_name',
-  '数量': 'good_num',
-  '销售单价': 'sale_price',
-  '采购单价': 'cgd_price',
-  '采购毛利率': 'cgd_tax',
-  '销售总额': 'good_total'
+  '发货时间': 'sendtime'
 }
+// '单据号': 'workCode',
 
 export const getTableProperty = (key) => mapTemplateToTable[key]
+
 export const getTableLabel = (field) => {
   const keys = Object.keys(mapTemplateToTable)
   for (const key of keys) {
@@ -55,10 +56,30 @@ export const PROPERTYS = {
   WORK_CODE: getTableProperty('单据号')
 }
 
-export const template = Array(1).fill(1).map(() => Object.keys(mapTemplateToTable).reduce((prev, property) => {
-  prev[property] = ''
-  return prev
-}, {}))
+export const template = [
+  {
+    '所属平台ID': '58',
+    '供应商公司编码': 'QS2206011407522117',
+    '销售方公司编码': 'GS2302231323386950',
+    '购买方公司编码': 'KH2203271822232121',
+    '一级品类ID': '871',
+    '二级品类ID': '871',
+    '三级品类ID': '871',
+    '商品单位ID': '7',
+    '商品名称': '测试商品名称',
+    '销售单价': '32',
+    '数量': '100',
+    '销售总额': '3200',
+    '税率': '13',
+    '采购单价': '30.08',
+    '采购毛利率': '6',
+    'PO编号': 'PO206020230400240002',
+    '收货人': '张三',
+    '联系电话': '19955554444',
+    '联系地址': 'xx市xx区xx街道',
+    '发货时间': '2023-4-9 8:00:00'
+  }
+]
 
 export const columns = [
   {
@@ -66,21 +87,6 @@ export const columns = [
     label: '序号',
     width: '70px'
   },
-  // {
-  //   prop: getTableProperty('销售方公司名称'),
-  //   label: '销售方公司名称',
-  //   width: '156px'
-  // },
-  // {
-  //   prop: getTableProperty('购买方公司名称'),
-  //   label: '购买方公司名称',
-  //   width: '180px'
-  // },
-  // {
-  //   prop: getTableProperty('供应商公司名称'),
-  //   label: '供应商公司名称',
-  //   width: '120px'
-  // },
   {
     prop: PROPERTYS.PLATFORM,
     label: '所属平台ID',
@@ -131,79 +137,79 @@ export const columns = [
     required: true
   },
   {
-    prop: PROPERTYS.TAX,
-    label: '税率',
+    prop: PROPERTYS.GOOD_NAME,
+    label: '商品名称',
     width: '150px',
     required: true
   },
   {
-    prop: PROPERTYS.WORK_CODE,
-    label: '单据号',
-    'width': '150px'
-  },
-  {
-    prop: PROPERTYS.PO_CODE,
-    label: 'PO编号',
+    prop: PROPERTYS.GOOD_PRICE,
+    label: '销售单价',
     'width': '150px',
     required: true
   },
   {
-    prop: PROPERTYS.CONTACTOR,
-    label: '收货人',
-    'width': '150px',
+    prop: PROPERTYS.GOOD_NUM,
+    label: '数量',
+    width: '140px',
     required: true
   },
   {
-    prop: PROPERTYS.MOBILE,
-    label: '联系电话',
-    'width': '150px',
-    required: true
+    prop: PROPERTYS.GOOD_TOTAL,
+    label: '销售总额',
+    'width': '150px'
   },
   {
-    prop: PROPERTYS.SEND_TIME,
-    label: '发货时间',
-    'width': '150px',
+    prop: PROPERTYS.TAX,
+    label: '税率',
+    width: '150px',
     required: true
   },
   {
-    prop: PROPERTYS.ADDR,
-    label: '联系地址',
+    prop: PROPERTYS.CGD_PRICE,
+    label: '采购单价',
     'width': '150px',
     required: true
   },
   {
-    prop: PROPERTYS.GOOD_NAME,
-    label: '商品名称',
-    width: '150px',
-    required: true
+    prop: PROPERTYS.CGD_TAX,
+    label: '采购毛利率',
+    'width': '150px'
   },
   {
-    prop: PROPERTYS.GOOD_NUM,
-    label: '数量',
-    width: '140px',
+    prop: PROPERTYS.PO_CODE,
+    label: 'PO编号',
+    'width': '150px',
     required: true
   },
   {
-    prop: PROPERTYS.GOOD_PRICE,
-    label: '销售单价',
+    prop: PROPERTYS.CONTACTOR,
+    label: '收货人',
     'width': '150px',
     required: true
   },
+  // {
+  //   prop: PROPERTYS.WORK_CODE,
+  //   label: '单据号',
+  //   'width': '150px'
+  // },
   {
-    prop: PROPERTYS.CGD_PRICE,
-    label: '采购单价',
+    prop: PROPERTYS.MOBILE,
+    label: '联系电话',
     'width': '150px',
     required: true
   },
   {
-    prop: PROPERTYS.CGD_TAX,
-    label: '采购毛利率',
-    'width': '150px'
+    prop: PROPERTYS.ADDR,
+    label: '联系地址',
+    'width': '150px',
+    required: true
   },
   {
-    prop: PROPERTYS.GOOD_TOTAL,
-    label: '销售总额',
-    'width': '150px'
+    prop: PROPERTYS.SEND_TIME,
+    label: '发货时间',
+    'width': '150px',
+    required: true
   }
 ]
 

+ 4 - 13
src/views/sellOut/bargainList/detail.vue

@@ -75,12 +75,7 @@
             <el-collapse-item
               title="商品成本信息"
               name="6"
-              v-if="
-                newTime !== '' &&
-                private_field &&
-                private_field.length > 0 &&
-                private_field.some((item) => item == '1')
-              "
+              v-if="isDisplayPrivateField('1')"
             >
               <show-data-table
                 :newTime="newTime"
@@ -93,12 +88,7 @@
             <el-collapse-item
               title="商品毛利信息"
               name="7"
-              v-if="
-                newTime !== '' &&
-                private_field &&
-                private_field.length > 0 &&
-                private_field.some((item) => item == '3')
-              "
+              v-if="isDisplayPrivateField('3')"
             >
               <show-data-table
                 :newTime="newTime"
@@ -171,12 +161,13 @@ import {
   statusList,
   rate_status_options,
 } from "./columns";
+import privateField from '../../../mixins/privateField';
 export default {
   components: {
     examFormss,
   },
   name: "bargainListDetail",
-  mixins: [resToken],
+  mixins: [resToken,privateField],
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size", "private_field", "isSupertube"]),
     powers() {

Some files were not shown because too many files changed in this diff