Преглед изворни кода

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-wms into dev

yusheng пре 9 месеци
родитељ
комит
a3e3eaab03

Разлика између датотеке није приказан због своје велике величине
+ 644 - 153
src/views/warehouseManagement/inventoryAllocation/add.vue


+ 0 - 179
src/views/warehouseManagement/inventoryAllocation/components/DeliveryNoteDialog.vue

@@ -1,179 +0,0 @@
-<template>
-  <el-dialog
-    title="送货单详情"
-    :visible.sync="visible"
-    center
-    append-to-body
-    width="70%"
-    :close-on-click-modal="false"
-
->
-
-    <div id="printSection">
-      <div style="text-align: center; padding-bottom: 20px;">
-        <h3 style="margin: 0; font-size: 20px; font-weight: 800;">送货单</h3>
-      </div>
-
-      <div style="margin-bottom: 15px; width: 100%;">
-        <div style="display: flex; margin-bottom: 8px; width: 100%;">
-          <div style="flex: 1; text-align: left;">客户名称:{{ infoData.customerName || '' }}</div>
-          <div style="flex: 1; text-align: left;">发货单号:{{ infoData.deliveryNumber || '' }}</div>
-        </div>
-        <div style="display: flex; margin-bottom: 8px;">
-          <div style="flex: 1; text-align: left;">发货日期:{{ infoData.deliveryDate || '' }}</div>
-          <div style="flex: 1; text-align: left;">联系人:{{ infoData.contactPerson || '' }}</div>
-        </div>
-        <div style="display: flex;">
-          <div style="flex: 1; text-align: left;">联系电话:{{ infoData.contactPhone || '' }}</div>
-        </div>
-      </div>
-
-      <table style="width: 100%; border-collapse: collapse; margin-bottom: 20px;">
-        <thead>
-          <tr>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;" width="50px;">序号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">型号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 160px;">零件名</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">单位</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">送货数量</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">验收数量</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">备注</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">订单号</th>
-            <th style="border: 1px solid #000; padding: 8px; text-align: center;">加工工艺</th>
-          </tr>
-        </thead>
-        <tbody>
-          <tr v-for="(item, index) in detailList" :key="index">
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ index + 1 }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryModel || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryName || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureUnit || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureQuantity || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureQuantity || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.remark || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.orderNumber || '' }}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.processingTechnology || '' }}</td>
-          </tr>
-          <tr style="height: 40px;">
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td colspan="2" style="border: 1px solid #000; padding: 8px; text-align: center;">合计</td>
-            <!-- <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td> -->
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.measureQuantity || 0), 0) || ''}}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.measureQuantity || 0), 0) || ''}}</td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
-          </tr>
-        </tbody>
-      </table>
-
-      <div style="display: flex; margin-top: 20px; width: 100%;">
-        <div style="flex: 1;">发货人:{{ infoData.deliverer || '' }}</div>
-        <div style="flex: 1;">送货人:{{ infoData.carrier || '' }}</div>
-        <div style="flex: 1;">收货人:{{ infoData.receiver || '' }}</div>
-      </div>
-    </div>
-
-    <div
-      slot="footer"
-      style="text-align: right"
-    >
-      <el-button type="primary" @click="confirm">打印预览</el-button>
-      <el-button @click="cancel">返回</el-button>
-    </div>
-  </el-dialog>
-</template>
-
-<script>
-import storageApi from '@/api/warehouseManagement/index.js';
-export default {
-  data () {
-    return {
-      visible: false,
-      row: {
-        customerName: '',
-        contactPerson: '',
-        contactPhone: '',
-        items: [{
-          model: '',
-          partName: '',
-          unit: '',
-          deliveryQuantity: '',
-          receivedQuantity: '',
-          remark: '',
-          orderNumber: '',
-          processingTechnology: '',
-        }],
-        deliverer: '',
-        carrier: '',
-        receiver: '',
-      },
-      detailList: [],
-      infoData: {},
-    }
-  },
-  computed: {
-
-  },
-  methods: {
-    async open (row) {
-      console.log('row', row)
-      this.row = row;
-      this.getData();
-      this.visible = true;
-    },
-    async getData() {
-      const res = await storageApi.getAllotDetailList({
-          applyId: this.row.id
-        });
-        const data = await storageApi.getAllotDetail(this.row.id);
-        this.infoData = data;
-        if (this.infoData.type == 1) {
-          // 库内调拨
-          /* this.infoData.auditStatus = 2; */
-          this.infoData.auditStatus = data.status;
-        } else {
-          // 库外调拨
-          this.infoData.auditStatus = data.status;
-        }
-        this.detailList = res.map((item) => {
-          return {
-            ...item,
-            categoryCode: this.infoData.categoryCode,
-            categoryName: this.infoData.categoryName,
-            brandNum: this.infoData.brandNum,
-            categoryModel: this.infoData.model,
-            specification: this.infoData.specification
-          };
-        });
-        console.log('infoData', this.infoData)
-        console.log('detailList', this.detailList)
-    },
-    confirm () {
-     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();
-      };
-    },
-    cancel () {
-      this.visible = false
-    }
-  }
-}
-</script>
-
-<style lang="scss" scoped>
-
-</style>

+ 229 - 0
src/views/warehouseManagement/inventoryAllocation/components/print-template-bs-car.vue

