huang_an 1 yıl önce
ebeveyn
işleme
8bdf0f179a

+ 18 - 0
src/api/warehouseManagement/index.js

@@ -201,5 +201,23 @@ export default {
       return res.data.data;
     }
     return Promise.reject(new Error(res.data.message));
+  },
+  // 动态表头
+  fieldModel: async (params) => {
+    const res = await request.get(`/main/fieldmodel/list`, { params });
+    if (res.data.code == 0) {
+      return res.data.data;
+    }
+    return Promise.reject(new Error(res.data.message));
+  },
+  unitPriceMaintenance: async (data) => {
+    const res = await request.put(
+      '/wms/stockpackingtwo/unitPriceMaintenance',
+      data
+    );
+    if (res.data.code == 0) {
+      return res.data;
+    }
+    return Promise.reject(new Error(res.data.message));
   }
 };

+ 27 - 1
src/views/warehouseManagement/components/AssetsDialog.vue

@@ -135,6 +135,15 @@
             label="规格"
             :show-overflow-tooltip="true"
           ></el-table-column>
+          <template v-if="dimension == 1">
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
+          </template>
           <el-table-column
             v-if="dimension == 1"
             label="出库数量"
@@ -273,6 +282,7 @@
     },
     data() {
       return {
+        newColumns: [], // 动态表头
         isShowTable: true,
         qualityResultOption: [
           {
@@ -315,8 +325,24 @@
         dimension: '1'
       };
     },
-    created() {},
+    created() {
+      this.getFieldModel();
+    },
     methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
       getRowKeys(row) {
         return row.id;
       },

+ 168 - 0
src/views/warehouseManagement/components/outboundOrderPrint.vue

@@ -0,0 +1,168 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div id="printSection">
+      <table border cellspacing="0">
+        <tbody>
+          <tr>
+            <td colspan="13" align="center" class="title">
+              嘉实(湖南)医药科技有限公司产品出库单</td
+            >
+          </tr>
+          <tr>
+            <td colspan="4"> 制单日期:{{ getNowFormatDate() }} </td>
+            <td colspan="5"> 制单人:{{ this.user.info.name }} </td>
+            <td colspan="4"> 出库单号:{{ this.formData.bizNo }} </td>
+          </tr>
+          <!-- <tr>
+            <td colspan="4"> 上市许可持有人:嘉实(湖南)医药科技有限公司 </td>
+            <td colspan="8">
+              地址:长沙高新开发区汇智中路179号全导民c区8栋 电话:0731-64221288
+            </td>
+          </tr>
+          <tr>
+            <td colspan="4"> 购货单位:阿萨德阿阿斯顿阿萨德 </td>
+            <td colspan="8">
+              收货地址:长沙高新开发区汇智中路179号全导民c区8栋
+            </td>
+          </tr> -->
+          <tr align="center">
+            <td> 产品名称 </td>
+            <td> 产品编码 </td>
+            <td> 型号 </td>
+            <td> 规格 </td>
+            <td> 牌号 </td>
+            <td> 批次号 </td>
+            <td> 最小包装单元 </td>
+            <td> 包装数量 </td>
+            <td> 计量数量 </td>
+            <td> 重量 </td>
+            <td> 重量单位 </td>
+            <td> 单价 </td>
+            <td> 仓库 </td>
+          </tr>
+          <tr align="center" v-for="(item, index) in codeList">
+            <td>{{ item.categoryName }}</td>
+            <td>{{ item.categoryCode }}</td>
+            <td>{{ item.categoryModel }}</td>
+            <td>{{ item.specification }}</td>
+            <td>{{ item.brandNum }}</td>
+            <td>{{ item.batchNo }}</td>
+            <td>{{ item.minPackingQuantity }}</td>
+            <td>{{ item.packingQuantity }}</td>
+            <td>{{ item.measureQuantity }}</td>
+            <td>{{ item.weight }}</td>
+            <td>{{ item.weightUnit }}</td>
+            <td>{{ item.price }}</td>
+            <td>{{ item.warehouseName }}</td>
+          </tr>
+          <!-- <tr align="center">
+            <td colspan="7"> 合计 </td>
+            <td colspan="2"> 500 </td>
+            <td colspan="3"> 5664.000 </td>
+          </tr> -->
+          <tr>
+            <td colspan="13"> 审核人:{{ formData.verifyName }} </td>
+            <!-- <td colspan="3"> 开票员:李玉瑶 </td>
+            <td colspan="3"> 保管员:李玉瑶 </td>
+            <td colspan="3"> 复核:李玉瑶 </td>
+            <td colspan="3"> 发货员:李玉瑶 </td> -->
+          </tr>
+        </tbody>
+      </table>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  import { mapGetters } from 'vuex';
+
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    data() {
+      return {
+        QRvisible: false,
+        codeList: [],
+        formData: {}
+      };
+    },
+
+    methods: {
+      open(id) {
+        console.log(this.user);
+        storageApi.getInboundDetailsById(id).then((res) => {
+          this.formData = res;
+          this.codeList = res.outInDetailList;
+          this.QRvisible = true;
+        });
+      },
+      close() {
+        this.QRvisible = false;
+      },
+      //获取当前日期函数
+      getNowFormatDate() {
+        let date = new Date(),
+          obj = {
+            year: date.getFullYear(), //获取完整的年份(4位)
+            month: date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
+            strDate: date.getDate(), // 获取当前日(1-31)
+            week: '星期' + '日一二三四五六'.charAt(date.getDay()), //获取当前星期几(0 ~ 6,0代表星期天)
+            hour: date.getHours(), //获取当前小时(0 ~ 23)
+            minute: date.getMinutes(), //获取当前分钟(0 ~ 59)
+            second: date.getSeconds() //获取当前秒数(0 ~ 59)
+          };
+        Object.keys(obj).forEach((key) => {
+          if (obj[key] < 10) obj[key] = `0${obj[key]}`;
+        });
+
+        return `${obj.year}年${obj.month}月${obj.strDate}日 ${obj.hour}:${obj.minute}:${obj.second}`;
+      },
+      print() {
+        const printSection = document.getElementById('printSection');
+        // 创建打印任务
+        const printWindow = window.open('', '_blank');
+        printWindow.document.open();
+        printWindow.document.write('<html><head><title>打印预览</title>');
+        printWindow.document.write(
+          '<link rel="stylesheet" href="your-stylesheet-url.css" type="text/css" />'
+        );
+        printWindow.document.write('</head><body>');
+        printWindow.document.write(printSection.innerHTML);
+        printWindow.document.write('</body></html>');
+        printWindow.document.close();
+        printWindow.onload = function () {
+          printWindow.print();
+        };
+      }
+    }
+  };
+</script>
+
+<style lang="scss">
+  #printSection {
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    th,
+    td {
+      padding: 20px;
+    }
+    .title {
+      font-size: 28px;
+      font-weight: bold;
+    }
+  }
+</style>

