Przeglądaj źródła

老库存出库、流转单打印

LiangtongHe 2 miesięcy temu
rodzic
commit
253e7a2b73

+ 8 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/mapper/LineSideCabinMapper.java

@@ -19,6 +19,14 @@ public interface LineSideCabinMapper
      */
     public LineSideCabin selectLineSideCabinById(Long id);
 
+    /**
+     * 查询线边舱库存
+     *
+     * @param id 线边舱库存主键
+     * @return 线边舱库存
+     */
+    public LineSideCabin selectLineSideCabinByIdEnd(Long id);
+
     /**
      * 查询线边舱库存列表
      * 

+ 8 - 0
zkqy-custom-business/src/main/java/com/zkqy/business/service/ILineSideCabinService.java

@@ -19,6 +19,14 @@ public interface ILineSideCabinService
      */
     public LineSideCabin selectLineSideCabinById(Long id);
 
+    /**
+     * 查询线边舱库存
+     *
+     * @param id 线边舱库存主键
+     * @return 线边舱库存
+     */
+    public LineSideCabin selectLineSideCabinByIdEnd(Long id);
+
     /**
      * 查询线边舱库存列表
      * 

+ 16 - 3
zkqy-custom-business/src/main/java/com/zkqy/business/service/impl/LineSideCabinServiceImpl.java

@@ -24,7 +24,7 @@ import com.zkqy.business.service.ILineSideCabinService;
  * @date 2025-05-20
  */
 @Service
-public class LineSideCabinServiceImpl implements ILineSideCabinService 
+public class LineSideCabinServiceImpl implements ILineSideCabinService
 {
     @Autowired
     private LineSideCabinMapper lineSideCabinMapper;
@@ -46,6 +46,18 @@ public class LineSideCabinServiceImpl implements ILineSideCabinService
         return lineSideCabinMapper.selectLineSideCabinById(id);
     }
 
+    /**
+     * 查询线边舱库存
+     *
+     * @param id 线边舱库存主键
+     * @return 线边舱库存
+     */
+    @Override
+    public LineSideCabin selectLineSideCabinByIdEnd(Long id)
+    {
+        return lineSideCabinMapper.selectLineSideCabinByIdEnd(id);
+    }
+
     /**
      * 查询线边舱库存列表
      * 
@@ -106,6 +118,7 @@ public class LineSideCabinServiceImpl implements ILineSideCabinService
         String formattedDate = sdf.format(now);
         lineSideCabin.setCollectTime(formattedDate);
         int zt = Integer.parseInt(lineSideCabin.getStatus());
+        LineSideCabin lineSideCabins = lineSideCabinMapper.selectLineSideCabinByIdEnd(lineSideCabin.getId());//取到库存数据
         if( zt < 3){
             lineSideCabin.setRecipient(SecurityUtils.getUsername());//领料人
             /** 新增流转日志 */
@@ -113,7 +126,7 @@ public class LineSideCabinServiceImpl implements ILineSideCabinService
             BeanUtils.copyProperties(lineSideCabin, operationLog);
             operationLog.setId(null);
             operationLog.setStatus("2");//状态为出库
-            operationLog.setJt(lineSideCabin.getMachineTool());//机台
+            operationLog.setJt(lineSideCabins.getMachineTool());//通过查询出来的库存数据给日志机台
             operationLog.setProductType(lineSideCabin.getProductId());//货品编号
             operationLog.setBatchNumber(lineSideCabin.getBatchNumber());//领料人
             operationLog.setRecipient(SecurityUtils.getUsername());//领料人
@@ -127,7 +140,7 @@ public class LineSideCabinServiceImpl implements ILineSideCabinService
             BeanUtils.copyProperties(lineSideCabin, operationLog);
             operationLog.setId(null);
             operationLog.setStatus(lineSideCabin.getStatus());//状态为确认出库
-            operationLog.setJt(lineSideCabin.getMachineTool());//机台
+            operationLog.setJt(lineSideCabins.getMachineTool());//机台
             operationLog.setProductType(lineSideCabin.getProductId());//货品编号
             operationLog.setBatchNumber(lineSideCabin.getBatchNumber());//批号
             operationLog.setConfirm(SecurityUtils.getUsername());//确认人

+ 31 - 1
zkqy-custom-business/src/main/resources/mapper/business/LineSideCabinMapper.xml

@@ -62,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectLineSideCabinList" parameterType="com.zkqy.business.domain.LineSideCabin" resultMap="LineSideCabinResult">
         <include refid="selectLineSideCabinVo"/>
-        where a.status != 3
+        <where>
             <if test="productNo != null "> and product_no = #{productNo}</if>
             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
             <if test="productSpecifications != null  and productSpecifications != ''"> and product_specifications = #{productSpecifications}</if>
