liyg %!s(int64=2) %!d(string=hai) anos
pai
achega
2b78151619

+ 349 - 2
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckDetailsOrderNew.vue

@@ -151,6 +151,15 @@
             <i class="el-icon-circle-check"></i>冲红
           </el-button>
         </el-form-item>
+        <el-form-item v-show="activeName == 'first'">
+          <el-button
+            type="primary"
+            @click="openConsigneeUpd"
+            v-if="!notRoutList.includes('uploadDetails')"
+          >
+            <i class="el-icon-circle-check"></i>改客户
+          </el-button>
+        </el-form-item>
         <!-- <el-form-item v-if="isShowOperate">
           <el-button type="primary" @click="openReceive()">
             <i class="el-icon-document"></i>签收抵达</el-button
@@ -946,6 +955,259 @@
         >确定</el-button
       >
     </el-dialog>
+    <el-dialog title="改收货客户" :visible.sync="showConsigneeUpd">
+      <el-table
+        :data="consigneeUpdList"
+        ref="consigneeUpdTableRef"
+        class="untable"
+        border
+        style="width: 100%"
+        height="200px"
+        individual-panel
+        highlight-current-row
+        @current-change="consigneeUpdSelect"
+      >
+        <el-table-column
+          width="40"
+          label="序号"
+          align="center"
+          :resizable="false"
+        >
+          <template slot-scope="scope">{{
+            scope.row.group + 1
+          }}</template>
+        </el-table-column>
+        <el-table-column
+          prop="orderTime"
+          label="订单日期"
+          width="110px"
+          align="center"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="saleMakeDate"
+          label="制单日期"
+          width="130px"
+          align="center"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="newCapacityNo"
+          column-key="newCapacityNo"
+          label="车号"
+          align="center"
+          width="90px"
+          sortable
+          show-overflow-tooltip
+          :filters="filterCapacityList"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="consigneeName"
+          label="客户"
+          width="160px"
+          align="center"
+          column-key="consigneeName"
+          :filters="filterConsigneeList"
+          sortable
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="materialName"
+          column-key="materialNameList"
+          label="物料名称"
+          align="center"
+          width="150px"
+          sortable
+          :filters="filtermaterialNameList"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="materialSpe"
+          label="规格型号"
+          column-key="materialSpe"
+          align="center"
+          sortable
+          :filters="filtermaterialSpe"
+          width="120px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="materialPlanNumber"
+          label="辅助数量"
+          align="center"
+          width="100px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="materialAcWeight"
+          label="累计出库数量"
+          align="center"
+          width="100px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="materialNum"
+          label="累计检斤通知单辅助数量"
+          align="center"
+          width="150px"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="netWeight"
+          label="磅重"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="saleRemark"
+          column-key="saleRemark"
+          label="摘要"
+          width="150px"
+          align="center"
+          :filters="filterSaleRemark"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="carrierName"
+          label="承运商"
+          align="center"
+          width="80px"
+          column-key="carrierList"
+          sortable
+          show-overflow-tooltip
+          :filters="filterCarrierList"
+        >
+        </el-table-column>
+        <el-table-column
+          prop="addressPlace"
+          label="下货地点"
+          width="300px"
+          sortable
+          column-key="actualAddress"
+        >
+        </el-table-column>
+        <el-table-column prop="priceValue" label="单价" width="100px">
+        </el-table-column>
+        <el-table-column
+          prop="detailsAmount"
+          label="运费"
+          width="100px"
+        ></el-table-column>
+        <el-table-column
+          prop="closeEntryId"
+          label="分录ID"
+          width="120px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="actualCity"
+          label="卸货城市"
+          width="120px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="areaName"
+          label="分区"
+          width="150px"
+          align="center"
+          column-key="saleAreaList"
+          :filters="filterSaleAreaList"
+        >
+        </el-table-column>
+        <el-table-column prop="unloadType" label="卸货类型" width="60px">
+        </el-table-column>
+        <el-table-column
+          prop="saleOrderReceiveCustomer"
+          label="收款客户"
+          width="120px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <!-- <el-table-column
+          prop="addressPlace"
+          label="收货地址"
+          width="250px"
+          sortable
+          column-key="addressPlace"
+          :filters="filteraddressPlace"
+        >
+        </el-table-column> -->
+        <el-table-column
+          prop="materialWeight"
+          label="理重"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+
+        <el-table-column
+          prop="paymentCustomer"
+          label="付款单位"
+          width="120px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="consingneeSettlementMethod"
+          label="结算方式"
+          width="120px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+
+        <el-table-column
+          prop="recordUserName"
+          label="操作人"
+          width="120px"
+          show-overflow-tooltip
+        >
+        </el-table-column>
+        <el-table-column
+          prop="detailsRemark"
+          label="直接修改备注"
+          width="120px"
+          show-overflow-tooltip
+        >
+          <template slot-scope="scope">
+            <el-button
+              @click="showPhoto(scope.row)"
+              type="text"
+              size="small"
+            >
+              {{ scope.row.detailsRemark }}
+            </el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-form style="margin-left:20%">
+        <el-form-item label="收货客户">
+          <el-autocomplete
+          class="inline-input"
+          v-model="consigneeName"
+          :fetch-suggestions="querySearchConsignee"
+          placeholder="请输入收货客户名称"
+          :trigger-on-focus="false"
+          @select="handleSelectConsignee"
+          style="width:300px"
+        >
+          <template slot-scope="{ item }">
+            <div class="name">{{ item.consigneeCompanyName }}</div>
+          </template>
+        </el-autocomplete>
+        </el-form-item>
+      </el-form>
+      <el-button
+        type="primary"
+        @click="updateConsignee"
+        :loading="isLoading"
+        style="margin-left:40%"
+        >确定
+      </el-button>
+    </el-dialog>
     <el-dialog :visible.sync="dialogVisible" width="80%">
       <img width="100%" :src="dialogImageUrl" alt="" />
     </el-dialog>
