فهرست منبع

库存台账的入库单添加’质检状态‘

yijing 1 سال پیش
والد
کامیت
915b4ddc07

+ 316 - 304
src/views/warehouseManagement/stockLedger/components/details/InWarehouse.vue

@@ -109,17 +109,10 @@
         </el-col>
       </el-row>
     </el-form> -->
-    <ele-pro-table
-      class="table_list"
-      ref="table"
-      height="calc(100vh - 300px)"
-      :columns="columns"
-      :datasource="datasource"
-      :pageSize="20"
-      row-key="id"
-    >
+    <ele-pro-table class="table_list" ref="table" height="calc(100vh - 300px)" :columns="columns"
+      :datasource="datasource" :pageSize="20" row-key="id">
       <!-- 展开内容 -->
-      <template v-slot:expand="{ row, $index }">
+      <!-- <template v-slot:expand="{ row, $index }">
         <div
           style="width: 100%; min-height: 60px"
           v-if="row.materialDetailResponseList"
@@ -135,7 +128,7 @@
           >
           </ele-pro-table>
         </div>
-      </template>
+      </template> -->
       <template v-slot:bizNo="{ row }">
         <el-link type="primary" @click="handleCellClick(row)">
           {{ row.bizNo }}
@@ -208,316 +201,335 @@
 </template>
 
 <script>
-  import Pagination from '@/components/Pagination';
-  // import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
-  import { sceneState } from '@/utils/dict/index';
-  import InWarehouseDialog from './InWarehouseDialog';
-  import { inventorybookPage } from '@/api/classifyManage/itemInformation';
-  import { useDictLabel } from '@/utils/dict/index';
+import Pagination from '@/components/Pagination';
+// import { getInWarehouseDetail } from '@/api/stockManagement/stockLedger'
+import { sceneState } from '@/utils/dict/index';
+import InWarehouseDialog from './InWarehouseDialog';
+import { inventorybookPage } from '@/api/classifyManage/itemInformation';
+import { useDictLabel } from '@/utils/dict/index';
 
