Browse Source

修改查看库区
修改库区明细

Qukatie 1 month ago
parent
commit
b999c810ba

+ 357 - 74
src/views/exportTrade/customerInquiry/index.vue

@@ -8,14 +8,29 @@
         <el-tab-pane label="已取消" name="third" />
         <el-tab-pane label="全部" name="fourth" />
       </el-tabs>
-      <avue-crud ref="crud" :option="option" :data="dataList" v-model="form" :page.sync="page" :search.sync="search"
-        @search-change="searchChange" @current-change="currentChange" @size-change="sizeChange"
-        @refresh-change="refreshChange" @on-load="onLoad" :table-loading="loading" @saveColumn="saveColumn"
-        @resetColumn="resetColumn" :cell-style="cellStyle" :summary-method="summaryMethod"
-        @selection-change="selectionChange" @expand-change="expandChange" @search-criteria-switch="searchCriteriaSwitch">
+      <avue-crud
+        ref="crud"
+        :option="option"
+        :data="dataList"
+        v-model="form"
+        :page.sync="page"
+        :search.sync="search"
+        @search-change="searchChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        :table-loading="loading"
+        :cell-style="cellStyle"
+        :summary-method="summaryMethod"
+        @selection-change="selectionChange"
+        @expand-change="expandChange"
+        @search-criteria-switch="searchCriteriaSwitch"
+        @resetColumn="resetColumn('crud', 'option', 'optionBack', 0)"
+        @saveColumn="saveColumn('crud', 'option', 'optionBack', 0)"
+      >
         <template slot-scope="{ row }" slot="expand">
-          <avue-crud :data="row.itemData" :option="itemOption" :table-loading="row.itemLoading" :cell-style="cellStyle"
-            class="itemTable">
+          <avue-crud :data="row.itemData" :option="itemOption" :table-loading="row.itemLoading" :cell-style="cellStyle" class="itemTable">
             <template slot-scope="{ row }" slot="orderQuantity">
               <span>{{ row.orderQuantity | decimalFormat2 }}</span>
             </template>
@@ -37,8 +52,7 @@
           <span>{{ row.amount | decimalFormat2 }}</span>
         </template>
         <template slot-scope="{ row }" slot="orderStatus">
-          <span v-for="item in orderStatusList" :style="{ color: item.colour }"
-            v-if="item.dictValue == row.orderStatus">{{ row.orderStatus }}</span>
+          <span v-for="item in orderStatusList" :style="{ color: item.colour }" v-if="item.dictValue == row.orderStatus">{{ row.orderStatus }}</span>
         </template>
         <template slot-scope="{ row }" slot="purchaseAmount">
           <span>{{ row.purchaseAmount | decimalFormat2 }}</span>
@@ -53,41 +67,57 @@
           <port-info v-model="search.portOfDestination" />
         </template>
         <template slot="businesDateSearch">
-          <el-date-picker v-model="search.businesDate" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
-            format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']">
+          <el-date-picker
+            v-model="search.businesDate"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
           </el-date-picker>
         </template>
         <template slot="dateValiditySearch">
-          <el-date-picker v-model="search.dateValidity" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
-            format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']">
+          <el-date-picker
+            v-model="search.dateValidity"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
           </el-date-picker>
         </template>
         <template slot="createTimeSearch">
-          <el-date-picker v-model="search.createTime" type="daterange" start-placeholder="开始日期" end-placeholder="结束日期"
-            format="yyyy-MM-dd" value-format="yyyy-MM-dd HH:mm:ss" :default-time="['00:00:00', '23:59:59']">
+          <el-date-picker
+            v-model="search.createTime"
+            type="daterange"
+            start-placeholder="开始日期"
+            end-placeholder="结束日期"
+            format="yyyy-MM-dd"
+            value-format="yyyy-MM-dd HH:mm:ss"
+            :default-time="['00:00:00', '23:59:59']"
+          >
           </el-date-picker>
         </template>
         <template slot="menuLeft">
