南骏 池
2025-04-14 84073105b42601bf08a45b58a3781580c922199f
1.产品绑定核对送检
已修改4个文件
218 ■■■■■ 文件已修改
H5/Cpbd.aspx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Cpdbsj.aspx 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Cpbd.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Cpbdsj.js 170 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Cpbd.aspx
@@ -154,5 +154,5 @@
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
    <script src="Js/Cpbd.js?<%=121112 %>"></script>
    <script src="Js/Cpbd.js?<%=1211121 %>"></script>
</asp:Content>
H5/Cpdbsj.aspx
@@ -51,9 +51,6 @@
        flex: 1; /* 等分剩余空间 */
        min-width: 0; /* 防止内容溢出 */
    }
</style>
</asp:Content>
@@ -85,14 +82,16 @@
                    <div class="si-status__left">
                      <span class="si-status__label">可装数</span>
                    </div>
                    <div  class="si-status__right">{{KbBarInfo.oldqty}}</div>
                    <div  class="si-status__right">{{KbBarInfo.oldqty??0}}</div>
                  </div>
                  <div class="si-status-box si-status--error">
                    <div class="si-status__left">
                      <span class="si-status__label">待装数</span>
                    </div>
                    <div class="si-status__right">{{KbBarInfo.ySum}}</div>
                    <div class="si-status__right">
                      {{ ((+(KbBarInfo.oldqty ?? 0) - +(KbBarInfo.ySum ?? 0)) || 0) }}
                    </div>
                  </div>
                </div>
                
@@ -117,10 +116,21 @@
                </van-field>
                
                <van-field
                    ref="LsBar"
                    v-model="LsBar"
                    ref="DAA001"
                    v-model="DAA001"
                    label="指令工单"
                    placeholder="指令工单"
                    autofocus="true"
                    readonly
                    >
                </van-field>
                <van-field
                    ref="XBar"
                    v-model="XBar"
                    label="箱条码"
                    placeholder="请扫外箱码"
                    @keyup.enter.native="getXBarInfo"
                    autofocus="true">
                </van-field>
@@ -129,16 +139,17 @@
                    v-model="LsBar"
                    label="产品条码"
                    placeholder="请扫产品条码"
                    @keyup.enter.native="checkProductBarcode"
                    autofocus="true">
                </van-field>
                
                <van-field
<%--                <van-field
                    ref="LsBar"
                    v-model="LsBar"
                    label="线别"
                    placeholder="请选择线别"
                    autofocus="true">
                </van-field>
                </van-field>--%>
               <!-- 修改后的按钮容器 -->
                <div class="button-container">
                  <van-button 
@@ -148,6 +159,7 @@
                  <van-button 
                    type="info" 
                    class="action-button submit-button"
                    @click.native="handleSubmit"
                  >送检</van-button>
                </div>
@@ -162,8 +174,11 @@
                    <van-col span="7" class="text-left padding-left">规格</van-col>
                    <van-col span="3" >数量</van-col>
                </van-row>
                <van-row v-for="(itm,index) in KbBarMxInfo" :key="index">
                    <van-col span="7" class="text-left padding-left" >{{itm.iteM_BARCODE}}</van-col>
                <van-row
                    v-for="(itm,index) in XbarInfo"
                    :key="index"
                    :style="{ background: itm.is_hedui === '1' ? '#e8f5e9 !important' : 'transparent' }">
                    <van-col span="7" class="text-left padding-left">{{itm.iteM_BARCODE}}</van-col>
                    <van-col span="7" class="text-left padding-left">
                        <div class="blue-text">{{itm.item_no}}</div>
                        <div>{{itm.item_name}}</div>
@@ -171,7 +186,6 @@
                    <van-col span="7" class="text-left padding-left">
                        <div>{{itm.item_model}}</div>
                    </van-col>
                    <van-col span="3" class="blue-text">{{itm.quantity}}</van-col>
                </van-row>
            </van-tab>
@@ -205,5 +219,5 @@
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
    <script src="Js/Cpbdsj.js?<%=11111 %>"></script>
    <script src="Js/Cpbdsj.js?<%=111111111 %>"></script>
</asp:Content>
H5/Js/Cpbd.js
@@ -80,13 +80,13 @@
                        that.$notify({ type: 'success', message: json.message });
                        that.$refs.ZsBar.focus();
                        that.ZsBar = null;
                        that.ZsBar = null;
                        that.LsBar = null;
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$refs.ZsBar.focus();
                        that.ZsBar = null;
                        that.ZsBar = null;
                        that.LsBar = null;
                    }
                    
                    that.isLoading = false;
@@ -96,7 +96,7 @@
                    that.$toast.fail("网络错误,请重试!");
                    that.$refs.ZsBar.focus();
                    that.ZsBar = null;
                    that.ZsBar = null;
                    that.LsBar = null;
                });
        },
        //打印机注释
