zhangyuewww 3 gadi atpakaļ
vecāks
revīzija
94ffc3f31f

+ 134 - 137
src/views/taskManagement/tranManagementTransportAdd.vue

@@ -200,7 +200,6 @@
         <div class="driver">
           <span>运输阶段{{ item.key }} {{ item.processNo }}</span>
           <img
-            v-if="endflag == '0' "
             width="22"
             height="22"
             class="add"
@@ -216,19 +215,14 @@
             src="../../../public/img/del.png"
             alt
           />
-          <!-- <span
-            style="margin-left : 20px;font-size : 14px"
-            v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
-          >最终阶段</span> -->
           <el-checkbox
-            @change="(val) => engflagchange(val, index)"
+            @change="(val) => {engflagchange(val, index)}"
             class="endflag"
             true-label="1"
             false-label="0"
-            v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
             v-model="item.endFlag"
             :label="1"
-            >最终阶段</el-checkbox
+            >粮款结算阶段</el-checkbox
           >
         </div>
         <ws-info-table>
@@ -460,7 +454,6 @@ export default {
       heightData: '600px',
       zoom: 7,
       options: [],
-      endflag: false,
       selectedOptions: [],
       selectedOptions1: [],
       window: '',
@@ -602,23 +595,26 @@ export default {
     weightchange(e) {
       this.deptBudgetList.tranProcessInfoList[0].weight = e
     },
-    engflagchange(e) {
-      this.endflag = e
-      if (this.endflag) {
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].selectedOptions1 = this.selectedOptions1
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
-      } else {
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].selectedOptions1 = []
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].receiveDetailedAddress = ''
+    engflagchange(e, index) {
+      for(var i=0;i<this.deptBudgetList.tranProcessInfoList.length;i++){
+        this.deptBudgetList.tranProcessInfoList[i].endFlag='0'
       }
+      this.deptBudgetList.tranProcessInfoList[index].endFlag = e
+      // if (this.endflag) {
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].selectedOptions1 = this.selectedOptions1
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
+      // } else {
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].selectedOptions1 = []
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].receiveDetailedAddress = ''
+      // }
     },
     // 获取当前年月日
     getdate() {
@@ -1016,7 +1012,8 @@ export default {
           return
         }
       }
