Browse Source

盘点 修改操作流程
查询库区 点确认新加校验
退货 dot禁用

Qukatie 3 months ago
parent
commit
365eba5b3d

+ 4 - 3
src/views/tirePartsMall/purchaseService/outStorage/components/viewArea.vue

@@ -8,12 +8,12 @@
           v-model="query.dot"
           placeholder="批次号"
           label="dot"
-          :disabled="disabled || query.historyList.length"
+          :disabled="true"
           :url="'/blade-sales-part/stockDesc/dotList?storageId=' + form.storageId + '&goodsId=' + query.goodsId"
           :filterable="true"
           @selectChange="dicChange('dot', $event)"
         ></dic-select>
-        <el-tag type="danger" style="margin-left: 10px;">出库数量:{{ 采购数量 }}</el-tag>
+        <el-tag type="danger" style="margin-left: 10px;">出库数量:{{ qtyMax }}</el-tag>
       </div>
       <avue-crud
         v-if="dialogVisible"
@@ -30,7 +30,7 @@
             size="small"
             :controls="false"
             style="width: 100%"
-            :max="qtyMax"
+            :max="row.balanceQuantity"
             :disabled="disabled"
             @change="qtyChange(row)"
           />
@@ -116,6 +116,7 @@ export default {
           this.onLoad();
         } else {
           this.query.dot = null;
+          this.onLoad();
         }
       }
     },

+ 30 - 33
src/views/tirePartsMall/purchaseService/outStorage/detailsPage.vue

@@ -55,13 +55,7 @@
                 >
                   清空库区
                 </el-button>
-                <el-button
-                  v-if="reservoirArea == 1"
-                  :size="size"
-                  :disabled="!row.id"
-                  type="text"
-                  @click="rowArea(row, index)"
-                >
+                <el-button v-if="reservoirArea == 1" :size="size" :disabled="!row.id" type="text" @click="rowArea(row, index)">
                   {{ row.historyList.length ? "查看库区" : "选择库区" }}
                 </el-button>
                 <el-button
@@ -595,14 +589,14 @@ export default {
           }
           itemRemove({ ids: ids.join(",") }).then(res => {
             row.historyList = [];
-            row.dot = null;
+            // row.dot = null;
             row.sendNum = 0;
             row.inventory = 0;
           });
         });
       } else {
         row.historyList = [];
-        row.dot = null;
+        // row.dot = null;
         row.sendNum = 0;
         row.inventory = 0;
       }
