南骏 池
2025-05-27 6b2633d1df4d4e84ee5c86aecf3522d22d01adf3
1.期初打印
已添加3个文件
268 ■■■■■ 文件已修改
H5/Js/QcPrint.js 147 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/QcPrint.aspx 107 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/QcPrint.aspx.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/QcPrint.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,147 @@
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            userInfo: {
                "loginGuid": '',
                "loginAccount": '',
            },
            num:"",
            sectionCode:"",
            selectKey: "",
            barcode:"",
            ItemBlDetail:[],
            modeInfo: [],
            active: 0,
            show: false,
            actions: [],
            barInfo: [],
            depotsInfo: "",//仓库信息
            orgInfo: "",//组织信息
            orgID: "",//组织id
            itemInfo: [],//总物料信息
            itemNo:"",//选中物料编码
            printItemInfo: [],//选中物料信息
        }
    },
    mounted() {
        var that = this;
        this.userInfo = {
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
    },
    methods: {
        getInfo() {
            this.show = true;
            var that = this;
            if (!that.sectionCode) {
                this.$toast.fail("库位编码不能为空");
                that.isLoading = false;
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Inventory/GetItemsList', {
                selectKey: that.selectKey,
                orgId: that.orgID,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        if (json.data.tbBillList.length <= 0) {
                            that.$toast.fail("没有可用的数据");
                        } else {
                            that.itemInfo = json.data.tbBillList;
                            that.actions = json.data.tbBillList.map(item => {
                                return {
                                    name: item.wlInfo  // æ‹¼æŽ¥å­—段
                                };
                            });
                        }
                    }
                    else {
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        onSelect(item) {
            // é»˜è®¤æƒ…况下点击选项时不会自动收起
            // å¯ä»¥é€šè¿‡ close-on-click-action å±žæ€§å¼€å¯è‡ªåŠ¨æ”¶èµ·
            this.show = false;
            if (item.name.includes('---')) {
                this.itemNo = item.name.split('---')[0];
            } else {
                // å¤„理没有分隔符的情况,比如设置为空或者原字符串
                this.itemNo = item.name; // æˆ–者 ''
            }
            this.GetMesItemByItemNo();
            //this.$toast(item.name);
        },
        GetMesItemByItemNo() {
            var that = this;
            // èŽ·å–åŒ¹é…ç»“æžœæ•°ç»„
            const filtered = that.itemInfo.filter(item =>
                item.item_no === that.itemNo
            );
            if (filtered.length === 0) {
                that.$toast.fail('没有找到匹配的物料信息');
                that.printItemInfo = {}; // æ¸…空数据
            } else {
                // å–第一个匹配项赋值给对象
                that.printItemInfo = filtered[0];
                //console.log('展示数据:', that.printItemInfo);
                that.$refs.num.focus();
            }
        },
        getSectionCode() {
            var that = this;
            if (!that.sectionCode) {
                this.$toast.fail("库位编码不能为空");
                that.isLoading = false;
                return;
            }
            // æ£€æŸ¥å¯¹è±¡æ˜¯å¦åŒ…含有效数据
            if (!that.printItemInfo || !that.printItemInfo.item_no) {
                that.$toast.fail("请先选择有效物料信息");
                that.isLoading = false;
                return;
            }
            that.AxiosHttp("post", 'Inventory/GetDepoptsInfo', {
                sectionCode: that.sectionCode
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                    }
                    else {
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
    }
})
H5/QcPrint.aspx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,107 @@
<%@ Page Title="" Language="C#" MasterPageFile="~/Mst.master" AutoEventWireup="true" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
        <style>
            .bg-info {
                background-color: #fff;
            }
        </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
        <van-nav-bar
          title="期初打印"
          left-text="返回"
          left-arrow
          @click-left="GoBack()"
        ></van-nav-bar>
        <div>
        <van-cell-group>
        <van-field
            ref="sectionCode"
        value=""
        label="库位编码"
        clearable
            v-model="sectionCode"
            @keyup.enter.native="getSectionCode"
            <%--@change="getSectionCode"--%>
        :right-icon-size="19"
        placeholder="库位编码"
<%--        v-focus.noKeyboard--%>
        ></van-field>
        <van-field
            ref="depotsInfo"
            v-model="depotsInfo"
        value=""
        label="仓库名称"
        clearable
        placeholder="仓库名称"
        :right-icon-size="19"
            disabled
    ></van-field>
        <van-field
            ref="orgInfo"
            v-model="orgInfo"
        value=""
        label="库存组织"
        clearable
        placeholder="库存组织"
        :right-icon-size="19"
            disabled
    ></van-field>
    <van-field
        ref ="selectKey"
    value=""
    label="物料查询"
    clearable
        placeholder="请输入编码/名称进行查询"
    :right-icon-size="19"
        v-model="selectKey"
        @keyup.enter.native="GetMesItemBlDetailByBillNo"
    ><template #button>
    <van-button size="small" type="info" plain @click="getInfo" >选择</van-button>
    </template></van-field>
       <van-field
          value=""
               v-model="printItemInfo.item_no"
          label="物料编码"
          placeholder=""
          disabled
        ></van-field>
           <van-field
          value=""
               v-model="printItemInfo.item_name"
          label="物料名称"
          placeholder=""
          disabled
        ></van-field>
        <van-field
          value=""
               v-model="printItemInfo.item_model"
          label="物料规格"
          placeholder=""
          disabled
        ></van-field>
        <van-field
            ref ="num"
        value=""
            v-model="num"
        label="数量"
        placeholder="数量"
    ></van-field>
</van-cell-group>
    </div>
    <van-button type="primary" @click="16718-00000B2025051690001" >确认打印</van-button>
    <van-action-sheet v-model="show" :actions="actions" @select="onSelect" ></van-action-sheet>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
    <comloading  v-if="isLoading"></comloading>
  <%--<comback ></comback>--%>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
 <script src="Js/QcPrint.js?<%=11111 %>"></script>
</asp:Content>
H5/QcPrint.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_Scbl : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}