ccjgmwz 3 years ago
parent
commit
d7f7ea30df

+ 35 - 63
src/views/financialManagement/collectionManagementList.vue

@@ -587,44 +587,9 @@ export default {
       this.tranCarNo = item.tranCarNo
       this.tranCarNo = item.tranCarNo
       this.staffId = item.staffId
       this.staffId = item.staffId
       //this.freightspace[0].agent = this.agent
       //this.freightspace[0].agent = this.agent
-      var tranCarNos = ''
       this.dialogFormVisible2 = true
       this.dialogFormVisible2 = true
       this.dataList = item
       this.dataList = item
-      paiLook({
-        contractNo: this.dataList.contractNo
-      })
-        .toPromise()
-        .then(response => {
-          // this.index = response.length + 1
-          var tmp1='C00'
-          if(response.length>0){
-            this.freightspace = response
-            console.log(this.freightspace)
-          }else{
-            this.freightspace=[{
-            carNo: '',
-            boxNo: '',
-            titleNo: '',
-            tranCarNo: 'C001',
-            agent: ''
-          }]
-          }
-          
-          if(this.freightspace.length+1>=10){
-            tmp1='C0'
-          }if(this.freightspace.length+1>=100){
-            tmp1='C'
-          }
-          this.freightspace.unshift({
-            carNo: '',
-            boxNo: '',
-            titleNo: '',
-            tranCarNo: tmp1+(this.freightspace.length+1),
-            agent: this.freightspace[this.freightspace.length-1].agent
-          })
-          
-        })
-
+      this.refresh()
       // this.staffQO.roleId = 'd6a5c8a52da544309259f91f75de1ec6'
       // this.staffQO.roleId = 'd6a5c8a52da544309259f91f75de1ec6'
       this.staffQO.roleId = '4be0c38df3e243a9b86446a3c524b91a'
       this.staffQO.roleId = '4be0c38df3e243a9b86446a3c524b91a'
       kuguan(this.staffQO)
       kuguan(this.staffQO)
@@ -645,18 +610,33 @@ export default {
         .then(response => {
         .then(response => {
           // this.index = response.length + 1
           // this.index = response.length + 1
           this.freightspace = response
           this.freightspace = response
+          var tmp = 'C001';
+          if(this.freightspace.length >0 ){
+            tmp = this.freightspace[0].tranCarNo;
+            tmp = parseInt(tmp.replace('C',''));
+            tmp++
+            if(tmp < 10){
+              tmp = 'C00'+ tmp
+            }
+            else if(tmp < 100){
+              tmp = 'C0'+ tmp
+            }
+            else{
+              tmp = 'C'+ tmp
+            }
+          }
           this.freightspace.unshift({
           this.freightspace.unshift({
             carNo: '',
             carNo: '',
             boxNo: '',
             boxNo: '',
             titleNo: '',
             titleNo: '',
-            tranCarNo: '',
-            agent: ''
+            tranCarNo: tmp,
+            agent: this.agent
           })
           })
-          for (var i = 0; i < this.freightspace.length; i++) {
-            var index = i + 1
-            this.freightspace[this.freightspace.length - 1 - i].tranCarNo =
-              'C00' + index
-          }
+          // for (var i = 0; i < this.freightspace.length; i++) {
+          //   var index = i + 1
+          //   this.freightspace[this.freightspace.length - 1 - i].tranCarNo =
+          //     'C00' + index
+          // }
         })
         })
     },
     },
     dateFormat(fmt, date) {
     dateFormat(fmt, date) {
@@ -787,7 +767,7 @@ export default {
     //   }
     //   }
     // },
     // },
     add1(item) {
     add1(item) {
-          if (!this.freightspace[0].carNo) {
+      if (!this.freightspace[0].carNo) {
         this.$message({
         this.$message({
            message: '车牌号不能为空',
            message: '车牌号不能为空',
              type: 'warning'
              type: 'warning'
@@ -835,32 +815,24 @@ export default {
         })
         })
         return
         return
       }
       }
-      var tmp = this.freightspace[0].agent
-      var tmp1 = this.freightspace.length + 1
-      var tmp2='C00'
-      if(tmp1>=10){
-        tmp2='C0'
+      if (!this.freightspace[0].agent && !this.agent) {
+        this.$message({
+          message: '请选择库管',
+          type: 'warning'
+        })
+        return
       }
       }
-      if(tmp1>=100){
-        tmp2='C'
+      if(this.freightspace[0].agent){
+        item.agent = this.freightspace[0].agent
+      }
+      else{
+        item.agent = this.agent
       }
       }
-      this.freightspace.unshift({
-        carNo: '',
-        boxNo: '',
-        titleNo: '',
-        planId: this.planId,
-        staffId: this.staffId,
-        goodsName: this.goodsName,
-        buyer: this.buyer,
-        tranCarNo: tmp2 + tmp1,
-        agent: tmp
-      })
       item.planId = this.planId
       item.planId = this.planId
       item.goodsName = this.goodsName
       item.goodsName = this.goodsName
       item.buyer = this.buyer
       item.buyer = this.buyer
       item.contractNo = this.contractNo
       item.contractNo = this.contractNo
       item.staffId = this.staffId
       item.staffId = this.staffId
-
       paifa(item)
       paifa(item)
         .toPromise()
         .toPromise()
         .then(response => {
         .then(response => {

+ 2 - 2
src/views/purchasingManagement/procurementPlanAdd.vue

@@ -532,7 +532,7 @@ export default {
     handleChange1(value) {
     handleChange1(value) {
       this.selectedOptions1 = value
       this.selectedOptions1 = value
       this.dataList.outputPrivate = CodeToText[value[0]]
       this.dataList.outputPrivate = CodeToText[value[0]]
-      this.dataList.outputCity = CodeToText[value[1]]
+      // this.dataList.outputCity = CodeToText[value[1]]
     },
     },
     sendWarehousechange(e) {
     sendWarehousechange(e) {
       for (let i = 0; i < this.warehouseList.length; i++) {
       for (let i = 0; i < this.warehouseList.length; i++) {
@@ -871,7 +871,7 @@ export default {
               this.dataList.receiveArea = CodeToText[this.selectedOptions[2]]
               this.dataList.receiveArea = CodeToText[this.selectedOptions[2]]
               this.dataList.outputPrivate =
               this.dataList.outputPrivate =
                 CodeToText[this.selectedOptions1[0]]
                 CodeToText[this.selectedOptions1[0]]
-              this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
+              // this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
               // if(this.dataList.procurementPlanType=='期货'){
               // if(this.dataList.procurementPlanType=='期货'){
               //   this.dataList.basisPrice='-'+Math.abs(this.dataList.basisPrice)
               //   this.dataList.basisPrice='-'+Math.abs(this.dataList.basisPrice)
               // }
               // }

+ 3 - 3
src/views/purchasingManagement/procurementPlanEdit.vue

@@ -613,7 +613,7 @@ export default {
     handleChange1(value) {
     handleChange1(value) {
       this.selectedOptions1 = value
       this.selectedOptions1 = value
       this.dataList.outputPrivate = CodeToText[value[0]]
       this.dataList.outputPrivate = CodeToText[value[0]]
-      this.dataList.outputCity = CodeToText[value[1]]
+      // this.dataList.outputCity = CodeToText[value[1]]
     },
     },
     submit() {
     submit() {
       if (this.outputYear) {
       if (this.outputYear) {
@@ -642,7 +642,7 @@ export default {
           this.selectedOptions = tmp
           this.selectedOptions = tmp
           var tmp1 = []
           var tmp1 = []
           tmp1[0] = TextToCode[this.dataList.outputPrivate].code
           tmp1[0] = TextToCode[this.dataList.outputPrivate].code
-          tmp1[1] = TextToCode[this.dataList.outputPrivate][this.dataList.outputCity].code
+          // tmp1[1] = TextToCode[this.dataList.outputPrivate][this.dataList.outputCity].code
           this.selectedOptions1 = tmp1
           this.selectedOptions1 = tmp1
         })
         })
       // 货名
       // 货名
@@ -910,7 +910,7 @@ export default {
               this.dataList.receiveCity = CodeToText[this.selectedOptions[1]]
               this.dataList.receiveCity = CodeToText[this.selectedOptions[1]]
               this.dataList.receiveArea = CodeToText[this.selectedOptions[2]]
               this.dataList.receiveArea = CodeToText[this.selectedOptions[2]]
               this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
               this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
-              this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
+              // this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
               // if(this.dataList.procurementPlanType=='期货'){
               // if(this.dataList.procurementPlanType=='期货'){
               //   this.dataList.basisPrice='-'+Math.abs(this.dataList.basisPrice)
               //   this.dataList.basisPrice='-'+Math.abs(this.dataList.basisPrice)
               // }
               // }

+ 2 - 2
src/views/salesManagement/salesPlanAdd.vue

@@ -617,7 +617,7 @@ export default {
     handleChange1(value) {
     handleChange1(value) {
       this.selectedOptions1 = value
       this.selectedOptions1 = value
       this.dataList.outputPrivate = CodeToText[value[0]]
       this.dataList.outputPrivate = CodeToText[value[0]]
-      this.dataList.outputCity = CodeToText[value[1]]
+      // this.dataList.outputCity = CodeToText[value[1]]
     },
     },
     sendWarehousechange(e) {
     sendWarehousechange(e) {
       for (let i = 0; i < this.warehouseList.length; i++) {
       for (let i = 0; i < this.warehouseList.length; i++) {
@@ -983,7 +983,7 @@ export default {
               this.dataList.sendCity = CodeToText[this.selectedOptions[1]]
               this.dataList.sendCity = CodeToText[this.selectedOptions[1]]
               this.dataList.sendArea = CodeToText[this.selectedOptions[2]]
               this.dataList.sendArea = CodeToText[this.selectedOptions[2]]
               this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
               this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
-              this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
+              // this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
               this.dataList.unitPrice=this.dataList.salePrice
               this.dataList.unitPrice=this.dataList.salePrice
 
 
               this.dataList.compId = this.compId
               this.dataList.compId = this.compId

+ 3 - 3
src/views/salesManagement/salesPlanEdit.vue

@@ -552,7 +552,7 @@ export default {
     handleChange1(value) {
     handleChange1(value) {
       this.selectedOptions1 = value
       this.selectedOptions1 = value
       this.dataList.outputPrivate = CodeToText[value[0]]
       this.dataList.outputPrivate = CodeToText[value[0]]
-      this.dataList.outputCity = CodeToText[value[1]]
+      // this.dataList.outputCity = CodeToText[value[1]]
     },
     },
     submit() {
     submit() {
       if (this.outputYear) {
       if (this.outputYear) {
@@ -581,7 +581,7 @@ export default {
           this.selectedOptions = tmp
           this.selectedOptions = tmp
           var tmp1 = []
           var tmp1 = []
           tmp1[0] = TextToCode[this.dataList.outputPrivate].code
           tmp1[0] = TextToCode[this.dataList.outputPrivate].code
-          tmp1[1] = TextToCode[this.dataList.outputPrivate][this.dataList.outputCity].code
+          // tmp1[1] = TextToCode[this.dataList.outputPrivate][this.dataList.outputCity].code
           this.selectedOptions1 = tmp1
           this.selectedOptions1 = tmp1
         })
         })
       // 货名
       // 货名
@@ -880,7 +880,7 @@ export default {
               this.dataList.sendCity = CodeToText[this.selectedOptions[1]]
               this.dataList.sendCity = CodeToText[this.selectedOptions[1]]
               this.dataList.sendArea = CodeToText[this.selectedOptions[2]]
               this.dataList.sendArea = CodeToText[this.selectedOptions[2]]
               this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
               this.dataList.outputPrivate = CodeToText[this.selectedOptions1[0]]
-              this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
+              // this.dataList.outputCity = CodeToText[this.selectedOptions1[1]]
 
 
               this.dataList.compId = this.compId
               this.dataList.compId = this.compId
               this.dataList.compId = sessionStorage.getItem('ws-pf_compId')
               this.dataList.compId = sessionStorage.getItem('ws-pf_compId')