huang_an 2 lat temu
rodzic
commit
a237d5c4cc

Plik diff jest za duży
+ 1 - 15028
package-lock.json


+ 19 - 18
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -341,24 +341,7 @@
                 label="物品编码"
                 prop="assetCode"
               ></el-table-column>
-              <el-table-column
-                label="客户编码"
-                v-if="formData.bizType == 3"
-                prop="contactCode"
-              >
-                <template slot-scope="{ row }">
-                  {{ row.customCode }}
-                </template>
-              </el-table-column>
-              <el-table-column
-                label="供应商编码"
-                v-if="formData.bizType == 4"
-                prop="assetCode"
-              >
-                <template slot-scope="{ row }">
-                  {{ row.supplierCode }}
-                </template>
-              </el-table-column>
+
               <el-table-column
                 label="物品名称"
                 prop="assetName"
@@ -442,6 +425,24 @@
                   min-width="100"
                   prop="sourceBizNo"
                 ></el-table-column>
+                <el-table-column
+                  label="客户代号"
+                  v-if="formData.bizType == 3"
+                  prop="contactCode"
+                >
+                  <template slot-scope="{ row }">
+                    {{ row.customCode }}
+                  </template>
+                </el-table-column>
+                <el-table-column
+                  label="供应商代号"
+                  v-if="formData.bizType == 4"
+                  prop="assetCode"
+                >
+                  <template slot-scope="{ row }">
+                    {{ row.supplierCode }}
+                  </template>
+                </el-table-column>
                 <el-table-column
                   label="批次号"
                   prop="sourceBatchNo"

+ 6 - 0
src/views/warehouseManagement/stockLedger/components/item-list.vue

@@ -16,6 +16,11 @@
     >
       <!-- 表头工具栏 -->
       <template v-slot:toolbar> </template>
+      <template v-slot:availableCountBase="{ row }">
+        {{ row.availableCountBase }}{{ row.minUnit }}-{{ row.packingCountBase
+        }}{{ row.measuringUnit }}
+      </template>
+
       <!-- 批次号 -->
       <template v-slot:batchNo="{ row }">
         <el-popover placement="right-start" width="800" trigger="hover">
@@ -154,6 +159,7 @@
             prop: 'availableCountBase',
             label: '实时库存',
             sortable: 'custom',