@@ -619,7 +613,7 @@ export default {
     },
     areaData(row, index) {
       // console.log(list, index);
-      this.form.shipItemsList[index].dot = row.dot;
+      // 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;
@@ -715,31 +709,34 @@ export default {
           submit({
             ...this.form,
             bizTypeName: "TKFHGD"
-          }).then(res => {
-            if (res.data.code === 601) {
-              if (this.onLoad.id) {
-                console.log(2);
-                this.refresh(this.onLoad.id, true);
+          })
+            .then(res => {
+              if (res.data.code === 601) {
+                if (this.onLoad.id) {
+                  this.refresh(this.onLoad.id, true);
+                }
+                this.$message({
+                  type: "error",
+                  message: res.data.msg
+                });
+                return true;
               }
-              this.$message({
-                type: "error",
-                message: res.data.msg
-              });
-              return true;
-            }
-            warehousingComplete({
-              ...this.form,
-              bizTypeName: "TKFHGD"
-            })
-              .then(res => {
-                this.$message.success("出库完成");
-                this.refresh(res.data.data.id);
-                loading.close();
+              warehousingComplete({
+                ...this.form,
+                bizTypeName: "TKFHGD"
               })
-              .finally(() => {
-                loading.close();
-              });
-          });
+                .then(res => {
+                  this.$message.success("出库完成");
+                  this.refresh(res.data.data.id);
+                  loading.close();
+                })
+                .finally(() => {
+                  loading.close();
+                });
+            })
+            .catch(() => {
+              loading.close();
+            });
         } else {
           this.$message.error("请选择库管");
         }

+ 9 - 1
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/components/viewArea.vue

@@ -49,7 +49,7 @@
             size="small"
             :controls="false"
             style="width: 100%"
-            :max="qtyMax"
+            :max="row.balanceQuantity"
             :disabled="disabled"
             @change="qtyChange(row)"
           />
@@ -191,6 +191,14 @@ export default {
         }
         sum += Number(item.quantity);
       }
+      for (let item of this.data.filter(item => item.quantity > 0)) {
+        if (this.data.filter(item => item.quantity > 0)[0].dot != item.dot) {
+          return this.$message.error("请选择一种批次号");
+        }
+      }
+      if (!this.query.dot) {
+        this.query.dot = this.data.filter(item => item.quantity > 0)[0].dot;
+      }
       if (sum > this.qtyMax) {
         return this.$message.error("总数量不能超过" + this.qtyMax);
       }

+ 74 - 77
src/views/tirePartsMall/salesManagement/Inventory/components/viewArea.vue

@@ -1,6 +1,21 @@
 <template>
   <div>
     <el-dialog title="查看库区" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <div style="display: flex;align-items: center;">
+        <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>
+        <el-tag type="danger" style="margin-left: 10px;">出库数量:{{ qtyMax }}</el-tag>
+      </div>
+
       <avue-crud
         v-if="dialogVisible"
         :option="option"
@@ -34,13 +49,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: [],
@@ -61,6 +80,8 @@ export default {
           {
             label: "库区",
             prop: "reservoirAreaName",
+            filters: true,
+            sortable: true,
             overHidden: true
           },
           {
@@ -74,91 +95,50 @@ 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;
+          this.onLoad();
+        }
+      }
+    },
     qtyChange(row) {
       let sum = 0;
       for (let item of this.data) {
         sum += Number(item.quantity);
       }
-      //融资系统参数=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;
-        }
+      if (sum > this.qtyMax) {
+        return this.$message.error("总数量不能超过" + this.qtyMax);
       }
     },
     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;
         })
@@ -166,14 +146,19 @@ 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.dialogVisible = true;
-      this.obj = val;
+      this.qtyMax = 0;
+      this.form = form;
+      this.query = row;
       this.index = index;
-      this.data = list;
-      if (list.length == 0) {
+      this.data = row.historyList;
+      this.qtyMax = row.goodsNum;
+      this.dialogVisible = true;
+      if (row.historyList.length == 0) {
         this.onLoad();
       }
     },
@@ -181,15 +166,27 @@ export default {
       if (this.data.filter(item => item.quantity > 0).length == 0) {
         return this.$message.error("至少有一条本次数量不能为0");
       }
+      for (let item of this.data.filter(item => item.quantity > 0)) {
+        if (this.data.filter(item => item.quantity > 0)[0].dot != item.dot) {
+          return this.$message.error("请选择一种批次号");
+        }
+      }
+      if (!this.query.dot) {
+        this.query.dot = this.data.filter(item => item.quantity > 0)[0].dot;
+      }
       let sum = 0;
       for (let item of this.data) {
         sum += Number(item.quantity);
       }
-      this.$emit(
-        "areaData",
-        this.data.filter(item => item.quantity > 0),
-        this.index
-      );
+      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", obj, this.index);
 
       this.dialogVisible = false;
     },

+ 8 - 16
src/views/tirePartsMall/salesManagement/Inventory/detailsPage.vue

@@ -100,7 +100,7 @@
             <el-button
               v-if="reservoirArea == 1 && row.historyList.length"
               :size="size"
-              :disabled="!row.id||form.status == '已确认'"
+              :disabled="!row.id || form.status == '已确认'"
               type="text"
               @click="rowDelArea(row, index)"
             >
@@ -948,33 +948,25 @@ export default {
           }
           itemRemove({ ids: ids.join(",") }).then(res => {
             row.historyList = [];
+            row.dot = null;
             row.sendNumHave = 0;
             this.calculator(row);
           });
         });
       } else {
         row.historyList = [];
+        row.dot = null;
         row.sendNumHave = 0;
         this.calculator(row);
       }
     },
     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);
+      this.$refs.viewArea.openDialog(this.form, row, index);
     },