@@ -82,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="confirm != null  and confirm != ''"> and confirm = #{confirm}</if>
             <if test="confirmTime != null  and confirmTime != ''"> and confirmTime = #{confirmTime}</if>
             <if test="createTime != null  and createTime != ''"> and createTime = #{createTime}</if>
+        </where>
     </select>
     
     <select id="selectLineSideCabinById" parameterType="Long" resultMap="LineSideCabinResult">
@@ -89,6 +90,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where a.id = #{id}
     </select>
 
+    <select id="selectLineSideCabinByIdEnd" parameterType="Long" resultMap="LineSideCabinResult">
+        SELECT
+            id,
+            product_no,
+            product_name,
+            product_specifications,
+            product_id,
+            batchNumber,
+            colours,
+            machineTool,
+            js,
+            STATUS,
+            standby,
+            standby1,
+            standby2,
+            standby3,
+            workshop,
+            recipient,
+            collectTime,
+            confirm,
+            confirmTime,
+            scid,
+            createTime,
+            createBy
+        FROM
+            {DBNAME}.lineSideCabin
+        where id = #{id}
+    </select>
+
     <insert id="insertLineSideCabin" parameterType="com.zkqy.business.domain.LineSideCabin">
         insert into {DBNAME}.lineSideCabin
         <trim prefix="(" suffix=")" suffixOverrides=",">

+ 15 - 7
zkqy-ui/src/views/orderMange/codeListManage/printIndex.vue

