#
whycq
2023-09-18 eed846f7b4d8b8dfc253dd583ee2bbb45c4d4f7d
#
3个文件已修改
99 ■■■■■ 已修改文件
pages/mat/matQuery.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matSelected.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/stock/stockCheck_merge.vue 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/mat/matQuery.vue
@@ -15,7 +15,7 @@
            </view>
        </scroll-view>
        <view>
            <view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item.matnr)">
            <view class="tag-list" v-for="(item,i) in matList" :key="i" @click="findBySelect(item.matNo)">
                <view class="tag">
                    <view style="display: flex;">
                        <view class="wms-tag" :style="baColor" >商品</view>
pages/mat/matSelected.vue
@@ -13,17 +13,17 @@
                <view class="form-item-desc"><text>规格</text></view>
                <view class="form-item-content"><text>{{mat.str2}}</text></view>
            </view>
            <view class="form-item">
            <!-- <view class="form-item">
                <view class="form-item-desc"><text>批号</text></view>
                <view class="form-item-content">
                    <view class="form-input">
                        <input type="text" v-model="mat.batch">
                    </view>
                </view>
            </view>
            </view> -->
            <view class="form-item">
                <view class="form-item-desc"><text>时间</text></view>
                <uni-datetime-picker type="datetime" v-model="mat.appeTime$" />
                <uni-datetime-picker type="date" v-model="mat.date" @change="changeLog"/>
            </view>
            <view class="form-item">
                <view class="form-item-desc"><text>数量</text></view>
@@ -48,7 +48,7 @@
                    matName: null,
                    str2: null,
                    batch: null,
                    appeTime: null,
                    date: '',
                    anfme: 0,
                },
                baseIP:'',
@@ -66,7 +66,6 @@
            
            // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据
            eventChannel.on('mat', function(data) {
                console.log(data.data);
                that.mat = data.data
                that.mat.anfme = 0
            })
@@ -80,6 +79,9 @@
            focus() {
                
            },
            changeLog(value) {
                this.mat.date = value
            },
            changeValue(value) {
                this.mat.anfme = value
            },
pages/stock/stockCheck_merge.vue
@@ -29,26 +29,20 @@
                    <view class="list-left-item">
                        <view class="desc">编码:</view>
                        <view class="left-item">
                            <uni-tag :text="item.matnr" type="primary"></uni-tag>
                            <uni-tag :text="item.matNo" type="primary"></uni-tag>
                        </view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">品名:</view>
                        <view class="left-item">{{item.maktx}}</view>
                        <view class="left-item">{{item.matName}}</view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">规格:</view>
                        <view class="left-item">{{item.specs}}</view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">批号:</view>
                        <view class="left-item">
                            <uni-tag :text="item.batch" type="warning"></uni-tag>
                        </view>
                        <view class="desc">日期:</view>
                        <view class="left-item">{{item.date}}</view>
                    </view>
                    <view class="list-left-item">
                        <view class="desc">数量:</view>
                        <view class="left-item">{{item.anfme}}</view>
                        <view class="left-item">{{item.count}}</view>
                    </view>
                </view>
                <view class="list-right">
@@ -77,8 +71,10 @@
                        </view>
                    </view>
                    <view class="popup-item">
                        <view class="popup-item-left">批号:</view>
                        <view class="popup-item-right"><input type="text" v-model="batch"></view>
                        <view class="popup-item-left">日期:</view>
                        <view class="popup-item-right">
                            <uni-datetime-picker type="date" v-model="date" />
                        </view>
                    </view>
                    <view class="popup-item">
                        <view class="popup-item-left">数量:</view>