H5/Js/Cpbdsj.js
@@ -9,12 +9,14 @@
            },
            KbBar: "",//卡板条码
            LsBar: "",//后盖流水条码
            XBar: "",//箱条码
            UserName: Cookies.get('loginName'),//用户名称
            KbBarInfo: [],
            KbBarMxInfo: [],
            GX: "G007:核对送检",
            Xvalue:4,
            ItemDetail:[],
            XbarInfo: [],
            DAA001: [],
        }
    },
    mounted() {
@@ -35,10 +37,12 @@
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$refs.LsBar.focus();
                        that.KbBarInfo = json.data.tbBillList.kbBarInfo[0];
                        that.DAA001 = that.KbBarInfo.daA001;
                        that.KbBarMxInfo = json.data.tbBillList.kbBarMxInfo;
                        that.$refs.XBar.focus();
                        that.XbarInfo = [];
                        that.XBar = "";
                    }
                    else {
                        that.$toast.fail(json.message);
@@ -50,8 +54,66 @@
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$refs.KbBar.focus();
                    that.KbBar = "";
                });
        },
        getXBarInfo() {
            var that = this;
            if (that.KbBar.length <= 0) {
                that.$toast.fail("卡板条码不能为空!");
                that.$refs.KbBar.focus();
                that.XBar = "";
                return;
            }
            if (that.DAA001.length <= 0) {
                that.$toast.fail("指令工单不能为空!");
                that.$refs.KbBar.focus();
                that.XBar = "";
                return;
            }
            // 检查是否超过装箱数
            if (that.XbarInfo.length >= that.Xvalue) {
                that.$toast.fail(`已达到装箱数限制(${that.Xvalue})`);
                that.XBar = "";
                return;
            }
            // 检查条码是否已存在
            const isExist = that.XbarInfo.some(item => item.iteM_BARCODE === that.XBar);
            if (isExist) {
                that.$toast.fail("该箱条码已存在,请勿重复扫描");
                that.XBar = "";
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/getXBarInfo', {
                Kbbarcode: that.KbBar,
                DAA001: that.DAA001,
                Xbarcode: that.XBar
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.XbarInfo.push(json.data.tbBillList.xBarInfo[0]);
                        that.$refs.XBar.focus();
                        that.XBar = "";
                    }
                    else {
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                });
        },
        productBinding() {
            var that = this;
            if (that.ZsBar.length <= 0) {
@@ -111,5 +173,107 @@
        //onPrinterSelected(value) {
        //    console.log('当前选中的打印机编号:', value);
        //},
        checkProductBarcode() {
            var that = this;
            if (!that.LsBar) {
                that.$toast.fail("请输入产品条码");
                return;
            }
            // 在XbarInfo中查找匹配的条码
            const matchedItem = that.XbarInfo.find(item =>
                item.iteM_BARCODE === that.LsBar
            );
            if (matchedItem) {
                if (matchedItem.is_hedui === "1") {
                    that.$toast("已核对");
                } else {
                    that.$set(matchedItem, 'is_hedui', "1");
                    that.$notify({ type: 'success', message: "核对成功" });
                    that.LsBar = "";
                    // 检查是否所有行都已核对
                    const allChecked = that.XbarInfo.every(item => item.is_hedui === "1");
                    if (allChecked && that.XbarInfo.length > 0) {
                        that.submitAllChecked();
                    }
                }
            } else {
                that.$toast.fail("未找到匹配的箱条码");
            }
            that.LsBar = ""; // 清空输入框
        },
        // 新增方法:提交所有已核对的数据
        submitAllChecked() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/submitAllChecked', {
                XbarInfo: that.XbarInfo,
                KbBar: that.KbBar,
                userName: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$notify({ type: 'success', message: json.message });
                        that.getKbBarInfo();
                    } else {
                        that.$toast.fail(json.message);
                        that.XbarInfo = [];
                        that.XBar = "";
                        that.LsBar = "";
                        that.$refs.XBar.focus();
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("绑定失败,请重试!");
                });
        },
        handleSubmit() {
            var that = this;
            if (!that.KbBar) {
                that.$toast.fail("请先扫描卡板条码");
                return;
            }
            // 计算可装数和已装数
            const oldqty = +(that.KbBarInfo.oldqty ?? 0);
            const ySum = +(that.KbBarInfo.ySum ?? 0);
            if (oldqty !== ySum) {
                that.$toast.fail(`装板未完成,待装数:${oldqty - ySum}`);
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/submitInspection', {
                KbBar: that.KbBar,
                userAccount: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.$notify({ type: 'success', message: json.tbBillList.message });
                        // 清空数据
                        that.KbBar = "";
                        that.XbarInfo = [];
                        that.KbBarInfo = [];
                        that.$refs.KbBar.focus();
                    } else {
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("提交失败,请重试!");
                    that.$refs.KbBar.focus();
                });
        },
    }
})