-      if (this.endflag) {
+      // debugger
+      // if (this.deptBudgetList.endFlag=='1') {
         this.$confirm(`运输任务提交成功后将派发到物流部门,是否确定提交?`, {
           confirmButtonText: '确定',
           cancelButtonText: '取消',
@@ -1041,17 +1038,17 @@ export default {
                   CodeToText[this.selectedOptions[1]]
                 this.deptBudgetList.tranProcessInfoList[0].sendArea =
                   CodeToText[this.selectedOptions[2]]
-                if (this.endflag) {
-                  this.deptBudgetList.tranProcessInfoList[
-                    this.deptBudgetList.tranProcessInfoList.length - 1
-                  ].receivePrivate = CodeToText[this.selectedOptions1[0]]
-                  this.deptBudgetList.tranProcessInfoList[
-                    this.deptBudgetList.tranProcessInfoList.length - 1
-                  ].receiveCity = CodeToText[this.selectedOptions1[1]]
-                  this.deptBudgetList.tranProcessInfoList[
-                    this.deptBudgetList.tranProcessInfoList.length - 1
-                  ].receiveArea = CodeToText[this.selectedOptions1[2]]
-                }
+                // if (this.endflag) {
+                //   this.deptBudgetList.tranProcessInfoList[
+                //     this.deptBudgetList.tranProcessInfoList.length - 1
+                //   ].receivePrivate = CodeToText[this.selectedOptions1[0]]
+                //   this.deptBudgetList.tranProcessInfoList[
+                //     this.deptBudgetList.tranProcessInfoList.length - 1
+                //   ].receiveCity = CodeToText[this.selectedOptions1[1]]
+                //   this.deptBudgetList.tranProcessInfoList[
+                //     this.deptBudgetList.tranProcessInfoList.length - 1
+                //   ].receiveArea = CodeToText[this.selectedOptions1[2]]
+                // }
                 if (
                   this.deptBudgetList.taskType != '销售出库' ||
                   this.deptBudgetList.taskType != '贸易服务出库' ||
@@ -1115,108 +1112,108 @@ export default {
           .catch(() => {
             return false
           })
-      } else {
-        this.$confirm(`您还未选择最终阶段,是否确定提交??`, {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(() => {
-            this.$refs.deptBudgetList.validate((valid) => {
-              if (valid) {
-                this.deptBudgetList.compId =
-                  sessionStorage.getItem('ws-pf_compId')
-                  console.log(this.checkList.toString())
-                this.deptBudgetList.tranType = this.checkList.toString()
-                this.deptBudgetList.startPrivate =
-                  CodeToText[this.selectedOptions[0]]
-                this.deptBudgetList.startCity =
-                  CodeToText[this.selectedOptions[1]]
-                this.deptBudgetList.startArea =
-                  CodeToText[this.selectedOptions[2]]
-                this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
-                  CodeToText[this.selectedOptions[0]]
-                this.deptBudgetList.tranProcessInfoList[0].sendCity =
-                  CodeToText[this.selectedOptions[1]]
-                this.deptBudgetList.tranProcessInfoList[0].sendArea =
-                  CodeToText[this.selectedOptions[2]]
-                if (this.endflag) {
-                  this.deptBudgetList.tranProcessInfoList[
-                    this.deptBudgetList.tranProcessInfoList.length - 1
-                  ].receivePrivate = CodeToText[this.selectedOptions1[0]]
-                  this.deptBudgetList.tranProcessInfoList[
-                    this.deptBudgetList.tranProcessInfoList.length - 1
-                  ].receiveCity = CodeToText[this.selectedOptions1[1]]
-                  this.deptBudgetList.tranProcessInfoList[
-                    this.deptBudgetList.tranProcessInfoList.length - 1
-                  ].receiveArea = CodeToText[this.selectedOptions1[2]]
-                }
-                 if (
-                  this.deptBudgetList.taskType != '销售出库' ||
-                  this.deptBudgetList.taskType != '贸易服务出库' ||
-                  this.deptBudgetList.taskType != '暂存出库'
-                ){
-                  this.deptBudgetList.endPrivate = CodeToText[this.selectedOptions1[0]]
-                  this.deptBudgetList.endCity = CodeToText[this.selectedOptions1[1]]
-                  this.deptBudgetList.endArea = CodeToText[this.selectedOptions1[2]]
-                }
+      // } else {
+      //   this.$confirm(`您还未选择粮款结算阶段,是否确定提交??`, {
+      //     confirmButtonText: '确定',
+      //     cancelButtonText: '取消',
+      //     type: 'warning',
+      //   })
+      //     .then(() => {
+      //       this.$refs.deptBudgetList.validate((valid) => {
+      //         if (valid) {
+      //           this.deptBudgetList.compId =
+      //             sessionStorage.getItem('ws-pf_compId')
+      //             console.log(this.checkList.toString())
+      //           this.deptBudgetList.tranType = this.checkList.toString()
+      //           this.deptBudgetList.startPrivate =
+      //             CodeToText[this.selectedOptions[0]]
+      //           this.deptBudgetList.startCity =
+      //             CodeToText[this.selectedOptions[1]]
+      //           this.deptBudgetList.startArea =
+      //             CodeToText[this.selectedOptions[2]]
+      //           this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
+      //             CodeToText[this.selectedOptions[0]]
+      //           this.deptBudgetList.tranProcessInfoList[0].sendCity =
+      //             CodeToText[this.selectedOptions[1]]
+      //           this.deptBudgetList.tranProcessInfoList[0].sendArea =
+      //             CodeToText[this.selectedOptions[2]]
+      //           // if (this.endflag) {
+      //           //   this.deptBudgetList.tranProcessInfoList[
+      //           //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //           //   ].receivePrivate = CodeToText[this.selectedOptions1[0]]
+      //           //   this.deptBudgetList.tranProcessInfoList[
+      //           //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //           //   ].receiveCity = CodeToText[this.selectedOptions1[1]]
+      //           //   this.deptBudgetList.tranProcessInfoList[
+      //           //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //           //   ].receiveArea = CodeToText[this.selectedOptions1[2]]
+      //           // }
+      //            if (
+      //             this.deptBudgetList.taskType != '销售出库' ||
+      //             this.deptBudgetList.taskType != '贸易服务出库' ||
+      //             this.deptBudgetList.taskType != '暂存出库'
+      //           ){
+      //             this.deptBudgetList.endPrivate = CodeToText[this.selectedOptions1[0]]
+      //             this.deptBudgetList.endCity = CodeToText[this.selectedOptions1[1]]
+      //             this.deptBudgetList.endArea = CodeToText[this.selectedOptions1[2]]
+      //           }
 
-                for (
-                  var i = 0;
-                  i < this.deptBudgetList.tranProcessInfoList.length;
-                  i++
-                ) {
-                  this.deptBudgetList.tranProcessInfoList[i].sort = i
-                }
+      //           for (
+      //             var i = 0;
+      //             i < this.deptBudgetList.tranProcessInfoList.length;
+      //             i++
+      //           ) {
+      //             this.deptBudgetList.tranProcessInfoList[i].sort = i
+      //           }
 
-                addtrantask(this.deptBudgetList)
-                  .toPromise()
-                  .then((response) => {
-                    this.$message.success('添加成功')
-                    this.deptBudgetList = {
-                      taskNo: '',
-                      totalStorage: 0,
-                      goodsName: '玉米',
-                      goodsNameKey: 1,
-                      warehouseType: '1',
-                      tranProcessInfoList: [
-                        {
-                          processNo: '',
-                          tranType: '汽运',
-                          deliveryDateStart: '',
-                          deliveryDateEnd: '',
-                          weight: '',
-                          selectedOptions: [],
-                          selectedOptions1: [],
-                          sendPrivate: '',
-                          sendCity: '',
-                          sendArea: '',
-                          receivePrivate: '',
-                          receiveCity: '',
-                          receiveArea: '',
-                          sendDetailedAddress: '',
-                          receiveDetailedAddress: '',
-                          sender: '',
-                          receiver: '',
-                          senderPhone: '',
-                          receiverPhone: '',
-                          contractNo: '',
-                          receiveWarehouse: '',
-                        },
-                      ],
-                    }
-                    this.$router.push({ path: 'tranManagementTransport' })
-                  })
-              } else {
-                EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-                return false
-              }
-            })
-          })
-          .catch(() => {
-            return false
-          })
-      }
+      //           addtrantask(this.deptBudgetList)
+      //             .toPromise()
+      //             .then((response) => {
+      //               this.$message.success('添加成功')
+      //               this.deptBudgetList = {
+      //                 taskNo: '',
+      //                 totalStorage: 0,
+      //                 goodsName: '玉米',
+      //                 goodsNameKey: 1,
+      //                 warehouseType: '1',
+      //                 tranProcessInfoList: [
+      //                   {
+      //                     processNo: '',
+      //                     tranType: '汽运',
+      //                     deliveryDateStart: '',
+      //                     deliveryDateEnd: '',
+      //                     weight: '',
+      //                     selectedOptions: [],
+      //                     selectedOptions1: [],
+      //                     sendPrivate: '',
+      //                     sendCity: '',
+      //                     sendArea: '',
+      //                     receivePrivate: '',
+      //                     receiveCity: '',
+      //                     receiveArea: '',
+      //                     sendDetailedAddress: '',
+      //                     receiveDetailedAddress: '',
+      //                     sender: '',
+      //                     receiver: '',
+      //                     senderPhone: '',
+      //                     receiverPhone: '',
+      //                     contractNo: '',
+      //                     receiveWarehouse: '',
+      //                   },
+      //                 ],
+      //               }
+      //               this.$router.push({ path: 'tranManagementTransport' })
+      //             })
+      //         } else {
+      //           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+      //           return false
+      //         }
+      //       })
+      //     })
+      //     .catch(() => {
+      //       return false
+      //     })
+      // }
     },
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()

+ 77 - 76
src/views/taskManagement/tranManagementTransportEdit.vue

@@ -200,7 +200,6 @@
             >运输阶段{{ index + 1 }} {{ item.processNo }}</span
           >
           <img
-            v-if="!endflag"
             width="22"
             height="22"
             class="add"
@@ -218,13 +217,13 @@
             alt=""
           />
           <el-checkbox
-          @change="(val) => engflagchange(val,index)"
+            @change="(val) => {engflagchange(val, index)}"
             class="endflag"
-            v-bind:checked="endflag"
-            v-if="index == deptBudgetList.tranProcessInfoList.length - 1"
+            true-label="1"
+            false-label="0"
             v-model="item.endFlag"
             :label="1"
-            >最终阶段</el-checkbox
+            >粮款结算阶段</el-checkbox
           >
         </div>
         <ws-info-table>
@@ -425,7 +424,6 @@ export default {
       checkList: [],
       deptBudgetList: {},
       radio: '1',
-      endflag: false,
       carModelList: [],
       carLengthList: [],
       warehouseType: '1',
@@ -572,32 +570,35 @@ export default {
       }
     },
     engflagchange(e,index) {
-      this.endflag = e
-      if (this.endflag) {
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].selectedOptions1 = this.selectedOptions1
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
-      } else {
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].selectedOptions1 = []
-        this.deptBudgetList.tranProcessInfoList[
-          this.deptBudgetList.tranProcessInfoList.length - 1
-        ].receiveDetailedAddress = ''
+       for(var i=0;i<this.deptBudgetList.tranProcessInfoList.length;i++){
+        this.deptBudgetList.tranProcessInfoList[i].endFlag='0'
       }
+      this.deptBudgetList.tranProcessInfoList[index].endFlag = e
+      // if (this.endflag) {
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].selectedOptions1 = this.selectedOptions1
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].receiveDetailedAddress = this.deptBudgetList.endDetailedAddress
+      // } else {
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].selectedOptions1 = []
+      //   this.deptBudgetList.tranProcessInfoList[
+      //     this.deptBudgetList.tranProcessInfoList.length - 1
+      //   ].receiveDetailedAddress = ''
+      // }
     },
     loaddata() {
       examinetran({ id: this.$route.query.id })
         .toPromise()
         .then((response) => {
-          for (var j = 0; j < response.tranProcessInfoList.length; j++) {
-            if (response.tranProcessInfoList[j].endFlag == 'true') {
-              this.endflag = true
-            }
-          }
+          // for (var j = 0; j < response.tranProcessInfoList.length; j++) {
+          //   if (response.tranProcessInfoList[j].endFlag == '1') {
+          //     this.endflag = '1'
+          //   }
+          // }
           this.deptBudgetList = response
           this.number = response.tranProcessInfoList.length + 1
           this.count = response.count + 1
@@ -630,7 +631,7 @@ export default {
             this.selectedOptions1 = tmp1
           }
           for (var i = 0; i < response.tranProcessInfoList.length; i++) {
-            console.log(response.tranProcessInfoList[i].endFlag)
+            // console.log(response.tranProcessInfoList[i].endFlag)
             if (
               response.tranProcessInfoList[i].sendPrivate != '' &&
               response.tranProcessInfoList[i].sendCity != '' &&
@@ -991,55 +992,55 @@ export default {
           return
         }
       }
-      if (this.endflag == false) {
-        this.$confirm('您还未选择最终阶段,是否确定提交?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning',
-        })
-          .then(() => {
-            this.$refs.deptBudgetList.validate((valid) => {
-              if (valid) {
-                this.deptBudgetList.compId =
-                  sessionStorage.getItem('ws-pf_compId')
-                this.deptBudgetList.tranType = this.checkList.toString()
-                this.deptBudgetList.startPrivate =
-                  CodeToText[this.selectedOptions[0]]
-                this.deptBudgetList.startCity =
-                  CodeToText[this.selectedOptions[1]]
-                this.deptBudgetList.startArea =
-                  CodeToText[this.selectedOptions[2]]
-                this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
-                  CodeToText[this.selectedOptions[0]]
-                this.deptBudgetList.tranProcessInfoList[0].sendCity =
-                  CodeToText[this.selectedOptions[1]]
-                this.deptBudgetList.tranProcessInfoList[0].sendArea =
-                  CodeToText[this.selectedOptions[2]]
-                for (
-                  var i = 0;
-                  i < this.deptBudgetList.tranProcessInfoList.length;
-                  i++
-                ) {
-                  this.deptBudgetList.tranProcessInfoList[i].sort = i
-                }
+      // if (this.endFlag == false) {
+      //   this.$confirm('您还未选择最终阶段,是否确定提交?', '提示', {
+      //     confirmButtonText: '确定',
+      //     cancelButtonText: '取消',
+      //     type: 'warning',
+      //   })
+      //     .then(() => {
+      //       this.$refs.deptBudgetList.validate((valid) => {
+      //         if (valid) {
+      //           this.deptBudgetList.compId =
+      //             sessionStorage.getItem('ws-pf_compId')
+      //           this.deptBudgetList.tranType = this.checkList.toString()
+      //           this.deptBudgetList.startPrivate =
+      //             CodeToText[this.selectedOptions[0]]
+      //           this.deptBudgetList.startCity =
+      //             CodeToText[this.selectedOptions[1]]
+      //           this.deptBudgetList.startArea =
+      //             CodeToText[this.selectedOptions[2]]
+      //           this.deptBudgetList.tranProcessInfoList[0].sendPrivate =
+      //             CodeToText[this.selectedOptions[0]]
+      //           this.deptBudgetList.tranProcessInfoList[0].sendCity =
+      //             CodeToText[this.selectedOptions[1]]
+      //           this.deptBudgetList.tranProcessInfoList[0].sendArea =
+      //             CodeToText[this.selectedOptions[2]]
+      //           for (
+      //             var i = 0;
+      //             i < this.deptBudgetList.tranProcessInfoList.length;
+      //             i++
+      //           ) {
+      //             this.deptBudgetList.tranProcessInfoList[i].sort = i
+      //           }
 
-                edittran(this.deptBudgetList)
-                  .toPromise()
-                  .then((response) => {
-                    this.$message.success('编辑成功')
-                    this.deptBudgetList = {}
-                    this.$router.push({ path: 'tranManagementTransport' })
-                  })
-              } else {
-                EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
-                return false
-              }
-            })
-          })
-          .catch(() => {
-            return false
-          })
-      } else {
+      //           edittran(this.deptBudgetList)
+      //             .toPromise()
+      //             .then((response) => {
+      //               this.$message.success('编辑成功')
+      //               this.deptBudgetList = {}
+      //               this.$router.push({ path: 'tranManagementTransport' })
+      //             })
+      //         } else {
+      //           EventBus.$emit('error', this.$t('showMessage.asteriskRequired'))
+      //           return false
+      //         }
+      //       })
+      //     })
+      //     .catch(() => {
+      //       return false
+      //     })
+      // } else {
         this.$confirm(
           '运输任务提交成功后将派发到物流部门,是否确定提交?',
           '提示',
@@ -1105,7 +1106,7 @@ export default {
             alert('失败2')
             return false
           })
-      }
+      // }
     },
     resetForm(deptBudgetList) {
       this.$refs[deptBudgetList].resetFields()