@@ -143,8 +139,8 @@
                content: '',
                barcodeFocus: true,
                matFocus: false,
                matData: ''
                matData: '',
                date: ''
            }
        },
        onLoad() {
@@ -163,28 +159,38 @@
            search() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/mobile/checkDetl/auth2',
                    header: {
                        'token':uni.getStorageSync('token')
                    },
                    url: that.baseUrl + '/mobile/comb/form/barcode',
                    header: { 'token': uni.getStorageSync('token') },
                    data: {barcode: that.barcode},
                    method:'GET',
                    success(res) {
                        console.log(res);
                        res = res.data
                        if(res.code === 200){
                            for(var i = 0; i < res.data.length;i++){
                                res.data[i]['maxAnfme'] = res.data[i].anfme
                                res.data[i]['matNo'] = res.data[i].matnr
                                res.data[i]['matName'] = res.data[i].maktx
                                res.data[i]['count'] = res.data[i].anfme
                                res.data[i]['date'] = res.data[i].date ? res.data[i].date : ''
                                that.dataList.push(res.data[i])
                            }
                        } else if (res.code == 403) {
                            uni.showToast({title: res.msg, icon: "none", position: 'top'})
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                            setTimeout(() => {
                                uni.reLaunch({
                                    url: '../login/login'
                                });
                            }, 1000);
                        } else {
                            uni.showToast({title: res.msg, icon: "none",position: 'top'})
                            uni.showToast({
                                title: res.msg,
                                icon: "none",
                                position: 'top'
                            })
                        }
                    }
                    
@@ -215,9 +221,9 @@
            findMat() {
                let that = this
                uni.request({
                    url: that.baseUrl + '/mat/auth',
                    url: that.baseUrl + '/matCode/list/auth',
                    data: {
                        matnr: that.matnr
                        mat_no: that.matnr
                    },
                    header: {
                        'token': uni.getStorageSync('token')
@@ -233,19 +239,20 @@
                                // 通过eventChannel向被打开页面传送数据
                                success: function(res) {
                                    res.eventChannel.emit('mat', {
                                        data: result.data
                                        data: result.data.records[0]
                                    })
                                },
                                // 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
                                events: {
                                    matList: function(data) {
                                        data.data['count'] = data.data.anfme
                                        that.checkMat(data.data)
                                    },
                                },
                            });
                        } else if (res.code == 403) {
                        } else if (result.code == 403) {
                            uni.showToast({
                                title: res.msg,
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
@@ -256,7 +263,7 @@
                            }, 1000);
                        } else {
                            uni.showToast({
                                title: res.msg,
                                title: result.msg,
                                icon: "none",
                                position: 'top'
                            })
@@ -292,7 +299,7 @@
                var len = this.dataList.length
                var add = true ,sameItem = false
                for (var i = 0; i < len; i++) {
                    if (mat.matnr == this.dataList[i].matnr) {
                    if (mat.matNo == this.dataList[i].matNo) {
                        for (var j = 0; j < len; j++) {
                            if (mat.batch == this.dataList[j].batch) {
                                sameItem = true
@@ -309,7 +316,7 @@
                            
                        } else {
                            // 相同物料相同批号 数量累加
                            this.dataList[i].anfme += mat.anfme
                            this.dataList[i].count += mat.count
                            this.$forceUpdate() // 强制刷新
                            add = false
                        }
@@ -318,13 +325,14 @@
                if (add) {
                    this.dataList.unshift(mat)
                }
                console.log(len);
            },
            // 修改批号
            revise(item, i) {
                this.matnr = this.dataList[i].matnr
                this.count = this.dataList[i].anfme
                this.count = this.dataList[i].count
                this.batch = this.dataList[i].batch
                this.maxAnfme = this.dataList[i].maxAnfme
                this.date = this.dataList[i].date
                this.rowNum = i
                this.eject()
            },
@@ -350,13 +358,15 @@
                this.$refs.alertDialog.close()
            },
            reviseConfirm() {
                this.dataList[this.rowNum].anfme = this.count
                this.dataList[this.rowNum].batch = this.batch
                this.dataList[this.rowNum].count = this.count
                this.dataList[this.rowNum].date = this.date
                this.matnr = ''
                this.messageText = "修改成功"
                this.messageToggle('success')
                this.$refs.revise.close()
            },
            reviseClose() {
                this.matnr = ''
                this.$refs.revise.close()
            },
            changeValue(value) {
@@ -399,9 +409,9 @@
                var combMats = []
                var combParam = {}
                combParam['barcode'] = that.barcode
                combParam['wrkDetls'] = that.dataList
                combParam['combMats'] = that.dataList
                uni.request({
                    url: that.baseUrl + '/mobile/adjustNew/auth',
                    url: that.baseUrl + '/mobile/comb/form/mergeBoard',
                    method: 'POST',
                    data: JSON.stringify(combParam),
                    header: {
@@ -433,6 +443,9 @@
<style>
    @import url('../../static/css/wms.css/wms.css');
    .list:first-child {
        margin-top: 320rpx;
    }
    .code {
        width: 100%;
        position: fixed;