18513069273 %!s(int64=4) %!d(string=hai) anos
pai
achega
92092be0bf

+ 129 - 57
src/views/contractManagement/purchaseContractAdd.vue

@@ -239,12 +239,9 @@
         <!--交货日期(起)-->
         <ws-form-item label="交货日期(起)" span="1" prop="deliveryDateStart">
           <ws-date-picker
-            :picker-options="pickerBeginDateBefore"
             v-model="deptBudgetList.deliveryDateStart"
             type="date"
-            default-value="1980-01-01"
             placeholder="请选择交货日期(起)"
-            format="yyyy-MM-dd"
             value-format="yyyy-MM-dd"
           />
         </ws-form-item>
@@ -267,12 +264,9 @@
         <!--交货日期(止)-->
         <ws-form-item label="交货日期(止)" span="1" prop="deliveryDateEnd">
           <ws-date-picker
-            :picker-options="pickerBeginDateBefore"
             v-model="deptBudgetList.deliveryDateEnd"
             type="date"
-            default-value="1980-01-01"
-            placeholder="请选择交货日期(起)"
-            format="yyyy-MM-dd"
+            placeholder="请选择交货日期(止)"
             value-format="yyyy-MM-dd"
           />
         </ws-form-item>
@@ -290,12 +284,9 @@
         <!--签订日期-->
         <ws-form-item label="签订日期" span="1" prop="signingDate">
           <ws-date-picker
-            :picker-options="pickerBeginDateBefore"
             v-model="deptBudgetList.signingDate"
             type="date"
-            default-value="1980-01-01"
             placeholder="请选择合同签订日期"
-            format="yyyy-MM-dd"
             value-format="yyyy-MM-dd"
           />
         </ws-form-item>
@@ -588,7 +579,7 @@ export default {
         },
         contractProcessInfo: {},
       },
