委外领料:1.显示当前组织2.添加工单查询列表3.添加库位列表4.(待发物料)和(物料总清单)更改为(待扫物料)和(已扫物料)5.查询列表与带出明细改为存储过程
已修改2个文件
292 ■■■■ 文件已修改
H5/Js/Wwll.js 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Wwll.aspx 154 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
H5/Js/Wwll.js
@@ -9,6 +9,20 @@
            },
            modeInfo: { daa001: "", planNo: "" },
            scanInfo: { barcodeNum: "", splitNum: "", barcode: "" },
            ItemDetail: [],
            ip: "",
            port: "",
            oldBarInfo: [],
            cfBarInfo: [],
            selectKey: "",//查询关键字
            actions: [],//列表的值
            show: false,//列表展示
            // 当前选中行的索引
            currentIndex: -1,
            // 存储选中行数据对象
            selItem: {},
            ItemBarKw: [],//当天行相关条码库位信息
            DaaInfo: {},
        }
    },
    mounted() {
@@ -19,6 +33,61 @@
        };
    },
    methods: {
        /**
        * 处理行点击事件(单选逻辑)
        * @param {Object} item 当前行数据
        * @param {Number} index 当前行索引
        */
        handleRowClick(item, index) {
            if (this.isLoading) {
                return;
            }
            // 重置所有行的选中状态
            this.currentIndex = -1;
            // 设置当前选中行
            this.currentIndex = index;
            this.selItem = {
                itemid: item.itemId,//驼峰命名法
                index: index
            };
            console.log('当前选中项:', this.selItem); // 调试用
            this.GetBarKwByItem();
        },
        //获取库位信息
        GetBarKwByItem() {
            //Womdaa
            //WwGd
            var that = this;
            that.isLoading = true;
            that.AxiosHttp("post", 'Womdaa/GetBarKwByItem', {
                itemId: that.selItem.itemid,
                userName: that.userInfo.loginAccount
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.ItemBarKw = json.data.tbBillList;
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.ItemBarKw = [];
                    }
                    that.isLoading = false;
                })
                .catch(function (error) {
                    that.isLoading = false;
                    that.$toast.fail("网络错误,请重试!");
                    that.$playSound('error');
                    console.log(error);
                    that.ItemBarKw = [];
                });
        },
        getModel() {
            var that = this;
            that.isLoading = true;
@@ -29,13 +98,20 @@
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        that.modeInfo = json.data.tbBillList;
                        that.ItemDetail = json.data.tbBillList;
                        that.DaaInfo = json.data.tbBillList.daaInfo;
                        that.modeInfo.planNo = json.data.tbBillList.planNo;
                        that.modeInfo.startTime = json.data.tbBillList.startTime;
                        that.$refs.barcode.focus();
                    }
                    else {
                        that.$toast.fail(json.message);
                        that.$playSound('error');
                        that.$refs.daa001.focus();
                        that.modeInfo.daa001 = "";
                        that.modeInfo.planNo = "";
                        that.modeInfo.startTime = "";
                        that.ItemDetail = [];
                    }
                    that.isLoading = false;
                })
