Browse Source

修改禅道达沃特和陆运问题

Qukatie 8 months ago
parent
commit
aa11861ad6

+ 2 - 1
src/components/crop-select/main.vue

@@ -134,11 +134,12 @@ export default {
     if (!this.slot) {
       allCropList({
         corpType: getCustomerCode(this.corpType),
-        adminProfiles: userObj.role_name != "admin" ? userObj.user_id : null,
+        adminProfiles: userObj.role_name != "admin" ? (userObj.role_name != "客户"?userObj.user_id : null): null,
         corpsTypeName: this.treeType == "CK" ? "货代和物流" : null,
         belongtocompany: this.belongtocompany
       }).then(res => {
         this.corpList = res.data.data;
+        console.log(this.corpList)
       });
     }
   },

+ 0 - 39
src/views/businessManagement/proxyOrder/configuration/customerContact.json

@@ -37,33 +37,10 @@
       "name": "actualQuantity",
       "type": "sum",
       "decimals": 0
-    },
-    {
-      "name": "cartonWeight",
-      "type": "sum"
-    },
-    {
-      "name": "cntrVolumn",
-      "type": "sum"
     }
   ],
   "column": [
     {
-      "label": "价格类别",
-      "prop": "priceType",
-      "index": 1,
-      "width": 150,
-      "cell": false,
-      "overHidden": true,
-      "rules": [
-        {
-          "required": true,
-          "message": "请输入类别",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
       "label": "商品名称",
       "prop": "cname",
       "index": 1,
@@ -157,22 +134,6 @@
       ]
     },
     {
-      "label": "采购价格",
-      "prop": "purchaseAmount",
-      "index": 11,
-      "width": 150,
-      "cell": false,
-      "slot": true,
-      "overHidden": true,
-      "rules": [
-        {
-          "required": false,
-          "message": "请输入采购价格",
-          "trigger": "blur"
-        }
-      ]
-    },
-    {
       "label": "金额",
       "prop": "amount",
       "index": 13,

+ 5 - 0
src/views/businessManagement/proxyOrder/configuration/mainList.json

@@ -53,6 +53,11 @@
   ],
   "column": [
     {
+      "label": "系统编号",
+      "prop": "orderNo",
+      "overHidden": true
+    },
+    {
       "label": "品牌",
       "prop": "brand",
       "search": true,

+ 51 - 5
src/views/businessManagement/proxyOrder/detailsPageEdit.vue

@@ -78,7 +78,8 @@
                   @getCorpData="getPlantRow" corpType="GYS" :disabled="detailData.seeDisabled || browse"
                   style="width: 100%"></crop-select>
                 <el-select v-else-if="item.prop === 'brand'" v-model="form[item.prop]" placeholder="请选择" clearable
-                  filterable style="width: 100%" size="small" :disabled="detailData.seeDisabled || browse||item.disabled">
+                  filterable style="width: 100%" size="small"
+                  :disabled="detailData.seeDisabled || browse || item.disabled">
                   <el-option v-for="(item, index) in brandOption" :key="index" :label="item.dictValue"
                     :value="item.dictValue"></el-option>
                 </el-select>
@@ -189,8 +190,8 @@
         <basic-container style="margin-bottom: 10px">
           <avue-crud :option="customerContact" v-model="contactsForm" :data="goodsShowData" ref="crudContact"
             @row-save="rowSave" @row-click="handleRowClick" @row-update="rowUpdate" @selection-change="productSelection"
-            @row-del="rowDel" @saveColumn="saveColumn('goods')" @resetColumn="resetColumn"
-            :summary-method="summaryMethod" :table-loading="goodsLoading" :key="index">
+            @row-del="rowDel" @saveColumn="saveColumn('goods')" @resetColumn="resetColumn" :table-loading="goodsLoading"
+            :key="index">
             <template slot="headerSerial">
               <span class="order_number">序号</span>
               <el-button class="number_button" type="primary" icon="el-icon-circle-plus-outline" circle size="mini"
@@ -279,6 +280,8 @@
                 <el-button type="primary" size="small" icon="el-icon-upload" v-show="goodsActives == 'goods'"
                   :disabled="detailData.seeDisabled || browse">导 入</el-button>
               </el-upload>
+              <el-button type="primary" size="small" icon="el-icon-upload"
+                :disabled="detailData.seeDisabled || browse || selection.length == 0" @click="allDel">批量删除</el-button>
               <!-- <el-button type="warning" icon="el-icon-refresh" size="small" @click="resetStock">库存刷新</el-button>
               <el-button type="danger" icon="el-icon-delete" size="small" @click="removeList"
                 :disabled="(selection.length == 0) || detailData.seeDisabled || browse">删除</el-button> -->
@@ -1377,7 +1380,6 @@ export default {
       index: 0,
       policyIndex: 0,
       routerTag: '',
-      roleName: null,
     }
   },
   mounted() {
@@ -1423,6 +1425,15 @@ export default {
     }
     if (this.roleName.includes('客户')) {
       this.findObject(this.basicData.column, "corpId").disabled = true
+      this.findObject(this.basicData.column, "brand").disabled = true
+      if (!this.detailData.id) {
+        getCorp().then(res => {
+          this.form.corpId = res.data.data.id;
+          this.form.corpName = res.data.data.cname;
+          this.getCorpRow(res.data.data)
+        })
+      }
+
     }
     if (this.roleName == 'salesman') {
       this.customerContact.column.forEach(item => {
@@ -2066,7 +2077,6 @@ export default {
         this.userList = res.data.data;
       })
       khDetail(data.id).then(res => {
-        console.log(res.data.data)
         this.$set(this.form, 'brand', res.data.data.goodtypes);
         if (res.data.data.adminProfiles) {
           res.data.data.adminProfiles = res.data.data.adminProfiles.split(",");
@@ -3462,6 +3472,42 @@ export default {
         );
       })
     },
+    allDel() {
+      let multiList = []
+      let arr = []
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        multiList = this.selection
+        arr = this.goodsShowData
+        // 获取有id 的数据
+        const itemsWithId = multiList.filter(item => item.hasOwnProperty('id'));
+        let arrIds = itemsWithId.map(item => item.id) // 获取id 数据
+        // 把选中的删除掉
+        multiList.forEach((item) => {
+          for (let index in arr) {
+            if (JSON.stringify(item) == JSON.stringify(arr[index])) {
+              arr.splice(Number(index), 1)
+            }
+          }
+        })
+        if (itemsWithId.length != 0) {
+          const loading = this.$loading({
+            lock: true,
+            text: '加载中',
+            spinner: 'el-icon-loading',
+            background: 'rgba(255,255,255,0.7)'
+          });
+          removeList({ ids: arrIds.join(',') }).then(res => {
+            this.$message.success("删除成功");
+          }).finally(() => {
+            loading.close();
+          })
+        }
+      })
+    }
   },
   computed: {
     ...mapGetters(["userInfo", "permission"])

+ 104 - 29
src/views/businessManagement/salesOrder/detailsPageEdit.vue

@@ -418,14 +418,14 @@
         <el-col :span="14">
           <el-tabs v-model="activeName">
             <el-tab-pane label="采购计划" name="searchList" />
-            <el-tab-pane label="已选定数据" name="importStaging" />
+            <el-tab-pane label="政策匹配" name="importStaging" />
           </el-tabs>
           <basic-container v-if="activeName == 'searchList'">
-            <avue-crud :option="optionThree" :table-loading="loading" :data="DLListShow" ref="crud">
+            <avue-crud :option="optionThree" :table-loading="loading" :data="DLListShow" ref="crud"  :search.sync="searchDL" @search-change="searchChange" @search-reset="resetChange">
               <template slot-scope="{row,index}" slot="menu">
                 <el-button type="text" icon="el-icon-edit" size="small" @click.stop="importStagListDL(row, index)"
                   v-if="activeName == 'searchList'"
-                  :disabled="DLListSave.findIndex(item => item.id == row.id) !== -1">选择
+                  :disabled="DLListSave.findIndex(item => item.id == row.id) !== -1 || goodsShowData.findIndex(item => item.code == row.code) !== -1">选择
                 </el-button>
               </template>
             </avue-crud>
@@ -434,7 +434,7 @@
             <dic-select v-model="policyType" placeholder="政策类型" key="id" label="title" keyValue="id"
               :url="'/blade-mocha-item/salespolicy/lazy-tree?newTime=' + nowDate + '&parentId=0&corps=' + form.corpId"
               :filterable="true" :remote="true"></dic-select>
-            <avue-crud :option="optionThree" :table-loading="loading" :data="DLListSave" ref="crud"
+            <avue-crud :option="optionFour" :table-loading="loading" :data="DLListSave" ref="crud"
               @selection-change="selectionChangeDL">
               <template slot-scope="{row,index}" slot="menu">
                 <el-button type="text" icon="el-icon-delete" size="small" @click.stop="removeStagListDL(row, index)">移除
@@ -667,6 +667,7 @@ export default {
   },
   data() {
     return {
+      searchDL:{},
       policyType: null,
       dataDL: [],
       optionThree: {
@@ -675,6 +676,45 @@ export default {
         editBtn: false,
         delBtn: false,
         menuWidth: '80',
+        searchSpan: 12,
+        // selection: true,
+        // tip: false,
+        column: [
+          {
+            label: '商品名称',
+            prop: 'cname',
+            search:true,
+            overHidden: true
+          }, {
+            label: '编码',
+            prop: 'code',
+            search:true,
+            overHidden: true
+          }, {
+            label: '规格型号',
+            prop: 'typeno',
+            overHidden: true
+          }, {
+            label: '花纹',
+            prop: 'brandItem',
+            overHidden: true
+          }, {
+            label: '订货数量',
+            prop: 'orderQuantity',
+            overHidden: true
+          }, {
+            label: '供应商',
+            prop: 'corpName',
+            overHidden: true
+          }
+        ]
+      },
+      optionFour: {
+        header: false,
+        menu: true,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: '80',
         // selection: true,
         // tip: false,
         column: [
@@ -698,6 +738,10 @@ export default {
             label: '订货数量',
             prop: 'orderQuantity',
             overHidden: true
+          }, {
+            label: '供应商',
+            prop: 'corpName',
+            overHidden: true
           }
         ]
       },
@@ -1536,6 +1580,7 @@ export default {
       index: 0,
       policyIndex: 0,
       routerTag: '',
+      handId:null,
     }
   },
   mounted() {
@@ -1950,7 +1995,8 @@ export default {
     },
     //点击行可编辑
     handleRowClick(row, event, column) {
-      this.onLoadDL(row)
+      this.handId=row.id
+      this.onLoadDL(this.serach,this.handId)
     },
     //商品编辑
     rowCell(row, index) {
@@ -2017,6 +2063,7 @@ export default {
       }
       this.dialogVisibleDL = !this.dialogVisibleDL
       this.commodityData = false
+      this.handId=null
       this.DLListSave = [];
       this.DLListShow = [];
       this.policyType = null
@@ -2539,6 +2586,14 @@ export default {
         }
       }
     },
+    async getPolicyPrice(res, item) {
+      res.data.data.specialItemList.forEach(e => {
+        if (this.DLListSave[item].code == e.code) {
+          console.log(this.DLListSave[item].code, e.code, e.salesPrice)
+          this.$set(this.DLListSave[item], 'price', e.salesPrice);
+        }
+      })
+    },
     async importDL() {
       if (this.DLListSave.length == 0) {
         return this.$message.error('请选择采购计划明细')
@@ -2546,34 +2601,36 @@ export default {
       this.saveLoading = true;
       for (let item in this.DLListSave) {
         if (this.policyType) {
-            detailList(this.policyType).then(res => {
-              if (res.data.data.specialItemList) {
-                res.data.data.specialItemList.forEach(e => {
-                  if (this.DLListSave[item].code == e.code) {
-                    this.$set(this.DLListSave[item], 'price', e.salesPrice);
-                  }
-                })
-              }
-            })
-          }
-        getMarketPrice({
-          code: this.DLListSave[item].code,
-          isFreight: this.form.isFreight,
-          isLabel: this.form.isLabel
-        }).then(res => {
-          if (res.data.data.length > 0) {
-            this.$set(this.DLListSave[item], 'price', res.data.data[0].salePrice)
-          } else {
-            this.$set(this.DLListSave[item], 'price', '0')
+          let res = await detailList(this.policyType)
+          console.log('第一个接口', Date.now())
+          if (res.data.data.specialItemList) {
+            console.log('第1.1个接口', Date.now())
+            await this.getPolicyPrice(res, item)
           }
-          this.priceChange(this.DLListSave[item])
-        })
+          // detailList(this.policyType).then(res => {
+          //   console.log('第一个接口',Date.now())
+
+          // })
+        }
+        // getMarketPrice({
+        //   code: this.DLListSave[item].code,
+        //   isFreight: this.form.isFreight,
+        //   isLabel: this.form.isLabel
+        // }).then(res => {
+        //   if (res.data.data.length > 0) {
+        //     this.$set(this.DLListSave[item], 'price', res.data.data[0].salePrice)
+        //   } else {
+        //     this.$set(this.DLListSave[item], 'price', '0')
+        //   }
+        //   this.priceChange(this.DLListSave[item])
+        // })
         selectGoodsNum({
           goodsId: this.DLListSave[item].id,
           itemType: this.DLListSave[item].typeno,
           tradeType: 'GN',
           warehouseId: this.form.storageId
         }).then(res => {
+          console.log('第二个接口', Date.now())
           if (res.data.data.length > 0) {
             res.data.data.forEach(e => {
               e.storageId = e.storageId + '-' + e.corpId
@@ -2591,6 +2648,7 @@ export default {
           }
 
           // this.DLListSave[item].storageQuantity =  res.data.data
+          this.$set(this.DLListSave[item], 'storageId','工厂仓-'+this.DLListSave[item].corpName)
           this.$set(this.DLListSave[item], 'priceCategory', this.DLListSave[item].goodsTypeName)
           // this.DLListSave[item].priceCategory = this.DLListSave[item].goodsTypeName
           delete this.DLListSave[item].goodsTypeName
@@ -2625,6 +2683,7 @@ export default {
           delete this.DLListSave[item].updateUserName
           this.maxGoodsNum++
           getPurchasePrice({ code: this.DLListSave[item].code }).then(res => {
+            console.log('第三个接口', Date.now())
             if (res.data.data.length > 0) {
               this.$set(this.DLListSave[item], 'purchaseAmount', res.data.data[0].purchasePrice)
               this.$set(this.DLListSave[item], 'purchaseRebatePrice', res.data.data[0].purchaseRebatePrice)
@@ -2632,7 +2691,7 @@ export default {
               this.$set(this.DLListSave[item], 'purchaseAmount', '0')
             }
             this.quantityChange(this.DLListSave[item])
-            console.log(this.DLListSave[item].price,222222)
+
             this.$refs.crudContact.rowCellAdd(this.DLListSave[item]);
             this.$nextTick(() => {
               this.quantityChange(this.DLListSave[item])
@@ -3303,10 +3362,26 @@ export default {
         this.loading = false;
       });
     },
+    searchChange(params, done) {
+      this.treeDeptId = ''
+      params = {
+        ...this.serach,
+        ...params,
+      }
+      this.onLoadDL(params,this.handId);
+      done()
+    },
+    resetChange(){
+      this.serach
+    },
     //商品列表查询
-    onLoadDL(row) {
+    onLoadDL(params,id) {
+      let obj={
+        ...params,
+        id:id
+      }
       this.loading = true;
-      getAgencyOrderItem({ id: row.id }).then(res => {
+      getAgencyOrderItem(obj).then(res => {
         this.DLListShow = res.data.data;
         this.loading = false;
       });

+ 26 - 7
src/views/landTransportation/dispatchingCars/detailPage.vue

@@ -378,7 +378,7 @@
         <el-button type="primary" @click="saveAnnex" size="small">保 存</el-button>
       </span>
     </el-dialog>
-    <report-dialog :switchDialog="switchDialog" :reportId="goodsForm.id" reportName="陆运-派车通知" @onClose="onClose()">
+    <report-dialog :switchDialog="switchDialog" :reportId="goodsForm.id" reportName="陆运-派车通知(调度)" @onClose="onClose()">
     </report-dialog>
     <track-playback :dialogVisible="dialogVisibleTwo" :lineArr="lineArr" ref="playback"></track-playback>
   </div>
@@ -405,6 +405,7 @@ import { getDeptTree } from "@/api/system/dept";
 import { customerList } from "@/api/basicData/basicFeesDesc";
 import { gaude, location } from "@/api/gaude";
 import reportDialog from "@/components/report-dialog/main";
+import { isProcurement } from "@/api/basicData/configuration";
 export default {
   props: {
     id: {
@@ -749,7 +750,7 @@ export default {
           label: '单柜运费',
           index: 14,
           prop: 'landAmountD'
-        }, 
+        },
         {
           label: '箱号',
           width: 100,
@@ -1334,7 +1335,8 @@ export default {
           },
         },
         ]
-      }
+      },
+      paymentFleet: null
     };
   },
   watch: {
@@ -1369,7 +1371,15 @@ export default {
     this.collectionOption = await this.getColumnData(this.getColumnName(86.4), this.collectionOptionBackup);
     this.paymentOption = await this.getColumnData(this.getColumnName(86.5), this.paymentOptionBackup);
     this.KeyBoxTwo++
-    this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
+    isProcurement({ "param": "payment.fleet" }).then(res => {
+      this.paymentFleet = res.data.data
+      if (this.paymentFleet == 1) {
+        this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-client/corpsdesc/getCorpListAll"
+      } else {
+        this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
+      }
+    })
+
     this.findObject(this.paymentOption.column, "plateNo").dicUrl = "api/blade-land/order-fee/plate-no?orderId=" + this.id + '&fleetId={{key}}'
     this.findObject(this.paymentOption.column, "plateNo").dicFormatter = (data) => {
       let list = []
@@ -1399,6 +1409,7 @@ export default {
           data.row.amount = Number(data.row.price) * Number(data.row.quantity)
         }
       }
+
     }
 
     this.KeyBoxTwo++
@@ -1579,7 +1590,11 @@ export default {
        */
       const inSave = await this.saveColumnData(this.getColumnName(86.5), this.paymentOption);
       if (inSave) {
-        this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
+        if (this.paymentFleet == 1) {
+          this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-client/corpsdesc/getCorpListAll"
+        } else {
+          this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
+        }
         this.findObject(this.paymentOption.column, "plateNo").dicUrl = "api/blade-land/order-fee/plate-no?orderId=" + this.id + '&fleetId={{key}}'
         this.$message.success("保存成功");
         //关闭窗口
@@ -1592,7 +1607,11 @@ export default {
       const inSave = await this.delColumnData(this.getColumnName(86.5), this.paymentOptionBackup);
       if (inSave) {
         this.$message.success("重置成功");
-        this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
+        if (this.paymentFleet == 1) {
+          this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-client/corpsdesc/getCorpListAll"
+        } else {
+          this.findObject(this.paymentOption.column, "fleetId").dicUrl = "/api/blade-land/order-fee/fleet?orderId=" + this.id
+        }
         this.findObject(this.paymentOption.column, "plateNo").dicUrl = "api/blade-land/order-fee/plate-no?orderId=" + this.id + '&fleetId={{key}}'
         this.$refs.payment.$refs.dialogColumn.columnBox = false;
       }
@@ -1989,7 +2008,7 @@ export default {
     },
     //选择客户信息触发
     getfleetId(data, row) {
-      console.log(data, row,1111)
+      console.log(data, row, 1111)
       this.$set(row, 'corpName', data.cname)
     },
     //收款信息移除

+ 26 - 3
src/views/landTransportation/motorcadeDriver/index.vue

@@ -148,6 +148,12 @@
               v-if="row.status > 2"
           >变更记录
           </el-button>
+          <el-button
+              size="small"
+              type="text"
+              @click="openReport(row, index)"
+          >派车通知
+          </el-button>
         </template>
         <template slot="addressDetail" slot-scope="{ row,index}">
           <el-tooltip class="item" effect="dark" placement="top">
@@ -207,6 +213,8 @@
         width="80%">
       <div id="container"></div>
     </el-dialog>
+    <report-dialog :switchDialog="switchDialog" :reportId="reportId" reportName="陆运-派车通知(派车)" @onClose="onClose()">
+    </report-dialog>
   </div>
 </template>
 
@@ -222,11 +230,17 @@ import {
 import {location} from "@/api/gaude";
 import {businessStatisticsFrequency} from "@/api/wel";
 import {defaultDate} from "@/util/date";
-
+import reportDialog from "@/components/report-dialog/main";
 export default {
   name: "index",
+  components: {
+    reportDialog
+  },
   data() {
     return {
+      reportId:null,
+      switchDialog: false,
+      formData: {},
       key: 0,
       query:{},
       screen:{},
@@ -315,7 +329,6 @@ export default {
       },
       dialogRecord: false,
       dialogChange: false,
-      formData: {},
       dataRecord: [],
       optionRecord: {
         stripe: true,
@@ -358,7 +371,7 @@ export default {
         index: true,
         addBtn: false,
         delBtn: false,
-        menuWidth:150,
+        menuWidth:240,
         cellBtn: false,
         cancelBtn: false,
         editBtn: false,
@@ -806,6 +819,14 @@ export default {
     clearInterval(this.dispatchACarTimer); //关闭
   },
   methods: {
+    openReport(row) {
+      this.reportId = row.id
+      this.switchDialog = !this.switchDialog;
+    },
+    onClose(val) {
+      this.reportId = null
+      this.switchDialog = val;
+    },
     confirmChange() {
       changeVehicle({
         ...this.formData,
@@ -839,11 +860,13 @@ export default {
       for (let item of data){
         if (row.status == item.dictKey){
           this.formData = {
+            ...row,
             status:item.dictKey,
             $status:item.dictValue
           }
         }
       }
+      console.log(row)
       this.formDataList = row
       this.dialogChange = true
       this.optionData.column[0].dicUrl = "/api/blade-client/land-vehicle/vehicle-list?fleetId="+this.formDataList.fleetId

+ 1 - 1
src/views/maintenance/salesPolicy/index.vue

@@ -264,7 +264,7 @@ export default {
       console.log('1')
     },
     onLoad(page, params = {parentId: 0}) {
-      let queryParams = Object.assign({}, params, {
+      let queryParams = Object.assign({}, params,this.search, {
         size: page.pageSize,
         current: page.currentPage,
       })