caojunjie 2 年 前
コミット
87300bc124

+ 1 - 1
src/views/landTransportation/bulkCargo/detailPage.vue

@@ -1612,7 +1612,7 @@ export default {
           prop: 'dispatcher',
           span: 6,
           type: "select",
-          dicUrl: "/api/blade-user/userList?deptPid={{key}}",
+          dicUrl: "/api/blade-user/deptUserList?deptPid={{key}}",
           props: {
             label: "realName",
             value: "id"

+ 1 - 1
src/views/landTransportation/bulkCargo/index.vue

@@ -410,7 +410,7 @@ export default {
         delBtn: false,
         height: "auto",
         searchSpan: 8,
-        searchIcon: false,
+        searchIcon: true,
         searchIndex: 2,
         selection: true,
         highlightCurrentRow: true,

+ 8 - 8
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -222,13 +222,6 @@
           >{{ row.$cellEdit ? '保 存' : '修 改' }}
           </el-button>
           <el-button
-              type="text"
-              size="small"
-              v-if="row.status===0"
-              @click="rowSaveThree(row,index)"
-          >{{ row.$cellEdit ? '确认调度派车' : '调度派车' }}
-          </el-button>
-          <el-button
               size="small"
               type="text"
               @click="designate(row, index)"
@@ -262,6 +255,13 @@
               @click="annexOpen(row, index)"
           >附 件
           </el-button>
+          <el-button
+              type="text"
+              size="small"
+              v-if="row.status===0"
+              @click="rowSaveThree(row,index)"
+          >{{ row.$cellEdit ? '确认调度派车' : '调度派车' }}
+          </el-button>
         </template>
       </avue-crud>
     </basic-container>
@@ -1132,7 +1132,7 @@ export default {
           label: '运输调度',
           prop: 'dispatcher',
           type: "select",
-          dicUrl: "/api/blade-user/userList?deptPid={{key}}",
+          dicUrl: "/api/blade-user/deptUserList?deptPid={{key}}",
           props: {
             label: "realName",
             value: "id"

+ 117 - 19
src/views/landTransportation/placeAnOrder/detailPage.vue

@@ -617,6 +617,7 @@ import website from "@/config/website";
 import {gaude, location} from "@/api/gaude";
 //地图回放
 import trackPlayback from "@/components/trackPlayback"
+import {contrastList, contrastObj} from "@/util/contrastData";
 
 export default {
   comments: {
@@ -1538,7 +1539,13 @@ export default {
             value: "dictKey"
           }
         }]
-      }
+      },
+      oldgoodsForm:{},
+      oldtableData:{},
+      oldentrustList:{},
+      oldgoodsList:{},
+      oldvehicleList:{},
+      oldorderFilesList:{},
     };
   },
   async created() {
@@ -1560,6 +1567,13 @@ export default {
           this.goodsList = res.data.data.itemList
           this.vehicleList = res.data.data.orderItemList
           this.orderFilesList = res.data.data.fileList
+
+          this.oldgoodsForm = res.data.data
+          this.oldtableData = this.deepClone(res.data.data.orderAddressList)
+          this.oldentrustList = this.deepClone(res.data.data.itemList)
+          this.oldgoodsList = this.deepClone(res.data.data.itemList)
+          this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
+          this.oldorderFilesList = this.deepClone(res.data.data.fileList)
           this.goodsForm.status = 0
           if (res.data.data.orderFeeList.length > 0) {
             res.data.data.orderFeeList.forEach(item => {
@@ -1601,6 +1615,13 @@ export default {
           this.goodsList = res.data.data.itemList
           this.vehicleList = res.data.data.orderItemList
           this.orderFilesList = res.data.data.fileList
+
+          this.oldgoodsForm = res.data.data
+          this.oldtableData = this.deepClone(res.data.data.orderAddressList)
+          this.oldentrustList = this.deepClone(res.data.data.itemList)
+          this.oldgoodsList = this.deepClone(res.data.data.itemList)
+          this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
+          this.oldorderFilesList = this.deepClone(res.data.data.fileList)
           if (res.data.data.orderFeeList.length > 0) {
             res.data.data.orderFeeList.forEach(item => {
               if (item.type == 1) {
@@ -1633,6 +1654,13 @@ export default {
           this.goodsList = res.data.data.itemList
           this.vehicleList = res.data.data.orderItemList
           this.orderFilesList = res.data.data.fileList
+
+          this.oldgoodsForm = res.data.data
+          this.oldtableData = this.deepClone(res.data.data.orderAddressList)
+          this.oldentrustList = this.deepClone(res.data.data.itemList)
+          this.oldgoodsList = this.deepClone(res.data.data.itemList)
+          this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
+          this.oldorderFilesList = this.deepClone(res.data.data.fileList)
           if (res.data.data.orderFeeList.length > 0) {
             res.data.data.orderFeeList.forEach(item => {
               if (item.type == 1) {
@@ -1673,6 +1701,12 @@ export default {
         this.salesmanQuery('', true)
       })
       this.entrustList = []
+      this.oldgoodsForm = this.goodsForm
+      this.oldtableData = this.deepClone(this.tableData)
+      this.oldentrustList = this.deepClone(this.entrustList)
+      this.oldgoodsList = this.deepClone(this.goodsList)
+      this.oldvehicleList = this.deepClone(this.vehicleList)
+      this.oldorderFilesList = this.deepClone(this.orderFilesList)
     }
     // 非租户模式默认加载管理组数据
     if (!website.tenantMode) {
@@ -1879,6 +1913,13 @@ export default {
         this.goodsList = res.data.data.itemList
         this.vehicleList = res.data.data.orderItemList
         this.orderFilesList = res.data.data.fileList
+
+        this.oldgoodsForm = res.data.data
+        this.oldtableData = this.deepClone(res.data.data.orderAddressList)
+        this.oldentrustList = this.deepClone(res.data.data.itemList)
+        this.oldgoodsList = this.deepClone(res.data.data.itemList)
+        this.oldvehicleList = this.deepClone(res.data.data.orderItemList)
+        this.oldorderFilesList = this.deepClone(res.data.data.fileList)
         if (res.data.data.orderFeeList.length > 0) {
           this.collectionList = []
           this.paymentList = []
@@ -1930,20 +1971,82 @@ export default {
     },
     //返回主列表
     backToList(value) {
-      if (value === 0) {
-        this.goodsForm = {}
-        this.$emit('backToList')
-      } else if (value === 1) {
-        this.goodsForm = {}
-        this.$emit('backToList', true)
-      } else if (value === 2) {
-        this.$router.push({
-          path: '/wel/index'
-        });
-      } else if (value === 3) {
-        this.$router.push({
-          path: '/landTransportation/reportAnalysis/index'
+      if (
+          contrastObj(this.goodsForm, this.oldgoodsForm)
+          || contrastList(this.tableData, this.oldtableData)
+          || contrastList(this.entrustList, this.oldentrustList)
+          || contrastList(this.goodsList, this.oldgoodsList)
+          || contrastList(this.vehicleList, this.oldvehicleList)
+          || contrastList(this.orderFilesList, this.oldorderFilesList)
+      ) {
+        this.$confirm("数据发生变化未有保存记录, 是否保存?", "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消",
+          type: "warning"
+        }).then(() => {
+          let data = JSON.parse(JSON.stringify(this.tableData))
+          data.forEach((item, index) => {
+            item.sort = index + 1
+          })
+          this.type = true
+          saveSaveList({
+            ...this.goodsForm,
+            kind: '1',
+            orderAddressList: data,
+            fileList: this.orderFilesList,
+            itemList: this.entrustList,
+            orderFeeList: this.collectionList.concat(this.paymentList)
+          }).then(res => {
+            this.$message.success('保存成功');
+            if (value === 0) {
+              this.goodsForm = {}
+              this.$emit('backToList')
+            } else if (value === 1) {
+              this.goodsForm = {}
+              this.$emit('backToList', true)
+            } else if (value === 2) {
+              this.$router.push({
+                path: '/wel/index'
+              });
+            } else if (value === 3) {
+              this.$router.push({
+                path: '/landTransportation/reportAnalysis/index'
+              });
+            }
+          })
+        }).catch(() => {
+          if (value === 0) {
+            this.goodsForm = {}
+            this.$emit('backToList')
+          } else if (value === 1) {
+            this.goodsForm = {}
+            this.$emit('backToList', true)
+          } else if (value === 2) {
+            this.$router.push({
+              path: '/wel/index'
+            });
+          } else if (value === 3) {
+            this.$router.push({
+              path: '/landTransportation/reportAnalysis/index'
+            });
+          }
         });
+      }else {
+        if (value === 0) {
+          this.goodsForm = {}
+          this.$emit('backToList')
+        } else if (value === 1) {
+          this.goodsForm = {}
+          this.$emit('backToList', true)
+        } else if (value === 2) {
+          this.$router.push({
+            path: '/wel/index'
+          });
+        } else if (value === 3) {
+          this.$router.push({
+            path: '/landTransportation/reportAnalysis/index'
+          });
+        }
       }
     },
     //删除途径地址
@@ -1987,11 +2090,6 @@ export default {
       let data = JSON.parse(JSON.stringify(this.tableData))
       data.forEach((item, index) => {
         item.sort = index + 1
-        // if (item.region !== undefined && item.region.length !== 0) {
-        //   item.region = item.region.join(',')
-        // } else {
-        //   item.region = ''
-        // }
       })
       this.type = true
       saveSaveList({