-  // import ouint from '@/api/warehouseManagement/outin';
-  import storageApi from '@/api/warehouseManagement/index.js';
-  export default {
-    components: { Pagination, InWarehouseDialog },
-    props: {
-      baseInfo: {
-        type: Object,
-        default: () => ({})
-      },
-      baseParams: {
-        type: Object,
-        default: () => ({})
-      }
+// import ouint from '@/api/warehouseManagement/outin';
+import storageApi from '@/api/warehouseManagement/index.js';
+import {
+  qualityStatus,
+} from '@/utils/dict/index';
+export default {
+  components: { Pagination, InWarehouseDialog },
+  props: {
+    baseInfo: {
+      type: Object,
+      default: () => ({})
     },
-    data() {
-      return {
-        columns: [
-          {
-            width: 45,
-            type: 'expand',
-            columnKey: 'materialDetailResponseList',
-            align: 'center',
-            slot: 'expand',
-            className: ''
-          },
-          {
-            slot: 'bizNo',
-            prop: 'bizNo',
-            label: '入库单号',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 200
-          },
-          {
-            prop: 'name',
-            label: '入库场景',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110,
-            formatter: (_row) => {
-              return this.getSceneState(Number(_row.bizType));
-            }
-          },
-          {
-            prop: 'categoryName',
-            label: '物品名称',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            align: 'center',
-            prop: 'measureQuantity',
-            label: '计量数量',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'packingQuantity',
-            label: '包装数量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'packingUnit',
-            label: '包装单位',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'weight',
-            label: '重量',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'weightUnit',
-            label: '重量单位',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'warehouseName',
-            label: '仓库',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'verifyName',
-            label: '审核人',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
-          },
-          {
-            prop: 'createTime',
-            label: '入库时间',
-            align: 'center',
-            showOverflowTooltip: true,
-            minWidth: 110
+    baseParams: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  data() {
+    return {
+      qualityStatus,
+      columns: [
+        // {
+        //   width: 45,
+        //   type: 'expand',
+        //   columnKey: 'materialDetailResponseList',
+        //   align: 'center',
+        //   slot: 'expand',
+        //   className: ''
+        // },
+        {
+          width: 55,
+          type: 'index',
+          label: '序号',
+          align: 'center',
+        },
+        {
+          slot: 'bizNo',
+          prop: 'bizNo',
+          label: '入库单号',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 200
+        },
+        {
+          prop: 'name',
+          label: '入库场景',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110,
+          formatter: (_row) => {
+            return this.getSceneState(Number(_row.bizType));
           }
-        ],
-
-        // 表格列配置
-        columns2: [
-          {
-            prop: 'materialCode',
-            label: '物料编码',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            prop: 'barcodes',
-            label: '发货条码',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          // {
-          //   prop: 'measureQuantity',
-          //   label: '计量数量',
-          //   showOverflowTooltip: true,
-          //   align: 'center',
-          //   minWidth: 110,
-          //   formatter: (_row) => {
-          //     return 1;
-          //   }
-          // },
-          // {
-          //   prop: 'measureUnit',
-          //   label: '计量单位',
-          //   showOverflowTooltip: true,
-          //   align: 'center',
-          //   minWidth: 110,
-          // },
-          {
-            prop: 'materielDesignation',
-            label: '物料代号',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            prop: 'clientCode',
-            label: '客户代号',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            prop: 'engrave',
-            label: '刻码',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 110
-          },
-          {
-            prop: 'weight',
-            label: '重量',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 100
-          },
-          {
-            prop: 'weightUnit',
-            label: '重量单位',
-            showOverflowTooltip: true,
-            align: 'center',
-            minWidth: 100
-          },
-          {
-            prop: 'result',
-            label: '质检结果',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row) => {
-              return this.qualityResults[_row.result];
-            }
-          },
-          {
-            prop: 'status',
-            label: '质检状态',
-            align: 'center',
-            showOverflowTooltip: true,
-            formatter: (_row) => {
-              return this.qualityStatus[_row.result];
-            }
+        },
+        {
+          prop: 'categoryName',
+          label: '物品名称',
+          showOverflowTooltip: true,
+          align: 'center',
+          minWidth: 110
+        },
+        {
+          align: 'center',
+          prop: 'measureQuantity',
+          label: '计量数量',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'packingQuantity',
+          label: '包装数量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'packingUnit',
+          label: '包装单位',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'weight',
+          label: '重量',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'weightUnit',
+          label: '重量单位',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'status',
+          label: '质检状态',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110,
+          formatter: (_row) => {
+            return this.qualityStatus[_row.result];
           }
-        ],
-        qualityStatus: {
-          0: '未质检',
-          1: '已质检'
-        }, // 质检状态 0未检 1已检
-        qualityResults: {
-          1: '合格',
-          2: '不合格'
-        }, // 质检结果 1合格 2不合格
-        sceneState,
-        sceneState: [],
-        searchForm: {
-          bizNum: '',
-          warehouseEnd: '',
-          warehouseStart: '',
-          packetEnd: '',
-          packetStart: ''
         },
-        tableData: [],
-        size: 10,
-        pageNum: 1,
-        total: 0,
-        vuexUser: []
-      };
+        {
+          prop: 'warehouseName',
+          label: '仓库',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'verifyName',
+          label: '审核人',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        },
+        {
+          prop: 'createTime',
+          label: '入库时间',
+          align: 'center',
+          showOverflowTooltip: true,
+          minWidth: 110
+        }
+      ],
+
+      // 表格列配置
+      // columns2: [
+      //   {
+      //     prop: 'materialCode',
+      //     label: '物料编码',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 110
+      //   },
+      //   {
+      //     prop: 'barcodes',
+      //     label: '发货条码',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 110
+      //   },
+      //   // {
+      //   //   prop: 'measureQuantity',
+      //   //   label: '计量数量',
+      //   //   showOverflowTooltip: true,
+      //   //   align: 'center',
+      //   //   minWidth: 110,
+      //   //   formatter: (_row) => {
+      //   //     return 1;
+      //   //   }
+      //   // },
+      //   // {
+      //   //   prop: 'measureUnit',
+      //   //   label: '计量单位',
+      //   //   showOverflowTooltip: true,
+      //   //   align: 'center',
+      //   //   minWidth: 110,
+      //   // },
+      //   {
+      //     prop: 'materielDesignation',
+      //     label: '物料代号',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 110
+      //   },
+      //   {
+      //     prop: 'clientCode',
+      //     label: '客户代号',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 110
+      //   },
+      //   {
+      //     prop: 'engrave',
+      //     label: '刻码',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 110
+      //   },
+      //   {
+      //     prop: 'weight',
+      //     label: '重量',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 100
+      //   },
+      //   {
+      //     prop: 'weightUnit',
+      //     label: '重量单位',
+      //     showOverflowTooltip: true,
+      //     align: 'center',
+      //     minWidth: 100
+      //   },
+      //   {
+      //     prop: 'result',
+      //     label: '质检结果',
+      //     align: 'center',
+      //     showOverflowTooltip: true,
+      //     formatter: (_row) => {
+      //       return this.qualityResults[_row.result];
+      //     }
+      //   },
+      //   {
+      //     prop: 'status',
+      //     label: '质检状态',
+      //     align: 'center',
+      //     showOverflowTooltip: true,
+      //     formatter: (_row) => {
+      //       return this.qualityStatus[_row.result];
+      //     }
+      //   }
+      // ],
+      qualityResults: {
+        1: '合格',
+        2: '不合格'
+      }, // 质检结果 1合格 2不合格
+      sceneState,
+      sceneState: [],
+      searchForm: {
+        bizNum: '',
+        warehouseEnd: '',
+        warehouseStart: '',
+        packetEnd: '',
+        packetStart: ''
+      },
+      tableData: [],
+      size: 10,
+      pageNum: 1,
+      total: 0,
+      vuexUser: []
+    };
+  },
+  created() {
+    this.getList();
+  },
+  methods: {
+    async datasource({ page, limit, where, order }) {
+      console.log(page);
+      console.log(limit);
+      this.pageNum = page;
+      this.size = limit;
+      return await this.getList();
     },
-    created() {
+    getSceneState: useDictLabel(sceneState),
+    search() {
+      this.pageNum = 1;
       this.getList();
     },
-    methods: {
-      async datasource({ page, limit, where, order }) {
-        console.log(page);
-        console.log(limit);
-        this.pageNum = page;
-        this.size = limit;
-        return await this.getList();
-      },
-      getSceneState: useDictLabel(sceneState),
-      search() {
-        this.pageNum = 1;
-        this.getList();
-      },
-      reset() {
-        this.searchForm = {};
-        this.search();
-      },
-      handleCellClick(row) {
-        console.log(row);
-        this.$router.push({
-          path: '/warehouseManagement/stockManagement/details',
-          query: {
-            id: row.outInId
-          }
-        });
-      },
-      handlePageChange(v) {
-        this.pageNum = v.current;
-        this.size = v.size;
-        this.getList();
-      },
-      handleDeta(row) {
-        for (const key in this.vuexUser) {
-          if (this.vuexUser[key].id == row) {
-            return this.vuexUser[key].name;
-          }
+    reset() {
+      this.searchForm = {};
+      this.search();
+    },
+    handleCellClick(row) {
+      console.log(row);
+      this.$router.push({
+        path: '/warehouseManagement/stockManagement/details',
+        query: {
+          id: row.outInId
         }
-      },
-      async getList() {
-        const res = await storageApi.outInRecordsPage({
-          categoryId: this.$route.query.id,
-          size: this.size,
-          pageNum: this.pageNum,
-          type: 1,
-          ...this.baseParams
-          // ...this.searchForm,
-          // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
-        });
-        if (res) {
-          const list = this.$store.state.userPage.userList;
-          this.vuexUser = list;
-          // this.tableData = res.list;
-          this.total = res.count;
-          return res;
-        } else {
-          return {};
+      });
+    },
+    handlePageChange(v) {
+      this.pageNum = v.current;
+      this.size = v.size;
+      this.getList();
+    },
+    handleDeta(row) {
+      for (const key in this.vuexUser) {
+        if (this.vuexUser[key].id == row) {
+          return this.vuexUser[key].name;
         }
       }
+    },
+    async getList() {
+      const res = await storageApi.outInRecordsPage({
+        categoryId: this.$route.query.id,
+        size: this.size,
+        pageNum: this.pageNum,
+        type: 1,
+        ...this.baseParams
+        // ...this.searchForm,
+        // batchNum: this.baseParams.batchNum || this.searchForm.batchNum
+      });
+      if (res) {
+        const list = this.$store.state.userPage.userList;
+        this.vuexUser = list;
+        // this.tableData = res.list;
+        this.total = res.count;
+        return res;
+      } else {
+        return {};
+      }
     }
-  };
+  }
+};
 </script>
 <style lang="scss" scoped>
-  .inWarehouse {
-    height: 100%;
-    width: 100%;
-    padding-top: 20px;
-    box-sizing: border-box;
+.inWarehouse {
+  height: 100%;
+  width: 100%;
+  padding-top: 20px;
+  box-sizing: border-box;
+  display: flex;
+  flex-direction: column;
+
+  :deep(.table) {
+    flex: 1;
     display: flex;
     flex-direction: column;
-    :deep(.table) {
+
+    .el-table__body-wrapper {
       flex: 1;
-      display: flex;
-      flex-direction: column;
-      .el-table__body-wrapper {
-        flex: 1;
-      }
-    }
-    .pagination {
-      flex: 0 0 50px;
-      display: flex;
-      align-items: center;
     }
   }
+
+  .pagination {
+    flex: 0 0 50px;
+    display: flex;
+    align-items: center;
+  }
+}
 </style>

+ 22 - 15
src/views/warehouseManagement/stockManagement/add.vue

@@ -848,24 +848,22 @@ export default {
 
 
         let total = Number(row.packingQuantity);
-        console.log(total, '111')
+        //计量数量
+        row.measureQuantity = this.changeCount(total);
+        console.log(total, '包装数量')
         if (row.packingUnit == row.measureUnit && row.measureUnit == '立方' && row.netWeight) {
           total = Number(row.packingQuantity) * row.netWeight;
-          console.log(total, '单位是立方,计量单位也是立方,如果有单重,就计量数量x单重=总重')
-          console.log(total, '2222')
+          console.log(total, '22')
         } else {
-          console.log(total, 333)
           for (; startIndex < endIndex; endIndex--) {
             total = this.$math.format(
               row.packingSpecificationOption[endIndex].packageCell * total,
               14
             );
           }
+          console.log(total, '333')
         }
-        console.log(total, '444456')
 
-        //计量数量
-        row.measureQuantity = this.changeCount(total);
 
         // 判断单位和计量单位是否为不拆物料层规格
         let packingBoolen = !!this.getDict('不拆物料层规格', row.packingUnit)
@@ -876,21 +874,30 @@ export default {
         console.log(measureBoolen, 'measureBoolen')
 
         if (packingBoolen && measureBoolen && row.packingUnit != 'L') {
-          // row.weight = total;
-          console.log(total, '6')
+
+          console.log(total, '55555')
           this.$set(this.productList[index], 'weight', total);
         } else {
           console.log(row, 'row')
-          if (row.measureType == '2') {
+          if (row.measureType != 1) {
             if (row.packingUnit == 'KG') {
-              const weight = total * Number(row.singleWeight);
-              this.$set(this.productList[index], 'weight', weight)
+              if (row.packingUnit == row.measureUnit) {
+                this.$set(this.productList[index], 'weight', row.measureQuantity)
+              } else {
+                const weight = total * Number(row.singleWeight);
+                this.$set(this.productList[index], 'weight', weight)
+              }
+              console.log(total, '66')
             } else {
-              this.$set(this.productList[index], 'weight', row.measureQuantity)
+              const weight = row.measureQuantity * Number(row.singleWeight);
+              this.$set(this.productList[index], 'weight', weight)
+              console.log(total, '77')
             }
+          } else {
+            const weight = total * Number(row.singleWeight);
+            this.$set(this.productList[index], 'weight', weight)
+            console.log(total, '8')
           }
-          // row.weight = this.$math.format(total * row.netWeight, 14);
-          console.log(total, '7')
         }
       }
     },

+ 1 - 1
vue.config.js

@@ -39,7 +39,7 @@ module.exports = {
         // target: 'http://124.71.68.31:50001',
         // target: 'http://192.168.1.132:18086',
 
-        target: 'http://192.168.1.116:28086',//开发
+        target: 'http://192.168.1.251:18186',//开发
         // target: 'http://192.168.1.251:18186', //测试
 
         // target: 'http://192.168.1.116:18086',