Browse Source

Merge remote-tracking branch 'origin/master'

liyuan 2 weeks ago
parent
commit
3d646f676c

+ 1 - 1
src/views/storehouse/inStockManage/inStockPlan/detailsPage.vue

@@ -1520,7 +1520,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.planItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);;
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

+ 1 - 1
src/views/storehouse/outStockManage/outStockPlan/detailsPage.vue

@@ -1650,7 +1650,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.planItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);;
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

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

@@ -415,7 +415,7 @@ export default {
             props: {
               label: "dot",
               value: "dot"
-            },
+            }
             // dicUrl: "/api/blade-sales-part/stockDesc/dotList"
           },
           {
@@ -634,6 +634,9 @@ export default {
                 this.refresh(this.form.id, true);
               }
             })
+            .catch(() => {
+              this.refresh(this.form.id);
+            })
             .finally(() => {
               loading.close();
             });
@@ -674,7 +677,10 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
-          if (this.reservoirArea==1) {
+          if (this.form.shipItemsList.length == 0) {
+            return this.$message.error("明细信息不能为空");
+          }
+          if (this.reservoirArea == 1) {
             for (let item of this.form.shipItemsList) {
               if (item.historyList.length == 0) {
                 return this.$message.error("请维护出库明细的库区");
@@ -711,6 +717,9 @@ export default {
                     this.$message.success("出库完成");
                     this.refresh(this.form.id);
                   })
+                  .catch(() => {
+                    this.refresh(this.form.id);
+                  })
                   .finally(() => {
                     loading.close();
                   });

+ 1 - 1
src/views/tirePartsMall/purchaseService/returns/detailsPage.vue

@@ -1160,7 +1160,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.orderItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);;
         let arrIds = [];
         itemsWithId.map(item => {
           if (item.id) {

+ 2 - 1
src/views/tirePartsMall/purchasingManagement/financingProcurement/index.vue

@@ -96,7 +96,7 @@ export default {
         column: [
           {
             label: '商品名称',
-            prop: 'goodsId',
+            prop: 'goodsName',
             width: 200,
             // disabled: false,
             // remote: true,
@@ -160,6 +160,7 @@ export default {
           }, {
             label: '批次号',
             prop: 'dot',
+            width: 100,
             type: "select",
             disabled: true,
             allowCreate: true,

+ 11 - 2
src/views/tirePartsMall/purchasingManagement/warehouseEntryOrder/detailsPage.vue

@@ -203,7 +203,7 @@
       </span>
       <span slot="footer" class="dialog-footer">
         <el-button @click="diaVisible = false" size="mini">取 消</el-button>
-        <el-button type="primary" @click="allClick('修改')" size="mini">修 改</el-button>
+        <el-button type="primary" @click="allClick('修改')" size="mini">确 定</el-button>
       </span>
     </el-dialog>
     <view-area ref="viewArea" @areaData="areaData" :disabled="editDisabled"></view-area>
@@ -1084,6 +1084,9 @@ export default {
                 this.refresh(this.form.id, true);
               }
             })
+            .catch(() => {
+              this.refresh(this.form.id);
+            })
             .finally(() => {
               loading.close();
             });
@@ -1119,6 +1122,9 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.form.shipItemsList.length == 0) {
+            return this.$message.error("明细信息不能为空");
+          }
           if (this.reservoirArea == 1) {
             for (let item of this.form.shipItemsList) {
               if (item.historyList.length == 0) {
@@ -1154,6 +1160,9 @@ export default {
                     this.refresh(res.data.data.id);
                     this.$message.success("入库完成");
                   })
+                  .catch(() => {
+                    this.refresh(this.form.id);
+                  })
                   .finally(() => {
                     loading.close();
                   });
@@ -1290,7 +1299,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.shipItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

+ 8 - 5
src/views/tirePartsMall/salesManagement/Inventory/components/viewArea.vue

@@ -182,6 +182,7 @@ export default {
         if (row) {
           el.reservoirAreaId = row.id;
           el.balanceQuantity = row.balanceQuantity;
+          this.qtyChange(el);
         } else {
           el.reservoirAreaId = null;
           el.reservoirAreaName = null;
@@ -190,7 +191,7 @@ export default {
       }
     },
     qtyChange(row) {
-      row.profitLossNum = Number(row.quantity) - Number(row.balanceQuantity);
+      row.profitLossNum = Number(row.quantity ? row.quantity : 0) - Number(row.balanceQuantity ? row.balanceQuantity : 0);
     },
     openDialog(form, row, index) {
       this.form = {};
@@ -210,15 +211,17 @@ export default {
         if (!item.reservoirAreaId) {
           return this.$message.error("请选择库区");
         }
-        if (!item.quantity) {
-          return this.$message.error("本次数量不能为0");
-        }
-        sum += Number(item.quantity);
+        sum += Number(item.quantity ? item.quantity : 0);
         profitLossNumSum += Number(item.profitLossNum ? item.profitLossNum : 0);
       }
       if (Number(profitLossNumSum) == 0) {
         return this.$message.error("盈亏数量的总数不能为零");
       }
+      if (Number(profitLossNumSum) < 0) {
+        if (Math.abs(Number(profitLossNumSum)) > Number(this.query.inventoryHave)) {
+          return this.$message.error("盘亏后数量不能小于融资剩余数量");
+        }
+      }
       let obj = {
         ...this.query,
         sendNum: sum,

+ 6 - 6
src/views/tirePartsMall/salesManagement/Inventory/detailsPage.vue

@@ -957,14 +957,14 @@ export default {
           itemRemove({ ids: ids.join(",") }).then(res => {
             row.historyList = [];
             // row.dot = null;
-            row.sendNumHave = row.inventory;
+            row.sendNumHave = Number(row.inventory ? row.inventory : 0) - Number(row.sendNumFinancing ? row.sendNumFinancing : 0);
             this.calculator(row);
           });
         });
       } else {
         row.historyList = [];
         // row.dot = null;
-        row.sendNumHave = row.inventory;
+        row.sendNumHave = Number(row.inventory ? row.inventory : 0) - Number(row.sendNumFinancing ? row.sendNumFinancing : 0);
         this.calculator(row);
       }
     },
@@ -974,7 +974,7 @@ export default {
     areaData(row, index) {
       this.form.orderItemsList[index].dot = row.dot;
       this.form.orderItemsList[index].historyList = row.historyList;
-      this.form.orderItemsList[index].profitLossNum =row.profitLossNum
+      this.form.orderItemsList[index].profitLossNum = row.profitLossNum;
       this.calculation(this.form.orderItemsList[index]);
     },
     outExport() {
@@ -1069,7 +1069,7 @@ export default {
           inventoryHave: item.balanceQuantityHave,
           sendNum: Number(item.balanceQuantity),
           sendNumFinancing: 0,
-          sendNumHave:Number(item.balanceQuantity),
+          sendNumHave: Number(item.balanceQuantity)-Number(item.balanceQuantityFinancing),
           price: item.inventoryAmount, // 账面金额
           historyList: []
         });
@@ -1108,8 +1108,8 @@ export default {
     calculation(row) {
       //明细的实际数量=明细总库存+明细盈亏数量
       row.sendNum = Number(Number(row.profitLossNum) + Number(row.inventory));
-      //实际数量赋值给自有数量
-      row.sendNumHave = row.sendNum;
+      //实际数量-融资数量赋值给自有数量
+      row.sendNumHave = Number(row.sendNum?row.sendNum:0)-Number(row.sendNumFinancing?row.sendNumFinancing:0);
       //实际金额=实际数量*库存单价
       row.subTotalMoney = Number(Number(row.sendNum) * Number(row.costprie)).toFixed(2);
       //盈亏金额=实际金额-账面金额

+ 12 - 3
src/views/tirePartsMall/salesManagement/outboundWorkOrder/detailsPage.vue

@@ -417,7 +417,7 @@ export default {
             label: "品牌",
             prop: "brandName",
             width: 100,
-            overHidden: true,
+            overHidden: true
           },
           {
             label: "规格型号",
@@ -446,7 +446,7 @@ export default {
             props: {
               label: "dot",
               value: "dot"
-            },
+            }
             // dicUrl: "/api/blade-sales-part/stockDesc/dotList"
           },
           {
@@ -721,6 +721,9 @@ export default {
                 this.refresh(this.form.id, true);
               }
             })
+            .catch(() => {
+              this.refresh(this.form.id);
+            })
             .finally(() => {
               loading.close();
             });
@@ -761,7 +764,10 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
-          if (this.reservoirArea==1) {
+          if (this.form.shipItemsList.length == 0) {
+            return this.$message.error("明细信息不能为空");
+          }
+          if (this.reservoirArea == 1) {
             for (let item of this.form.shipItemsList) {
               if (item.historyList.length == 0) {
                 return this.$message.error("请维护出库明细的库区");
@@ -798,6 +804,9 @@ export default {
                     this.$message.success("出库完成");
                     this.refresh(res.data.data.id);
                   })
+                  .catch(() => {
+                    this.refresh(this.form.id);
+                  })
                   .finally(() => {
                     loading.close();
                   });

+ 10 - 1
src/views/tirePartsMall/salesManagement/outboundWorkOrderL/detailsPage.vue

@@ -1084,6 +1084,9 @@ export default {
               this.$message.success("撤销成功");
               this.refresh(this.form.id, true);
             })
+            .catch(() => {
+              this.refresh(this.form.id);
+            })
             .finally(() => {
               loading.close();
             });
@@ -1138,7 +1141,7 @@ export default {
       dotList({
         storageId: this.form.storageId,
         goodsId: goodsId,
-        whether:1
+        whether: 1
       }).then(res => {
         this.picihaolist = res.data.data;
       });
@@ -1160,6 +1163,9 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.form.shipItemsList.length == 0) {
+            return this.$message.error("明细信息不能为空");
+          }
           if (this.reservoirArea == 1) {
             for (let item of this.form.shipItemsList) {
               if (item.historyList.length == 0) {
@@ -1194,6 +1200,9 @@ export default {
                   this.$message.success("调拨完成");
                   this.refresh(this.form.id);
                 })
+                .catch(() => {
+                  this.refresh(this.form.id);
+                })
                 .finally(() => {
                   loading.close();
                 });

+ 1 - 1
src/views/tirePartsMall/salesManagement/purchaseOrder/detailsPage.vue

@@ -2395,7 +2395,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.orderItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

+ 2 - 1
src/views/tirePartsMall/salesManagement/purchaseOrder/index.vue

@@ -112,7 +112,7 @@ export default {
         column: [
           {
             label: '商品名称',
-            prop: 'goodsId',
+            prop: 'goodsName',
             width: 200,
             // disabled: false,
             // remote: true,
@@ -180,6 +180,7 @@ export default {
             disabled: true,
             allowCreate: true,
             filterable: true,
+            width: 100,
             dicData: [],
             props: {
               label: "dot",

+ 1 - 1
src/views/tirePartsMall/salesManagement/saleOrder/detailsPage.vue

@@ -3332,7 +3332,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.orderItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);;
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

+ 81 - 38
src/views/tirePartsMall/salesService/inStorage/detailsPage.vue

@@ -142,6 +142,19 @@
                 ></dic-select>
                 <span v-else>{{ row.reservoirAreaName }}</span>
               </template>
+              <template slot-scope="{ row }" slot="dot">
+                <dic-select
+                  v-if="row.$cellEdit"
+                  :key="row.dotList"
+                  v-model="row.dot"
+                  placeholder="批次号"
+                  label="dot"
+                  :mockData="row.dotList"
+                  :activateCreated="false"
+                  :filterable="true"
+                ></dic-select>
+                <span v-else>{{ row.dot }}</span>
+              </template>
             </avue-crud>
           </el-tab-pane>
           <el-tab-pane label="入库信息" name="payment_details">
@@ -593,18 +606,18 @@ export default {
           },
           {
             label: "批次号",
-            cell: true,
+            // cell: true,
             width: 120,
             prop: "dot",
-            type: "select",
-            disabled: false,
+            // type: "select",
+            // disabled: false,
             // allowCreate: true,
             // filterable: true,
-            dicData: [],
-            props: {
-              label: "dot",
-              value: "dot"
-            },
+            // dicData: [],
+            // props: {
+            //   label: "dot",
+            //   value: "dot"
+            // },
             overHidden: true
           },
           {
@@ -813,13 +826,13 @@ export default {
             this.findObject(this.optionContacts.column, "dot").disabled = true;
           } else {
             this.findObject(this.optionContacts.column, "dot").disabled = false;
-            dotList({
-              storageId: this.form.storageId,
-              goodsId: this.formContacts.goodsId
-            }).then(res => {
-              console.log("dot", res);
-              this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
-            });
+            // dotList({
+            //   storageId: this.form.storageId,
+            //   goodsId: this.formContacts.goodsId
+            // }).then(res => {
+            //   console.log("dot", res);
+            //   this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
+            // });
           }
         });
       }
@@ -853,13 +866,13 @@ export default {
             this.findObject(this.optionContacts.column, "dot").disabled = true;
           } else {
             this.findObject(this.optionContacts.column, "dot").disabled = false;
-            dotList({
-              storageId: this.form.storageId,
-              goodsId: this.formContacts.goodsId
-            }).then(res => {
-              console.log("567");
-              this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
-            });
+            // dotList({
+            //   storageId: this.form.storageId,
+            //   goodsId: this.formContacts.goodsId
+            // }).then(res => {
+            //   console.log("567");
+            //   this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
+            // });
           }
         });
       }
@@ -1095,6 +1108,9 @@ export default {
                 this.refresh(this.form.id, true);
               }
             })
+            .catch(() => {
+              this.refresh(this.form.id);
+            })
             .finally(() => {
               loading.close();
             });
@@ -1117,13 +1133,13 @@ export default {
           this.findObject(this.optionContacts.column, "dot").disabled = true;
         } else {
           this.findObject(this.optionContacts.column, "dot").disabled = false;
-          dotList({
-            storageId: this.form.storageId,
-            goodsId: this.formContacts.goodsId
-          }).then(res => {
-            console.log("567");
-            this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
-          });
+          // dotList({
+          //   storageId: this.form.storageId,
+          //   goodsId: this.formContacts.goodsId
+          // }).then(res => {
+          //   console.log("567");
+          //   this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
+          // });
         }
       });
     },
@@ -1131,6 +1147,9 @@ export default {
       this.$refs["form"].validate((valid, done) => {
         done();
         if (valid) {
+          if (this.form.shipItemsList.length == 0) {
+            return this.$message.error("明细信息不能为空");
+          }
           if (this.reservoirArea == 1) {
             for (let item of this.form.shipItemsList) {
               if (item.historyList.length == 0) {
@@ -1166,6 +1185,9 @@ export default {
                     this.refresh(this.form.id);
                     this.$message.success("入库完成");
                   })
+                  .catch(() => {
+                    this.refresh(this.form.id);
+                  })
                   .finally(() => {
                     loading.close();
                   });
@@ -1237,6 +1259,17 @@ export default {
             this.editDisabled = false;
             this.optionForm.disabled = false;
           }
+          res.data.data.shipItemsList.forEach(row => {
+            row.dotList = [];
+            if (row.dots) {
+              let list = row.dots.split(",");
+              for (let item of list) {
+                row.dotList.push({
+                  dot: item
+                });
+              }
+            }
+          });
           this.form = res.data.data;
           this.filesList = res.data.data.filesList;
         })
@@ -1258,15 +1291,25 @@ export default {
         this.$set(row, "$cellEdit", true);
       }
       // this.confirmEditing()
-      dotList({
-        storageId: this.form.storageId,
-        goodsId: row.goodsId
-      }).then(res => {
-        this.findObject(this.optionContactsBack.column, "dot").dicData = res.data.data;
-        // console.log(this.dicData)
-      });
-      console.log(this.optionContacts, 802);
+      // dotList({
+      //   storageId: this.form.storageId,
+      //   goodsId: row.goodsId
+      // }).then(res => {
+      //  this.findObject(this.optionContacts.column, "dot").dicData = res.data.data;
+      //   // console.log(this.dicData)
+      // });
+      // console.log(this.optionContacts, 802);
       // this.$refs.formContacts.rowEdit(row, index)
+      //  if (row.dots) {
+      //   let dots=[]
+      //   let list =row.dots.split(",");
+      //   for (let item of list) {
+      //     dots.push({
+      //       dot: item
+      //     });
+      //   }
+      //   this.findObject(this.optionContacts.column, "dot").dicData =dots
+      // }
     },
     rowDelBox(row, index) {
       this.$confirm("确定将选择数据删除?", {
@@ -1302,7 +1345,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.shipItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);
         let arrIds = itemsWithId.map(item => item.id); // 获取id 数据
         // 把选中的删除掉
         multiList.forEach(item => {

+ 1 - 1
src/views/tirePartsMall/salesService/returns/detailsPage.vue

@@ -1162,7 +1162,7 @@ export default {
         let multiList = this.selectionMultilist;
         let arr = this.form.orderItemsList;
         // 获取有id 的数据
-        const itemsWithId = multiList.filter(item => item.hasOwnProperty("id"));
+        const itemsWithId = multiList.filter(item => item.id);;
         let arrIds = [];
         itemsWithId.map(item => {
           if (item.id) {