QuKatie 3 years ago
parent
commit
94db087aae

+ 8 - 1
src/api/kaihe/domesticTrade/myOrder.js

@@ -139,5 +139,12 @@ export function confirmAllocation(data) {
     data: data
   })
 }
-
+//扣货
+export function detention(data) {
+  return request({
+    url: '/khwarehouse/updateOrderMessage/detention',
+    method: 'post',
+    data: data
+  })
+}
 

+ 141 - 5
src/views/kaihe/domesticTrade/myOrder/index.vue

@@ -32,6 +32,8 @@
               size="small"
               style="width: 240px"
               v-model="queryParams.fVslid"
+              @change="vslidChange"
+              clearable
             >
               <el-option
                 v-for="item in vesselOptions"
@@ -157,6 +159,27 @@
               </el-form-item>
             </el-col>
             <el-col :span="6">
+              <el-form-item label="货物状态" prop="fCaregoStatus">
+                <el-select
+                  v-model="queryParams.fCaregoStatus"
+                  clearable
+                  filterable
+                  size="small"
+                  placeholder="请选择货物状态"
+                  style="width: 240px"
+                >
+                  <el-option
+                    v-for="(item, index) in caregoList"
+                    :key="index.dictValue"
+                    :label="item.dictLabel"
+                    :value="item.dictValue"
+                  ></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-col :span="6">
               <el-form-item label="业务员" prop="createBy">
                 <el-select
                   v-model="queryParams.createBy"
@@ -175,8 +198,6 @@
                 </el-select>
               </el-form-item>
             </el-col>
-          </el-row>
-          <el-row>
             <el-col :span="6">
               <el-form-item label="箱号" prop="fCntrno">
                 <el-input
@@ -280,6 +301,38 @@
           :disabled="selection.length == 0 ? true : false"
           >取消配船</el-button
         >
+        <el-button
+          type="primary"
+          plain
+          icon="el-icon-search"
+          size="mini"
+          @click="inDetention(3)"
+          :disabled="
+            selection.length == 0
+              ? true
+              : false ||
+                selection.findIndex(function (item) {
+                  return item.fCaregoStatus == '放货';
+                }) === -1
+          "
+          >扣货</el-button
+        >
+        <el-button
+          type="info"
+          plain
+          icon="el-icon-search"
+          size="mini"
+          @click="inDetention(2)"
+          :disabled="
+            selection.length == 0
+              ? true
+              : false ||
+                selection.findIndex(function (item) {
+                  return item.fCaregoStatus == '扣货';
+                }) === -1
+          "
+          >取消扣货</el-button
+        >
       </div>
       <div class="tabSetting">
         <right-toolbar
@@ -396,6 +449,18 @@
           <span v-else-if="item.label == 'fCargoPlanning'">{{
             scope.row.fCargoPlanning == "1" ? "否" : "是"
           }}</span>
+          <span v-else-if="item.label == 'fCaregoStatus'">
+            <p style="color: #67c23a" v-if="scope.row.fCaregoStatus == '放货'">
+              {{ scope.row.fCaregoStatus }}
+            </p>
+            <p
+              style="color: #f56c6c"
+              v-else-if="scope.row.fCaregoStatus == '扣货'"
+            >
+              {{ scope.row.fCaregoStatus }}
+            </p>
+            <p v-else>{{ scope.row.fCaregoStatus }}</p>
+          </span>
           <span v-else>{{ scope.row[item.label] }}</span>
         </template>
       </el-table-column>
@@ -508,6 +573,7 @@ import {
   cancelAllocation,
   confirmAllocation,
   exportItem,
+  detention,
 } from "@/api/kaihe/domesticTrade/myOrder";
 import Cookies from "js-cookie";
 import { addSet, resetModule, select } from "@/api/system/set";
@@ -723,13 +789,48 @@ export default {
         },
         {
           surface: "20",
+          label: "fReceivable",
+          name: "应收",
+          checked: 0,
+          width: 120,
+        },
+        {
+          surface: "21",
+          label: "fRecycle",
+          name: "实收",
+          checked: 0,
+          width: 120,
+        },
+        {
+          surface: "22",
+          label: "fDue",
+          name: "应付",
+          checked: 0,
+          width: 120,
+        },
+        {
+          surface: "23",
+          label: "fPay",
+          name: "实付",
+          checked: 0,
+          width: 120,
+        },
+        {
+          surface: "24",
+          label: "fCaregoStatus",
+          name: "货物状态",
+          checked: 0,
+          width: 120,
+        },
+        {
+          surface: "25",
           label: "fCargoPlanning",
           name: "配船",
           checked: 0,
           width: 120,
         },
         {
-          surface: "21",
+          surface: "26",
           label: "remark",
           name: "备注",
           checked: 0,
@@ -770,6 +871,7 @@ export default {
       fMblnoOptions: [],
       createBy: [],
       fCorpid: [],
+      caregoList: [],
     };
   },
   created() {
@@ -793,6 +895,11 @@ export default {
         this.serviceitems = response.data;
       }
     });