@@ -613,7 +613,7 @@ export default {
       summertId: "", //总码单id
       qrCode: "", //码单号
       isStartReadNum: false, //是否开始读取重量
-      printAuto: true, //是否自动打印
+      printAuto: false, //是否自动打印
       timer: null, //定时器
       nowWeight: 0,
       websocket: null,
@@ -626,7 +626,7 @@ export default {
         boxNo: "",
         msg: "不定重",
       },
-      tempStr: "",
+      tempStr: "",
       printShow: false,
       uuCode: "",
       tableData: [
@@ -661,7 +661,7 @@ export default {
         foreignTradeNumber: "", //外贸号
         canisterWeight: "", //筒重
         boxWeight: "", //箱重-车重
-        canisterNum: "", //筒数
+        canisterNum: "6", //筒数
         tubeColor: "", //管色
         comPort: "", //端口
         printFormat: "", //格式
@@ -762,7 +762,7 @@ export default {
         lotNum: null,
         productId: null,
         levels: null,
-        canisterNum: null,
+        canisterNum: 6,
         boxNum: null,
         suttle: null,
       },
@@ -773,6 +773,7 @@ export default {
   },
   created() {
     this.getList();
+    document.addEventListener('keydown', this.handleEnterKey);
   },
   watch: {
     tableData: {
@@ -859,6 +860,13 @@ export default {
   },
 
   methods: {
+    //按下回车键事件调用打印
+    handleEnterKey(event) {
+      if (event.key === 'Enter') {
+        // 处理回车键事件
+        this.printBtnHandler();
+      }
+    },
     handleClose(){
       //jxtc关闭
       this.jxtc=false;
@@ -1325,7 +1333,7 @@ export default {
         canisterNum,
         workShifts,
         tubeColor,
-        grossWeight: this.printAuto ? this.nowWeight : grossWeight, //毛重
+        grossWeight:  this.nowWeight , //毛重
         // suttle: this.getSuttle(), //净重
         suttle: 0, //净重
         boxNum: this.tableData.length + 1, //序号
@@ -1734,7 +1742,7 @@ export default {
             canisterNum,
             workShifts,
             tubeColor,
-            grossWeight: this.printAuto ? this.nowWeight : grossWeight, //毛重
+            grossWeight:  this.nowWeight , //毛重
             // suttle: this.getSuttle(), //净重
             suttle: 0, //净重
             boxNum: this.tableData.length + 1, //序号
@@ -1947,7 +1955,7 @@ export default {
         lotNum: null,
         productId: null,
         levels: null,
-        canisterNum: null,
+        canisterNum: 6,
         boxNum: null,
         suttle: null,
         productionDate: null,

+ 140 - 2
zkqy-ui/src/views/orderMange/lineSideCabin/index.vue

@@ -223,6 +223,13 @@
             @click="handleUpdateConfirm(scope.row)"
             v-hasPermi="['lineSideCabin:lineSideCabin:edit']"
           >出库确认</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdateConfirmPrint(scope.row)"
+            v-hasPermi="['lineSideCabin:lineSideCabin:edit']"
+          >打印流转单</el-button>
 <!--          <el-button-->
 <!--            size="mini"-->
 <!--            type="text"-->
@@ -371,6 +378,111 @@
         <el-button @click="cancels">取 消</el-button>
       </div>
     </el-dialog>
+
+    <el-dialog :title="title" :visible.sync="prinopens" width="500px" append-to-body>
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="机台" prop="machineTool">
+          <!--          <el-input v-model="form.machineTool" placeholder="请输入机台" />-->
+          <span>{{form.machineTool}}</span>
+        </el-form-item>
+        <el-form-item label="产品:" prop="productNo">
+          <!--          <el-input v-model="form.productNo" placeholder="请输入产品编号" />-->
+          <span>{{form.productName}}--{{form.productSpecifications}}</span>
+        </el-form-item>
+        <el-form-item label="色泽:" prop="colours">
+          <!--          <el-input v-model="form.colours" placeholder="请输入色泽" />-->
+          <span>{{form.colours}}</span>
+        </el-form-item>
+        <el-form-item label="批号" prop="batchNumber">
+          <!--          <el-input v-model="form.batchNumber" placeholder="请输入批号" />-->
+          <span>{{form.batchNumber}}</span>
+        </el-form-item>
+        <el-form-item label="卷数" prop="js">
+          <!--          <el-input v-model="form.js" placeholder="请输入卷数" />-->
+          <span>{{form.js}}</span>
+        </el-form-item>
+        <el-form-item label="净重" prop="standby2">
+          <!--          <el-input v-model="form.standby2" placeholder="请输入净重" />-->
+          <span>{{form.standby2}}</span>
+        </el-form-item>
+        <el-form-item label="丝车" prop="scid">
+          <!--          <el-input v-model="form.standby2" placeholder="请输入净重" />-->
+          <span>{{form.scid}}</span>
+        </el-form-item>
+        <el-form-item label="领料车间" prop="workshop">
+          <span>{{form.workshop}}</span>
+        </el-form-item>
+        <el-form-item label="领料人" prop="recipient">
+<!--          <el-input v-model="form.recipient" placeholder="请输入领料人" />-->
+          <span>{{form.recipient}}</span>
+        </el-form-item>
+        <el-form-item label="确认人" prop="recipient">
+          <span>{{form.confirm}}</span>
+<!--          <el-input v-model="form.confirm" placeholder="请输入领料人" />-->
+        </el-form-item>
+        <!--        <el-form-item label="领料时间" prop="collectTime">-->
+        <!--          <el-input v-model="form.collectTime" placeholder="请输入领料时间" />-->
+        <!--        </el-form-item>-->
+
+        <!--        <el-form-item label="确认时间" prop="confirmTime">-->
+        <!--          <el-input v-model="form.confirmTime" placeholder="请输入确认时间" />-->
+        <!--        </el-form-item>-->
+      </el-form>
+      <div slot="footer" class="dialog-footer">
+        <el-button type="primary" @click="printDetails">打 印</el-button>
+        <el-button @click="cancelprint">取 消</el-button>
+      </div>
+    </el-dialog>
+
+    <div id="printSection" v-show="false">
+      <el-form :model="form" :rules="rules" label-width="80px">
+      <table border="1px" style="width: 400px;height: 650px">
+        <tr>
+          <td colspan="2" style="text-align: center;">流转单</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">机台</td>
+          <td style="text-align: center;">{{form.machineTool}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">产品</td>
+          <td style="text-align: center;">{{form.productName}}---{{form.productSpecifications}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">色泽</td>
+          <td style="text-align: center;">{{form.colours}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">批号</td>
+          <td style="text-align: center;">{{form.batchNumber}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">卷数</td>
+          <td style="text-align: center;">{{form.js}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">净重</td>
+          <td style="text-align: center;">{{form.standby2}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">领料车间</td>
+          <td style="text-align: center;">{{form.workshop}}</td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">送达人</td>
+          <td ></td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">接收人</td>
+          <td ></td>
+        </tr>
+        <tr>
+          <td style="text-align: center;">日期</td>
+          <td style="text-align: right;">(日夜)</td>
+        </tr>
+      </table>
+      </el-form>
+    </div>
   </div>
 </template>
 
@@ -398,8 +510,9 @@ export default {
       // 弹出层标题
       title: "",
       // 是否显示弹出层
-      open: false,
-      opens:false,
+      open: false,//领料
+      opens:false,//确认领料
+      prinopens:false,//打印详情
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -446,6 +559,15 @@ export default {
         this.loading = false;
       });
     },
+    printDetails() {
+      const printContents = document.getElementById('printSection');
+      const originalContents = document.body.innerHTML;
+      document.body.innerHTML = printContents.innerHTML;
+      window.print();
+      document.body.innerHTML = originalContents;
+      window.location.reload();
+      return false;
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -457,6 +579,11 @@ export default {
       this.opens = false;
       this.reset();
     },
+    // 取消按钮
+    cancelprint() {
+      this.prinopens = false;
+      this.reset();
+    },
     // 表单重置
     reset() {
       this.form = {
@@ -528,6 +655,17 @@ export default {
         this.title = "领料出库登记";
       });
     },
+    /** 打印流转单 */
+    handleUpdateConfirmPrint(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getLineSideCabin(id).then(response => {
+        this.form = response.data;
+        this.prinopens = true;
+        this.title = "物料流转转打印";
+      });
+    },
+
     /** 确认出库提交按钮 */
     submitFormqr() {
       this.$refs["form"].validate(valid => {

+ 18 - 5
zkqy-ui/src/views/orderMange/oldOutStock/index.vue

@@ -222,7 +222,7 @@
               <template slot-scope="{ row, $index }">
                 <el-form :model="row" :rules="getRules2($index)" :ref="`boxFormRef${$index}`" :inline="true" style="margin-top: 20px;">
                   <el-form-item prop="oldActualBoxNum">
-                    <el-input v-model="row.oldActualBoxNum"  v-allow-decimal size="mini"  @input="iptChange"></el-input>
+                    <el-input :disabled="row.deleted === 1" v-model="row.oldActualBoxNum"  v-allow-decimal size="mini"  @input="iptChange"></el-input>
                   </el-form-item>
                 </el-form>
               </template>
@@ -231,7 +231,7 @@
               <template slot-scope="{ row, $index }">
                 <el-form :model="row" :rules="getRules1($index)" :ref="`weightFormRef${$index}`" :inline="true" style="margin-top: 20px;">
                   <el-form-item prop="oldActualWeight">
-                    <el-input v-model="row.oldActualWeight" v-allow-decimal size="mini" @input="iptChange"></el-input>
+                    <el-input :disabled="row.deleted === 1" v-model="row.oldActualWeight" v-allow-decimal size="mini" @input="iptChange"></el-input>
                   </el-form-item>
                 </el-form>
               </template>
@@ -406,7 +406,10 @@ export default {
               if (!value) {
                 callback(new Error(this.$t('oldOutStock.validation.weight.required')));
               } else if (currentRow.oldActualWeight>currentRow.totalGrossWeight) {
-                callback(new Error(this.$t('oldOutStock.validation.weight.exceed')));
+                //标识为已出完就不提示
+                if(currentRow.deleted === 0){
+                  callback(new Error(this.$t('oldOutStock.validation.weight.exceed')));
+                }
               } else {
                 callback();
               }
@@ -431,7 +434,10 @@ export default {
               if (!value) {
                 callback(new Error(this.$t('oldOutStock.validation.boxCount.required')));
               } else if (currentRow.oldActualBoxNum>currentRow.totalBoxNum) {
-                callback(new Error(this.$t('oldOutStock.validation.boxCount.exceed')));
+                //标识为已出完就不提示
+                if(currentRow.deleted === 0){
+                  callback(new Error(this.$t('oldOutStock.validation.boxCount.exceed')));
+                }
               } else {
                 callback();
               }
@@ -481,6 +487,7 @@ export default {
       //出库逻辑........
       console.log("出库逻辑.........")
       console.log(row.totalBoxNum,row.oldActualBoxNum,row.totalGrossWeight,row.oldActualWeight)
+      // return;
       if(row.totalBoxNum==row.oldActualBoxNum&&row.oldActualWeight<row.totalGrossWeight){
         this.$message.warning(this.$t('oldOutStock.message.boxCountExceed'));
         return;
@@ -538,7 +545,13 @@ export default {
         let resOut= await oldInventoryGoOut(payLoad)
         console.log(resOut)
         if(resOut.code==200){
-          this.tableData[index].deleted = 1;//出库成功后出库按钮隐藏
+          console.log(row.totalBoxNum,row.oldActualBoxNum,row.totalGrossWeight,row.oldActualWeight)
+          this.tableData[index].totalBoxNum = this.tableData[index].totalBoxNum-row.oldActualBoxNum;//减箱数
+          this.tableData[index].totalGrossWeight = (this.tableData[index].totalGrossWeight-row.oldActualWeight).toFixed(2);//减重量
+          if(this.tableData[index].totalBoxNum <=0 && this.tableData[index].totalGrossWeight<=0){
+            this.tableData[index].deleted = 1;//出库成功后出库按钮隐藏
+          }
+
           this.$message.success(this.$t('oldOutStock.message.outStockSuccess'));
         }else {
           this.$message.error(this.$t('oldOutStock.message.outStockFailed'));

+ 1 - 1
zkqy-ui/src/views/orderMange/operationLog/index.vue

@@ -105,7 +105,7 @@
     <el-table v-loading="loading" :data="operationLogList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="任务号" align="center" prop="standby3" />
+<!--      <el-table-column label="任务号" align="center" prop="standby3" />-->
       <el-table-column label="产品编号" align="center" prop="productNo" />
       <el-table-column label="品名" align="center" prop="productName" />
       <el-table-column label="产品规格" align="center" prop="productSpecifications" />