@@ -47,6 +123,7 @@
                    that.modeInfo.daa001 = "";
                });
        },
        //扫码
        getScan() {
            var that = this;
            if (that.modeInfo.daa001.length <= 0) {
@@ -87,6 +164,7 @@
                    that.$refs.barcode.focus();
                });
        },
        //拆分
        getChaiFen() {
            var that = this;
            if (that.modeInfo.daa001.length <= 0) {
@@ -132,5 +210,63 @@
                    that.$refs.splitNum.focus();
                });
        },
        //获取工单信息
        getInfo() {
            this.show = true;
            var that = this;
            that.actions = [];
            that.isLoading = true;
            that.AxiosHttp("post", 'WwGd/GetXcslDaa', {
                selectKey: that.selectKey,
            }, false)
                .then(function (res) {
                    var json = res;
                    if (json.status == 0) {
                        if (json.data.tbBillList.length <= 0) {
                            that.$toast.fail("没有可用的数据");
                            that.$playSound('error');
                        } else {
                            that.itemInfo = json.data.tbBillList;
                            that.actions = json.data.tbBillList.map(item => {
                                return {
                                    name: item.daaInfo,  // 拼接字段
                                    subname: item.startTime
                                };
                            });
                        }
                    }
                    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);
                });
        },
        onSelect(item) {
            // 默认情况下点击选项时不会自动收起
            // 可以通过 close-on-click-action 属性开启自动收起
            this.show = false;
            console.log(item);
            // 正则匹配第一个方括号内容
            const regex = /\[([^\]]+)\]/;
            const matchResult = item.name.match(regex);
            if (matchResult && matchResult[1]) {
                this.modeInfo.daa001 = matchResult[1]; // PPBOM00000088-1
                console.log('提取的DAA001:', this.modeInfo.daa001);
            } else {
                this.$toast.fail('工单号格式异常');
                this.modeInfo.daa001 = '';
            }
            this.getModel();
            //this.$toast(item.name);
        },
    }
})
H5/Wwll.aspx
@@ -4,18 +4,43 @@
    .bg-info {
        background-color:#fff;
    }
          .org-info {
        height: 0.5rem;
        line-height: 0.5rem;
        padding: 0 0.16rem;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
            <van-notice-bar
    :scrollable="false"
    :text="'当前组织:' + (Cookies.get('orgName') || '暂无组织信息')"
    class="org-info"
/></van-notice-bar>
    <van-nav-bar
  title="委外领料"
  left-text="返回"
  left-arrow
  @click-left="GoBack()"
></van-nav-bar>
    <%--<div class="mySolid">--%>
    <div class="mySolid">
        <van-cell-group>
                <van-field
                    ref ="selectKey"
                value=""
                label="工单查询"
                clearable
                    placeholder="请选择工单号进行查询"
                :right-icon-size="19"
                    v-model="selectKey"
                ><template #button>
                <van-button size="small" type="info" plain @click="getInfo" >选择</van-button>
                </template></van-field>
  <van-field 
    ref="daa001"
    v-model="modeInfo.daa001"
@@ -35,6 +60,25 @@
   placeholder="任务单号"
   disabled
></van-field>
<%--                <van-field
                    v-model="DaaInfo.startTime"
                    label="开工时间"
                    clearable
                    :right-icon-size="19"
                    placeholder="开工时间"
                    disabled>
                </van-field>
                <van-field
                    v-model="DaaInfo.lineName"
                    label="线体名称"
                    clearable
                    :right-icon-size="19"
                    placeholder="线体名称"
                    disabled>
                </van-field>--%>
 <van-field
   ref="barcode"
   v-model="scanInfo.barcode"
@@ -59,49 +103,85 @@
    label="发料数量"
    placeholder="发料数量" 
  >
    <van-button slot="button" type="info" size="small"  plain @click="getChaiFen">
      条码拆分
    </van-button>
    <van-button slot="button" type="info" size="small"  plain @click="getChaiFen">条码拆分</van-button>
  </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="12" class="text-left padding-left">物料</van-col>
             <van-col span="6">待扫</van-col>
            <van-col span="6">已扫</van-col>
    </van-row>
    <van-row  v-for="(itm,index) in modeInfo.daisao1" :key="index">
          <van-col span="12"  class="text-left padding-left">
               <div>{{itm.itemNo}}</div>
               <div>{{itm.itemName}}</div>
          </van-col>
          <van-col span="6">{{itm.dab006}}</van-col>
         <van-col span="6">{{itm.dab007}}</van-col>
    </van-row>
  </van-tab>
   <van-tab title="物料总清单" class="mySolid font">
         <van-row>
            <van-col span="12" class="text-left padding-left">物料</van-col>
             <van-col span="6">需领数</van-col>
            <van-col span="6">已领数</van-col>
    </div>
    <van-action-sheet v-model="show" :actions="actions" @select="onSelect" ></van-action-sheet>
    <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 modeInfo.totals1" :key="index">
           <van-col span="12" class="text-left padding-left">
                <div>{{itm.itemNo}}</div>
        <!-- 增加行点击与选中高亮 -->
            <van-row
            v-for="(itm,index) in ItemDetail.items"
            :key="index"
            :style="{ background: currentIndex === index ? '#87CEEB' : '' }"
            @click.native="handleRowClick(itm, 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="6">{{itm.dab006}}</van-col>
           <van-col span="6">{{itm.dab007}}</van-col>
       </van-row>
   </van-tab>
            </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="10" class="text-left padding-left">条码编号</van-col>
                    <van-col span="5" class="text-left padding-left">库位</van-col>
                    <van-col span="4">数量</van-col>
                    <van-col span="5">仓库</van-col>
                </van-row>
                <van-row v-for="(itm,index) in ItemBarKw" :key="index">
                    <van-col span="10" class="text-left padding-left">
                        <div class="blue-text">{{itm.iteM_BARCODE}}</div>
                    </van-col>
                    <van-col span="5" class="text-left padding-left">
                        <div>{{itm.depoT_SECTIONS_CODE}}</div>
                    </van-col>
                    <van-col span="4" class="blue-text">{{itm.quantity}}</van-col>
                    <van-col span="5" >{{itm.depot_name}}</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"><%--ItemBlDetail.ysitems--%>
            <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>
    </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/Wwll.js?<%=12324 %>"></script>
    <script src="Js/Wwll.js?<%=123263 %>"></script>
</asp:Content>