+    this.getDicts("carego_status").then((response) => {
+      if (response.data) {
+        this.caregoList = response.data;
+      }
+    });
     this.getRow();
   },
   activated() {
@@ -912,7 +1019,22 @@ export default {
     onEnd() {
       this.drag = false;
     },
-
+    inDetention(type) {
+      let ids = [];
+      this.selection.forEach((e) => {
+        ids.push(e.fId);
+      });
+      detention({ fCaregoStatus: type, orderList: ids }).then((res) => {
+        if (res.code == 200) {
+          this.getList();
+          if (type == 3) {
+            this.$message.success("扣货成功");
+          } else {
+            this.$message.success("取消扣货成功");
+          }
+        }
+      });
+    },
     //箱型下拉查询
     cntrRemoteMethod() {
       let queryParams = { pageNum: 1 };
@@ -920,6 +1042,14 @@ export default {
         this.container = response.rows;
       });
     },
+    vslidChange(row) {
+      getVoyageName({ fPid: this.queryParams.fVslid }).then((response) => {
+        this.voyageOptions = response.rows;
+        if (this.queryParams.fVoyid) {
+          this.queryParams.fVoyid = "";
+        }
+      });
+    },
     /** 删除按钮操作 */
     handleDelete(row) {
       const fIds = row.fId || this.ids;
@@ -1051,7 +1181,7 @@ export default {
         });
     },
     handleExportItem() {
-           exportItem(this.queryParams).then((response) => {
+      exportItem(this.queryParams).then((response) => {
         this.download(response.msg);
       });
       // const queryParams = this.queryParams;
@@ -1087,6 +1217,12 @@ export default {
       };
       this.resetForm("queryForm");
       this.handleQuery();
+      getVoyageName({ fPid: this.queryParams.fVslid }).then((response) => {
+        this.voyageOptions = response.rows;
+        if (this.queryParams.fVoyid) {
+          this.queryParams.fVoyid = "";
+        }
+      });
     },
     // 多选框选中数据
     handleSelectionChange(selection) {

+ 142 - 94
src/views/kaihe/domesticTrade/orderInformation/index.vue

@@ -88,7 +88,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-               <el-row>
+          <el-row>
             <el-col :span="6">
               <el-form-item label="预计装货时间" prop="fBsdate">
                 <el-date-picker
@@ -137,8 +137,8 @@
                 </el-select>
               </el-form-item>
             </el-col>
-               </el-row>
-               <el-row>
+          </el-row>
+          <el-row>
             <el-col :span="6">
               <el-form-item label="付款方式" prop="fPaymode">
                 <el-select
@@ -472,6 +472,46 @@
                 />
               </el-form-item>
             </el-col>
+            <el-col :span="6">
+              <el-form-item label="应收" prop="fReceivable">
+                <el-input
+                  v-model="form.fReceivable"
+                  :disabled="modify"
+                  style="width: 100%"
+                  size="small"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="实收" prop="fRecycle">
+                <el-input
+                  v-model="form.fRecycle"
+                  :disabled="modify"
+                  style="width: 100%"
+                  size="small"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="应付" prop="fDue">
+                <el-input
+                  v-model="form.fDue"
+                  :disabled="modify"
+                  style="width: 100%"
+                  size="small"
+                />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item label="实付" prop="fPay">
+                <el-input
+                  v-model="form.fPay"
+                  :disabled="modify"
+                  style="width: 100%"
+                  size="small"
+                />
+              </el-form-item>
+            </el-col>
           </el-row>
         </el-form>
       </el-collapse-item>
@@ -860,7 +900,8 @@
               size="small"
               @click="feeChange('D')"
               v-if="form.moneyStatus == 6"
-            >费用变更</el-button>
+              >费用变更</el-button
+            >
           </div>
         </div>
         <el-table
@@ -1182,7 +1223,8 @@
               size="small"
               @click="feeChange('C')"
               v-if="form.moneyStatus == 6"
-            >费用变更</el-button>
+              >费用变更</el-button
+            >
           </div>
         </div>
         <el-table
@@ -2001,7 +2043,7 @@ export default {
   },
   data() {
     return {
-      auditLoading:false,
+      auditLoading: false,
       selection: [],
       insurance: [],
       etentioncargo: [],
@@ -2010,7 +2052,7 @@ export default {
       fLaneList: [],
       cEsign: [],
       transport: [],
-      fServiceitemsNews:[],
+      fServiceitemsNews: [],
       paymentMethod: [],
       drawee: [],
       whether: false,
@@ -2278,9 +2320,9 @@ export default {
         this.transport = response.data;
       }
     });
-         this.getDicts("f_serviceitemsNew").then((response) => {
-        this.fServiceitemsNews = response.data;
-      });
+    this.getDicts("f_serviceitemsNew").then((response) => {
+      this.fServiceitemsNews = response.data;
+    });
     this.getDicts("f_paymode").then((response) => {
       if (response.data) {
         this.paymentMethod = response.data;
@@ -2682,28 +2724,29 @@ export default {
         "tWarehousebillsfeesCr",
         JSON.stringify(this.warehouseCrList)
       );
-      this.auditLoading=true
-      getfee(formData).then((response) => {
-        this.$message.success("操作成功");
-        this.form.moneyStatus = 4;
-        this.jumpDonot = true;
-        this.modify = true;
-        let data = {
-          actId: 460,
-          id: this.form.fId,
-        };
-        getName(data).then((response) => {
-          if (response.data.length != 0) {
-            this.before = response.data[0].userName;
-            if (this.current == this.before) {
-              this.disappear = false;
+      this.auditLoading = true;
+      getfee(formData)
+        .then((response) => {
+          this.$message.success("操作成功");
+          this.form.moneyStatus = 4;
+          this.jumpDonot = true;
+          this.modify = true;
+          let data = {
+            actId: 460,
+            id: this.form.fId,
+          };
+          getName(data).then((response) => {
+            if (response.data.length != 0) {
+              this.before = response.data[0].userName;
+              if (this.current == this.before) {
+                this.disappear = false;
+              }
             }
-          }
+          });
+        })
+        .finally(() => {
+          this.auditLoading = false;
         });
-      })
-      .finally(() => {
-         this.auditLoading= false;
-      });
     },
     //箱信息操作限制
     cntrWeight(res) {
@@ -3039,7 +3082,7 @@ export default {
         console.log(list);
         list.forEach((e) => {
           this.warehouseDrList.push({
-            fBusinessType:"3",
+            fBusinessType: "3",
             fCorpid: this.form.corpName,
             fFeeid: e.fFeeId,
             fFeeUnitid: e.fFeeunitId + "",
@@ -3053,7 +3096,7 @@ export default {
               (this.goodsList && this.goodsList.length > 0
                 ? this.goodsList[0].fCntrcount
                 : 0),
-            fStltypeid:1,
+            fStltypeid: 1,
             fCurrency: "RMB",
             fExrate: "1",
             fTaxrate: this.fTaxrate,
@@ -3064,7 +3107,7 @@ export default {
       } else {
         list.forEach((e) => {
           this.warehouseCrList.push({
-            fBusinessType:"3",
+            fBusinessType: "3",
             fCorpid: null,
             fFeeid: e.fFeeId,
             fFeeUnitid: e.fFeeunitId + "",
@@ -3078,7 +3121,7 @@ export default {
               (this.goodsList && this.goodsList.length > 0
                 ? this.goodsList[0].fCntrcount
                 : 0),
-            fStltypeid:1,
+            fStltypeid: 1,
             fCurrency: "RMB",
             fExrate: "1",
             fTaxrate: this.fTaxrate,
@@ -3212,64 +3255,69 @@ export default {
         "tWarehousebillsfeesCr",
         JSON.stringify(this.warehouseCrList)
       );
-      this.auditLoading=true
-      cancellationFees(formData).then((response) => {
-        this.$message.success("操作成功");
-        this.form.moneyStatus = 4;
-        this.jumpDonot = false;
-        this.modify = true;
-        let data = {
-          actId: 460,
-          id: this.form.fId,
-        };
-        getName(data).then((response) => {
-          if (response.data.length != 0) {
-            this.before = response.data[0].userName;
-            if (this.current == this.before) {
-              this.disappear = false;
+      this.auditLoading = true;
+      cancellationFees(formData)
+        .then((response) => {
+          this.$message.success("操作成功");
+          this.form.moneyStatus = 4;
+          this.jumpDonot = false;
+          this.modify = true;
+          let data = {
+            actId: 460,
+            id: this.form.fId,
+          };
+          getName(data).then((response) => {
+            if (response.data.length != 0) {
+              this.before = response.data[0].userName;
+              if (this.current == this.before) {
+                this.disappear = false;
+              }
             }
-          }
-        });
-        if (response.data.tWarehouseBills) {
-          this.form = response.data.tWarehouseBills;
-          this.$set(this.form, "fPaymode", JSON.stringify(this.form.fPaymode));
-          this.$set(this.form, "fSign", JSON.stringify(this.form.fSign));
-          this.$set(
-            this.form,
-            "fDetentioncargo",
-            JSON.stringify(this.form.fDetentioncargo)
-          );
-        }
-        if (response.data.tWarehousebillsCntrList) {
-          this.goodsList = response.data.tWarehousebillsCntrList;
-        }
-        if (response.data.tWarehousebillsCntritemsList !== null) {
-          this.dataList = response.data.tWarehousebillsCntritemsList;
-        } else this.dataList = [];
-        if (response.data.warehousebillsfeesCrList) {
-          this.warehouseCrList = response.data.warehousebillsfeesCrList;
-          for (let item in this.warehouseCrList) {
+          });
+          if (response.data.tWarehouseBills) {
+            this.form = response.data.tWarehouseBills;
             this.$set(
-              this.warehouseCrList[item],
-              "fFeeUnitid",
-              JSON.stringify(this.warehouseCrList[item].fFeeunitid)
+              this.form,
+              "fPaymode",
+              JSON.stringify(this.form.fPaymode)
             );
-          }
-        }
-        if (response.data.warehousebillsfeesDrList) {
-          this.warehouseDrList = response.data.warehousebillsfeesDrList;
-          for (let item in this.warehouseDrList) {
+            this.$set(this.form, "fSign", JSON.stringify(this.form.fSign));
             this.$set(
-              this.warehouseDrList[item],
-              "fFeeUnitid",
-              JSON.stringify(this.warehouseDrList[item].fFeeunitid)
+              this.form,
+              "fDetentioncargo",
+              JSON.stringify(this.form.fDetentioncargo)
             );
           }
-        }
-      })
-      .finally(() => {
-         this.auditLoading= false;
-      });
+          if (response.data.tWarehousebillsCntrList) {
+            this.goodsList = response.data.tWarehousebillsCntrList;
+          }
+          if (response.data.tWarehousebillsCntritemsList !== null) {
+            this.dataList = response.data.tWarehousebillsCntritemsList;
+          } else this.dataList = [];
+          if (response.data.warehousebillsfeesCrList) {
+            this.warehouseCrList = response.data.warehousebillsfeesCrList;
+            for (let item in this.warehouseCrList) {
+              this.$set(
+                this.warehouseCrList[item],
+                "fFeeUnitid",
+                JSON.stringify(this.warehouseCrList[item].fFeeunitid)
+              );
+            }
+          }
+          if (response.data.warehousebillsfeesDrList) {
+            this.warehouseDrList = response.data.warehousebillsfeesDrList;
+            for (let item in this.warehouseDrList) {
+              this.$set(
+                this.warehouseDrList[item],
+                "fFeeUnitid",
+                JSON.stringify(this.warehouseDrList[item].fFeeunitid)
+              );
+            }
+          }
+        })
+        .finally(() => {
+          this.auditLoading = false;
+        });
     },
     //提交审批
     approval(res) {
@@ -3646,19 +3694,19 @@ export default {
         form: {},
         warehousebillsfeesCr: [],
         warehousebillsfeesDr: [],
-        billType: 'outStock',
-        fDc: fDC
-      }
-      data.form = this.form
+        billType: "outStock",
+        fDc: fDC,
+      };
+      data.form = this.form;
       data.form.fId = this.formList.fId;
-      if (fDC == 'C') {
-        data.warehousebillsfeesCr = this.warehouseCrList
+      if (fDC == "C") {
+        data.warehousebillsfeesCr = this.warehouseCrList;
       } else {
-        data.warehousebillsfeesDr = this.warehouseDrList
+        data.warehousebillsfeesDr = this.warehouseDrList;
       }
       this.$router.push({
         path: "/domesticTrade/costModify",
-        query: { data: data},
+        query: { data: data },
       });
     },
   },