gjy пре 3 година
родитељ
комит
198098b7e4
1 измењених фајлова са 34 додато и 23 уклоњено
  1. 34 23
      src/views/taskManagement/tranManagementTransportEdit.vue

+ 34 - 23
src/views/taskManagement/tranManagementTransportEdit.vue

@@ -219,8 +219,10 @@
             alt=""
             alt=""
           />
           />
           <el-checkbox
           <el-checkbox
-            @change="engflagchange"
+          @change="(val) => engflagchange(val,index)"
             class="endflag"
             class="endflag"
+            true-label="1"
+            false-label="0"
             v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
             v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
             v-model="item.endFlag"
             v-model="item.endFlag"
             :label="1"
             :label="1"
@@ -482,7 +484,8 @@ export default {
     weightchange(e) {
     weightchange(e) {
       this.deptBudgetList.tranProcessInfoList[0].weight = e
       this.deptBudgetList.tranProcessInfoList[0].weight = e
     },
     },
-    engflagchange(e) {
+    engflagchange(e,index) {
+      console.log(e)
       this.endflag = e
       this.endflag = e
       if (this.endflag) {
       if (this.endflag) {
         this.deptBudgetList.tranProcessInfoList[
         this.deptBudgetList.tranProcessInfoList[
@@ -536,6 +539,7 @@ export default {
           }
           }
 
 
           for (var i = 0; i < response.tranProcessInfoList.length; i++) {
           for (var i = 0; i < response.tranProcessInfoList.length; i++) {
+            console.log(response.tranProcessInfoList[i].endFlag)
             if (
             if (
               response.tranProcessInfoList[i].sendPrivate != '' &&
               response.tranProcessInfoList[i].sendPrivate != '' &&
               response.tranProcessInfoList[i].sendCity != '' &&
               response.tranProcessInfoList[i].sendCity != '' &&
@@ -656,6 +660,7 @@ export default {
         sendDetailedAddress: '',
         sendDetailedAddress: '',
         receiveDetailedAddress: '',
         receiveDetailedAddress: '',
         sender: '',
         sender: '',
+        endFlag:'0',
         receiver: '',
         receiver: '',
         senderPhone: '',
         senderPhone: '',
         receiverPhone: '',
         receiverPhone: '',
@@ -718,6 +723,7 @@ export default {
       this.$router.push({ path: 'tranManagementTransport' })
       this.$router.push({ path: 'tranManagementTransport' })
     },
     },
     submit() {
     submit() {
+      console.log(this.deptBudgetList)
       this.$refs.deptBudgetList.validate((valid) => {
       this.$refs.deptBudgetList.validate((valid) => {
         if (valid) {
         if (valid) {
           if (!this.deptBudgetList.taskNo) {
           if (!this.deptBudgetList.taskNo) {
@@ -819,49 +825,49 @@ export default {
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart) {
+            if (this.deptBudgetList.tranProcessInfoList[i].deliveryDateStart=='') {
               this.$message({
               this.$message({
                 message: '发货日期不能为空!',
                 message: '发货日期不能为空!',
                 type: 'warning',
                 type: 'warning',
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd) {
+            if (this.deptBudgetList.tranProcessInfoList[i].deliveryDateEnd=='') {
               this.$message({
               this.$message({
                 message: '最晚到货日期不能为空!',
                 message: '最晚到货日期不能为空!',
                 type: 'warning',
                 type: 'warning',
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].weight) {
+            if (this.deptBudgetList.tranProcessInfoList[i].weight=='') {
               this.$message({
               this.$message({
                 message: '重量不能为空!',
                 message: '重量不能为空!',
                 type: 'warning',
                 type: 'warning',
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].sender) {
+            if (this.deptBudgetList.tranProcessInfoList[i].sender=='') {
               this.$message({
               this.$message({
                 message: '发货人不能为空!',
                 message: '发货人不能为空!',
                 type: 'warning',
                 type: 'warning',
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].senderPhone) {
+            if (this.deptBudgetList.tranProcessInfoList[i].senderPhone=='') {
               this.$message({
               this.$message({
                 message: '发货人电话不能为空!',
                 message: '发货人电话不能为空!',
                 type: 'warning',
                 type: 'warning',
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].receiver) {
+            if (this.deptBudgetList.tranProcessInfoList[i].receiver=='') {
               this.$message({
               this.$message({
                 message: '收货人不能为空!',
                 message: '收货人不能为空!',
                 type: 'warning',
                 type: 'warning',
               })
               })
               return
               return
             }
             }
-            if (!this.deptBudgetList.tranProcessInfoList[i].receiverPhone) {
+            if (this.deptBudgetList.tranProcessInfoList[i].receiverPhone=='') {
               this.$message({
               this.$message({
                 message: '收货人电话不能为空!',
                 message: '收货人电话不能为空!',
                 type: 'warning',
                 type: 'warning',
@@ -869,7 +875,7 @@ export default {
               return
               return
             }
             }
             if (
             if (
-              !this.deptBudgetList.tranProcessInfoList[i].receiveDetailedAddress
+              this.deptBudgetList.tranProcessInfoList[i].receiveDetailedAddress==''
             ) {
             ) {
               this.$message({
               this.$message({
                 message: '收获详细地址不能为空!',
                 message: '收获详细地址不能为空!',
@@ -878,7 +884,7 @@ export default {
               return
               return
             }
             }
             if (
             if (
-              !this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress
+              this.deptBudgetList.tranProcessInfoList[i].sendDetailedAddress==''
             ) {
             ) {
               this.$message({
               this.$message({
                 message: '发货详细地址不能为空!',
                 message: '发货详细地址不能为空!',
@@ -887,27 +893,32 @@ export default {
               return
               return
             }
             }
           }
           }
-          this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
+          var text=''
+          if (this.deptBudgetList.tranProcessInfoList.every( function( item, index, array ){  
+            return item.endflag==0 
+          })==true) {
+             text='你还未选择最终阶段,是否确认提交?'
+            }else{
+              text='运输任务提交成功后将派发到物流部门,是否确定提交?'
+            }
+        this.$confirm(text, '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+      }).then(()=>{
+         this.deptBudgetList.compId = sessionStorage.getItem('ws-pf_compId')
           this.deptBudgetList.tranType = this.checkList.toString()
           this.deptBudgetList.tranType = this.checkList.toString()
           this.deptBudgetList.startPrivate = CodeToText[this.selectedOptions[0]]
           this.deptBudgetList.startPrivate = CodeToText[this.selectedOptions[0]]
         this.deptBudgetList.startCity = CodeToText[this.selectedOptions[1]]
         this.deptBudgetList.startCity = CodeToText[this.selectedOptions[1]]
          this.deptBudgetList.startArea = CodeToText[this.selectedOptions[2]]
          this.deptBudgetList.startArea = CodeToText[this.selectedOptions[2]]
-        //  for(var i = 0; i< this.deptBudgetList.tranProcessInfoList.length ; i++){
-        //     this.deptBudgetList.tranProcessInfoList[i].sort = i
-        //    this.deptBudgetList.tranProcessInfoList[i].sendPrivate = CodeToText[this.selectedOptions[0]]
-        //     this.deptBudgetList.tranProcessInfoList[i].sendCity = CodeToText[this.selectedOptions[1]]
-        //      this.deptBudgetList.tranProcessInfoList[i].sendArea = CodeToText[this.selectedOptions[2]]
-        //     this.deptBudgetList.tranProcessInfoList[i].receivePrivate = CodeToText[this.selectedOptions1[0]]
-        //     this.deptBudgetList.tranProcessInfoList[i].receiveCity = CodeToText[this.selectedOptions1[1]]
-        //      this.deptBudgetList.tranProcessInfoList[i].receiveArea = CodeToText[this.selectedOptions1[2]]
-        //  }
-          edittran(this.deptBudgetList)
-            .toPromise()
+        edittran(this.deptBudgetList).toPromise()
             .then((response) => {
             .then((response) => {
               this.$message.success('编辑成功')
               this.$message.success('编辑成功')
               this.deptBudgetList = {}
               this.deptBudgetList = {}
               this.$router.push({ path: 'tranManagementTransport' })
               this.$router.push({ path: 'tranManagementTransport' })
             })
             })
+      })
+          
         } else {
         } else {
           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
           return false
           return false