-    areaData(list, index) {
-      let sum = 0;
-      for (let item of list) {
-        sum += Number(item.quantity ? item.quantity : 0);
-      }
-      this.form.orderItemsList[index].historyList = list;
-      this.form.orderItemsList[index].sendNumHave = sum;
+    areaData(row, index) {
+      this.form.shipItemsList[index].dot = row.dot;
+      this.form.orderItemsList[index].historyList = row.historyList;
+      this.form.orderItemsList[index].sendNumHave = row.sendNum;
       this.calculator(this.form.orderItemsList[index]);
     },
     outExport() {

+ 9 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrder/components/viewArea.vue

@@ -31,7 +31,7 @@
             size="small"
             :controls="false"
             style="width: 100%"
-            :max="qtyMax"
+            :max="row.balanceQuantity"
             :disabled="disabled"
             @change="qtyChange(row)"
           />
@@ -165,6 +165,14 @@ export default {
       if (this.data.filter(item => item.quantity > 0).length == 0) {
         return this.$message.error("至少有一条本次数量不能为0");
       }
+      for (let item of this.data.filter(item => item.quantity > 0)) {
+        if (this.data.filter(item => item.quantity > 0)[0].dot != item.dot) {
+          return this.$message.error("请选择一种批次号");
+        }
+      }
+      if (!this.query.dot) {
+        this.query.dot = this.data.filter(item => item.quantity > 0)[0].dot;
+      }
       let sum = 0;
       for (let item of this.data) {
         sum += Number(item.quantity);

+ 18 - 25
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/commodityxsho.json

@@ -35,6 +35,24 @@
       "overHidden": true,
       "width": 80
     },
+    
+    {
+      "label": "批次号",
+      "prop": "dot",
+      "cell":true,
+      "width": "150",
+      "type": "select",
+      "disabled": true,
+      "allowCreate": true,
+      "filterable": true,
+      "dicData": [],
+      "props": {
+        "label": "dot",
+        "value": "dot"
+      },
+      "dicUrl": "/api/blade-sales-part/stockDesc/dotList",
+      "overHidden": true
+    },
     {
       "label": "融资数量",
       "prop": "sendNumFinancing",
@@ -54,31 +72,6 @@
     {
       "label": "单价",
       "prop":"price",
-      "overHidden": true,
-      "slot": true,
-      "width": 100,
-      "cell": true,
-      "rules": [{
-        "required": true,
-        "message": " ",
-        "trigger": "blur"
-      }]
-    },
-    {
-      "label": "批次号",
-      "prop": "dot",
-      "cell":true,
-      "width": "150",
-      "type": "select",
-      "disabled": true,
-      "allowCreate": true,
-      "filterable": true,
-      "dicData": [],
-      "props": {
-        "label": "dot",
-        "value": "dot"
-      },
-      "dicUrl": "/api/blade-sales-part/stockDesc/dotList",
       "overHidden": true
     },
     {

+ 296 - 0
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/components/viewArea copy.vue

@@ -0,0 +1,296 @@
+<template>
+  <div>
+    <el-dialog title="查看库区" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <avue-crud
+        v-if="dialogVisible"
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        id="out-table"
+        :header-cell-class-name="headerClassName"
+      >
+        <template slot="callInReservoirAreaName" slot-scope="{ row }">
+          <dic-select
+            :key="callInStorageId"
+            v-model="row.callInReservoirAreaName"
+            placeholder="库区"
+            label="cname"
+            res="records"
+            :url="'/blade-sales-part/reservoirarea/list?current=1&size=5&storageId=' + callInStorageId"
+            :filterable="true"
+            :remote="true"
+            dataName="cname"
+            :disabled="disabled"
+            @selectChange="rowDicChange('callInReservoirAreaName', $event, row)"
+          ></dic-select>
+        </template>
+        <template slot="quantity" slot-scope="{ row }">
+          <el-input-number
+            v-model="row.quantity"
+            size="small"
+            :controls="false"
+            style="width: 100%"
+            :max="row.balanceQuantity"
+            :disabled="disabled"
+            @change="qtyChange(row)"
+          />
+        </template>
+      </avue-crud>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button type="primary" @click="submit" size="mini">确 认</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+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: {
+    disabled: {
+      type: Boolean,
+      default: false
+    }
+  },
+  components: {
+    dicSelect
+  },
+  data() {
+    return {
+      callInStorageId: null,
+      data: [],
+      dialogVisible: false,
+      loading: false,
+      option: {
+        height: 500,
+        calcHeight: 30,
+        border: true,
+        index: true,
+        addBtn: false,
+        viewBtn: false,
+        delBtn: false,
+        editBtn: false,
+        menu: false,
+        header: false,
+        column: [
+          {
+            label: "库区",
+            prop: "reservoirAreaName",
+            overHidden: true
+          },
+          {
+            label: "调入库库区",
+            prop: "callInReservoirAreaName",
+            overHidden: true
+          },
+          {
+            label: "批次",
+            prop: "dot",
+            overHidden: true
+          },
+          {
+            label: "库存",
+            prop: "balanceQuantity",
+            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
+          }
+        ]
+      },
+      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;
+      }
+    });
+  },
+  methods: {
+    rowDicChange(name, row, el) {
+      if (name == "callInReservoirAreaName") {
+        if (row) {
+          el.callInReservoirAreaId = row.id;
+        } else {
+          el.callInReservoirAreaId = null;
+          el.callInReservoirAreaName = null;
+        }
+      }
+    },
+    qtyChange(row) {
+      let sum = 0;
+      for (let item of this.data) {
+        sum += Number(item.quantity);
+      }
+      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() {
+      this.loading = true;
+      selectReservoirAreaList(this.obj)
+        .then(res => {
+          this.data = res.data.data;
+        })
+        .finally(() => {
+          this.loading = false;
+        });
+    },
+    openDialog(val, index, list, max, callInStorageId) {
+      this.data = [];
+      this.index = 0;
+      this.qtyMax = 0;
+      this.callInStorageId = null;
+      this.dialogVisible = true;
+      this.obj = val;
+      this.index = index;
+      this.data = list;
+      this.qtyMax = max;
+      this.callInStorageId = callInStorageId;
+      if (list.length == 0) {
+        this.onLoad();
+      }
+    },
+    submit() {
+      if (this.data.filter(item => item.quantity > 0).length == 0) {
+        return this.$message.error("至少有一条本次数量不能为0");
+      }
+      let sum = 0;
+      for (let item of this.data) {
+        sum += Number(item.quantity);
+      }
+      if (sum > this.qtyMax) {
+        return this.$message.error("总数量不能超过" + this.qtyMax);
+      }
+      this.$emit(
+        "areaData",
+        this.data.filter(item => item.quantity > 0),
+        this.index
+      );
+
+      this.dialogVisible = false;
+    },
+    //自定义列保存
+    async saveColumn(ref, option, optionBack, code) {
+      /**
+       * 已定义全局方法,直接使用,saveColumnData保存列数据方法,参数传值(表格名称,当前表格的option数据)
+       * 已定义全局方法,直接使用,getColumnName方法用来获取枚举值,参数根据自己定义的code值获取中文名
+       * 一定要执行异步操作,要等接口成功返回,才能执行下一行代码
+       */
+      const inSave = await this.saveColumnData(this.getColumnName(code), this[option]);
+      if (inSave) {
+        this.$message.success("保存成功");
+        //关闭窗口
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+        this.searchReset();
+      }
+    },
+    //自定义列重置
+    async resetColumn(ref, option, optionBack, code) {
+      this[option] = this[optionBack];
+      const inSave = await this.delColumnData(this.getColumnName(code), this[optionBack]);
+      if (inSave) {
+        this.$message.success("重置成功");
+        this.$refs[ref].$refs.dialogColumn.columnBox = false;
+      }
+    },
+
+    // 更改表格颜色
+    headerClassName(tab) {
+      //颜色间隔
+      let back = "";
+      if (tab.columnIndex >= 0 && tab.column.level === 1) {
+        if (tab.columnIndex % 2 === 0) {
+          back = "back-one";
+        } else if (tab.columnIndex % 2 === 1) {
+          back = "back-two";
+        }
+      }
+      return back;
+    }
+  }
+};
+</script>
+
+<style scoped>
+::v-deep#out-table .back-one {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+
+::v-deep#out-table .back-two {
+  background: #ecf5ff !important;
+  text-align: center;
+  padding: 4px 0;
+}
+</style>

+ 72 - 86
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/components/viewArea.vue

@@ -1,6 +1,21 @@
 <template>
   <div>
     <el-dialog title="查看库区" :visible.sync="dialogVisible" append-to-body width="60%" :before-close="handleClose">
+      <div style="display: flex;align-items: center;">
+        <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>
+        <el-tag type="danger" style="margin-left: 10px;">库存数量:{{ qtyMax }}</el-tag>
+      </div>
+
       <avue-crud
         v-if="dialogVisible"
         :option="option"
@@ -31,7 +46,7 @@
             size="small"
             :controls="false"
             style="width: 100%"
-            :max="qtyMax"
+            :max="row.balanceQuantity"
             :disabled="disabled"
             @change="qtyChange(row)"
           />
@@ -51,7 +66,7 @@ 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
@@ -81,11 +96,8 @@ export default {
           {
             label: "库区",
             prop: "reservoirAreaName",
-            overHidden: true
-          },
-          {
-            label: "调入库库区",
-            prop: "callInReservoirAreaName",
+            filters: true,
+            sortable: true,
             overHidden: true
           },
           {
@@ -99,53 +111,24 @@ export default {
             overHidden: true
           },
           {
-            label: "融资库存",
-            prop: "balanceQuantityFinancing",
-            overHidden: true,
-            hide: true
-          },
-          {
-            label: "自有库存",
-            prop: "balanceQuantityHave",
-            overHidden: true,
-            hide: true
+            label: "调入库库区",
+            prop: "callInReservoirAreaName",
+            overHidden: 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: {
     rowDicChange(name, row, el) {
       if (name == "callInReservoirAreaName") {
@@ -157,6 +140,16 @@ export default {
         }
       }
     },
+    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) {
@@ -165,39 +158,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;
         })
@@ -205,18 +176,20 @@ export default {
           this.loading = false;
         });
     },
-    openDialog(val, index, list, max, callInStorageId) {
+    openDialog(form, row, index) {
+      this.form = {};
+      this.query = {};
+      this.index = null;
       this.data = [];
-      this.index = 0;
       this.qtyMax = 0;
-      this.callInStorageId = null;
-      this.dialogVisible = true;
-      this.obj = val;
+      this.form = form;
+      this.query = row;
       this.index = index;
-      this.data = list;
-      this.qtyMax = max;
-      this.callInStorageId = callInStorageId;
-      if (list.length == 0) {
+      this.data = row.historyList;
+      this.qtyMax = row.inventory;
+      this.callInStorageId = form.callInStorageId;
+      this.dialogVisible = true;
+      if (row.historyList.length == 0) {
         this.onLoad();
       }
     },
@@ -224,19 +197,32 @@ export default {
       if (this.data.filter(item => item.quantity > 0).length == 0) {
         return this.$message.error("至少有一条本次数量不能为0");
       }
+      for (let item of this.data.filter(item => item.quantity > 0)) {
+        if (this.data.filter(item => item.quantity > 0)[0].dot != item.dot) {
+          return this.$message.error("请选择一种批次号");
+        }
+      }
+      if (!this.query.dot) {
+        this.query.dot = this.data.filter(item => item.quantity > 0)[0].dot;
+      }
       let sum = 0;
       for (let item of this.data) {
-        // if()
         sum += Number(item.quantity);
       }
+      for (let item of this.data.filter(item => item.quantity > 0)) {
+        if (!item.callInReservoirAreaId) {
+          return this.$message.error("请选择调入库区");
+        }
+      }
       if (sum > this.qtyMax) {
         return this.$message.error("总数量不能超过" + this.qtyMax);
       }
-      this.$emit(
-        "areaData",
-        this.data.filter(item => item.quantity > 0),
-        this.index
-      );
+      let obj = {
+        ...this.query,
+        sendNum: sum,
+        historyList: this.data.filter(item => item.quantity > 0)
+      };
+      this.$emit("areaData", obj, this.index);
 
       this.dialogVisible = false;
     },

+ 20 - 14
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/detailsPage.vue

@@ -9,14 +9,20 @@
       <div class="add-customer-btn">
         <el-button class="el-button&#45;&#45;small-yh" type="primary" size="small" v-if="editButton" @click="confirmEditing">编辑 </el-button>
         <el-button class="el-button--small-yh" type="primary" size="small" :disabled="isSave" @click="editCustomer">保存数据 </el-button>
-        <el-button class="el-button--small-yh" type="warning" size="small" v-if="form.statusName == '确认调拨'" @click="revoke" :disabled="isSave||form.status == '是'"
+        <el-button
+          class="el-button--small-yh"
+          type="warning"
+          size="small"
+          v-if="form.statusName == '确认调拨'"
+          @click="revoke"
+          :disabled="isSave || form.status == '是'"
           >撤销调拨
         </el-button>
         <el-button class="el-button--small-yh" type="success" size="small" style="margin-left: 6px;" v-else @click="complete" :disabled="isSave"
           >确认调拨
         </el-button>
         <el-button
-          v-if="form.statusName == '确认调拨'&&form.status == '否'"
+          v-if="form.statusName == '确认调拨' && form.status == '否'"
           class="el-button--small-yh"
           type="info"
           size="small"
@@ -102,12 +108,13 @@
               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 ? "查看库区" : "选择库区" }}
             </el-button>
             <el-button
+              v-if="reservoirArea != 1"
               :size="size"
               :disabled="disabled || isAddDisabled"
               :type="type"
@@ -1024,25 +1031,24 @@ export default {
           }
           itemRemove({ ids: ids.join(",") }).then(res => {
             row.historyList = [];
+            row.dot = null;
+            row.sendNum = 0;
           });
         });
       } else {
         row.historyList = [];
+        row.dot = null;
+        row.sendNum = 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, this.form.callInStorageId);
+      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].goodsNum = row.sendNum;
+      this.form.shipItemsList[index].historyList = row.historyList;
     },
     viewInventory() {
       inventoryList({

+ 0 - 3
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/dialogAssembly.vue

@@ -90,9 +90,6 @@
                 </el-select>
                 <!--<span v-else>{{ row.dot }}</span>-->
               </template>
-              <template slot="price" slot-scope="{ row }">
-                <el-input-number v-model="row.price" size="small" :controls="false" style="width: 100%" />
-              </template>
               <template slot-scope="scope" slot="menu">
                 <el-button
                   type="text"

+ 2 - 2
src/views/tirePartsMall/salesService/inStorage/components/viewArea.vue

@@ -19,7 +19,7 @@
               v-model="query.dot"
               placeholder="批次号"
               label="dot"
-              :disabled="disabled || query.historyList.length"
+              :disabled="true"
               :url="'/blade-sales-part/stockDesc/dotList?storageId=' + form.storageId + '&goodsId=' + query.goodsId"
               :filterable="true"
               :allowCreate="true"
@@ -49,7 +49,7 @@
             size="small"
             :controls="false"
             style="width: 100%"
-            :max="qtyMax"
+            :max="row.balanceQuantity"
             :disabled="disabled"
             @change="qtyChange(row)"
           />

+ 5 - 5
src/views/tirePartsMall/salesService/inStorage/detailsPage.vue

@@ -923,13 +923,13 @@ export default {
           }
           itemRemove({ ids: ids.join(",") }).then(res => {
             row.historyList = [];
-            row.dot = null;
+            // row.dot = null;
             row.sendNum = 0;
           });
         });
       } else {
         row.historyList = [];
-        row.dot = null;
+        // row.dot = null;
         row.sendNum = 0;
       }
     },
@@ -939,7 +939,7 @@ export default {
     areaData(row, index) {
       this.form.shipItemsList[index].reservoirAreaId = row.reservoirAreaId;
       this.form.shipItemsList[index].reservoirAreaName = row.reservoirAreaName;
-      this.form.shipItemsList[index].dot = row.dot;
+      // this.form.shipItemsList[index].dot = row.dot;
       this.form.shipItemsList[index].sendNum = row.sendNum;
       this.form.shipItemsList[index].historyList = row.historyList;
       if (row.historyList.filter(item => !item.id).length) {
@@ -1004,14 +1004,14 @@ export default {
               }
             } else {
               row.historyList = [];
-              row.dot = null;
+              // row.dot = null;
               row.sendNum = 0;
             }
             if (ids.length) {
               itemRemove({ ids: ids.join(",") }).then(res => {
                 this.$message.success("操作成功");
                 row.historyList = [];
-                row.dot = null;
+                // row.dot = null;
                 row.sendNum = 0;
               });
             }