-
+      acceptanceCheck: {},
       pickerBeginDateBefore: {
         disabledDate: (time) => {
           return time.getTime() > Date.now()
@@ -707,6 +698,7 @@ export default {
     },
 
     submit() {
+      console.log(this.deptBudgetList)
       if (!this.deptBudgetList.contractNo) {
         this.$message({
           message: '请输入合同编号',
@@ -856,7 +848,10 @@ export default {
 
       if (
         isNaN(this.deptBudgetList.weight) ||
-        /\.\d{3}$/.test(this.deptBudgetList.weight) == false ||
+        (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.weight).length -
+            (String(this.deptBudgetList.weight).indexOf('.') + 1) >
+            3) ||
         this.deptBudgetList.weight < 0 ||
         this.deptBudgetList.weight > 200000
       ) {
@@ -951,7 +946,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.impurity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.impurity)
+        (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.impurity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '杂质输入错误',
@@ -961,7 +963,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.bulkDensity)
+        (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '容重输入错误',
@@ -971,7 +981,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.mildewGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
+            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '霉变粒输入错误',
@@ -981,7 +999,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.jiaorenli)
+        (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
+            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '热损伤输入错误',
@@ -991,7 +1016,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.imperfectGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
+            (String(
+              this.deptBudgetList.contractGoodsInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '不完整粒输入错误',
@@ -1000,10 +1033,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) |
+        (this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.goodsNameKey < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsNameKey) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.goodsNameKey
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '合同收入金额输入错误',
@@ -1012,10 +1052,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
+        (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
           (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.waterContent) ==
-          false
+        (String(this.deptBudgetList.ccontractProcessInfo.waterContent).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.waterContent).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.waterContent
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '费用金额输入错误',
@@ -1024,22 +1071,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.mildewGrain) ==
-          false
-      ) {
-        this.$message({
-          message: '未回款金额输入错误',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        (!this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
+        (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsName) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsName).length -
+            (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '已开发票金额输入错误',
@@ -1048,10 +1090,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
+        (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.impurity) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.impurity).length -
+            (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '未开发票金额输入错误',
@@ -1060,11 +1109,18 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
+        (this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
           (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
-        /\.\d{3}$/.test(
-          this.deptBudgetList.contractProcessInfo.imperfectGrain
-        ) == false
+        (String(this.deptBudgetList.contractProcessInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.imperfectGrain)
+            .length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '已完成发运量输入错误',
@@ -1091,6 +1147,22 @@ export default {
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()
     },
+    addClick() {
+      // let [flag, constValue, constKey] = ['check', '', '']
+      // let obj = { flag, constValue, constKey }
+      // let objAdd = { flag: 'add', constValue: '新增项目', constKey: '' }
+      // let result = this.unitList.filter((item, val, arr) => {
+      //   return item.id != '1'
+      // })
+      // result.push(obj)
+      // result.push(objAdd)
+      // this.unitList = result
+      this.unitList.push({
+        flag: 'add',
+        constValue: '',
+        constKey: '',
+      })
+    },
     saveClick(item, index) {
       console.log(item)
 
@@ -1108,23 +1180,23 @@ export default {
       }
       if (item.flag == 'add') {
         item.constKey = Math.random() * 20
-        this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
-        this.trainingMethods.constKey = item.constKey
-        this.trainingMethods.constCode = 'TYPEYAN'
-        this.trainingMethods.constValue = item.constValue
-        this.trainingMethods.id = item.id
-        addxiala(this.trainingMethods)
+        this.acceptanceCheck.compId = this.compId
+        this.acceptanceCheck.constKey = item.constKey
+        this.acceptanceCheck.constCode = 'TYPEYAN'
+        this.acceptanceCheck.constValue = item.constValue
+        this.acceptanceCheck.id = item.id
+        addxiala(this.acceptanceCheck)
           .toPromise()
           .then((response) => {
             this.getUnitList()
           })
       } else if (item.flag == 'check') {
-        this.trainingMethods.compId = sessionStorage.getItem('ws-pf_compId')
-        this.trainingMethods.constKey = item.constKey
-        this.trainingMethods.constCode = 'TYPEYAN'
-        this.trainingMethods.constValue = item.constValue
-        this.trainingMethods.id = item.id
-        editxiala(this.trainingMethods)
+        this.acceptanceCheck.compId = this.compId
+        this.acceptanceCheck.constKey = item.constKey
+        this.acceptanceCheck.constCode = 'TYPEYAN'
+        this.acceptanceCheck.constValue = item.constValue
+        this.acceptanceCheck.id = item.id
+        editxiala(this.acceptanceCheck)
           .toPromise()
           .then((response) => {
             this.getUnitList()

+ 184 - 33
src/views/contractManagement/purchaseContractEdit.vue

@@ -559,6 +559,7 @@ export default {
           return time.getTime() > Date.now()
         },
       },
+      acceptanceCheck: {},
       compId: sessionStorage.getItem('ws-pf_compId'),
     }
   },
@@ -615,6 +616,22 @@ export default {
           this.ChapterTwoList = response
         })
     },
+    addClick() {
+      // let [flag, constValue, constKey] = ['check', '', '']
+      // let obj = { flag, constValue, constKey }
+      // let objAdd = { flag: 'add', constValue: '新增项目', constKey: '' }
+      // let result = this.unitList.filter((item, val, arr) => {
+      //   return item.id != '1'
+      // })
+      // result.push(obj)
+      // result.push(objAdd)
+      // this.unitList = result
+      this.unitList.push({
+        flag: 'add',
+        constValue: '',
+        constKey: '',
+      })
+    },
     // 上传附件
     uploadSuccess(data, files, url) {
       console.log(data, files, url)
@@ -686,6 +703,76 @@ export default {
         }
       }
     },
+    saveClick(item, index) {
+      console.log(item)
+
+      if (Object.is(item.id, 1)) {
+        return
+      }
+      if (Object.is(this.unitList[index].flag, 'delete')) {
+        this.$set(this.unitList, index, { flag: 'check' })
+      } else {
+        this.$set(this.unitList, index, { flag: 'delete' })
+      }
+      if (!item.constValue) {
+        this.unitList.splice(index, 1)
+        return
+      }
+      if (item.flag == 'add') {
+        item.constKey = Math.random() * 20
+        this.acceptanceCheck.compId = this.compId
+        this.acceptanceCheck.constKey = item.constKey
+        this.acceptanceCheck.constCode = 'TYPEYAN'
+        this.acceptanceCheck.constValue = item.constValue
+        this.acceptanceCheck.id = item.id
+        addxiala(this.acceptanceCheck)
+          .toPromise()
+          .then((response) => {
+            this.getUnitList()
+          })
+      } else if (item.flag == 'check') {
+        this.acceptanceCheck.compId = this.compId
+        this.acceptanceCheck.constKey = item.constKey
+        this.acceptanceCheck.constCode = 'TYPEYAN'
+        this.acceptanceCheck.constValue = item.constValue
+        this.acceptanceCheck.id = item.id
+        editxiala(this.acceptanceCheck)
+          .toPromise()
+          .then((response) => {
+            this.getUnitList()
+          })
+      }
+    },
+    // 编辑
+    editClick(item, index) {
+      const map = JSON.parse(JSON.stringify(item))
+      if (Object.is(item.id, 1)) {
+        return
+      }
+      if (Object.is(this.unitList[index].flag, 'delete')) {
+        map.flag = 'check'
+        this.$set(this.unitList, index, map)
+      } else {
+        map.flag = 'delete'
+        this.$set(this.unitList, index, map)
+      }
+    },
+    // 删除
+    deleteClick(item, index) {
+      if (Object.is(item.constKey, 1)) {
+        return
+      }
+      if (!item.constValue) {
+        this.unitList.splice(index, 1)
+        return
+      }
+      delxiala({ id: this.unitList[index].id })
+        .toPromise()
+        .then((response) => {
+          this.getUnitList()
+          this.pleaseChoose = ''
+        })
+    },
     submit() {
       if (!this.deptBudgetList.contractNo) {
         this.$message({
@@ -836,7 +923,10 @@ export default {
 
       if (
         isNaN(this.deptBudgetList.weight) ||
-        /\.\d{3}$/.test(this.deptBudgetList.weight) == false ||
+        (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.weight).length -
+            (String(this.deptBudgetList.weight).indexOf('.') + 1) >
+            3) ||
         this.deptBudgetList.weight < 0 ||
         this.deptBudgetList.weight > 200000
       ) {
@@ -931,7 +1021,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.impurity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.impurity)
+        (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.impurity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '杂质输入错误',
@@ -941,7 +1038,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.bulkDensity)
+        (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '容重输入错误',
@@ -951,7 +1056,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.mildewGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
+            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '霉变粒输入错误',
@@ -961,7 +1074,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.jiaorenli)
+        (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
+            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '热损伤输入错误',
@@ -971,7 +1091,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.imperfectGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
+            (String(
+              this.deptBudgetList.contractGoodsInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '不完整粒输入错误',
@@ -982,8 +1110,15 @@ export default {
       if (
         (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.goodsNameKey < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsNameKey) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.goodsNameKey
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '合同收入金额输入错误',
@@ -992,10 +1127,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
+        (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
           (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.waterContent) ==
-          false
+        (String(this.deptBudgetList.ccontractProcessInfo.waterContent).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.waterContent).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.waterContent
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '费用金额输入错误',
@@ -1004,22 +1146,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.mildewGrain) ==
-          false
-      ) {
-        this.$message({
-          message: '未回款金额输入错误',
-          type: 'warning',
-        })
-        return
-      }
-      if (
-        (!this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
+        (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsName) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsName).length -
+            (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '已开发票金额输入错误',
@@ -1028,10 +1165,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
+        (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.impurity) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.impurity).length -
+            (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '未开发票金额输入错误',
@@ -1040,11 +1184,18 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
+        (this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
           (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
-        /\.\d{3}$/.test(
-          this.deptBudgetList.contractProcessInfo.imperfectGrain
-        ) == false
+        (String(this.deptBudgetList.contractProcessInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.imperfectGrain)
+            .length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '已完成发运量输入错误',

+ 132 - 37
src/views/contractManagement/salesContractAdd.vue

@@ -588,7 +588,7 @@ export default {
       // 提交类型
       submitType: true,
       tableData: [{ date: 1111, name: 'qqqq', address: 'errrtt' }],
-
+      trainingMethods: {},
       packtypeList: [],
       compId: sessionStorage.getItem('ws-pf_compId'),
       mainReportAdd: {},
@@ -727,10 +727,6 @@ export default {
     },
 
     submit() {
-      console.log(
-        new Date(this.deptBudgetList.deliveryDateStart).getTime(),
-        new Date(this.deptBudgetList.deliveryDateEnd).getTime()
-      )
       if (!this.deptBudgetList.contractNo) {
         this.$message({
           message: '请输入合同编号',
@@ -880,7 +876,10 @@ export default {
 
       if (
         isNaN(this.deptBudgetList.weight) ||
-        /\.\d{3}$/.test(this.deptBudgetList.weight) == false ||
+        (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.weight).length -
+            (String(this.deptBudgetList.weight).indexOf('.') + 1) >
+            3) ||
         this.deptBudgetList.weight < 0 ||
         this.deptBudgetList.weight > 200000
       ) {
@@ -975,7 +974,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.impurity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.impurity)
+        (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.impurity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '杂质输入错误',
@@ -985,7 +991,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.bulkDensity)
+        (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '容重输入错误',
@@ -995,7 +1009,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.mildewGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
+            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '霉变粒输入错误',
@@ -1005,7 +1027,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.jiaorenli)
+        (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
+            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '热损伤输入错误',
@@ -1015,7 +1044,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.imperfectGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
+            (String(
+              this.deptBudgetList.contractGoodsInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '不完整粒输入错误',
@@ -1026,8 +1063,15 @@ export default {
       if (
         (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.goodsNameKey < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsNameKey) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.goodsNameKey
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '合同收入金额输入错误',
@@ -1036,10 +1080,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
+        (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
           (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.waterContent) ==
-          false
+        (String(this.deptBudgetList.ccontractProcessInfo.waterContent).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.waterContent).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.waterContent
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '费用金额输入错误',
@@ -1048,50 +1099,78 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.mildewGrain) ==
-          false
+        (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
+          (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsName).length -
+            (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '未回款金额输入错误',
+          message: '已开发票金额输入错误',
           type: 'warning',
         })
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsName) ==
-          false
+        (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
+          (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.impurity).length -
+            (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '已开发票金额输入错误',
+          message: '开发票金额输入错误',
           type: 'warning',
         })
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.impurity) ==
-          false
+        (this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
+          (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.imperfectGrain)
+            .length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '未开发票金额输入错误',
+          message: '已完成发运量输入错误',
           type: 'warning',
         })
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
-          (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
-        /\.\d{3}$/.test(
-          this.deptBudgetList.contractProcessInfo.imperfectGrain
-        ) == false
+        (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
+          (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.mildewGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '已完成发运量输入错误',
+          message: '未回款金额输入错误',
           type: 'warning',
         })
         return
@@ -1165,6 +1244,22 @@ export default {
     // returnsales() {
     //   this.$router.push({ path: 'purchaseContract' })
     // },
+    addClick() {
+      // let [flag, constValue, constKey] = ['check', '', '']
+      // let obj = { flag, constValue, constKey }
+      // let objAdd = { flag: 'add', constValue: '新增项目', constKey: '' }
+      // let result = this.unitList.filter((item, val, arr) => {
+      //   return item.id != '1'
+      // })
+      // result.push(obj)
+      // result.push(objAdd)
+      // this.unitList = result
+      this.unitList.push({
+        flag: 'add',
+        constValue: '',
+        constKey: '',
+      })
+    },
     selectChapterTwo(e) {
       for (var i = 0; i < this.ChapterTwoList.length; i++) {
         if (this.ChapterTwoList[i].constValue == e) {

+ 136 - 32
src/views/contractManagement/salesContractEdit.vue

@@ -523,6 +523,7 @@
 <script>
 // import { getVesselOne } from '@/model/procurement/basic'
 // import { dayjs } from 'base-core-lib'
+import WsUpload from '@/components/WsUpload'
 import {
   examineList,
   editInfo,
@@ -534,6 +535,9 @@ import {
 } from '@/model/contarct/index'
 export default {
   name: 'viewSpareMoney',
+  components: {
+    WsUpload,
+  },
   watch: {
     vesselId(val) {
       this.getVesselData()
@@ -585,6 +589,7 @@ export default {
       // selectpackingMethod:{},
       //  change:{},
       ruleDeptBudget: {},
+      trainingMethods: {},
       isEdited: false,
       registered: {},
       selectCrtDuty: {},
@@ -741,6 +746,22 @@ export default {
           })
       }
     },
+    addClick() {
+      // let [flag, constValue, constKey] = ['check', '', '']
+      // let obj = { flag, constValue, constKey }
+      // let objAdd = { flag: 'add', constValue: '新增项目', constKey: '' }
+      // let result = this.unitList.filter((item, val, arr) => {
+      //   return item.id != '1'
+      // })
+      // result.push(obj)
+      // result.push(objAdd)
+      // this.unitList = result
+      this.unitList.push({
+        flag: 'add',
+        constValue: '',
+        constKey: '',
+      })
+    },
     submit() {
       if (!this.deptBudgetList.contractNo) {
         this.$message({
@@ -891,7 +912,10 @@ export default {
 
       if (
         isNaN(this.deptBudgetList.weight) ||
-        /\.\d{3}$/.test(this.deptBudgetList.weight) == false ||
+        (String(this.deptBudgetList.weight).indexOf('.') != -1 &&
+          String(this.deptBudgetList.weight).length -
+            (String(this.deptBudgetList.weight).indexOf('.') + 1) >
+            3) ||
         this.deptBudgetList.weight < 0 ||
         this.deptBudgetList.weight > 200000
       ) {
@@ -986,7 +1010,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.impurity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.impurity)
+        (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.impurity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '杂质输入错误',
@@ -996,7 +1027,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.bulkDensity ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.bulkDensity)
+        (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.bulkDensity).length -
+            (String(this.deptBudgetList.contractGoodsInfo.bulkDensity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '容重输入错误',
@@ -1006,7 +1045,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.mildewGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.mildewGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.mildewGrain).length -
+            (String(this.deptBudgetList.contractGoodsInfo.mildewGrain).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '霉变粒输入错误',
@@ -1016,7 +1063,14 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.jiaorenli ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.jiaorenli)
+        (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf('.') !=
+          -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.jiaorenli).length -
+            (String(this.deptBudgetList.contractGoodsInfo.jiaorenli).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
           message: '热损伤输入错误',
@@ -1026,7 +1080,15 @@ export default {
       }
       if (
         !this.deptBudgetList.contractGoodsInfo.imperfectGrain ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractGoodsInfo.imperfectGrain)
+        (String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractGoodsInfo.imperfectGrain).length -
+            (String(
+              this.deptBudgetList.contractGoodsInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '不完整粒输入错误',
@@ -1037,8 +1099,15 @@ export default {
       if (
         (!this.deptBudgetList.contractProcessInfo.goodsNameKey > 1000000000) |
           (this.deptBudgetList.contractProcessInfo.goodsNameKey < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsNameKey) ==
-          false
+        (String(this.deptBudgetList.contractProcessInfo.goodsNameKey).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsNameKey).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.goodsNameKey
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '合同收入金额输入错误',
@@ -1047,10 +1116,17 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
+        (this.deptBudgetList.contractProcessInfo.waterContent > 10000000) |
           (this.deptBudgetList.contractProcessInfo.waterContent < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.waterContent) ==
-          false
+        (String(this.deptBudgetList.ccontractProcessInfo.waterContent).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.waterContent).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.waterContent
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
           message: '费用金额输入错误',
@@ -1059,50 +1135,78 @@ export default {
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.mildewGrain) ==
-          false
+        (this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
+          (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.goodsName).length -
+            (String(this.deptBudgetList.contractProcessInfo.goodsName).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '未回款金额输入错误',
+          message: '已开发票金额输入错误',
           type: 'warning',
         })
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.goodsName > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.goodsName < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.goodsName) ==
-          false
+        (this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
+          (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.impurity).length -
+            (String(this.deptBudgetList.contractProcessInfo.impurity).indexOf(
+              '.'
+            ) +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '已开发票金额输入错误',
+          message: '开发票金额输入错误',
           type: 'warning',
         })
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.impurity > 1000000000) |
-          (this.deptBudgetList.contractProcessInfo.impurity < 0) ||
-        /\.\d{2}$/.test(this.deptBudgetList.contractProcessInfo.impurity) ==
-          false
+        (this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
+          (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.imperfectGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.imperfectGrain)
+            .length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.imperfectGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '未开发票金额输入错误',
+          message: '已完成发运量输入错误',
           type: 'warning',
         })
         return
       }
       if (
-        (!this.deptBudgetList.contractProcessInfo.imperfectGrain > 200000) |
-          (this.deptBudgetList.contractProcessInfo.imperfectGrain < 0) ||
-        /\.\d{3}$/.test(
-          this.deptBudgetList.contractProcessInfo.imperfectGrain
-        ) == false
+        (!this.deptBudgetList.contractProcessInfo.mildewGrain > 1000000000) |
+          (this.deptBudgetList.contractProcessInfo.mildewGrain < 0) ||
+        (String(this.deptBudgetList.contractProcessInfo.mildewGrain).indexOf(
+          '.'
+        ) != -1 &&
+          String(this.deptBudgetList.contractProcessInfo.mildewGrain).length -
+            (String(
+              this.deptBudgetList.contractProcessInfo.mildewGrain
+            ).indexOf('.') +
+              1) >
+            2)
       ) {
         this.$message({
-          message: '已完成发运量输入错误',
+          message: '未回款金额输入错误',
           type: 'warning',
         })
         return