南骏 池
2025-02-11 889633898125d8476af87bb5cc246250f02e697f
1.生产补料,超领优化
2.成品入库界面和初步功能
已添加3个文件
已修改3个文件
373 ■■■■■ 文件已修改
H5/Default.aspx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Scbl.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/cprk.js 263 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Scbl.aspx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/cprk.aspx 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/cprk.aspx.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Default.aspx
@@ -19,7 +19,7 @@
            <template>
             <van-grid :column-num="3" :border="true">
              <van-grid-item v-for="(item1,index1) in itm.child" :key="index1"  icon="photo" text="标题" >
                <a class="font text-center" :href="item1.path+'?tabIdx='+index">
                <a class="font text-center" :href="item1.path+'&tabIdx='+index">
                  <img :src="item1.icoimg" alt="" class="img" style=" display:inline-block" />
                  <span style="display:inline-block"> {{item1.pageView}}</span>
               </a>
@@ -36,5 +36,5 @@
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" runat="Server">
   <script src="/H5/Js/comLoading.js"></script>
    <script src="Js/comWebNav.js"></script>
   <script src="Js/Default.js?<%=12 %>"></script>
   <script src="Js/Default.js?<%=121 %>"></script>
</asp:Content>
H5/Js/Scbl.js
@@ -8,10 +8,12 @@
                "loginAccount": '',
            },
            sms: "",
            num:"",
            billNo:"",
            num: "",
            type: "",
            billNo: "",
            selectType: "",
            daa001: "",
            barcode:"",
            barcode: "",
            ItemBlDetail:[],
            modeInfo: [],
            active: 0,
@@ -25,6 +27,8 @@
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
        this.type = this.Request("type");
        selectType = this.type == "bl" ? selectType = "生产补料" : selectType = "生产超领";
    },
    methods: {
        getInfo() {
@@ -32,8 +36,11 @@
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesItemBl/GetSCBLBillNo', {
                type: "生产补料",
                type: selectType,
            }, false)
                .then(function (res) {
                    var json = res;
@@ -77,7 +84,7 @@
            that.isLoading = true;
            that.AxiosHttp("post", 'MesItemBl/GetMesItemBlDetailByBillNo', {
                billNo: that.billNo,
                type: "生产补料"
                type: selectType
            }, false)
                .then(function (res) {
                    var json = res;
@@ -132,7 +139,8 @@
                userName: that.userInfo.loginAccount,
                barcode: that.barcode,
                blNo: that.billNo,
                billNo: that.daa001
                billNo: that.daa001,
                type: selectType
            }, false)
                .then(function (res) {
                    var json = res;
@@ -201,7 +209,8 @@
                barcode: that.barcode,
                blNo: that.billNo,
                billNo: that.daa001,
                num: that.sms
                num: that.sms,
                type: selectType
            }, false)
                .then(function (res) {
                    var json = res;
H5/Js/cprk.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,263 @@
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            userInfo: {
                "loginGuid": '',
                "loginAccount": '',
            },
            formData: {
                sectionCode: "",
                barcode: "",
                itemNo: "",
                sumQuantity:0
            },
            itemInsFormData: {},
            tableData: [],
            itemTableData: [],
            barMessage: "",
            Message: "",
            messageCenter: {},
            messageId: 0,
            showClearIcon: false,
            focus1: true,
            focus2: false,
            isActive: 0,
            index: 0,
            currentTab: 0,
            contentScrollW: 0, // å¯¼èˆªåŒºå®½åº¦
            scrollLeft: 0, // æ¨ªå‘滚动条位置
            fullHeight: "",
        }
    },
    mounted() {
        var that = this;
        this.userInfo = {
            loginGuid: this.GetLoginInfor().loginGuid,
            loginAccount: this.GetLoginInfor().loginAccount,
        };
    },
    methods: {
        getModel() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesDepotSections/GetSectionName', {
                sectionCode: that.formData.sectionCode
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        //that.formData.sectionCode = json.data.tbBillList;
                        that.$refs.barcode.focus();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.formData.sectionCode = null;
                        that.$refs.sectionCode.focus();
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                    that.formData.sectionCode = null;
                    that.$refs.sectionCode.focus();
                });
        },
        getScan() {
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'MesInvItemInCDetails/SaveBarCodes', {
                sectionCode: that.formData.sectionCode,
                userName: that.userInfo.loginAccount,
                barcode: that.formData.barcode,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.formData.itemNo = json.data.tbBillList.itemNo;
                        that.formData.sumQuantity = json.data.tbBillList.sumQuantity;
                        that.itemInsFormData = json.data.tbBillList.itemIns;
                        that.itemTableData = json.data.tbBillList.itemInDetails;
                        that.tableData = json.data.tbBillList.invItemInCDetails;
                        that.barMessage = json.data.tbBillList.message;
                        that.$refs.barcode.focus();
                        that.formData.barcode = null;
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$refs.barcode.focus();
                        that.formData.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();
                });
        },
        getChaiFen() {
            var that = this;
            if (that.modeInfo.daa001.length <= 0) {
                that.$toast.fail("领料单号不能为空!");
                return;
            }
            if (that.scanInfo.splitNum * 1 <= 0) {
                that.$toast.fail("拆分数量不能为空!");
                return;
            }
            if (that.scanInfo.barcode.length * 1 <= 0) {
                that.$toast.fail("物料条码不能为空!");
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/ScanCode', {
                daa001: that.modeInfo.daa001,
                userName: that.userInfo.loginAccount,
                barcode: that.modeInfo.barcode,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                      //  that.modeInfo = json.data.tbBillList;
                    }
                    else {
                        that.$toast.fail(json.message);
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    console.log(error);
                });
        },
        cleraCode() {
            this.formData.sectionCode = null;
        },
        ToErp() {
            this.Message = "";
            if (this.tableData.length == 0) {
                this.Message = "条码为空,无法推送ERP";
                return;
            }
            let userName = this.$loginInfo.account;
            this.Message = "正在推送采购入库单[" + this.itemInsFormData.billNo + "]到ERP....  è¯·ç¨åŽ";
            this.$post({
                url: '/MesInvItemInCDetails/SaveMessageCenter',
                data: {
                    id: this.itemInsFormData.id,
                    userName: userName,
                    billNo: this.itemInsFormData.billNo,
                    type: "A"
                }
            }).then(res => {
                this.messageCenter = res.data.tbBillList;
                this.sendPostRequest(this.messageCenter);
            });
        },
        sendPostRequest(e) {
            this.$sendPostRequest(e).then(res => {
                //记录一下MES的回调
                this.saveMessage("A", {
                    url: this.$store.state.serverInfo.serverAPI + '/MesInvItemInCDetails/Audit',
                    data: { billNo: this.itemInsFormData.billNo }
                });
                if (res.state == 200) {
                    this.Message += "  æ­£åœ¨æ‰§è¡ŒMES回调!请稍后"
                    //执行MES回调
                    this.audit();
                } else {
                    this.Message += " ERP返回信息:" + res.msg;
                    //更新接口记录表
                    this.messageCenter.result = 0;
                    this.messageCenter.dealWith = 0;
                    this.messageCenter.status = 1;
                    this.messageCenter.resultData = res.msg;
                    this.updateMessage(this.messageCenter);
                }
            });
        },
        //审核的MES回调
        audit() {
            this.$post({
                url: '/MesInvItemInCDetails/Audit',
                data: {
                    id: this.itemInsFormData.id,
                    billNo: this.itemInsFormData.billNo
                }
            }).then(res => {
                if (res.data.tbBillList) {
                    this.Message += "  å®¡æ ¸æˆåŠŸï¼";
                } else {
                    this.Message += " å®¡æ ¸å¤±è´¥ï¼š";
                }
                let entity = {
                    id: this.messageId,
                    resultData: JSON.stringify(res.data),
                    dealWith: res.data.tbBillList ? 1 : 0,
                    result: res.data.tbBillList ? 1 : 0,
                }
                this.updateMessage(entity);
            });
        },
        saveMessage(s, item) {
            let title = "采购入库单" + this.itemInsFormData.billNo + "审核";
            let tableName = "MES_INV_ITEM_INS_" + s;
            if (s == "B") {
                title = "采购入库单" + this.itemInsFormData.billNo + "反审核";
            }
            let entity = {
                data: JSON.stringify(item.data),
                url: item.url,
                pid: this.messageCenter.id,
                dealWith: 0,
                result: 0,
                status: 1,
                seq: this.messageCenter.seq + 1,
                createBy: this.$loginInfo.account,
                title: title,
                route: this.itemInsFormData.billNo,
                tableName: tableName,
                contentType: "application/json",
            }
            this.$post({
                url: "/MessageCenter/Insert",
                data: entity
            }).then(res => {
                this.messageId = res.data.tbBillList;
            });
        },
        //更新接口记录表
        updateMessage(messageCenter) {
            this.$post({
                url: "/MessageCenter/ResetUpdate",
                data: messageCenter
            }).then(res => {
                if (res.data.tbBillList > 0) {
                    this.Message += " [问题记录成功!]";
                } else {
                    this.Message += " [问题记录失败!!!]";
                }
            });
        },
    }
})
H5/Scbl.aspx
@@ -9,7 +9,7 @@
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
        <van-nav-bar
          title="生产补料"
          :title="type=='cl'?'生产超领':'生产补料'"
          left-text="返回"
          left-arrow
          @click-left="GoBack()"