@@ -0,0 +1,229 @@
+<template>
+  <ele-modal
+    title="出库单"
+    :visible.sync="QRvisible"
+    v-if="QRvisible"
+    width="90%"
+  >
+    <div
+      id="printSection"
+      style="
+        display: flex;
+        align-items: center;
+        justify-content: center;
+        flex-direction: column;
+      "
+    >
+      <div
+        style="
+          position: relative;
+          width: 100%;
+          height: 100px;
+          display: flex;
+          flex-direction: column;
+          align-items: center;
+        "
+      >
+        <!-- <img
+          v-if="groupName.includes('宝盛')"
+          style="width: 80px; height: 80px; position: absolute; left: 20px"
+          src="@/assets/bslogo.png"
+          alt=""
+        /> -->
+        <div
+          style="
+            font-size: 20px;
+            font-weight: 800;
+            text-align: center;
+            width: 100%;
+          "
+          >{{ groupName || '长沙宝盛汽车配件有限公司' }}送货单</div
+        >
+        <!-- <div
+          style="
+            font-size: 18px;
+            font-weight: 800;
+            text-align: center;
+            width: 100%;
+          "
+          >送货单</div
+        > -->
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span style="width: 40%">客户名称:{{ formData.contactName }}</span>
+        <span style="width: 40%"
+          >发货单号:{{ formData.printNo || formData.docNo }}</span
+        >
+      </div>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-bottom: 10px;
+        "
+      >
+        <span style="width: 40%">发货日期:{{ formData.createTime }}</span>
+        <span style="width: 40%"
+          >收货联系人:{{ formData.linkName }}
+
+          <!-- 联系电话:{{ formData.linkPhone }} -->
+        </span>
+        <!-- <span> 车牌号:{{ formData.carNo }} </span> -->
+      </div>
+      <table
+        cellspacing="0"
+        border
+        style="
+          width: 100%;
+          table-layout: fixed;
+          word-break: break-all;
+          word-wrap: break-word;
+          font-size: 12px;
+        "
+      >
+        <tbody>
+          <tr align="center">
+            <td style="padding: 5px; width: 35px"> 序号 </td>
+            <td style="padding: 5px;"> 车型 </td>
+            <td style="padding: 5px;"> 料号 </td>
+            <td style="padding: 5px; width: 50px"> 单位</td>
+            <td style="padding: 5px"> 交货数</td>
+            <td style="padding: 5px"> 实收数量</td>
+            <td style="padding: 5px"> 客户订单号</td>
+            <td style="padding: 5px"> 重量</td>
+            <td style="padding: 5px"> 工艺</td>
+            <td style="padding: 5px"> 备注</td>
+          </tr>
+
+          <tr align="center" v-for="(item, index) in formData.productList">
+            <td style="padding: 5px"> {{ index + 1 }} </td>
+            <td style="padding: 5px"> </td>
+            <td style="padding: 5px"> {{ item.productName }} </td>
+            <td style="padding: 5px">
+              {{ item.productCode }}
+            </td>
+            <td style="padding: 5px"> {{ item.productName }} </td>
+            <td style="padding: 5px"> {{ item.measuringUnit }}</td>
+            <td style="padding: 5px"> {{ item.totalCount }}</td>
+            <td style="padding: 5px"> {{ item.totalCount }}</td>
+            <td style="padding: 5px"> </td>
+            <td style="padding: 5px">{{ item.orderNo }} </td>
+            <td style="padding: 5px"> </td>
+          </tr>
+        </tbody>
+      </table>
+      <div
+        style="
+          width: 100%;
+          font-size: 12px;
+          display: flex;
+          justify-content: space-between;
+          margin-top: 10px;
+        "
+      >
+        <div style="flex: 1">
+          <div>发货人:</div>
+        </div>
+        <div style="flex: 1">
+          <div>送货人:</div>
+        </div>
+        <div style="flex: 1"> 收货人: </div>
+        <div style="flex: 1"> 托盘:{{   formData.trayNum }} </div>
+      
+      </div>
+    </div>
+
+    <div slot="footer">
+      <el-button @click="print">打印预览</el-button>
+      <el-button @click="close">关闭</el-button>
+    </div>
+  </ele-modal>
+</template>
+
+<script>
+  // import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
+  import { mapGetters } from 'vuex';
+  export default {
+    name: 'print',
+    computed: {
+      ...mapGetters(['user'])
+    },
+    props: {
+      groupName: ''
+    },
+    data() {
+      return {
+        checked: '',
+        QRvisible: false,
+        isPrintPrice: false,
+        formData: {},
+        outBound: {}
+      };
+    },
+
+    methods: {
+      async open(id) {
+        // this.formData = await getSendSaleOrderrecordDetailSplit(id);
+        this.QRvisible = true;
+        // let dataArray = await getInfoBySourceBizNoAll(this.formData.docNo);
+        // this.outBound = JSON.parse(JSON.stringify(dataArray[0]));
+        // this.outBound['outInDetailRecordRequestList'] = [];
+
+        // dataArray.forEach((item) => {
+        //   item.outInDetailList.forEach((val) => {
+        //     val['orderNo'] = item.orderNo;
+        //     if (val.outInDetailRecordRequestList.length) {
+        //       val.outInDetailRecordRequestList.forEach((j) => {
+        //         j['categoryName'] = val.categoryName;
+        //         j['categoryModel'] = val.categoryModel;
+        //         j['specification'] = val.specification;
+        //         j['categoryCode'] = val.categoryCode;
+        //         j['orderNo'] = item.orderNo;
+
+        //       });
+        //       this.outBound['outInDetailRecordRequestList'].push(
+        //         ...val.outInDetailRecordRequestList
+        //       );
+        //     } else {
+        //       this.outBound['outInDetailRecordRequestList'].push(val);
+        //     }
+        //   });
+        // });
+        //包装维度
+      },
+      close() {
+        this.QRvisible = false;
+      },
+
+      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"></style>

+ 156 - 203
src/views/warehouseManagement/inventoryAllocation/components/print-template-bs.vue

@@ -1,226 +1,179 @@
 <template>
-  <ele-modal
-    title="出库单"
-    :visible.sync="QRvisible"
-    v-if="QRvisible"
-    width="90%"
-  >
-    <div
-      id="printSection"
-      style="
-        display: flex;
-        align-items: center;
-        justify-content: center;
-        flex-direction: column;
-      "
-    >
-      <div
-        style="
-          position: relative;
-          width: 100%;
-          height: 100px;
-          display: flex;
-          flex-direction: column;
-          align-items: center;
-        "
-      >
-        <!-- <img
-          v-if="groupName.includes('宝盛')"
-          style="width: 80px; height: 80px; position: absolute; left: 20px"
-          src="@/assets/bslogo.png"
-          alt=""
-        /> -->
-        <div
-          style="
-            font-size: 20px;
-            font-weight: 800;
-            text-align: center;
-            width: 100%;
-          "
-          >{{ groupName || '长沙宝盛汽车配件有限公司' }}</div
-        >
-        <div
-          style="
-            font-size: 18px;
-            font-weight: 800;
-            text-align: center;
-            width: 100%;
-          "
-          >送货单</div
-        >
-      </div>
-      <div
-        style="
-          width: 100%;
-          font-size: 12px;
-          display: flex;
-          justify-content: space-between;
-          margin-bottom: 10px;
-        "
-      >
-        <span style="width: 40%">客户名称:{{ formData.contactName }}</span>
-        <span style="width: 40%"
-          >发货单号:{{ formData.printNo || formData.docNo }}</span
-        >
+  <el-dialog
+    title="送货单详情"
+    :visible.sync="visible"
+    center
+    append-to-body
+    width="70%"
+    :close-on-click-modal="false"
+
+>
+
+    <div id="printSection">
+      <div style="text-align: center; padding-bottom: 20px;">
+        <h3 style="margin: 0; font-size: 20px; font-weight: 800;">送货单</h3>
       </div>
-      <div
-        style="
-          width: 100%;
-          font-size: 12px;
-          display: flex;
-          justify-content: space-between;
-          margin-bottom: 10px;
-        "
-      >
-        <span style="width: 40%">发货日期:{{ formData.createTime }}</span>
-        <span style="width: 40%"
-          >联系人:{{ formData.linkName }}
 
-          联系电话:{{ formData.linkPhone }}
-        </span>
-        <span> 车牌号:{{ formData.carNo }} </span>
+      <div style="margin-bottom: 15px; width: 100%;">
+        <div style="display: flex; margin-bottom: 8px; width: 100%;">
+          <div style="flex: 1; text-align: left;">客户名称:{{ infoData.customerName || '' }}</div>
+          <div style="flex: 1; text-align: left;">发货单号:{{ infoData.deliveryNumber || '' }}</div>
+        </div>
+        <div style="display: flex; margin-bottom: 8px;">
+          <div style="flex: 1; text-align: left;">发货日期:{{ infoData.deliveryDate || '' }}</div>
+          <div style="flex: 1; text-align: left;">联系人:{{ infoData.contactPerson || '' }}</div>
+        </div>
+        <div style="display: flex;">
+          <div style="flex: 1; text-align: left;">联系电话:{{ infoData.contactPhone || '' }}</div>
+        </div>
       </div>
-      <table
-        cellspacing="0"
-        border
-        style="
-          width: 100%;
-          table-layout: fixed;
-          word-break: break-all;
-          word-wrap: break-word;
-          font-size: 12px;
-        "
-      >
+
+      <table style="width: 100%; border-collapse: collapse; margin-bottom: 20px;">
+        <thead>
+          <tr>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;" width="50px;">序号</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">型号</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center; width: 160px;">零件名</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">单位</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">送货数量</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">验收数量</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">备注</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">订单号</th>
+            <th style="border: 1px solid #000; padding: 8px; text-align: center;">加工工艺</th>
+          </tr>
+        </thead>
         <tbody>
-          <tr align="center">
-            <td style="padding: 5px; width: 35px"> 序号 </td>
-            <td style="padding: 5px"> 编码 </td>
-            <td style="padding: 5px"> 零件名 </td>
-            <td style="padding: 5px; width: 50px"> 单位</td>
-            <td style="padding: 5px"> 送货数量</td>
-            <td style="padding: 5px"> 验收数量</td>
-            <td style="padding: 5px"> 备注</td>
-            <td style="padding: 5px"> 订单号</td>
-            <td style="padding: 5px"> 加工工艺</td>
+          <tr v-for="(item, index) in detailList" :key="index">
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ index + 1 }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryModel || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.categoryName || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureUnit || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureQuantity || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.measureQuantity || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.remark || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.orderNumber || '' }}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ item.processingTechnology || '' }}</td>
           </tr>
