cdk
昨天 65e595c85e7ff31252c651f05949b711209f45ec
称重逻辑调整
已修改2个文件
已添加3个文件
152 ■■■■■ 文件已修改
H5/Cpdbsj.aspx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Cz.aspx 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Cz.aspx.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Cpbdsj.js 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Cz.js 70 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Cpdbsj.aspx
@@ -266,5 +266,5 @@
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
    <script src="Js/Cpbdsj.js?<%=121114211526 %>"></script>
    <script src="Js/Cpbdsj.js?<%=12152156 %>"></script>
</asp:Content>
H5/Cz.aspx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,47 @@
<%@ Page Title="称重" Language="C#" MasterPageFile="~/Mst.master" AutoEventWireup="true" CodeFile="Cpdbsj.aspx.cs" Inherits="H5_Cpdbsj" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
  <style>
    .content-wrapper { padding-bottom: 0.6rem; }
  </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <div class="content-wrapper">
        <van-nav-bar
            title="称重"
            left-text="返回"
            left-arrow
            @click-left="GoBack()">
        </van-nav-bar>
        <div class="mySolid">
            <van-cell-group>
                <van-field
                    ref="XBar"
                    v-model="XBar"
                    label="条码"
                    placeholder="请扫码或回车"
                    clearable
                    @keyup.enter.native="getWeight"
                    autofocus="true">
                </van-field>
                <van-field
                    ref="Weight"
                    v-model="Weight"
                    label="重量"
                    readonly>
                </van-field>
            </van-cell-group>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
    <comloading v-if="isLoading"></comloading>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
    <script src="Js/Cz.js?<%=12114211526 %>"></script>
</asp:Content>
H5/Cz.aspx.cs
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class H5_Cpbd : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}
H5/Js/Cpbdsj.js
@@ -28,6 +28,7 @@
                //}
            ],
            DAA001: [],
            DAA015: "",
            show: false,//列表展示
            actions: [],//列表的值
            xtName: "",//线体名称
@@ -71,6 +72,8 @@
                        console.log(json.data.tbBillList.kbBarInfo[0].agvPostion);
                        that.KbBarInfo = json.data.tbBillList.kbBarInfo[0];
                        that.DAA001 = that.KbBarInfo.daA001;
                        that.DAA015 = that.KbBarInfo.daA015;
                        console.log(that.KbBarInfo)
                        that.KbBarMxInfo = json.data.tbBillList.kbBarMxInfo;
                        that.$refs.XBar.focus();
                        that.XbarInfo = [];
@@ -202,7 +205,6 @@
                        if (that.XbarInfo.length >= that.Xvalue) {
                            that.$refs.LsBar.focus();
                        }
                    }
                    else {
                        that.$playSound('error');
@@ -313,6 +315,21 @@
                if (matchedItem.is_hedui === "1") {
                    that.$toast("已核对");
                } else {
                    console.log(that.DAA015);
                    if ((that.DAA015) === "462") {
                        that.$set(matchedItem, 'is_hedui', "1");
                        // å¯æ ¹æ®éœ€è¦è®¾ç½® weight,这里保持为空/不变
                        that.$playSound('success');
                        that.$notify({ type: 'success', message: "核对成功" });
                        that.LsBar = "";
                        // æ£€æŸ¥æ˜¯å¦æ‰€æœ‰è¡Œéƒ½å·²æ ¸å¯¹
                        const allChecked = that.XbarInfo.every(item => item.is_hedui === "1");
                        if (allChecked && that.XbarInfo.length > 0 && that.XbarInfo.length === that.Xvalue) {
                            that.submitAllChecked();
                        }
                        // ç›´æŽ¥è¿”回,不调用 GetWeightByXt
                        return;
                    }
                    that.AxiosHttp("post", 'Womdaa/GetWeightByXt', {
                        LsBar: that.LsBar,
H5/Js/Cz.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,70 @@
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            XBar: '',     // æ‰«åˆ°çš„æ¡ç 
            Weight: '',   // æ˜¾ç¤ºçš„重量
            userInfo: { loginGuid: '', loginAccount: '' } // å¦‚需传 userName
        }
    },
    mounted() {
        try {
            var info = this.GetLoginInfor();
            if (info) {
                this.userInfo.loginGuid = info.loginGuid || '';
                this.userInfo.loginAccount = info.loginAccount || '';
            }
            // åˆå§‹å°†ç„¦ç‚¹æ”¾åˆ°æ¡ç è¾“å…¥
            this.$nextTick(() => this.$refs.XBar && this.$refs.XBar.focus());
        } catch (e) {
            // ignore
        }
    },
    methods: {
        // æ‰«ç åŽè°ƒç”¨åŽç«¯èŽ·å–é‡é‡
        getWeight() {
            var that = this;
            if (!that.XBar || that.XBar.toString().trim().length === 0) {
                that.$playSound && that.$playSound('error');
                that.$toast && that.$toast.fail("条码不能为空");
                that.$refs.XBar && that.$refs.XBar.focus();
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/GetWeightByXt_new', {
                LsBar: that.XBar,
                userName: that.userInfo.loginAccount || ''
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json && json.status == 0) {
                        // åŽç«¯è¿”回的重量字段(沿用现有代码习惯)
                        var weight = (json.data && json.data.tbBillList && json.data.tbBillList.weight) || '';
                        that.Weight = weight;
                        that.$playSound && that.$playSound('success');
                        that.$notify && that.$notify({ type: 'success', message: "称重成功" });
                    } else {
                        that.Weight = '';
                        that.$playSound && that.$playSound('error');
                        var msg = (json && json.message) ? json.message : "称重失败";
                        that.$dialog && that.$dialog.alert({ message: msg, theme: 'round-button' });
                    }
                    that.isLoading = false;
                    // æ¸…空并聚焦准备下一个扫码
                    that.XBar = '';
                    that.$nextTick(() => that.$refs.XBar && that.$refs.XBar.focus());
                })
                .catch(function () {
                    that.isLoading = false;
                    that.Weight = '';
                    that.$playSound && that.$playSound('error');
                    that.$dialog && that.$dialog.alert({ message: "网络错误,请重试!", theme: 'round-button' });
                    that.XBar = '';
                    that.$nextTick(() => that.$refs.XBar && that.$refs.XBar.focus());
                });
        }
    }
});