+            slot: 'availableCountBase',
             showOverflowTooltip: true
           },
           {

+ 109 - 24
src/views/warehouseManagement/stockManagement/add.vue

@@ -327,6 +327,15 @@
             :model="{ warehousingMaterialList: warehousingMaterialList }"
             :show-message="false"
           >
+            <el-button
+              v-if="warehousingMaterialList.length != 0"
+              type="success"
+              plain
+              style="margin-bottom: 20px; float: right; margin-right: 20px"
+              size="mini"
+              @click="listSaveArrs"
+              >批量保存</el-button
+            >
             <el-table
               :header-cell-style="rowClass"
               ref="multipleTable"
@@ -498,6 +507,13 @@
                   </el-form-item>
                 </template>
               </el-table-column>
+              <el-table-column label="总数" prop="counts">
+                <template slot-scope="{ row, $index }">
+                  {{ row.minPackingCount * row.outInNum }}/{{
+                    handleRowUnit(row)
+                  }}
+                </template>
+              </el-table-column>
               <el-table-column
                 label="单价"
                 prop="univalence"
@@ -707,6 +723,7 @@
                 fixed="right"
                 align="center"
               >
+                <template slot="header" slot-scope="scope"> 操作 </template>
                 <template slot-scope="{ row, $index }">
                   <el-button
                     type="text"
@@ -1068,13 +1085,10 @@
     },
     methods: {
       async searchContact(id) {
-        console.log(id);
         const data = await contactlink({ contactId: id });
-        console.log(data);
         this.contactList = data.data;
       },
       async pickerSuccess(row) {
-        console.log('===row', row);
         this.pickerRow = row;
         this.formData.extInfo.documentSource = row.orderNo;
         this.formData.clientName = row.partaName;
@@ -1108,12 +1122,10 @@
         this.$refs.pickerRef.open();
       },
       codeListValue(val) {
-        console.log(val);
         this.formData.extInfo.assetType = val.id;
         this.$forceUpdate();
         this.title = val?.name;
         this.selectEquiType = val?.id;
-        console.log(this.title);
       },
       //计算生产设备重量
       deviceWeight(row, num) {
@@ -1142,17 +1154,16 @@
         return total.PackingCount * total.outInNum * total.univalence;
       },
       handleRowUnit(row) {
-        console.log('===sss', this.formData);
         if (this.formData.extInfo.assetType == 1) {
-          console.log(row);
           return row.weightUnit;
         } else if (this.formData.extInfo.assetType == 4) {
           return row.measuringUnit;
+        } else {
+          return row.measuringUnit;
         }
       },
       changeVerfy(it) {
         this.formData.verifyName = it.name;
-        console.log(this.formData.verifyName);
       },
       //选择供应啥的操作
       ChangeSupplier(data) {
@@ -1174,8 +1185,6 @@
         return { background: '#EEEEEE', border: 'none' };
       },
       calcSum(a, b, c, row) {
-        console.log(a, b, c);
-
         if (
           (Number.isNaN(+a) && a !== '') ||
           (Number.isNaN(+b) && b !== '') ||
@@ -1183,14 +1192,12 @@
         ) {
           return '';
         }
-        console.log(row);
 
         return a * b * c + { yuan: '元', wanyuan: '万元' }[row.univalenceUnit];
         // return a * b * c;
       },
       // 部门 点击事件
       async auditorDeptClick(data) {
-        console.log(data);
         this.formData.extInfo.verifyDeptCode = data?.id;
         this.formData.extInfo.verifyDeptName = data?.name;
         this.formData.verifyId = '';
@@ -1243,7 +1250,6 @@
       },
       // 仓库编辑
       handleWareHouse(row, idx) {
-        console.log('row===', row);
         this.$refs.wareHouseDailogRef.open(row, idx);
       },
       // 入库操作
@@ -1253,7 +1259,6 @@
         row.warehouseLedgerDetails = [];
       },
       listSave(row, index) {
-        console.log(this.formData);
         const fileds = [
           // `warehousingMaterialList.${index}.cargoSpaceCode`,
           `warehousingMaterialList.${index}.batchNo`,
@@ -1279,12 +1284,10 @@
           this.$message.error('请选择资产编号!');
           return;
         }
-        console.log(fileds);
         Promise.all(
           fileds.map(
             (item) =>
               new Promise(async (resolve, rej) => {
-                console.log('item', item);
                 this.$refs.warehousingMaterialListRef.validateField(
                   item,
                   (err) => {
@@ -1311,6 +1314,75 @@
             this.$message.error('请填入必填项!');
           });
       },
+      listSaveArrs() {
+        const rows = this.warehousingMaterialList;
+        const indexes = Array.from(
+          { length: this.warehousingMaterialList.length },
+          (_, index) => index
+        );
+        rows.forEach((row, i) => {
+          const index = indexes[i];
+          console.log('rowroworoworworworworworworoworworoworoworw', row);
+          console.log('indexindexindexirnjkdfnjfndjkfn', index);
+          const fileds = [
+            // `warehousingMaterialList.${index}.cargoSpaceCode`,
+            `warehousingMaterialList.${index}.batchNo`,
+            `warehousingMaterialList.${index}.houseList`
+          ];
+          if (this.formData.bizType == 1) {
+            // fileds.push(...[`warehousingMaterialList.${index}.customCode`]);
+          } else if (this.formData.bizType == 2) {
+            // fileds.push(...[`warehousingMaterialList.${index}.supplierCode`]);
+          }
+          if (this.formData.bizType != 5) {
+            fileds.push(
+              ...[
+                `warehousingMaterialList.${index}.outInNum`,
+                `warehousingMaterialList.${index}.minPackingCount`
+              ]
+            );
+          } else if (
+            this.warehousingMaterialList.some(
+              (i) => !i.selfWarehouseLedgerDetails?.length
+            )
+          ) {
+            this.$message.error('请选择资产编号!');
+            return;
+          }
+          Promise.all(
+            fileds.map(
+              (item) =>
+                new Promise(async (resolve, rej) => {
+                  this.$refs.warehousingMaterialListRef.validateField(
+                    item,
+                    (err) => {
+                      if (err) {
+                        rej(err);
+                      } else {
+                        resolve();
+                      }
+                    }
+                  );
+                })
+            )
+          )
+            .then((res) => {
+              this.$set(row, 'isSave', true);
+              if (this.formData.bizType != 5) {
+                this.createMaterialCode(row);
+              } else {
+                // 退还
+                this.createMaterialCodeReturn(row);
+              }
+            })
+            .catch((err) => {
+              // this.$message.error('请填入必填项!');
+            });
+        });
+      },
+      // listSaveArrs() {
+      //   console.log(this.warehousingMaterialList);
+      // },
       // 批量设置生产日期
       handleSelectionChange(val) {
         this.materialCodeReqListSelected = val;
@@ -1333,6 +1405,7 @@
       },
       // 入库明细生成条码信息
       async createMaterialCode(row) {
+        console.lot('====', row);
         // 添加相同物品、批次号重新更新明细 原料编码
         const list = this.warehousingMaterialList.filter(
           (i) =>
@@ -1340,7 +1413,6 @@
             i.batchNo === row.batchNo &&
             i.isSave
         );
-
         const num = list.reduce((num, pre) => {
           num += row.isUnpack
             ? pre.outInNum * pre.minPackingCount
@@ -1348,10 +1420,16 @@
           return num;
         }, 0);
 
+        const nums = list.reduce((num, pre) => {
+          num += pre.outInNum * pre.minPackingCount;
+
+          return num;
+        }, 0);
+
         const res = await outin.getAssetNum({
           assetCode: row.assetCode,
           batchNum: row.batchNo,
-          num
+          num: row.measuringUnit == 'PCS' ? nums : num
         });
 
         list.forEach((item) => {
@@ -1360,6 +1438,15 @@
               i.onlyCode = res.shift().onlyCode;
             });
           } else {
+            console.log(' item.isUnpack', item.isUnpack);
+            console.log('1', +item.outInNum);
+            console.log('2', item);
+            console.log(
+              '3',
+              item.isUnpack
+                ? item.outInNum * item.minPackingCount
+                : +item.minPackingCount
+            );
             this.$set(
               item,
               'warehouseLedgerDetails',
@@ -1367,6 +1454,8 @@
                 new Array(
                   item.isUnpack
                     ? item.outInNum * item.minPackingCount
+                    : item.measuringUnit == 'PCS'
+                    ? +item.outInNum * parseInt(item.minPackingCount)
                     : +item.outInNum
                 ),
                 (val, idx) => {
@@ -1426,7 +1515,6 @@
             });
           }
         }
-        console.log('rrrrr', this.warehousingMaterialList);
       },
       // 入库明细生成条码信息 退还
       async createMaterialCodeReturn(row) {
@@ -1537,7 +1625,6 @@
               outInWarehouse: { ...this.formData, type: 1 },
               warehouseLedgerInfos: this.warehousingMaterialList
             };
-            console.log('第一层', this.warehousingMaterialList);
 
             for (let key in this.warehousingMaterialList) {
               for (let k in this.warehousingMaterialList[key].houseList) {
@@ -1568,7 +1655,7 @@
                   this.warehousingMaterialList[key].houseList[k].num;
               }
             }
-            // console.log('充值', this.warehousingMaterialList);
+            console.log('===', this.warehousingMaterialList);
             let arr = this.warehousingMaterialList.map((item) => {
               return {
                 num: item.num,
@@ -1579,7 +1666,7 @@
                       ? item.categoryId
                       : item.id
                     : item.id,
-                count: item.outInNum,
+                count: parseInt(item.outInNum) * parseInt(item.minPackingCount),
                 minPackingCount: item.minPackingCount,
                 packingCount: item.outInNum,
                 price: item.univalence,
@@ -1673,8 +1760,6 @@
             return cur;
           })
         );
-
-        console.log('sasasa===', this.warehousingMaterialList);
       },
       async initData() {
         const { data } = await getTreeByGroup({ type: 1 });

+ 12 - 0
src/views/warehouseManagement/stockManagement/details.vue

@@ -200,6 +200,16 @@
                     {{ row.packingCount }} {{ row.packingUnit }}
                   </template>
                 </el-table-column>
+                <el-table-column
+                  label="总数"
+                  prop="count"
+                  width="150"
+                  align="center"
+                >
+                  <template slot-scope="{ row, $index }">
+                    {{ row.count }}/{{ handleRowUnit(row) }}
+                  </template>
+                </el-table-column>
                 <el-table-column
                   label="单价"
                   prop="univalence"
@@ -571,6 +581,8 @@
           return row.weightUnit;
         } else if (this.extInfo.assetType == 4) {
           return row.measuringUnit;
+        } else {
+          return row.measuringUnit;
         }
       },
       handleAssetType(r) {

+ 3 - 5
src/views/warehouseManagement/warehouseDefinition/add.vue

@@ -661,15 +661,13 @@
               </el-table-column>
               <el-table-column label="限重(kg)" min-width="120">
                 <template slot-scope="scope">
-                  <el-form-item
-                    :rules="areaLocationRules.weightLimit"
+                  <!-- :rules="areaLocationRules.weightLimit"
                     :prop="
                       'allocationReqList.' +
                       scope.$index +
                       '.extInfo[0].weightLimit'
-                    "
-                    v-if="scope.row.isEdit"
-                  >
+                    " -->
+                  <el-form-item v-if="scope.row.isEdit">
                     <el-input
                       placeholder="请输入"
                       type="number"

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików