南骏 池
2025-04-21 41e334380166d820c41b7033df441d43e5654a23
1.生产退库功能实现
已添加3个文件
334 ■■■■■ 文件已修改
H5/Js/Sctk.js 209 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Sctk.aspx 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Sctk.aspx.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Sctk.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,209 @@
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            userInfo: {
                "loginGuid": '',
                "loginAccount": '',
            },
            scanFormData: {
                itemOutNo: "",
                barcode: "",
                itemNo: "",
                quantity:0
            },
            formData: {},
            ItemDetail: [],
            codeTableData: [],
            itemOutNoList: [],
            itemOutNoStr: [],
            invItemOutId: '',
            barMessage: "",
            Message: "",
            messageCenter: {},
            messageId: 0,
            show: false,
        }
    },
    mounted() {
        var that = this;
        this.userInfo = {
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
        that.beginload();
        //that.show = false;
    },
    methods: {
        getItemOutNo() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesSctk/GetMesSctkSq', {
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.itemOutNoList = json.data.tbBillList;
                        that.itemOutNoStr = that.itemOutNoList.map(s => {
                            return { name: s.billNo }
                        });
                        that.show = true;
                    }
                    else {
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        beginload() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesSctk/GetMesSctkSq', {
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.itemOutNoList = json.data.tbBillList;
                    }
                    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;
            //let staf = this.stafList.filter(it => it.staffName === item.name);
            this.scanFormData.itemOutNo = item.name;
            let itemOut = this.itemOutNoList.filter(it => it.billNo == item.name);
            this.invItemOutId = itemOut[0].id;
            this.getItem();
            //var that = this;
            //that.isLoading = true;
            //that.AxiosHttp("post", 'MesInvItemOuts/GetPage', {
            //    billNo: this.scanFormData.itemOutNo,
            //    pageIndex: 1,
            //    limit: 1,
            //}, false)
            //    .then(function (res) {
            //        var json = res;
            //        if (json.status == 0) {
            //            that.formData = json.data.tbBillList[0];
            //            that.formData.billTypeName = "出库单";
            //            that.getScanBarcode();
            //        }
            //        else {
            //            that.$toast.fail(json.message);
            //        }
            //        that.isLoading = false;
            //    })
            //    .catch(function (error) {
            //        that.isLoading = false;
            //        that.$toast.fail("网络错误,请重试!");
            //        console.log(error);
            //    });
        },
        getItem() {
            var that = this;
            that.isLoading = true;
            let itemOut = this.itemOutNoList.filter(it => it.billNo == that.scanFormData.itemOutNo);
            this.invItemOutId = itemOut[0].id;
            that.AxiosHttp("post", 'MesSctk/GetSumItem', {
                id: that.invItemOutId,
                billNo: that.scanFormData.itemOutNo,
                barcode: that.scanFormData.barcode,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.ItemDetail = json.data.tbBillList;
                        that.$refs.barcode.focus();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.ItemDetail = [];
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.ItemDetail = [];
                });
        },
        SaveBarCodes() {
            //if (!this.scanFormData.barcode) {
            //}
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesSctk/ScanCode', {
                billNo: that.scanFormData.itemOutNo,
                userName: that.userInfo.loginAccount,
                barcode: that.scanFormData.barcode,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        //if (json.data.tbBillList) {
                        //    //this.ToErp();
                        //} else {
                        //}
                        that.scanFormData.quantity = json.data.tbBillList.barcodeNum
                        that.getItem();
                        that.$refs.barcode.focus();
                        that.scanFormData.barcode = null;
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$refs.barcode.focus();
                        that.scanFormData.barcode = null;
                    }
                    that.$notify({ type: 'success', message: json.message });
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                    that.$refs.barcode.focus();
                });
        }
    }
})
H5/Sctk.aspx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,111 @@
<%@ Page Title="生产退库" Language="C#" MasterPageFile="~/Mst.master" AutoEventWireup="true" CodeFile="Sctk.aspx.cs" Inherits="H5_Scll" %>
<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">
        <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
      value=""
      label="退库申请"
      clearable
       placeholder="选择退库申请"
      :right-icon-size="19"
        v-model="scanFormData.itemOutNo"
      @keyup.enter.native="getItem"
       v-focus.noKeyboard
    ><template #button>
      <van-button size="small" type="info" plain @click="getItemOutNo" >选择</van-button>
    </template></van-field>
 <van-field
   ref="barcode"
   v-model="scanFormData.barcode"
  label="物料条码"
   clearable
 placeholder="请扫描物料条码"
  :right-icon-size="19"
  v-focus.noKeyboard
     @keyup.enter.native="SaveBarCodes"
  <%--@change="SaveBarCodes"--%>
></van-field>
   <van-field
  v-model="scanFormData.itemNo"
  label="物料编码"
  placeholder="物料编码"
  disabled
></van-field>
   <van-field
  v-model="scanFormData.quantity"
  label="数量"
  placeholder="数量"
  disabled
></van-field>
</van-cell-group>
    </div>
  <van-tabs color="#000" title-active-color="#0283EF">
    <van-tab title="待发物料" class="mySolid font">
        <van-row>
            <van-col span="8" class="text-left padding-left">物料</van-col>
            <van-col span="8" class="text-left padding-left">规格</van-col>
            <van-col span="3">待扫</van-col>
            <van-col span="5">推荐库位</van-col>
        </van-row>
        <van-row v-for="(itm,index) in ItemDetail.items" :key="index">
            <van-col span="8" class="text-left padding-left">
                <div class="blue-text">{{itm.itemNo}}</div>
                <div>{{itm.itemName}}</div>
            </van-col>
            <van-col span="8" class="text-left padding-left">
                <div>{{itm.itemModel}}</div>
            </van-col>
            <van-col span="3" class="blue-text">{{itm.dsQty}}</van-col>
            <van-col span="5">{{itm.recoKw}}</van-col>
        </van-row>
    </van-tab>
    <van-tab title="已领物料" class="mySolid font">
        <van-row>
            <van-col span="8" class="text-left padding-left">物料</van-col>
            <van-col span="8" class="text-left padding-left">规格</van-col>
            <van-col span="3">需领数</van-col>
            <van-col span="5">已领数</van-col>
        </van-row>
        <van-row v-for="(itm,index) in ItemDetail.ysitems" :key="index">
            <van-col span="8" class="text-left padding-left">
                <div class="blue-text">{{itm.itemNo}}</div>
                <div>{{itm.itemName}}</div>
            </van-col>
            <van-col span="8" class="text-left padding-left">
                <div>{{itm.itemModel}}</div>
            </van-col>
            <van-col span="3">{{itm.fQty}}</van-col>
            <van-col span="5" class="blue-text">{{itm.sQty}}</van-col>
        </van-row>
    </van-tab>
</van-tabs>
<%--    <van-button type="primary" @click="SaveBarCodes" >确认</van-button>--%>
    <van-action-sheet v-model="show" :actions="itemOutNoStr" @select="onSelect" ></van-action-sheet>
                </div>
</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/Sctk.js?<%=11 %>"></script>
</asp:Content>
H5/Sctk.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_Scll : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
    }
}