-
-          <tr align="center" v-for="(item, index) in formData.productList">
-            <td style="padding: 5px"> {{ index + 1 }} </td>
-            <td style="padding: 5px">
-              {{ item.productCode }}
-            </td>
-            <td style="padding: 5px"> {{ item.productName }} </td>
-            <td style="padding: 5px"> {{ item.measuringUnit }}</td>
-            <td style="padding: 5px"> {{ item.totalCount }}</td>
-            <td style="padding: 5px"> {{ item.totalCount }}</td>
-            <td style="padding: 5px"> </td>
-            <td style="padding: 5px">{{ item.orderNo }} </td>
-            <td style="padding: 5px"> </td>
+          <tr style="height: 40px;">
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td colspan="2" style="border: 1px solid #000; padding: 8px; text-align: center;">合计</td>
+            <!-- <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td> -->
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.measureQuantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;">{{ detailList.reduce((total, item) => total + Number(item.measureQuantity || 0), 0) || ''}}</td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
+            <td style="border: 1px solid #000; padding: 8px; text-align: center;"></td>
           </tr>
         </tbody>
       </table>
-      <div
-        style="
-          width: 100%;
-          font-size: 12px;
-          display: flex;
-          justify-content: space-between;
-          margin-top: 10px;
-        "
-      >
-        <div style="flex: 1">
-          <div>发货人:</div>
-        </div>
-        <div style="flex: 1">
-          <div>送货人:</div>
-        </div>
-        <div style="flex: 1"> 收货人: </div>
-        <div style="flex: 1"> 托盘:{{   formData.trayNum }} </div>
-      
+
+      <div style="display: flex; margin-top: 20px; width: 100%;">
+        <div style="flex: 1;">发货人:{{ infoData.deliverer || '' }}</div>
+        <div style="flex: 1;">送货人:{{ infoData.carrier || '' }}</div>
+        <div style="flex: 1;">收货人:{{ infoData.receiver || '' }}</div>
       </div>
     </div>
 