-          <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd()">创建单据
-          </el-button>
-          <el-button type="success" size="small" @click.stop="copyDoc()"
-            :disabled="selectionList.length != 1">复制单据</el-button>
+          <el-button type="primary" icon="el-icon-plus" size="small" @click.stop="newAdd()">创建单据 </el-button>
+          <el-button type="success" size="small" @click.stop="copyDoc()" :disabled="selectionList.length != 1">复制单据</el-button>
           <el-button type="info" size="small">报表打印</el-button>
         </template>
         <template slot="corpIdSearch">
           <crop-select v-model="search.corpId" corpType="KH"></crop-select>
         </template>
         <template slot-scope="scope" slot="corpId">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">{{ scope.row.corpsName }}
-          </span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">{{ scope.row.corpsName }} </span>
         </template>
         <template slot-scope="scope" slot="orderNo">
-          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">{{ scope.row.orderNo }}
-          </span>
+          <span style="color: #409EFF;cursor: pointer" @click.stop="editOpen(scope.row, 1)">{{ scope.row.orderNo }} </span>
         </template>
         <template slot-scope="scope" slot="menu">
-          <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(scope.row, scope.index)">删除
-          </el-button>
+          <el-button type="text" icon="el-icon-delete" size="small" @click.stop="rowDel(scope.row, scope.index)">删除 </el-button>
         </template>
       </avue-crud>
     </basic-container>
@@ -97,12 +127,7 @@
 
 <script>
 import option from "./config/mainList.json";
-import {
-  getList,
-  remove,
-  gainUser,
-  getGoodsInfo
-} from "@/api/basicData/customerInquiry";
+import { getList, remove, gainUser, getGoodsInfo } from "@/api/basicData/customerInquiry";
 import detailPage from "./detailsPage";
 import { defaultDate } from "@/util/date";
 import { micrometerFormat2, IntegerFormat, decimalFormat2 } from "@/util/validate";