@@ -1109,7 +1371,6 @@ export default {
         '运单状态',
         '车号',
         '承运商',
-        '客户',
         '收货地址',
         '下货地点',
         '业务员',
@@ -1143,7 +1404,6 @@ export default {
         '运单状态',
         '车号',
         '承运商',
-        '客户',
         '收货地址',
         '下货地点',
         '业务员',
@@ -1295,8 +1555,13 @@ export default {
       showStatementUpLoad: false,
       detailAmount: null,
       detailsList: [],
+      consigneeUpdList:[],
       showDetailsUpLoad: false,
       showDetailsAdd: false,
+      showConsigneeUpd:false,
+      updateConsigneeRow:null,
+      consigneeId:null,
+      consigneeName:'',
       detailRemark: null,
       showPhotoPreview: false,
       previewList: [],
@@ -1945,6 +2210,88 @@ export default {
         })
       }
     },
+    openConsigneeUpd(){
+      if (
+        !this.$refs.tableRef.selection ||
+        this.$refs.tableRef.selection.length != 1
+      ) {
+        this.$message.warning('请选择需要修改的订单,一次只允许选中一个')
+        return
+      } else {
+        this.consigneeUpdList = [];
+        let data = this.$refs.tableRef.selection
+        if (!data[0].orderId || !data[0].detailsId) {
+          this.$message.warning('没有派发运单或没有详单,无法修改此项')
+          return
+        }
+        this.consigneeUpdList = this.visibleList.filter((item)=>{
+          return item.orderId == data[0].orderId;
+        });
+        this.showConsigneeUpd = true
+        this.updateConsigneeRow = null
+        this.consigneeId = null
+        this.consigneeName = null
+        this.isLoading = false
+      }
+    },
+    consigneeUpdSelect(selection){
+      console.log(selection);
+      this.updateConsigneeRow=selection;
+    },
+    handleSelectConsignee(item) {
+      this.consigneeName = item.consigneeCompanyName
+      this.consigneeId = item.consigneeId
+    },
+    querySearchConsignee(queryString, cb) {
+      this.axios
+        .post('/api/v1/uc/getConsigneeByLike?index=' + queryString)
+        .then(res => {
+          if (res.data.code == '200') {
+            var restaurantsConsignee = res.data.data
+            var results = queryString
+              ? restaurantsConsignee.filter(
+                  this.createFilterConsignee(queryString)
+                )
+              : restaurantsConsignee
+            // 调用 callback 返回建议列表的数据
+            cb(results)
+          }
+        })
+    },
+    createFilterConsignee(queryString) {
+      return restaurantsConsignee => {
+        return (
+          restaurantsConsignee.value
+            .toLowerCase()
+            .indexOf(queryString.toLowerCase()) > -1
+        )
+      }
+    },
+    updateConsignee(){
+      this.isLoading = true
+      if (!this.consigneeId || !this.updateConsigneeRow) {
+        this.$message.warning('请点击物资并填写、选中收货客户!')
+        this.isLoading = false
+      } else {
+        let map = {
+          orderId: this.updateConsigneeRow.orderId,
+          detailsId: this.updateConsigneeRow.detailsId,
+          userId: getCookie('userId'),
+          consigneeId:this.consigneeId
+        }
+        this.axios.post('/api/v1/bms/updateConsignee', map).then(res => {
+          if (res.data.status == 'succeed') {
+            this.$message.success('修改成功!')
+            this.setteldAllselectValue = 0
+            this.onclick()
+          } else {
+            this.$message.error(res.data.data)
+          }
+          this.showConsigneeUpd = false
+          this.isLoading = false
+        })
+      }
+    },
     receiveClick(src, title) {
       // this.dialogImageUrl = src
       downloadFile(src, `${this.downloadCapacityNo}${title}照片`, '.jpg')

+ 2 - 3
src/views/sale/components/transportFreight/saleTruckSettlement/bmsTruckStatementNew.vue

@@ -352,11 +352,10 @@ export default {
         '出厂时间',
         '进厂时间',
         '运单状态',
-        '车号',
+        '车号',
         '承运商',
-        '客户',
         '收货地址',
-        '实际收货地址',
+        '下货地点',
         '业务员',
         '送货单打印',
         '收货客户电话',