-    <div slot="footer">
-      <el-button @click="print">打印预览</el-button>
-      <el-button @click="close">关闭</el-button>
+    <div
+      slot="footer"
+      style="text-align: right"
+    >
+      <el-button type="primary" @click="confirm">打印预览</el-button>
+      <el-button @click="cancel">返回</el-button>
     </div>
-  </ele-modal>
+  </el-dialog>
 </template>
 
 <script>
-  // import { getSendSaleOrderrecordDetailSplit } from '@/api/saleManage/saleordersendrecord';
-  import { mapGetters } from 'vuex';
-  export default {
-    name: 'print',
-    computed: {
-      ...mapGetters(['user'])
+import storageApi from '@/api/warehouseManagement/index.js';
+export default {
+  data () {
+    return {
+      visible: false,
+      row: {
+        customerName: '',
+        contactPerson: '',
+        contactPhone: '',
+        items: [{
+          model: '',
+          partName: '',
+          unit: '',
+          deliveryQuantity: '',
+          receivedQuantity: '',
+          remark: '',
+          orderNumber: '',
+          processingTechnology: '',
+        }],
+        deliverer: '',
+        carrier: '',
+        receiver: '',
+      },
+      detailList: [],
+      infoData: {},
+    }
+  },
+  computed: {
+
+  },
+  methods: {
+    async open (row) {
+      console.log('row', row)
+      this.row = row;
+      this.getData();
+      this.visible = true;
     },
-    props: {
-      groupName: ''
+    async getData() {
+      const res = await storageApi.getAllotDetailList({
+          applyId: this.row.id
+        });
+        const data = await storageApi.getAllotDetail(this.row.id);
+        this.infoData = data;
+        if (this.infoData.type == 1) {
+          // 库内调拨
+          /* this.infoData.auditStatus = 2; */
+          this.infoData.auditStatus = data.status;
+        } else {
+          // 库外调拨
+          this.infoData.auditStatus = data.status;
+        }
+        this.detailList = res.map((item) => {
+          return {
+            ...item,
+            categoryCode: this.infoData.categoryCode,
+            categoryName: this.infoData.categoryName,
+            brandNum: this.infoData.brandNum,
+            categoryModel: this.infoData.model,
+            specification: this.infoData.specification
+          };
+        });
+        console.log('infoData', this.infoData)
+        console.log('detailList', this.detailList)
     },
-    data() {
-      return {
-        checked: '',
-        QRvisible: false,
-        isPrintPrice: false,
-        formData: {},
-        outBound: {}
+    confirm () {
+     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();
       };
     },
-
-    methods: {
-      async open(id) {
-        // this.formData = await getSendSaleOrderrecordDetailSplit(id);
-        // this.QRvisible = true;
-        // let dataArray = await getInfoBySourceBizNoAll(this.formData.docNo);
-        // this.outBound = JSON.parse(JSON.stringify(dataArray[0]));
-        // this.outBound['outInDetailRecordRequestList'] = [];
-
-        // dataArray.forEach((item) => {
-        //   item.outInDetailList.forEach((val) => {
-        //     val['orderNo'] = item.orderNo;
-        //     if (val.outInDetailRecordRequestList.length) {
-        //       val.outInDetailRecordRequestList.forEach((j) => {
-        //         j['categoryName'] = val.categoryName;
-        //         j['categoryModel'] = val.categoryModel;
-        //         j['specification'] = val.specification;
-        //         j['categoryCode'] = val.categoryCode;
-        //         j['orderNo'] = item.orderNo;
-
-        //       });
-        //       this.outBound['outInDetailRecordRequestList'].push(
-        //         ...val.outInDetailRecordRequestList
-        //       );
-        //     } else {
-        //       this.outBound['outInDetailRecordRequestList'].push(val);
-        //     }
-        //   });
-        // });
-        //包装维度
-      },
-      close() {
-        this.QRvisible = false;
-      },
-
-      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();
-        };
-      }
+    cancel () {
+      this.visible = false
     }
-  };
+  }
+}
 </script>
 
-<style lang="scss"></style>
+<style lang="scss" scoped>
+
+</style>

+ 23 - 7
src/views/warehouseManagement/inventoryAllocation/index.vue

@@ -16,9 +16,14 @@
           <el-button icon="el-icon-plus" type="primary" @click="add"
             >新建</el-button
           >
-          <!-- <el-button :disabled="selection.length > 1" icon="el-icon-download" type="primary" @click="printExl"
-            >打印</el-button
+          <!-- <el-button :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl"
+            >打印送货单</el-button
           > -->
+          <!-- v-if="$hasPermission('wms:inventoryAllocation:print1')" -->
+          <!-- <el-button :disabled="selection.length > 1" icon="el-icon-download" type="primary"  @click="printExl2"
+            >打印送货单</el-button
+          > -->
+          <!-- v-if="$hasPermission('wms:inventoryAllocation:print2')" -->
         </template>
         <!-- 单号链接 -->
         <template v-slot:allotCode="{ row }">
@@ -66,7 +71,8 @@
       </ele-pro-table>
     </el-card>
     <!-- 打印弹窗 -->
-    <delivery-note-dialog ref="deliveryNoteDialogRef"></delivery-note-dialog>
+    <printTemplateBs ref="printTemplateBsRef"></printTemplateBs>
+    <printTemplateBsCar ref="printTemplateBsCarRef"></printTemplateBsCar>
   </div>
 </template>
 
@@ -74,13 +80,15 @@
   import { allocationType } from '@/utils/dict/warehouse';
   import storageApi from '@/api/warehouseManagement/index.js';
   import InventorySearch from './components/inventory-search.vue';
-  import DeliveryNoteDialog from './components/DeliveryNoteDialog.vue';
+  import printTemplateBs from './components/print-template-bs.vue';
+  import printTemplateBsCar from './components/print-template-bs-car.vue';
   import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
   import { pageRoles } from '@/api/system/role';
   export default {
     components: {
       InventorySearch,
-      DeliveryNoteDialog
+      printTemplateBs,
+      printTemplateBsCar 
     },
     data() {
       return {
@@ -206,10 +214,18 @@
       printExl() {
         console.log('selection', this.selection)
         if (this.selection.length == 0) {
-          this.$message.warning('请选择要导出的记录');
+          this.$message.warning('请选择要打印的记录');
+          return;
+        }
+        this.$refs.printTemplateBsRef.open(this.selection[0]);
+      },
+      printExl2() {
+        console.log('selection', this.selection)
+        if (this.selection.length == 0) {
+          this.$message.warning('请选择要打印的记录');
           return;
         }
-        this.$refs.deliveryNoteDialogRef.open(this.selection[0]);
+        this.$refs.printTemplateBsCarRef.open(this.selection[0]);
       },
       // 删除
       async deleted(row) {

+ 10 - 2
src/views/warehouseManagement/stockLedger/components/item-search.vue

@@ -86,7 +86,7 @@
           <el-form-item label="关键词:" prop="keyWord">
             <el-input
               clearable
-              placeholder="请输入"
+              placeholder="物品编码/物品名称/批次号/规格/型号"
               v-model.trim="params.keyWord"
             ></el-input>
           </el-form-item>
@@ -159,6 +159,15 @@
             ></el-input>
           </el-form-item>
         </el-col>
+        <el-col :span="6">
+          <el-form-item label="批次号:" prop="batchNo">
+            <el-input
+              clearable
+              v-model="params.batchNo"
+              placeholder="请输入"
+            ></el-input>
+          </el-form-item>
+        </el-col>
         <!-- <el-col v-if="dimension == 3 || dimension == 4" :span="6">
           <el-form-item label="客户代号:" prop="clientCode">
             <el-input
@@ -331,7 +340,6 @@
   .ele-form-actions {
     display: flex;
     align-items: center;
-    justify-content: flex-end;
   }
   :deep(.el-form-item) {
     margin-bottom: 5px !important;

+ 288 - 246
src/views/warehouseManagement/warehouseDefinition/components/WarehouseEdit.vue

@@ -27,6 +27,23 @@
           maxlength="16"
         ></el-input>
       </el-form-item>
+      <el-form-item label="物品类型" prop="warehouseType">
+        <el-select
+          filterable
+          size="small"
+          class="w100"
+          v-model="formData.warehouseType"
+          placeholder="物品类型"
+          :clearable="true"
+        >
+          <el-option
+            v-for="item in warehousetypeList"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item label="仓库类型" prop="inventoryType">
         <!-- <DictSelection
           dictName="仓库类型"
@@ -164,133 +181,81 @@
 </template>
 
 <script>
-  import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
+import warehouseDefinition from '@/api/warehouseManagement/warehouseDefinition';
 
-  // import selectTree from '@/components/selectTree';
-  import DeptSelect from '@/components/CommomSelect/new-dept-select.vue';
+// import selectTree from '@/components/selectTree';
+import DeptSelect from '@/components/CommomSelect/new-dept-select.vue';
 
-  // import city from '@/assets/js/city';
-  import { cityData } from 'ele-admin/packages/utils/regions';
-  // import user from '@/api/main/user';
+import { getByCode } from '@/api/system/dictionary-data';
+// import city from '@/assets/js/city';
+import { cityData } from 'ele-admin/packages/utils/regions';
+// import user from '@/api/main/user';
 
-  export default {
-    components: { DeptSelect },
-    data() {
-      return {
-        visible: false,
-        loading: false,
-        formData: {
-          code: '',
-          name: '',
-          inventoryType: [],
-          inventoryName: [],
-          remarks: '',
-          factoryId: '',
-          status: 1,
-          lockStatus: 0,
-          ownerId: '',
-          departmentId: '',
-          contact: '',
-
-        },
-        rules: {
-          code: [
-            { required: true, message: '请输入仓库编码', trigger: 'blur' }
-          ],
-          name: [
-            { required: true, message: '请输入仓库名称', trigger: 'blur' }
-          ],
-          inventoryType: [
-            { required: true, message: '请选择仓库类型', trigger: 'blur' }
-          ],
-          factoryId: [
-            { required: true, message: '请选择工厂名称', trigger: 'blur' }
-          ],
-          departmentId: [
-            { required: true, message: '请选择权属部门', trigger: 'change' }
-          ],
-          ownerId: [
-            { required: true, message: '请选择权属人', trigger: 'change' }
-          ]
-          // status: [
-          //   { required: true, message: '请选择仓库状态', trigger: 'blur' }
-          // ]
-        },
-        type: '新建',
-        userList: [],
-        deptList: [], //部门集合
-        inventoryTypeList: [],
-        factoryList: [], //工厂集合
-        locationOptions: cityData,
-        loadingVis: false
-      };
-    },
-    watch: {
-      visible: {
-        handler(val) {
-          if (val) {
-            // this.init();
-          }
-        }
+export default {
+  components: { DeptSelect },
+  data() {
+    return {
+      visible: false,
+      loading: false,
+      formData: {
+        code: '',
+        name: '',
+        inventoryType: [],
+        inventoryName: [],
+        remarks: '',
+        factoryId: '',
+        status: 1,
+        lockStatus: 0,
+        ownerId: '',
+        departmentId: '',
+        contact: '',
+        warehouseType: ''
       },
-      loadingVis: {
-        handler(val) {
-          console.log(val);
-          if (!val && this.type == '新建') {
-            this.formData = {
-              code: '',
-              name: '',
-              inventoryType: [],
-              inventoryName: [],
-              remarks: '',
-              factoryId: '',
-              status: 1,
-              lockStatus: 0,
-              ownerId: '',
-              departmentId: ''
-            };
-          }
+      warehousetypeList: [],
+      rules: {
+        code: [{ required: true, message: '请输入仓库编码', trigger: 'blur' }],
+        name: [{ required: true, message: '请输入仓库名称', trigger: 'blur' }],
+        inventoryType: [
+          { required: true, message: '请选择仓库类型', trigger: 'blur' }
+        ],
+        factoryId: [
+          { required: true, message: '请选择工厂名称', trigger: 'blur' }
+        ],
+        departmentId: [
+          { required: true, message: '请选择权属部门', trigger: 'change' }
+        ],
+        ownerId: [
+          { required: true, message: '请选择权属人', trigger: 'change' }
+        ],
+        warehouseType: [
+          { required: true, message: '请选择物品类型', trigger: 'change' }
+        ]
+        // status: [
+        //   { required: true, message: '请选择仓库状态', trigger: 'blur' }
+        // ]
+      },
+      type: '新建',
+      userList: [],
+      deptList: [], //部门集合
+      inventoryTypeList: [],
+      factoryList: [], //工厂集合
+      locationOptions: cityData,
+      loadingVis: false
+    };
+  },
+  watch: {
+    visible: {
+      handler(val) {
+        if (val) {
+          // this.init();
         }
       }
     },
-    created() {},
-    methods: {
-      async open(type, row) {
-        console.log(type);
-        this.type = type;
-        this.visible = true;
-        this.init();
-        console.log('locationOptions', this.locationOptions);
-        if (type === '修改') {
-          console.log(1);
-          this.loadingVis = true;
-          this.$nextTick(async () => {
-            setTimeout(async () => {
-              const { warehouseVO } = await warehouseDefinition.warehouseDetail(
-                row.id
-              );
-              if (warehouseVO.departmentId) {
-                let userData = await warehouseDefinition.getUserPage({
-                  groupId: warehouseVO.departmentId,
-                  size: 9999,
-                  pageNum: 1
-                });
-                this.userList = userData.list;
-              }
-              this.formData = {
-                ...warehouseVO,
-                location: [
-                  warehouseVO.province,
-                  warehouseVO.city,
-                  warehouseVO.area
-                ],
-                inventoryType: warehouseVO.inventoryType.split(','),
-                inventoryName: warehouseVO.inventoryName.split(',')
-              };
-              this.loadingVis = false;
-            }, 2000);
-          });
-        } else {
+
+    loadingVis: {
+      handler(val) {
+        console.log(val);
+        if (!val && this.type == '新建') {
           this.formData = {
             code: '',
             name: '',
@@ -304,152 +269,229 @@
             departmentId: ''
           };
         }
+      }
+    }
+  },
+  created() {
+    this.getwarehousetypeCode('warehouse_type');
+  },
+  methods: {
+    async getwarehousetypeCode(code) {
+      console.log(code);
+      try {
+        const res = await getByCode(code);
+        if (res.code == 0) {
+          let list = Object.values(res.data).map((el) => {
+            let k = Object.keys(el)[0];
+            let v = Object.values(el)[0];
+            return { label: v, value: k };
+          });
+          this.warehousetypeList = list;
+          console.log(this.warehousetypeList);
+        }
+      } catch (err) {
+        this.$message.error(err.message);
+      }
+    },
+    async open(type, row) {
+      console.log(type);
+      this.type = type;
+      this.visible = true;
+      this.init();
+      console.log('locationOptions', this.locationOptions);
+      if (type === '修改') {
+        console.log(1);
+        this.loadingVis = true;
+        this.$nextTick(async () => {
+          setTimeout(async () => {
+            const { warehouseVO } = await warehouseDefinition.warehouseDetail(
+              row.id
+            );
+            if (warehouseVO.departmentId) {
+              let userData = await warehouseDefinition.getUserPage({
+                groupId: warehouseVO.departmentId,
+                size: 9999,
+                pageNum: 1
+              });
+              this.userList = userData.list;
+            }
+            this.formData = {
+              ...warehouseVO,
+              location: [
+                warehouseVO.province,
+                warehouseVO.city,
+                warehouseVO.area
+              ],
+              inventoryType: warehouseVO.inventoryType.split(','),
+              inventoryName: warehouseVO.inventoryName.split(',')
+            };
+            this.loadingVis = false;
+          }, 2000);
+        });
+      } else {
+        this.formData = {
+          code: '',
+          name: '',
+          inventoryType: [],
+          inventoryName: [],
+          remarks: '',
+          factoryId: '',
+          status: 1,
+          lockStatus: 0,
+          ownerId: '',
+          departmentId: ''
+        };
+      }
 
-        // if (type === '新建') {
-        //   let num = 1
-        //   const res = await warehouseList()
-        //   if (res?.success && res.data?.length) {
-        //     num = +res.data[0].code.substr(1) + 1
-        //   }
-        // this.formData.code = 'A' + pushZero(num)
-        // }
-      },
-      async init() {
-        // org.tree().then((tree) => {
-        //   if (tree?.success) {
-        //     this.deptList = tree.data;
-        //   }
-        // });
-        // const tree = await warehouseDefinition.tree();
+      // if (type === '新建') {
+      //   let num = 1
+      //   const res = await warehouseList()
+      //   if (res?.success && res.data?.length) {
+      //     num = +res.data[0].code.substr(1) + 1
+      //   }
+      // this.formData.code = 'A' + pushZero(num)
+      // }
+    },
+    async init() {
+      // org.tree().then((tree) => {
+      //   if (tree?.success) {
+      //     this.deptList = tree.data;
+      //   }
+      // });
+      // const tree = await warehouseDefinition.tree();
 
-        // this.deptList = this.$util.toTreeData({
-        //   data: tree,
-        //   idField: 'id',
-        //   parentIdField: 'parentId'
-        // });
+      // this.deptList = this.$util.toTreeData({
+      //   data: tree,
+      //   idField: 'id',
+      //   parentIdField: 'parentId'
+      // });
 
-        //获取工厂车间列表
-        const res = await warehouseDefinition.getFactoryarea({
-          pageNum: 1,
-          size: 9999,
-          type: 1
-        });
+      //获取工厂车间列表
+      const res = await warehouseDefinition.getFactoryarea({
+        pageNum: 1,
+        size: 9999,
+        type: 1
+      });
 
-        // let data = org.factorys({ status: true });
-        this.factoryList = res.list;
+      // let data = org.factorys({ status: true });
+      this.factoryList = res.list;
 
-        const res2 = await warehouseDefinition.getTreeByGroup({ type: 2 });
-        this.inventoryTypeList = res2;
-      },
-      changeInventoryType(val) {
-        console.log(val, '1');
-        // 根据选中的仓库类型ID数组,获取对应的名称数组
-        const inventoryNames = val.map(typeId => {
-          const item = this.inventoryTypeList.find(item => item.id === typeId);
+      const res2 = await warehouseDefinition.getTreeByGroup({ type: 2 });
+      this.inventoryTypeList = res2;
+    },
+    changeInventoryType(val) {
+      console.log(val, '1');
+      // 根据选中的仓库类型ID数组,获取对应的名称数组
+      const inventoryNames = val
+        .map((typeId) => {
+          const item = this.inventoryTypeList.find(
+            (item) => item.id === typeId
+          );
           return item ? item.name : '';
-        }).filter(name => name !== '');
-        
-        this.formData.inventoryName = inventoryNames;
-        console.log('仓库类型名称数组:', this.formData.inventoryName);
-      },
+        })
+        .filter((name) => name !== '');
+
+      this.formData.inventoryName = inventoryNames;
+      console.log('仓库类型名称数组:', this.formData.inventoryName);
+    },
 
-      handleSave() {
-        this.$refs.formRef.validate(async (value) => {
-          if (value) {
-            let params = Object.assign(this.formData);
-            params.inventoryType = params.inventoryType.join(',');
-            params.inventoryName = params.inventoryName.join(',');
+    handleSave() {
+      this.$refs.formRef.validate(async (value) => {
+        if (value) {
+          let params = Object.assign(this.formData);
+          params.inventoryType = params.inventoryType.join(',');
+          params.inventoryName = params.inventoryName.join(',');
 
-            // if (params.location?.length) {
-            //   const [province, city, area] = params.location;
+          // if (params.location?.length) {
+          //   const [province, city, area] = params.location;
 
-            //   Object.assign(params, {
-            //     province,
-            //     city,
-            //     area
-            //   });
-            // }
-            // delete params.location;
-            // console.log(params);
+          //   Object.assign(params, {
+          //     province,
+          //     city,
+          //     area
+          //   });
+          // }
+          // delete params.location;
+          // console.log(params);
 
-            this.loading = true;
-            const res = await warehouseDefinition
-              .saveOrUpdateWarehouse(params)
-              .finally(() => (this.loading = false));
-            if (res.data?.code == '0') {
-              this.$message.success('保存成功!');
-              this.$emit('success');
-              this.cancel();
-            }
+          this.loading = true;
+          const res = await warehouseDefinition
+            .saveOrUpdateWarehouse(params)
+            .finally(() => (this.loading = false));
+          if (res.data?.code == '0') {
+            this.$message.success('保存成功!');
+            this.$emit('success');
+            this.cancel();
           }
-        });
-      },
-      cancel() {
-        this.$refs.formRef.resetFields();
-        // this.$refs.tree.clearHandle();
-        this.visible = false;
-      },
-      async nodeClick(id, data) {
-        // this.formData.departmentCode = data?.code;
-        this.formData.departmentId = id;
-        if (data) {
-          this.formData.departmentName = data.name;
-        }
-        this.formData.ownerName = '';
-        this.formData.ownerId = '';
-        if (id) {
-          let userData = await warehouseDefinition.getUserPage({
-            groupId: id,
-            size: 9999,
-            pageNum: 1
-          });
-          this.userList = userData.list;
         }
-      },
-      changeOwner(val) {
-        this.formData.ownerId = val;
-        let user = this.userList.find((item) => {
-          return item.id == val;
+      });
+    },
+    cancel() {
+      this.$refs.formRef.resetFields();
+      // this.$refs.tree.clearHandle();
+      this.visible = false;
+    },
+    async nodeClick(id, data) {
+      // this.formData.departmentCode = data?.code;
+      this.formData.departmentId = id;
+      if (data) {
+        this.formData.departmentName = data.name;
+      }
+      this.formData.ownerName = '';
+      this.formData.ownerId = '';
+      if (id) {
+        let userData = await warehouseDefinition.getUserPage({
+          groupId: id,
+          size: 9999,
+          pageNum: 1
         });
-        console.log(user);
+        this.userList = userData.list;
+      }
+    },
+    changeOwner(val) {
+      this.formData.ownerId = val;
+      let user = this.userList.find((item) => {
+        return item.id == val;
+      });
+      console.log(user);
 
-        this.formData.ownerName = user.name;
+      this.formData.ownerName = user.name;
 
-        this.formData.contact = user.phone;
+      this.formData.contact = user.phone;
 
-        // this.$nextTick(() => {
-        //   this.$forceUpdate();
-        // });
-        // this.$set(this.formData, 'ownerId', val);
-        // this.$set(
-        //   this.formData,
-        //   'ownerName',
-        //   this.userList.find((item) => {
-        //     return item.id == val;
-        //   }).name
-        // );
-        // console.log(this.formData);
-        // this.$forceUpdate();
-      },
-      changeLocation(val) {
-        console.log(val, '1~~~');
-        this.$set(this.formData, 'province', val[0]); //省
-        this.$set(this.formData, 'city', val[1]); //市
-        this.$set(this.formData, 'area', val[2]); //区
-        // delete this.formData.location;
-      }
+      // this.$nextTick(() => {
+      //   this.$forceUpdate();
+      // });
+      // this.$set(this.formData, 'ownerId', val);
+      // this.$set(
+      //   this.formData,
+      //   'ownerName',
+      //   this.userList.find((item) => {
+      //     return item.id == val;
+      //   }).name
+      // );
+      // console.log(this.formData);
+      // this.$forceUpdate();
+    },
+    changeLocation(val) {
+      console.log(val, '1~~~');
+      this.$set(this.formData, 'province', val[0]); //省
+      this.$set(this.formData, 'city', val[1]); //市
+      this.$set(this.formData, 'area', val[2]); //区
+      // delete this.formData.location;
     }
-  };
+  }
+};
 </script>
 
 <style lang="scss" scoped>
-  ::v-deep .el-form {
-    .el-form-item {
-      margin-bottom: 20px;
-    }
+::v-deep .el-form {
+  .el-form-item {
+    margin-bottom: 20px;
   }
+}
 
-  .el-divider--horizontal {
-    margin: 0 !important;
-  }
+.el-divider--horizontal {
+  margin: 0 !important;
+}
 </style>

Неке датотеке нису приказане због велике количине промена