@@ -111,13 +136,283 @@ export default {
   name: "customerInformation",
   data() {
     return {
-      activeName: 'second',
+      activeName: "second",
       tabType: 2,
       search: {
         businesDate: defaultDate()
       },
       form: {},
       option: {},
+      optionBack: {
+        searchShow: true,
+        searchMenuSpan: 24,
+        border: true,
+        index: true,
+        viewBtn: false,
+        editBtn: false,
+        delBtn: false,
+        addBtn: false,
+        headerAlign: "center",
+        menuWidth: "70",
+        showSummary: true,
+        searchIcon: true,
+        searchIndex: 2,
+        selection: true,
+        tip: false,
+        expand: true,
+        expandWidth: 38,
+        column: [
+          {
+            label: "客户名称",
+            prop: "corpId",
+            search: true,
+            index: 1,
+            minWidth: 80,
+            overHidden: true,
+            searchSpan: 8
+          },
+          {
+            label: "详情信息",
+            prop: "clientMessage",
+            index: 2,
+            hide: true,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "报价日期",
+            prop: "businesDate",
+            search: true,
+            index: 1.2,
+            minWidth: 80,
+            overHidden: true,
+            searchSpan: 8,
+            type: "date",
+            format: "yyyy-MM-dd"
+          },
+          {
+            label: "订单号",
+            prop: "orderNo",
+            search: true,
+            index: 1.3,
+            minWidth: 80,
+            overHidden: true,
+            searchSpan: 8
+          },
+          {
+            label: "有效日期",
+            prop: "dateValidity",
+            search: true,
+            index: 5,
+            hide: true,
+            minWidth: 80,
+            overHidden: true,
+            searchSpan: 8,
+            type: "date",
+            format: "yyyy-MM-dd"
+          },
+          {
+            label: "价格条款",
+            prop: "priceTerms",
+            index: 1.4,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "收款方式",
+            prop: "paymentType",
+            index: 7,
+            hide: true,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "运输方式",
+            prop: "transport",
+            index: 8,
+            hide: true,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "箱型",
+            prop: "boxPile",
+            index: 1.5,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "箱量",
+            prop: "boxNumber",
+            index: 1.6,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "订单状态",
+            prop: "orderStatus",
+            search: true,
+            index: 11,
+            hide: true,
+            minWidth: 80,
+            overHidden: true,
+            type: "select",
+            props: {
+              label: "dictValue",
+              value: "dictValue"
+            },
+            searchSpan: 8
+          },
+          {
+            label: "起运港",
+            prop: "portOfLoad",
+            search: true,
+            index: 1.7,
+            minWidth: 140,
+            overHidden: true,
+            searchSpan: 8
+          },
+          {
+            label: "目的港",
+            prop: "portOfDestination",
+            search: true,
+            index: 1.8,
+            minWidth: 140,
+            overHidden: true,
+            type: "select",
+            filterable: true,
+            dicData: [],
+            props: {
+              label: "name",
+              value: "name"
+            },
+            searchSpan: 8
+          },
+          {
+            label: "数量合计",
+            prop: "orderQuantity",
+            index: 1.9,
+            minWidth: 80,
+            align: "right",
+            overHidden: true
+          },
+          {
+            label: "产品毛利",
+            prop: "grossProfit",
+            index: 2,
+            minWidth: 110,
+            align: "right",
+            overHidden: true
+          },
+          {
+            label: "产品利率",
+            prop: "grossProfitRate",
+            index: 2.1,
+            minWidth: 70,
+            align: "right",
+            overHidden: true
+          },
+          {
+            label: "销售金额",
+            prop: "amount",
+            index: 2.2,
+            minWidth: 110,
+            align: "right",
+            overHidden: true
+          },
+          {
+            label: "采购金额",
+            prop: "purchaseAmount",
+            index: 18,
+            hide: true,
+            minWidth: 80,
+            align: "right",
+            overHidden: true
+          },
+          {
+            label: "商品名称",
+            prop: "",
+            search: true,
+            index: 19,
+            minWidth: 80,
+            overHidden: true,
+            hide: true,
+            showColumn: false,
+            searchSpan: 8
+          },
+          {
+            label: "系统号",
+            prop: "sysNo",
+            search: true,
+            index: 20,
+            hide: true,
+            minWidth: 80,
+            overHidden: true,
+            searchSpan: 8
+          },
+          {
+            label: "制单人",
+            prop: "createUser",
+            index: 2.3,
+            minWidth: 80,
+            search: true,
+            overHidden: true,
+            type: "select",
+            dicData: [],
+            props: {
+              label: "name",
+              value: "id"
+            },
+            filterable: true,
+            searchSpan: 8
+          },
+          {
+            label: "制单日期",
+            prop: "createTime",
+            index: 22,
+            hide: true,
+            minWidth: 80,
+            search: true,
+            overHidden: true,
+            searchSpan: 8,
+            type: "date",
+            format: "yyyy-MM-dd"
+          },
+          {
+            label: "船务状态",
+            prop: "ifShipping",
+            index: 23,
+            hide: true,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "备注",
+            prop: "orderRemark",
+            index: 2.4,
+            minWidth: 80,
+            search: true,
+            overHidden: true,
+            searchSpan: 8
+          },
+          {
+            label: "采购备注",
+            prop: "purchaseRemark",
+            index: 25,
+            hide: true,
+            minWidth: 80,
+            overHidden: true
+          },
+          {
+            label: "销售备注",
+            prop: "shippingRemark",
+            index: 26,
+            hide: true,
+            minWidth: 80,
+            overHidden: true
+          }
+        ]
+      },
       parentId: 0,
       dataList: [],
       page: {
@@ -199,9 +494,8 @@ export default {
      */
     this.option = await this.getColumnData(this.getColumnName(0), option);
     this.getWorkDicts("order_status").then(res => {
-      this.findObject(this.option.column, "orderStatus").dicData =
-        res.data.data;
-      this.orderStatusList = res.data.data
+      this.findObject(this.option.column, "orderStatus").dicData = res.data.data;
+      this.orderStatusList = res.data.data;
     });
     gainUser().then(res => {
       this.findObject(this.option.column, "createUser").dicData = res.data.data;
@@ -228,16 +522,16 @@ export default {
   },
   methods: {
     handleClick(tab, event) {
-      if (this.activeName == 'first') {
-        this.tabType = 1
-      } else if (this.activeName == 'second') {
-        this.tabType = 2
-      } else if (this.activeName == 'third') {
-        this.tabType = 3
-      } else if (this.activeName == 'fourth') {
-        this.tabType = ''
-      } else if (this.activeName == 'fifth') {
-        this.tabType = 4
+      if (this.activeName == "first") {
+        this.tabType = 1;
+      } else if (this.activeName == "second") {
+        this.tabType = 2;
+      } else if (this.activeName == "third") {
+        this.tabType = 3;
+      } else if (this.activeName == "fourth") {
+        this.tabType = "";
+      } else if (this.activeName == "fifth") {
+        this.tabType = 4;
       }
       this.onLoad(this.page, this.search);
     },
@@ -319,22 +613,22 @@ export default {
         params.orderStartDate = params.businesDate[0];
         params.orderEndDate = params.businesDate[1];
       } else {
-        delete params.orderStartDate
-        delete params.orderEndDate
+        delete params.orderStartDate;
+        delete params.orderEndDate;
       }
       if (params.dateValidity) {
         params.dateValidityStart = params.dateValidity[0];
         params.dateValidityEnd = params.dateValidity[1];
       } else {
-        delete params.dateValidityStart
-        delete params.dateValidityEnd
+        delete params.dateValidityStart;
+        delete params.dateValidityEnd;
       }
       if (params.createTime) {
         params.createTimeStart = params.createTime[0];
         params.createTimeEnd = params.createTime[1];
       } else {
-        delete params.createTimeStart
-        delete params.createTimeEnd
+        delete params.createTimeStart;
+        delete params.createTimeEnd;
       }
       this.search = this.deepClone(params);
       delete params.businesDate;
@@ -362,7 +656,7 @@ export default {
       params = {
         ...params,
         tabType: this.tabType
-      }
+      };
       let data = this.deepClone(Object.assign(params, this.search));
       delete data.businesDate;
       delete data.dateValidity;
@@ -390,11 +684,7 @@ export default {
       if (columns.length > 0) {
         columns.forEach((item, index) => {
           sums[0] = "合计";
-          if (
-            item.property == "orderQuantity" ||
-            item.property == "amount" ||
-            item.property == "purchaseAmount"
-          ) {
+          if (item.property == "orderQuantity" || item.property == "amount" || item.property == "purchaseAmount") {
             let qtySum = 0;
             let instoreSum = 0;
             let totalSum = 0;
@@ -439,39 +729,32 @@ export default {
       this.onLoad(this.page, this.search);
       this.$store.commit("OUT_BJ_STATUS");
     },
-    async saveColumn() {
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
       /**
        * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
        * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
        * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
        */
-      const inSave = await this.saveColumnData(
-        this.getColumnName(0),
-        this.option
-      );
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
       if (inSave) {
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout();
-        });
         this.$message.success("保存成功");
         //关闭窗口
-        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
       }
     },
-    async resetColumn() {
-      this.option = option;
-      const inSave = await this.delColumnData(this.getColumnName(0), option);
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
       if (inSave) {
-        this.$nextTick(() => {
-          this.$refs.crud.doLayout();
-        });
         this.$message.success("重置成功");
-        this.$refs.crud.$refs.dialogColumn.columnBox = false;
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
       }
     }
   },
   watch: {
-    option: function () {
+    option: function() {
       this.search.businesDate = defaultDate();
     }
   }

+ 3 - 33
src/views/tirePartsMall/inventory/areaDetail.vue

@@ -81,50 +81,20 @@ export default {
             overHidden: true
           },
           {
-            label: "数量(总)",
+            label: "数量",
             prop: "quantity",
             overHidden: true
           },
           {
-            label: "数量(融资)",
-            prop: "updateTime",
-            overHidden: true
-          },
-          {
-            label: "数量(自有)",
-            prop: "inQuantityHave",
-            overHidden: true
-          },
-          {
-            label: "出库数量(总)",
+            label: "出库数量",
             prop: "outQuantity",
             overHidden: true
           },
           {
-            label: "出库数量(融资)",
-            prop: "outQuantityFinancing",
-            overHidden: true
-          },
-          {
-            label: "出库数量(自有)",
-            prop: "outQuantityHave",
-            overHidden: true
-          },
-          {
-            label: "结余数量(总)",
+            label: "结余数量",
             prop: "balanceQuantity",
             overHidden: true
           },
-          {
-            label: "结余数量(融资)",
-            prop: "balanceQuantityFinancing",
-            overHidden: true
-          },
-          {
-            label: "结余数量(自有)",
-            prop: "balanceQuantityHave",
-            overHidden: true
-          }
         ]
       },
       dataList: [],

+ 7 - 2
src/views/tirePartsMall/purchaseService/outStorage/components/viewArea.vue

@@ -17,7 +17,7 @@
             :controls="false"
             style="width: 100%"
             :max="qtyMax"
-            :disabled="row.id"
+            :disabled="disabled"
             @change="qtyChange(row)"
           />
         </template>
@@ -35,7 +35,12 @@ import { selectReservoirAreaList } from "@/api/tirePartsMall/salesManagement/out
 import { head } from "lodash";
 import { isProcurement } from "@/api/basicData/configuration";
 export default {
-  props: {},
+  props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
   data() {
     return {
       data: [],

+ 2 - 10
src/views/tirePartsMall/purchaseService/outStorage/detailsPage.vue

@@ -45,15 +45,7 @@
               <template slot-scope="scope" slot="menuLeft">
                 <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
               </template>
-              <!-- <template slot="sendNum" slot-scope="{ row }">
-                <el-input-number v-if="row.$cellEdit" size="small" v-model="row.sendNum" :controls="false"
-                  :precision="numberDecimal" :min="0" style="width: 100%"></el-input-number>
-                <span v-else>{{ row.sendNum }}</span>
-              </template> -->
               <template slot-scope="{ type, size, row, index, disabled }" slot="menu">
-                <!--<el-button :size="size" :disabled="disabled || isAddDisabled" :type="type"-->
-                <!--  :icon="row.$cellEdit ? 'el-icon-plus' : 'el-icon-edit'" @click="rowEdit(row, index)">编辑-->
-                <!--</el-button>-->
                 <el-button
                   v-if="reservoirArea == 1 && row.historyList.length"
                   :size="size"
@@ -61,7 +53,7 @@
                   type="text"
                   @click="rowDelArea(row, index)"
                 >
-                  撤销
+                  清空库区
                 </el-button>
                 <el-button v-if="reservoirArea == 1" :size="size" :disabled="!row.id" type="text" @click="rowArea(row, index)">
                   {{ row.historyList.length ? "查看库区" : "选择库区" }}
@@ -116,7 +108,7 @@
           </el-tab-pane>
         </el-tabs>
       </trade-card>
-      <view-area ref="viewArea" @areaData="areaData"></view-area>
+      <view-area ref="viewArea" @areaData="areaData"  :disabled="disabled || isDisabled"></view-area>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload
         v-loading="loadingBtn"

+ 14 - 7
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -102,7 +102,7 @@
               <template slot-scope="{ scope, row }" slot="menuLeft">
                 <!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="rowAdd(row, score)"
                                     :disabled="isrowAdd">添加商品</el-button>
-                                <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入
+                                <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入库区
                                 </el-button> -->
                 <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
                 <el-button
@@ -117,12 +117,12 @@
                   v-if="reservoirArea == 1"
                   type="success"
                   size="small"
-                  @click="allClick('批量修改')"
+                  @click="allClick('修改库区')"
                   :disabled="disabled || isEdit || selectionMultilist.length == 0"
-                  >批量修改</el-button
+                  >修改库区</el-button
                 >
-                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入')" :disabled="disabled || isEdit"
-                  >导入</el-button
+                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="disabled || isEdit"
+                  >导入库区</el-button
                 >
               </template>
             </avue-crud>
@@ -897,7 +897,7 @@ export default {
   },
   methods: {
     allClick(name) {
-      if (name == "批量修改") {
+      if (name == "修改库区") {
         this.fixForm = {
           reservoirAreaId: null,
           reservoirAreaName: null
@@ -921,7 +921,7 @@ export default {
           this.diaVisible = false;
         });
       }
-      if (name == "导入") {
+      if (name == "导入库区") {
         this.findObject(this.excelOption2.column, "excelFile").action = "/api/blade-sales-part/ship/importReservoirArea?id=" + this.form.id;
         this.excelBox2 = true;
       }
@@ -1103,6 +1103,13 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.reservoirArea == 1) {
+            for (let item of this.form.shipItemsList) {
+              if (!item.reservoirAreaId) {
+                return this.$message.error("请选择入库明细的库区");
+              }
+            }
+          }
           const loading = this.$loading({
             lock: true,
             text: "加载中",

+ 7 - 2
src/views/tirePartsMall/salesManagement/Inventory/components/viewArea.vue

@@ -17,7 +17,7 @@
             :controls="false"
             style="width: 100%"
             :max="row.balanceQuantity"
-            :disabled="row.id"
+            :disabled="disabled"
             @change="qtyChange(row)"
           />
         </template>
@@ -35,7 +35,12 @@ import { selectReservoirAreaList } from "@/api/tirePartsMall/salesManagement/out
 import { head } from "lodash";
 import { isProcurement } from "@/api/basicData/configuration";
 export default {
-  props: {},
+    props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
   data() {
     return {
       data: [],

+ 58 - 79
src/views/tirePartsMall/salesManagement/outboundWorkOrder/components/viewArea.vue

@@ -1,6 +1,17 @@
 <template>
   <div>
     <el-dialog title="查看库区" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <dic-select
+        v-if="dialogVisible"
+        style="width: 300px;"
+        v-model="query.dot"
+        placeholder="批次号"
+        label="dot"
+        :disabled="disabled || query.historyList.length"
+        :url="'/blade-sales-part/stockDesc/dotList?storageId=' + form.storageId + '&goodsId=' + query.goodsId"
+        :filterable="true"
+        @selectChange="dicChange('dot', $event)"
+      ></dic-select>
       <avue-crud
         v-if="dialogVisible"
         :option="option"
@@ -17,7 +28,7 @@
             :controls="false"
             style="width: 100%"
             :max="qtyMax"
-            :disabled="row.id"
+            :disabled="disabled"
             @change="qtyChange(row)"
           />
         </template>
@@ -34,8 +45,17 @@
 import { selectReservoirAreaList } from "@/api/tirePartsMall/salesManagement/outboundWorkOrder";
 import { head } from "lodash";
 import { isProcurement } from "@/api/basicData/configuration";
+import dicSelect from "@/components/dicSelect/main";
 export default {
-  props: {},
+  props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: {
+    dicSelect
+  },
   data() {
     return {
       data: [],
@@ -69,54 +89,30 @@ export default {
             overHidden: true
           },
           {
-            label: "融资库存",
-            prop: "balanceQuantityFinancing",
-            overHidden: true,
-            hide: true
-          },
-          {
-            label: "自有库存",
-            prop: "balanceQuantityHave",
-            overHidden: true,
-            hide: true
-          },
-          {
             label: "本次数量",
             prop: "quantity",
             overHidden: true
-          },
-          {
-            label: "本次融资数量",
-            prop: "quantityFinancing",
-            overHidden: true,
-            hide: true
-          },
-          {
-            label: "本次自有数量",
-            prop: "quantityHave",
-            overHidden: true,
-            hide: true
           }
         ]
       },
+      form: {},
       query: {},
       index: 0,
-      whetherFinancing: 0,
       qtyMax: 0
     };
   },
-  async created() {
-    isProcurement({ param: "whether.financing" }).then(res => {
-      if (res.data.data == 1) {
-        this.whetherFinancing = res.data.data;
-        this.findObject(this.option.column, "balanceQuantityFinancing").hide = false;
-        this.findObject(this.option.column, "balanceQuantityHave").hide = false;
-        this.findObject(this.option.column, "quantityFinancing").hide = false;
-        this.findObject(this.option.column, "quantityHave").hide = false;
-      }
-    });
-  },
+  async created() {},
   methods: {
+    dicChange(name, row) {
+      if (name == "dot") {
+        if (row) {
+          this.query.inventory = row.balanceQuantity;
+          this.onLoad();
+        } else {
+          this.query.dot = null;
+        }
+      }
+    },
     qtyChange(row) {
       let sum = 0;
       for (let item of this.data) {
@@ -125,39 +121,17 @@ export default {
       if (sum > this.qtyMax) {
         return this.$message.error("总数量不能超过" + this.qtyMax);
       }
-      //融资系统参数=1
-      if (this.whetherFinancing == 1) {
-        if (row.balanceQuantityFinancing > 0) {
-          //融资库存>0
-          if (Number(row.quantity) <= Number(row.balanceQuantityFinancing)) {
-            //本次数量小于等于融资库存 取本次数量
-            row.quantityFinancing = row.quantity;
-          } else {
-            //本次数量大于融资库存 最大值取融资库存
-            row.quantityFinancing = row.balanceQuantityFinancing;
-          }
-        } else {
-          //融资库存=0
-          row.quantityFinancing = 0;
-        }
-        if (row.balanceQuantityHave > 0) {
-          //自有库存>0
-          if (Number(row.quantity) <= Number(row.balanceQuantityHave)) {
-            //本次数量小于等于自有库存 取本次数量
-            row.quantityHave = row.quantity;
-          } else {
-            //本次数量大于融资库存 最大值取自有库存
-            row.quantityHave = row.balanceQuantityHave;
-          }
-        } else {
-          //自有库存=0
-          row.quantityHave = 0;
-        }
-      }
     },
     onLoad() {
+      let obj = {
+        shipId: this.form.id,
+        shipItemId: this.query.id,
+        goodsId: this.query.goodsId,
+        storageId: this.form.storageId,
+        dot: this.query.dot
+      };
       this.loading = true;
-      selectReservoirAreaList(this.obj)
+      selectReservoirAreaList(obj)
         .then(res => {
           this.data = res.data.data;
         })
@@ -165,18 +139,18 @@ export default {
           this.loading = false;
         });
     },
-    openDialog(val, index, list, max) {
+    openDialog(form, row, index) {
+      this.form = {};
+      this.query = {};
+      this.index = null;
       this.data = [];
-      this.index = 0;
       this.qtyMax = 0;
-      this.dialogVisible = true;
-      this.obj = val;
+      this.form = form;
+      this.query = row;
       this.index = index;
-      this.data = list;
-      this.qtyMax = max;
-      if (list.length == 0) {
-        this.onLoad();
-      }
+      this.data = row.historyList;
+      this.qtyMax = row.goodsNum;
+      this.dialogVisible = true;
     },
     submit() {
       if (this.data.filter(item => item.quantity > 0).length == 0) {
@@ -189,10 +163,15 @@ export default {
       if (sum > this.qtyMax) {
         return this.$message.error("总数量不能超过" + this.qtyMax);
       }
+      let obj = {
+        ...this.query,
+        sendNum: sum,
+        historyList: this.data.filter(item => item.quantity > 0)
+      };
       this.$emit(
         "areaData",
-        this.data.filter(item => item.quantity > 0),
-        this.index
+       obj,
+        this.index,
       );
 
       this.dialogVisible = false;

+ 24 - 14
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -97,18 +97,19 @@
                   type="text"
                   @click="rowDelArea(row, index)"
                 >
-                  撤销
+                  清空库区
                 </el-button>
                 <el-button
                   v-if="reservoirArea == 1"
                   :size="size"
-                  :disabled="!row.id"
+                  :disabled="!row.id || disabled || isDisabled"
                   type="text"
                   @click="rowArea(row, index)"
                 >
                   {{ row.historyList.length ? "查看库区" : "选择库区" }}
                 </el-button>
                 <el-button
+                  v-if="reservoirArea != 1"
                   :size="size"
                   :disabled="disabled || isDisabled"
                   :type="type"
@@ -153,7 +154,7 @@
           </el-tab-pane>
         </el-tabs>
       </trade-card>
-      <view-area ref="viewArea" @areaData="areaData"></view-area>
+      <view-area ref="viewArea" @areaData="areaData" :disabled="disabled || isDisabled"></view-area>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload
         v-loading="loadingBtn"
@@ -662,25 +663,34 @@ export default {
           }
           itemRemove({ ids: ids.join(",") }).then(res => {
             row.historyList = [];
+            row.dot = null;
+            row.sendNum = 0;
+            row.inventory = 0;
           });
         });
       } else {
         row.historyList = [];
+        row.dot = null;
+        row.sendNum = 0;
+        row.inventory = 0;
       }
     },
     rowArea(row, index) {
-      let obj = {
-        shipId: this.form.id,
-        shipItemId: row.id,
-        goodsId: row.goodsId,
-        storageId: this.form.storageId,
-        dot: row.dot
-      };
-      this.$refs.viewArea.openDialog(obj, index, row.historyList, row.goodsNum);
+      // let obj = {
+      //   shipId: this.form.id,
+      //   shipItemId: row.id,
+      //   goodsId: row.goodsId,
+      //   storageId: this.form.storageId,
+      //   dot: row.dot
+      // };
+      this.$refs.viewArea.openDialog(this.form, row, index);
     },
-    areaData(list, index) {
-      // console.log(list, index);
-      this.form.shipItemsList[index].historyList = list;
+    areaData(row, index) {
+      console.log(row, index);
+      this.form.shipItemsList[index].dot = row.dot;
+      this.form.shipItemsList[index].inventory = row.inventory;
+      this.form.shipItemsList[index].sendNum = row.sendNum;
+      this.form.shipItemsList[index].historyList = row.historyList;
     },
     notice() {
       this.$confirm("是否微信发货通知?", "提示", {

+ 8 - 2
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/components/viewArea.vue

@@ -21,6 +21,7 @@
             :filterable="true"
             :remote="true"
             dataName="cname"
+            :disabled="disabled"
             @selectChange="rowDicChange('callInReservoirAreaName', $event, row)"
           ></dic-select>
         </template>
@@ -31,7 +32,7 @@
             :controls="false"
             style="width: 100%"
             :max="qtyMax"
-            :disabled="row.id"
+            :disabled="disabled"
             @change="qtyChange(row)"
           />
         </template>
@@ -50,7 +51,12 @@ import { head } from "lodash";
 import { isProcurement } from "@/api/basicData/configuration";
 import dicSelect from "@/components/dicSelect/main";
 export default {
-  props: {},
+   props: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
   components: {
     dicSelect
   },

+ 2 - 2
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/detailsPage.vue

@@ -102,7 +102,7 @@
               type="text"
               @click="rowDelArea(row, index)"
             >
-              撤销
+             清空库区
             </el-button>
             <el-button v-if="reservoirArea == 1" :size="size" :disabled="!row.id" type="text" @click="rowArea(row, index)">
               {{ row.historyList.length ? "查看库区" : "选择库区" }}
@@ -180,7 +180,7 @@
           </template>
         </avue-crud>
       </trade-card>
-      <view-area ref="viewArea" @areaData="areaData"></view-area>
+      <view-area ref="viewArea" @areaData="areaData" :disabled="disabled || isAddDisabled"></view-area>
       <containerTitle title="上传附件"></containerTitle>
       <c-upload
         v-loading="loadingBtn"

+ 14 - 7
src/views/tirePartsMall/salesService/inStorage/detailsPage.vue

@@ -87,7 +87,7 @@
               <template slot-scope="{ scope, row }" slot="menuLeft">
                 <!-- <el-button type="primary" icon="el-icon-plus" size="small" @click="rowAdd(row, score)"
                                   :disabled="isrowAdd">添加商品</el-button>
-                              <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入
+                              <el-button type="success" size="small" :disabled="isrowAdd" icon="el-icon-bottom" @click="excelBox = true">导入库区
                               </el-button> -->
                 <el-button type="primary" icon="el-icon-printer" size="small" @click="handlePrint">打印</el-button>
                 <el-button
@@ -102,12 +102,12 @@
                   v-if="reservoirArea == 1"
                   type="success"
                   size="small"
-                  @click="allClick('批量修改')"
+                  @click="allClick('修改库区')"
                   :disabled="disabled || isEdit || selectionMultilist.length == 0"
-                  >批量修改</el-button
+                  >修改库区</el-button
                 >
-                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入')" :disabled="disabled || isEdit"
-                  >导入</el-button
+                <el-button v-if="reservoirArea == 1" type="success" size="small" @click="allClick('导入库区')" :disabled="disabled || isEdit"
+                  >导入库区</el-button
                 >
               </template>
               <template slot-scope="{ row }" slot="reservoirAreaName">
@@ -893,7 +893,7 @@ export default {
   },
   methods: {
     allClick(name) {
-      if (name == "批量修改") {
+      if (name == "修改库区") {
         this.fixForm = {
           reservoirAreaId: null,
           reservoirAreaName: null
@@ -917,7 +917,7 @@ export default {
           this.diaVisible = false;
         });
       }
-      if (name == "导入") {
+      if (name == "导入库区") {
         this.findObject(this.excelOption2.column, "excelFile").action = "/api/blade-sales-part/ship/importReservoirArea?id=" + this.form.id;
         this.excelBox2 = true;
       }
@@ -1099,6 +1099,13 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.reservoirArea == 1) {
+            for (let item of this.form.shipItemsList) {
+              if (!item.reservoirAreaId) {
+                return this.$message.error("请选择入库明细的库区");
+              }
+            }
+          }
           const loading = this.$loading({
             lock: true,
             text: "加载中",