+ 4 - 1
src/views/warehouseManagement/inboundRequests/components/tgDetails.vue

@@ -48,7 +48,10 @@
             label: '型号',
             prop: 'modelType'
           },
-
+          {
+            label: '计量数量',
+            prop: 'measureQuantity'
+          },
           {
             label: '包装数量',
             prop: 'packingQuantity'

+ 5 - 1
src/views/warehouseManagement/inboundRequests/components/tgTable.vue

@@ -116,7 +116,11 @@
             label: '审核人',
             align: 'center'
           },
-
+          {
+            prop: 'createUserName',
+            label: '申请人',
+            align: 'center'
+          },
           {
             prop: 'createTime',
             label: '创建时间',

+ 53 - 11
src/views/warehouseManagement/outgoingManagement/add.vue

@@ -17,7 +17,6 @@
                 v-model="formData.bizType"
                 clearable
                 @change="handleBizSceneChange"
-                :disabled="!!(productList && productList.length)"
               >
                 <el-option
                   v-for="item in outputSceneState"
@@ -28,10 +27,10 @@
               </el-select> </el-form-item
           ></el-col>
           <el-col :span="6">
-            <el-form-item label="单据来源" prop="documentSource">
+            <el-form-item label="单据来源" prop="sourceBizNo">
               <el-input
                 placeholder="请选择"
-                v-model="formData.extInfo.documentSource"
+                v-model="formData.sourceBizNo"
                 @click.native="openDocumentSourceDialog"
               >
                 <el-button
@@ -47,7 +46,6 @@
               <el-select
                 style="width: 100%"
                 multiple
-                :disabled="!!(productList && productList.length)"
                 v-model="formData.extInfo.assetType"
                 placeholder="请选择"
               >
@@ -76,6 +74,7 @@
                 class="form-ipt"
                 size="medium"
                 style="width: 100%"
+                :value="formData.extInfo.verifyDeptCode"
                 clearable
                 :options="treeList"
                 :props="{
@@ -181,6 +180,13 @@
                 prop="brandNum"
                 :show-overflow-tooltip="true"
               ></el-table-column>
+              <el-table-column
+                v-for="(item, index) in newColumns"
+                :label="item.label"
+                :align="item.align"
+                :prop="item.prop"
+                :show-overflow-tooltip="item.showOverflowTooltip"
+              ></el-table-column>
               <el-table-column
                 label="批次号"
                 prop="batchNo"
@@ -479,6 +485,11 @@
       :treeIds="formData.extInfo.assetType"
       @detailData="detailData"
     />
+    <outboundRequisitionDialog
+      ref="outboundRequisitionDialogRef"
+      @detailData="outboundRequisitionSelection"
+      type="2"
+    />
   </div>
 </template>
 
@@ -488,20 +499,22 @@
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { getTreeByGroup } from '@/api/classifyManage';
   import { outputSceneState } from '@/utils/dict/index';
-
+  import outboundRequisitionDialog from './components/outboundRequisitionDialog.vue';
   import selectTree from '@/components/selectTree';
   import AssetsDialog from '../components/AssetsDialog.vue';
   import { deepClone } from '@/utils';
   export default {
     components: {
       selectTree,
-      AssetsDialog
+      AssetsDialog,
+      outboundRequisitionDialog
     },
     directives: {
       'el-table-infinite-scroll': elTableInfiniteScroll
     },
     data() {
       return {
+        newColumns: [], // 动态表头
         goodsLists: [], // 商品列表
         qualityStatus: {
           0: '未质检',
@@ -568,21 +581,50 @@
         return this.$store.state.user.info.clientEnvironmentId;
       }
     },
-    created() {
+    async created() {
+      this.getFieldModel();
       this.getListItems();
       this.initUserInfo();
       this.initDeptData();
+      let queryObj = this.$route.query;
+      console.log('queryObj------', queryObj);
+      if (queryObj.ids) {
+        this.formData.bizType = queryObj.bizType;
+        this.formData.extInfo.assetType = queryObj.assetType.split(',');
+        let data = await storageApi.getHierarchyList({
+          ids: this.$route.query.ids,
+          type: 3
+        });
+        this.detailData(data, 3);
+      }
     },
     methods: {
+      outboundRequisitionSelection(data, dimension, query) {
+        this.formData.sourceBizNo = query.sourceBizNo;
+        this.formData.bizType = query.bizType;
+        this.formData.extInfo.assetType = query.assetType.split(',');
+        this.detailData(data, dimension);
+      },
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
       userSlected(data) {
         console.log(data);
         this.formData.fromId = data.id;
         this.formData.fromUser = data.name;
         this.formData.fromUserPhone = data.phone;
       },
-      openDocumentSourceDialog() {
-        console.log('打开单据来源弹窗');
-      },
       clearDocumentSource() {
         console.log('清空');
       },
@@ -626,7 +668,7 @@
       },
       // 打开单据来源弹窗
       openDocumentSourceDialog() {
-        console.log('打开单据来源弹窗');
+        this.$refs.outboundRequisitionDialogRef.open();
       },
       tableRowClassName({ row, rowIndex }) {
         console.log(row);

+ 217 - 0
src/views/warehouseManagement/outgoingManagement/components/outboundRequisitionDialog.vue

@@ -0,0 +1,217 @@
+<template>
+  <div>
+    <el-dialog
+      title="选择出库申请单"
+      :visible.sync="dialogVisible"
+      width="90%"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+    >
+      <div class="main">
+        <ele-pro-table
+          ref="table"
+          :columns="columns"
+          :datasource="datasource"
+          @cell-click="cellClick"
+          cache-key="workOrderTable"
+        >
+          <!-- 表头工具栏 -->
+          <template v-slot:action="{ row }">
+            <el-radio class="radio" v-model="currentId" :label="row.id"
+              ><i></i
+            ></el-radio>
+          </template>
+          <template v-slot:totalCount="{ row }">
+            {{ row.totalCount }} {{ row.measuringUnit }}
+          </template>
+
+          <template v-slot:totalPackage="{ row }">
+            {{ row.totalPackage }}
+          </template>
+
+          <template v-slot:totalWeight="{ row }">
+            {{ row.totalWeight }} {{ row.weightUnit }}
+          </template>
+
+          <template v-slot:status="{ row }">
+            <span>
+              {{ statusFormatter(row.status) }}
+            </span>
+          </template>
+        </ele-pro-table>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">取 消</el-button>
+        <el-button type="primary" @click="handleMine">确 定</el-button>
+      </span>
+    </el-dialog>
+
+    <pickOrderEdit ref="pickOrderEditRef" />
+  </div>
+</template>
+
+<script>
+  import { outputSceneState, sceneState } from '@/utils/dict/index';
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    props: {
+      // 1入库 2出库
+      type: {
+        type: String,
+        default: '1'
+      }
+    },
+    data() {
+      return {
+        outputSceneState,
+        sceneState,
+        dialogVisible: false,
+        currentRow: {},
+        currentId: '',
+        statusOpt: [
+          { label: '待处理', value: 0 },
+          { label: '已处理', value: 1 },
+          { label: '已撤销', value: 2 }
+        ]
+      };
+    },
+    computed: {
+      // 表格列配置
+      columns() {
+        return [
+          {
+            action: 'action',
+            slot: 'action',
+            align: 'center',
+            label: '选择'
+          },
+          {
+            columnKey: 'index',
+            label: '序号',
+            type: 'index',
+            width: 55,
+            align: 'center',
+            showOverflowTooltip: true,
+            fixed: 'left'
+          },
+          {
+            prop: 'code',
+            label: '编码',
+            align: 'center',
+            minWidth: 100
+          },
+          {
+            prop: 'categoryNames',
+            label: '名称',
+            align: 'center'
+          },
+          { label: '型号', prop: 'modelType', width: '150' },
+          { label: '规格', prop: 'specification', width: '150' },
+          { label: '牌号', prop: 'brandNum', width: '100' },
+          {
+            prop: 'sourceType',
+            label: '出入库类型',
+            align: 'center',
+            formatter: (row, column, cellValue) => {
+              console.log(row);
+              switch (this.type) {
+                case '1':
+                  // 入库
+                  return this.sceneState.filter(
+                    (item) => item.code == row.sourceType
+                  )[0].label;
+                case '2':
+                  // 出库
+                  return this.outputSceneState.filter(
+                    (item) => item.code == row.sourceType
+                  )[0].label;
+              }
+            }
+          },
+          {
+            prop: 'approvalUserName',
+            label: '审核人',
+            align: 'center'
+          },
+          {
+            prop: 'createUserName',
+            label: '申请人',
+            align: 'center'
+          },
+          {
+            prop: 'createTime',
+            label: '创建时间',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 110
+          },
+          {
+            slot: 'status',
+            label: '状态',
+            align: 'center'
+          }
+        ];
+      }
+    },
+    methods: {
+      handleMine() {
+        if (!this.currentId) {
+          return this.$message.warning('请选择出库申请单');
+        }
+        storageApi
+          .getApplystoragedetail({ applyId: this.currentId })
+          .then(async (res) => {
+            let data = await storageApi.getHierarchyFifo({
+              type: 1,
+              builders: res.map((item) => {
+                return {
+                  categoryId: item.categoryId,
+                  num: item.measureQuantity
+                };
+              })
+            });
+            if (data?.length > 0) {
+              console.log({
+                sourceBizNo: this.currentRow.code,
+                bizType: this.currentRow.sourceType,
+                assetType: res[0].rootCategoryLevelId
+              });
+              this.$emit('detailData', data, 1, {
+                sourceBizNo: this.currentRow.code,
+                bizType: this.currentRow.sourceType,
+                assetType: res[0].rootCategoryLevelId
+              });
+              this.dialogVisible = false;
+            } else {
+              this.$message.warning('该入库申请单无库存');
+            }
+          });
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.currentRow = row;
+        this.currentId = row.id;
+      },
+      statusFormatter(status) {
+        const obj = this.statusOpt.find((i) => i.value == status);
+        return obj && obj.label;
+      },
+      /* 表格数据源 */
+      datasource({ page, limit, where }) {
+        return storageApi.getinboundRequestsList({
+          pageNum: page,
+          size: limit,
+          type: this.type,
+          ...where
+        });
+      },
+      open() {
+        this.dialogVisible = true;
+      },
+      handleClose() {
+        this.dialogVisible = false;
+      }
+    }
+  };
+</script>

+ 23 - 0
src/views/warehouseManagement/outgoingManagement/details.vue

@@ -153,6 +153,13 @@
               prop="brandNum"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
             <el-table-column
               label="批次号"
               prop="batchNo"
@@ -451,6 +458,7 @@
     },
     data() {
       return {
+        newColumns: [], // 动态表头
         qualityStatus: {
           0: '未质检',
           1: '已质检'
@@ -529,11 +537,26 @@
       }
     },
     created() {
+      this.getFieldModel();
       this.requestDict('类型用途');
       this.getAllCategoryType();
       this._getInfo();
     },
     methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
       pickingHandleScroll() {
         console.log('---------pickingHandleScroll------------');
         if (this.showPackingList.length < this.packingList.length) {

+ 51 - 2
src/views/warehouseManagement/outgoingManagement/index.vue

@@ -108,6 +108,7 @@
         ref="table"
         :columns="columns"
         :datasource="datasource"
+        @cell-click="cellClick"
         cache-key="systemRoleTable"
       >
         <!-- 表头工具栏 -->
@@ -115,6 +116,17 @@
           <el-button icon="el-icon-plus" type="primary" @click="add"
             >新建</el-button
           >
+          <el-button
+            icon="el-icon-receiving"
+            type="primary"
+            @click="putIntoStorage"
+            >退货入库</el-button
+          >
+        </template>
+        <template v-slot:selection="{ row }">
+          <el-radio class="radio" v-model="currentId" :label="row.id"
+            ><i></i
+          ></el-radio>
         </template>
         <!-- 单号链接 -->
         <template v-slot:bizNo="{ row }">
@@ -186,9 +198,18 @@
           >
             删除
           </el-link>
+          <el-link
+            type="primary"
+            :underline="false"
+            icon="el-icon-delete"
+            @click="print(row)"
+          >
+            打印出库单
+          </el-link>
         </template>
       </ele-pro-table>
     </el-card>
+    <outboundOrderPrint ref="outboundOrderPrintRef" />
   </div>
 </template>
 
@@ -197,15 +218,17 @@
   import { allCategoryLevel } from '@/api/classifyManage';
   import outin from '@/api/warehouseManagement/outin';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
-
+  import outboundOrderPrint from '../components/outboundOrderPrint.vue';
   import { auditStatus, useDict, outputSceneState } from '@/utils/dict/index';
 
   // import { getPage } from '@/api/stockManagement'
   // import { deepClone } from '@/utils'
   export default {
-    //   components: { tablePagination },
+    components: { outboundOrderPrint },
     data() {
       return {
+        currentId: '',
+        currentRow: {},
         auditStatus,
         outputSceneState,
         codeList: [],
@@ -229,6 +252,12 @@
           { label: '驳回', class: 'ele-text-danger' }
         ],
         columns: [
+          {
+            slot: 'selection',
+            label: '选择',
+            width: 50,
+            align: 'center'
+          },
           {
             type: 'index',
             label: '序号',
@@ -338,6 +367,26 @@
       this.getTypeList();
     },
     methods: {
+      putIntoStorage() {
+        if (this.currentRow.verifyStatus == 2) {
+          this.$router.push({
+            path: '/warehouseManagement/stockManagement/add',
+            query: {
+              detailId: this.currentId
+            }
+          });
+        } else {
+          this.$message.warning('该单据未审核通过!');
+        }
+      },
+      // 单击获取id
+      cellClick(row) {
+        this.currentRow = row;
+        this.currentId = row.id;
+      },
+      print(row) {
+        this.$refs.outboundOrderPrintRef.open(row.id);
+      },
       handleAssetType(r) {
         const code = this.codeList.find((item) => item.dictCode == r);
         return code?.dictValue;

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

@@ -204,28 +204,47 @@
           {
             prop: 'categoryCode',
             label: '物品编码',
+            align: 'center',
             showOverflowTooltip: true
           },
           {
             prop: 'categoryName',
             label: '物品名称',
+            align: 'center',
             showOverflowTooltip: true
           },
           {
             prop: 'brandNum',
             label: '牌号',
+            align: 'center',
             showOverflowTooltip: true
           },
           {
             prop: 'categoryModel',
             label: '型号',
+            align: 'center',
             showOverflowTooltip: true
           },
           {
             prop: 'specification',
             label: '规格',
+            align: 'center',
             showOverflowTooltip: true
           },
+          this.selectedDime == 1
+            ? {
+                prop: 'approvalNumber',
+                label: '批准文号',
+                align: 'center'
+              }
+            : '',
+          this.selectedDime == 1
+            ? {
+                prop: 'packingSpecification',
+                label: '包装规格',
+                align: 'center'
+              }
+            : '',
           this.selectedDime != 1
             ? {
                 prop: 'batchNo',
@@ -282,6 +301,27 @@
                 showOverflowTooltip: true
               }
             : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'warehouseName',
+                label: '仓库	',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'productionDate',
+                label: '生产日期',
+                showOverflowTooltip: true
+              }
+            : '',
+          this.selectedDime == 3
+            ? {
+                prop: 'purchaseDate',
+                label: '采购日期',
+                showOverflowTooltip: true
+              }
+            : '',
           this.selectedDime == 3 || this.selectedDime == 4
             ? {
                 prop: 'barcodes',

+ 113 - 6
src/views/warehouseManagement/stockManagement/add.vue

@@ -60,14 +60,14 @@
               </el-select> </el-form-item
           ></el-col>
           <el-col :span="6">
-            <el-form-item label="单据来源" prop="documentSource">
+            <el-form-item label="单据来源" prop="sourceBizNo">
               <el-input
                 placeholder="请选择"
-                v-model="formData.extInfo.documentSource"
+                v-model="formData.sourceBizNo"
                 @click.native="openDocumentSourceDialog"
               >
                 <el-button
-                  @click="clearDocumentSource"
+                  @click="clearSourceBizNo"
                   slot="append"
                   icon="el-icon-circle-close"
                 ></el-button>
@@ -204,6 +204,13 @@
                 prop="brandNum"
                 :show-overflow-tooltip="true"
               ></el-table-column>
+              <el-table-column
+                v-for="(item, index) in newColumns"
+                :label="item.label"
+                :align="item.align"
+                :prop="item.prop"
+                :show-overflow-tooltip="item.showOverflowTooltip"
+              ></el-table-column>
               <el-table-column
                 label="批次号"
                 align="center"
@@ -908,6 +915,7 @@
     },
     data() {
       return {
+        newColumns: [], // 动态表头
         sceneState,
         saveLoading: false,
         dateVisible: false,
@@ -997,6 +1005,7 @@
       }
     },
     created() {
+      this.getFieldModel();
       this.getListItems();
       this.initUserInfo();
       if (this.$route.query.id) {
@@ -1006,7 +1015,7 @@
             console.log(data);
             this.formData.extInfo.assetType = [data.rootCategoryLevelId];
             this.formData.bizType = String(data.type);
-            this.formData.extInfo.documentSource = data.code;
+            this.formData.sourceBizNo = data.code;
             const batchNo = await getCode('lot_number_code');
             this.productList = data.detailList.map((item, index) => {
               return {
@@ -1041,8 +1050,104 @@
             });
           });
       }
+      if (this.$route.query.detailId) {
+        storageApi
+          .getInboundDetailsById(this.$route.query.detailId)
+          .then(async (data) => {
+            this.formData.extInfo.assetType = data.extInfo.assetType.split(',');
+            this.formData.bizType = String(data.bizType);
+            this.formData.sourceBizNo = data.bizNo;
+            const batchNo = await getCode('lot_number_code');
+            this.productList = data.outInDetailList.map(
+              (productItem, productIndex) => {
+                return {
+                  ...productItem,
+                  index: this.productList.length + productIndex,
+                  isSave: true,
+                  batchNo: batchNo, // 批次号
+                  warehouseIds: [productItem.warehouseId], // 仓库Id
+                  warehouseNames: [productItem.warehouseName], // 仓库名称
+                  outInDetailRecordRequestList:
+                    productItem.outInDetailRecordRequestList.map(
+                      (packingItem, packingIndex) => {
+                        return {
+                          ...packingItem,
+                          index:
+                            this.productList.length +
+                            productIndex +
+                            '-' +
+                            packingIndex, // 包装索引
+                          batchNo: batchNo, // 批次号
+                          parentIndex: this.productList.length + productIndex, // 物品索引
+                          categoryName: productItem.categoryName,
+                          categoryCode: productItem.categoryCode,
+                          materialDetailList:
+                            packingItem.materialDetailList.map(
+                              (materialItem, materialIndex) => {
+                                return {
+                                  ...materialItem,
+                                  index:
+                                    this.productList.length +
+                                    productIndex +
+                                    '-' +
+                                    packingIndex +
+                                    '——' +
+                                    materialIndex, // 包装索引
+                                  parentIndex:
+                                    this.productList.length +
+                                    productIndex +
+                                    '-' +
+                                    packingIndex, // 物品索引
+                                  batchNo: batchNo, // 批次号
+                                  categoryName: productItem.categoryName,
+                                  categoryCode: productItem.categoryCode
+                                };
+                              }
+                            )
+                        };
+                      }
+                    )
+                };
+              }
+            );
+            console.log('this.productList-----------', this.productList);
+            // 获取包装维度数据
+            const arr = [];
+            for (const key in this.productList) {
+              for (const k in this.productList[key]
+                .outInDetailRecordRequestList) {
+                arr.push({
+                  ...this.productList[key].outInDetailRecordRequestList[k]
+                });
+              }
+            }
+            this.packingList = arr;
+            // 获取物料维度数据
+            let iArr = [];
+            arr.forEach((item) => {
+              item.materialDetailList.forEach((ele) => {
+                iArr.push({ ...ele });
+              });
+            });
+            this.materialList = iArr;
+          });
+      }
     },
     methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
       // 初始化当前用户信息
       async initUserInfo() {
         const res = await warehouseDefinition.tree();
@@ -1066,8 +1171,8 @@
         console.log('打开单据来源弹窗');
       },
       // 清除单据来源
-      clearDocumentSource() {
-        this.formData.extInfo.documentSource = '';
+      clearSourceBizNo() {
+        this.formData.sourceBizNo = '';
       },
       // 返回
       back() {
@@ -1729,6 +1834,8 @@
             specification: item.specification, // 规格
             brandNum: item.brandNum, // 牌号
             batchNo: batchNo, // 批次号
+            approvalNumber: item.approvalNumber, // 批准文号
+            packingSpecification: item.packingSpecification, // 包装规格
             minPackingQuantity: '', // 最小包装单元数量
             packingQuantity: '', // 包装数量
             packingUnit: item.packingUnit, // 包装单位

+ 236 - 0
src/views/warehouseManagement/stockManagement/components/priceMaintenanceDialog.vue

@@ -0,0 +1,236 @@
+<template>
+  <div>
+    <el-dialog title="产品详情" :visible.sync="dialogVisible" width="90%">
+      <el-table
+        ref="productListTable"
+        :data="productList"
+        tooltip-effect="dark"
+        border
+        :height="500"
+        :header-cell-style="rowClass"
+      >
+        <el-table-column label="序号" type="index" width="50">
+        </el-table-column>
+        <el-table-column
+          label="编码"
+          prop="categoryCode"
+          align="center"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          label="名称"
+          align="center"
+          prop="categoryName"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column label="级别" prop="level" align="center">
+        </el-table-column>
+        <el-table-column
+          label="型号"
+          align="center"
+          prop="categoryModel"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          label="规格"
+          align="center"
+          prop="specification"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          label="牌号"
+          align="center"
+          prop="brandNum"
+          :show-overflow-tooltip="true"
+        ></el-table-column>
+        <el-table-column
+          v-for="(item, index) in newColumns"
+          :label="item.label"
+          :align="item.align"
+          :prop="item.prop"
+          :show-overflow-tooltip="item.showOverflowTooltip"
+        ></el-table-column>
+        <el-table-column
+          label="批次号"
+          prop="batchNo"
+          align="center"
+          :show-overflow-tooltip="true"
+        >
+        </el-table-column>
+        <el-table-column
+          label="最小包装单元"
+          align="center"
+          width="120"
+          prop="minPackingQuantity"
+        >
+          <template slot-scope="{ row, $index }">
+            {{ row.minPackingQuantity }} {{ row.measureUnit }} /{{
+              row.packingUnit
+            }}
+          </template>
+        </el-table-column>
+
+        <el-table-column label="包装数量" prop="packingQuantity" align="center">
+          <template slot-scope="{ row, $index }">
+            {{ row.packingQuantity }} {{ row.packingUnit }}
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="计量数量"
+          prop="measureQuantity"
+          width="100"
+          align="center"
+        >
+          <template slot-scope="{ row, $index }">
+            <template>
+              {{
+                $math.format(row.minPackingQuantity * row.packingQuantity, 14)
+              }}
+            </template>
+          </template>
+        </el-table-column>
+        <el-table-column label="计量单位" prop="measureUnit" align="center">
+          <template slot-scope="{ row, $index }">
+            <template>
+              {{ row.measureUnit }}
+            </template>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="重量"
+          prop="weight"
+          align="center"
+          :show-overflow-tooltip="true"
+        >
+        </el-table-column>
+        <el-table-column
+          label="重量单位"
+          prop="weightUnit"
+          align="center"
+          :show-overflow-tooltip="true"
+        >
+        </el-table-column>
+        <el-table-column
+          label="单价"
+          prop="unitPrice"
+          align="center"
+          width="200"
+        >
+          <template slot-scope="{ row }">
+            <el-input
+              type="number"
+              v-model.number="row.unitPrice"
+              placeholder="非必填"
+              @input="
+                (value) => (row.unitPrice = value.replace(/[^0-9.]+/g, ''))
+              "
+            >
+              <template slot="append"> 元/{{ row.measureUnit }} </template>
+            </el-input>
+          </template>
+        </el-table-column>
+        <el-table-column
+          label="总价"
+          align="center"
+          prop="totalPrice"
+          :show-overflow-tooltip="true"
+        >
+          <template slot-scope="{ row, $index }">
+            {{
+              $math.format(
+                (row.measureQuantity || 0) * (row.unitPrice || 0),
+                14
+              )
+            }}
+          </template>
+        </el-table-column>
+        <!-- <el-table-column
+          label="采购原因"
+          align="center"
+          prop="purpose"
+          :show-overflow-tooltip="true"
+        ></el-table-column> -->
+        <el-table-column
+          label="仓库"
+          prop="warehouseName"
+          :show-overflow-tooltip="true"
+          width="200"
+        >
+        </el-table-column>
+      </el-table>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false">关 闭</el-button>
+        <el-button type="primary" @click="confirm">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+  import storageApi from '@/api/warehouseManagement';
+  export default {
+    data() {
+      return {
+        newColumns: [],
+        dialogVisible: false
+      };
+    },
+    created() {
+      this.getFieldModel();
+    },
+    methods: {
+      // 表格样式
+      rowClass({ row, column, rowIndex, columnIndex }) {
+        if (rowIndex === 1) {
+          return {
+            display: 'none',
+            background: '#EEEEEE'
+          };
+        }
+        return { background: '#0000' };
+      },
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
+      confirm() {
+        let params = this.productList.map((item) => {
+          return {
+            outInDetailId: item.id,
+            unitPrice: item.unitPrice
+          };
+        });
+        storageApi.unitPriceMaintenance(params).then((data) => {
+          console.log(data);
+          if (data.code == 0) {
+            this.$message.success('修改成功');
+            this.dialogVisible = false;
+          } else {
+            this.$message.error('修改失败');
+          }
+        });
+      },
+      async open(id) {
+        const res = await storageApi.getInboundDetailsById(id);
+        this.productList = res.outInDetailList;
+        this.dialogVisible = true;
+      }
+    }
+  };
+</script>
+
+<style lang="scss" scoped>
+  .el-row {
+    margin-bottom: 15px;
+    font-size: 14px;
+  }
+</style>

+ 27 - 3
src/views/warehouseManagement/stockManagement/components/selectType.vue

@@ -69,6 +69,13 @@
               label="规格"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
             <el-table-column
               prop="measuringUnit"
               label="计量单位"
@@ -126,7 +133,7 @@
 <script>
   import AssetTree from './assetTree.vue';
   import { getList } from '@/api/classifyManage/itemInformation';
-
+  import storageApi from '@/api/warehouseManagement/index.js';
   export default {
     props: {
       visibleDialog: {
@@ -176,11 +183,28 @@
         total: 0,
         curType: '',
         classificationId: '',
-        memoSelection: []
+        memoSelection: [],
+        newColumns: [] // 动态表头
       };
     },
-    created() {},
+    created() {
+      this.getFieldModel();
+    },
     methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
       handleSearch() {
         this.pages.pageNum = 1;
         this.initData();

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

@@ -149,6 +149,13 @@
               prop="brandNum"
               :show-overflow-tooltip="true"
             ></el-table-column>
+            <el-table-column
+              v-for="(item, index) in newColumns"
+              :label="item.label"
+              :align="item.align"
+              :prop="item.prop"
+              :show-overflow-tooltip="item.showOverflowTooltip"
+            ></el-table-column>
             <el-table-column
               label="批次号"
               prop="batchNo"
@@ -530,6 +537,7 @@
     },
     data() {
       return {
+        newColumns: [], // 动态表头
         qualityStatus: {
           0: '未质检',
           1: '已质检'
@@ -608,11 +616,26 @@
       }
     },
     created() {
+      this.getFieldModel();
       this.requestDict('类型用途');
       this.getAllCategoryType();
       this._getInfo();
     },
     methods: {
+      // 获取动态表头
+      getFieldModel() {
+        storageApi.fieldModel({ fieldModel: 't_main_category' }).then((res) => {
+          let newRes = res.map((m) => {
+            return {
+              prop: 'extField.' + m.prop,
+              label: m.label,
+              align: 'center',
+              showOverflowTooltip: true
+            };
+          });
+          this.newColumns = [...newRes];
+        });
+      },
       isUpper(row) {
         let filterPackingList = this.packingList.filter((packingItem) => {
           return packingItem.parentIndex === row.index;

+ 82 - 4
src/views/warehouseManagement/stockManagement/index.vue

@@ -121,21 +121,38 @@
         ref="table"
         :columns="columns"
         :datasource="datasource"
+        @cell-click="cellClick"
         cache-key="systemRoleTable"
       >
+        <template v-slot:selection="{ row }">
+          <el-radio class="radio" v-model="currentId" :label="row.id"
+            ><i></i
+          ></el-radio>
+        </template>
         <!-- 表头工具栏 -->
         <template v-slot:toolbar>
           <el-button icon="el-icon-plus" type="primary" @click="add"
             >新建</el-button
           >
-          <!-- v-if="clientEnvironmentId == 4" -->
           <el-button
+            icon="el-icon-edit-outline"
+            type="primary"
+            @click="priceMaintenance"
+            >单价维护</el-button
+          >
+          <!-- <el-button icon="el-icon-top" type="primary" @click="shelves"
+            >上下架</el-button
+          > -->
+          <el-button icon="el-icon-receiving" type="primary" @click="outbound"
+            >出库</el-button
+          >
+          <!-- <el-button
             icon="el-icon-plus"
             v-if="clientEnvironmentId == 4"
             type="primary"
             @click="exportExcel"
             >导入</el-button
-          >
+          > -->
         </template>
         <!-- 状态 -->
         <template v-slot:verifyStatus="{ row }">
@@ -167,7 +184,7 @@
             icon="el-icon-view"
             @click="details(row)"
           >
-            详情
+            详情{{ row.verifyStatus == 2 ? '(上下架)' : '' }}
           </el-link>
           <el-link
             type="primary"
@@ -187,11 +204,13 @@
         </template>
       </ele-pro-table>
     </el-card>
+    <priceMaintenanceDialog ref="priceMaintenanceDialogRef" />
   </div>
 </template>
 
 <script>
   import storageApi from '@/api/warehouseManagement';
+  import priceMaintenanceDialog from './components/priceMaintenanceDialog.vue';
   import { allCategoryLevel } from '@/api/classifyManage';
   import {
     warehousingType,
@@ -200,6 +219,7 @@
     useDict
   } from '@/utils/dict/index';
   export default {
+    components: { priceMaintenanceDialog },
     data() {
       return {
         auditStatus,
@@ -225,8 +245,15 @@
           { label: '审核通过', class: 'ele-text-success' },
           { label: '驳回', class: 'ele-text-danger' }
         ],
-
+        currentId: '',
+        currentRow: {},
         columns: [
+          {
+            slot: 'selection',
+            label: '选择',
+            width: 50,
+            align: 'center'
+          },
           {
             type: 'index',
             label: '序号',
@@ -326,6 +353,57 @@
       this.getTypeList();
     },
     methods: {
+      // 单击获取id
+      cellClick(row) {
+        this.currentRow = row;
+        this.currentId = row.id;
+      },
+      shelves() {
+        console.log('上架');
+      },
+      unShelves() {
+        console.log('下架');
+      },
+      priceMaintenance() {
+        console.log('单价维护');
+        if (this.currentRow.verifyStatus == 2) {
+          if (this.currentId) {
+            this.$refs.priceMaintenanceDialogRef.open(this.currentId);
+          } else {
+            this.$message.error('请选择单据');
+          }
+        } else {
+          this.$message.error('该单据未审核通过');
+        }
+      },
+      async outbound() {
+        console.log(this.currentRow);
+        if (this.currentRow.verifyStatus == 2) {
+          const res = await storageApi.getInboundDetailsById(
+            this.currentRow.id
+          );
+          const arr = [];
+          for (const key in res.outInDetailList) {
+            for (const k in res.outInDetailList[key]
+              .outInDetailRecordRequestList) {
+              arr.push({
+                ...res.outInDetailList[key].outInDetailRecordRequestList[k]
+              });
+            }
+          }
+          let ids = arr.map((item) => item.id).join(',');
+          this.$router.push({
+            path: '/warehouseManagement/outgoingManagement/add',
+            query: {
+              ids,
+              bizType: this.currentRow.bizType,
+              assetType: this.currentRow.extInfo.assetType
+            }
+          });
+        } else {
+          this.$message.error('该单据未审核通过');
+        }
+      },
       handleAssetType(r) {
         const code = this.codeList.find((item) => item.dictCode == r);
         return code?.dictValue;