@@ -99,5 +99,5 @@
  <comback ></comback>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder4" Runat="Server">
 <script src="Js/Scbl.js?<%=12313 %>"></script>
 <script src="Js/Scbl.js?<%=12315 %>"></script>
</asp:Content>
H5/cprk.aspx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
<%@ Page Title="生产入库" Language="C#" MasterPageFile="~/Mst.master" AutoEventWireup="true" CodeFile="cprk.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">
    <van-nav-bar
  title="生产入库"
  left-text="返回"
  left-arrow
  @click-left="GoBack()"
></van-nav-bar>
    <div class="mySolid">
        <van-cell-group>
  <van-field
    ref="sectionCode"
    v-model="formData.sectionCode"
    label="库位编码"
    clearable
     placeholder="请扫码"
    :right-icon-size="19"
     v-focus.noKeyboard
    @change="getModel" autofocus="true"
  ></van-field>
 <van-field
   ref="barcode"
   v-model="formData.barcode"
  label="物料条码"
   clearable
 placeholder="请扫码"
  :right-icon-size="19"
  v-focus.noKeyboard
  @change="getScan"
></van-field>
   <van-field
  v-model="formData.itemNo"
  label="物料编码"
  placeholder="物料编码"
  disabled
></van-field>
   <van-field
  v-model="formData.sumQuantity"
  label="当前条码入库数量"
  placeholder="当前条码入库数量"
  disabled
></van-field>
</van-cell-group>
    </div>
    <van-button type="primary" @click="getScan" >确认</van-button>
    <%--<van-button type="primary" @click="ToErp" >审核</van-button>--%>
    <van-button type="primary" @click="cleraCode" >清除库位编码</van-button>
</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/cprk.js?<%=1211 %>"></script>
</asp:Content>
H5/cprk.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)
    {
    }
}