kyy
2025-10-08 3d78e368525c0584ec10e305fec38c7dd771300a
1、采购验退
已添加3个文件
668 ■■■■■ 文件已修改
H5/Js/PurchaseInventoryReturn.js 393 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/PurchaseInventoryReturn.aspx 261 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/PurchaseInventoryReturn.aspx.cs 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/PurchaseInventoryReturn.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,393 @@
var vm = new Vue({
    el: '#app',
    data: function () {
        return {
            isLoading: false,
            userInfo: {
                "loginGuid": '',
                "loginAccount": '',
            },
            formData: {
                sectionCode: "",
                barcode: "",
                itemNo: "",
                sumQuantity:0,
                barcodeQuantity: 0,
                returnBarcode: "",
                returnQuantity: 0,
                billNo: ""
            },
            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: "",
            sectionCode:"",
            depotData: [],
            ItemDetail: [],
        }
    },
    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.sectionCode
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.depotData = json.data.tbBillList;
                        that.$refs.barcode.focus();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.depotData = [];
                        that.sectionCode = "";
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    that.depotData = [];
                    that.sectionCode = "";
                    that.$refs.sectionCode.focus();
                });
        },
        getScan() {
            var that = this;
            if (that.formData.barcode.length * 1 <= 0) {
                that.$toast.fail("物料条码不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.sectionCode.length * 1 <= 0) {
                that.$toast.fail("库位编码不能为空!");
                that.$playSound('error');
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'MesInvItemInCDetails/SaveBarCodes', {
                sectionCode: that.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.ItemDetail = json.data.tbBillList.itemInDetails;
                        //that.itemInsFormData = json.data.tbBillList.itemIns;
                        //that.itemTableData = json.data.tbBillList.itemInDetails;g
                        that.tableData = json.data.tbBillList.itemBarCDetails;
                        //that.barMessage = json.data.tbBillList.message;
                        that.$refs.barcode.focus();
                        that.formData.barcode = null;
                        that.$notify({ type: 'success', message: json.message });
                        that.$playSound('success');
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.$refs.barcode.focus();
                        that.formData.barcode = null;
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                    that.$refs.barcode.focus();
                });
        },
        getReturnScan() {
            var that = this;
            if (that.formData.returnBarcode.length * 1 <= 0) {
                that.$toast.fail("验退条码不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.sectionCode.length * 1 <= 0) {
                that.$toast.fail("库位编码不能为空!");
                that.$playSound('error');
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'MesInvItemInCDetails/GetReturnBarcodeInfo', {
                sectionCode: that.sectionCode,
                userName: that.userInfo.loginAccount,
                returnBarcode: that.formData.returnBarcode,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.formData.returnQuantity = json.data.tbBillList.quantity || 0;
                        // ä»ŽitemBarcodeDetails获取itemNo和quantity
                        if (json.data.tbBillList.itemBarcodeDetails) {
                            that.formData.itemNo = json.data.tbBillList.itemBarcodeDetails.itemNo || '';
                            that.formData.barcodeQuantity = json.data.tbBillList.itemBarcodeDetails.quantity || 0;
                            that.formData.billNo = json.data.tbBillList.itemBarcodeDetails.billNo || '';
                        }
                        that.$notify({ type: 'success', message: json.message });
                        that.$playSound('success');
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.$refs.returnBarcode.focus();
                        that.formData.returnBarcode = null;
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                    that.$refs.returnBarcode.focus();
                });
        },
        confirmReturn() {
            var that = this;
            if (!that.formData.returnBarcode || that.formData.returnBarcode.length <= 0) {
                that.$toast.fail("验退条码不能为空!");
                that.$playSound('error');
                return;
            }
            if (!that.formData.returnQuantity || that.formData.returnQuantity * 1 <= 0) {
                that.$toast.fail("验退数量必须大于0!");
                that.$playSound('error');
                return;
            }
            if (that.sectionCode.length * 1 <= 0) {
                that.$toast.fail("库位编码不能为空!");
                that.$playSound('error');
                return;
            }
            that.isLoading = true;
            that.AxiosHttp("post", 'MesInvItemInCDetails/ConfirmReturn', {
                sectionCode: that.sectionCode,
                userName: that.userInfo.loginAccount,
                returnBarcode: that.formData.returnBarcode,
                returnQuantity: that.formData.returnQuantity
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.formData.returnBarcode = "";
                        that.formData.returnQuantity = 0;
                        that.$refs.returnBarcode.focus();
                        that.$notify({ type: 'success', message: json.message });
                        that.$playSound('success');
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                });
        },
        getChaiFen() {
            var that = this;
            if (that.modeInfo.daa001.length <= 0) {
                that.$toast.fail("领料单号不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.scanInfo.splitNum * 1 <= 0) {
                that.$toast.fail("拆分数量不能为空!");
                that.$playSound('error');
                return;
            }
            if (that.scanInfo.barcode.length * 1 <= 0) {
                that.$toast.fail("物料条码不能为空!");
                that.$playSound('error');
                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.$playSound('error');
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                });
        },
        cleraCode() {
            this.sectionCode = "";
            this.$refs.sectionCode.focus();
        },
        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/PurchaseInventoryReturn.aspx
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,261 @@
<%@ Page Title="采购入库(验退)" Language="C#" MasterPageFile="~/Mst.master" AutoEventWireup="true" CodeFile="PurchaseInventoryReturn.aspx.cs" Inherits="H5_Scll" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style>
    .bg-info {
        background-color:#fff;
    }
    .return-warning {
        color: #ff4444 !important;
        font-weight: bold;
    }
    .return-field .van-field__label {
        color: #ff4444 !important;
        font-weight: bold;
    }
    .return-field .van-field__control {
        color: #ff4444 !important;
        font-weight: bold;
    }
    .return-button {
        background: linear-gradient(135deg, #ff6b6b, #ee5a52) !important;
        border: none !important;
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3) !important;
    }
</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="sectionCode"
    label="库位编码"
    clearable
     placeholder="请扫码"
    :right-icon-size="19"
     v-focus.noKeyboard
      @keyup.enter.native="getModel"
    <%--@change="getModel" --%>
      autofocus="true"
  ></van-field>
   <van-field
  v-model="depotData.depotName"
  label="仓库名称"
  placeholder=""
  disabled
></van-field>
     <van-field
  v-model="depotData.depotCode"
  label="仓库编码"
  placeholder=""
  disabled
></van-field>
 <van-field
   ref="barcode"
   v-model="formData.barcode"
  label="物料条码"
   clearable
 placeholder="请扫码"
  :right-icon-size="19"
  v-focus.noKeyboard
     @keyup.enter.native="getScan"
  <%--@change="getScan"--%>
></van-field>
 <van-field
   ref="returnBarcode"
   v-model="formData.returnBarcode"
  label="⚠️ éªŒé€€æ¡ç "
   clearable
 placeholder="请扫码"
  :right-icon-size="19"
  v-focus.noKeyboard
     @keyup.enter.native="getReturnScan"
     class="return-field"
></van-field>
 <van-row>
   <van-col span="18">
     <van-field
        v-model="formData.returnQuantity"
       label="⚠️ éªŒé€€æ•°é‡"
        clearable
      placeholder="请输入验退数量"
       type="number"
       class="return-field"
     ></van-field>
   </van-col>
   <van-col span="6" style="padding:10px;">
     <van-button type="primary" size="small" @click="confirmReturn" class="return-button">⚠️ éªŒé€€</van-button>
   </van-col>
 </van-row>
   <van-field
  v-model="formData.itemNo"
  label="物料编码"
  placeholder=""
  disabled
></van-field>
   <van-field
  v-model="formData.billNo"
  label="到货单号"
  placeholder=""
  disabled
></van-field>
   <van-field
  v-model="formData.barcodeQuantity"
  label="条码数量"
  placeholder=""
  disabled
></van-field>
   <van-field
  v-model="formData.sumQuantity"
  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="5">物料编码</van-col>
            <van-col span="5">物料名称</van-col>
          <van-col span="5">数量</van-col>
          <van-col span="4">单位</van-col>
    </van-row>
    <van-row  v-for="(itm,index) in itemTableData" :key="index">
        <van-col span="5">{{itm.itemNo}}</van-col>
        <van-col span="5">{{itm.itemSname}}</van-col>
          <van-col span="5">{{itm.quantity}}</van-col>
         <van-col span="4">{{itm.unit}}</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="4">需求数</van-col>--%>
            <van-col span="5">物料分区</van-col>
            <van-col span="3">已入库数</van-col>
        </van-row>
        <van-row  v-for="(itm,index) in ItemDetail" :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.fQty}}</van-col>
            <van-col span="5" class="blue-text">{{itm.fQty}}</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="4">数量</van-col>
            <van-col span="4">库位编码</van-col>
        </van-row>
        <van-row  v-for="(itm,index) in tableData" :key="index">
           <van-col span="8" class="text-left padding-left">
                <div>{{itm.barcode}}</div>
           </van-col>
            <van-col span="8" class="text-left padding-left">
            <div>{{itm.itemNo}}</div>
            <div>{{itm.itemName}}</div>
            </van-col>
            <van-col span="4">
                <div>{{itm.fQty}}</div>
            </van-col>
           <van-col span="4">{{itm.kw}}</van-col>
       </van-row>
   </van-tab>
      <%--<van-tab title="收料原单" class="mySolid font">
         <van-field
          v-model="itemInsFormData.billNo"
          label="入库单号"
          placeholder="入库单号"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.cbillNo"
          label="到货单号"
          placeholder="到货单号"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.createDate"
          label="创建时间"
          placeholder="创建时间"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.createBy"
          label="创建人员"
          placeholder="创建人员"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.insDate"
          label="审核日期"
          placeholder="审核日期"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.depotsCode"
          label="收货仓库编码"
          placeholder="收货仓库编码"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.depotName"
          label="收货仓库名称"
          placeholder="收货仓库名称"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.suppNo"
          label="供应商编码"
          placeholder="供应商编码"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.suppName"
          label="供应商名称"
          placeholder="供应商名称"
          disabled
        ></van-field>
        <van-field
          v-model="itemInsFormData.paperBillNo"
          label="送货单号"
          placeholder="送货单号"
          disabled
        ></van-field>
        <van-field
           v-model="itemInsFormData.remark"
           label="备注信息"
           placeholder="备注信息"
           disabled
         ></van-field>
      </van-tab>--%>
</van-tabs>
<%--    <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/PurchaseInventoryReturn.js?<%=123611111 %>"></script>
</asp:Content>
H5/PurchaseInventoryReturn.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)
    {
    }
}