chenhaozhe
2025-09-01 5a5811e85ae92a93319fbd5b1fa7f6bdd3aac336
添加 记录当前提交保存 单据 次数,单号,时间 请求函数
3个文件已修改
169 ■■■■ 已修改文件
pages/caigouruku/form.vue 74 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tiaomaguanli/table_son.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/xiaoshouchuku/form.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/caigouruku/form.vue
@@ -274,6 +274,10 @@
                HPageTitle: '采购入库单',
                materMeta: [
                ],
                showHStockPlaceName: false,
                showHMainSourceBillType: true,
                showHSourceBillNo: true,
@@ -1077,6 +1081,7 @@
                                    this.showHSupName = false
                                    this.tabs = 2
                                } else { //物料条码
                                    this.materMeta.push(data)
                                    this.tabs = 2
                                    if (!this.hform.HSourceBillNo) {
                                        this.hform.HSupName = data.hSupNameField
@@ -1156,6 +1161,7 @@
                        console.log('物料', res.data)
                        if (res.data.count == 1) {
                            var data = res.data.data
                            this.materMeta = data.BarCodeDetailslist
                            this.Materlist = data.Materlist
                            if (!data.BarCodeDetailslist[0].HBarCode) {
                                this.hform.HMaterName_B = ''
@@ -1389,27 +1395,39 @@
                            data: {
                                oMain: sMainStr
                            },
                            success: (res) => {
                            success: async (res) => {
                                console.log(1, res);
                                uni.hideLoading()
                                if (res.data.count == 1) {
                                    uni.showModal({
                                        title: '提示',
                                        content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                                        success: (res) => {
                                            if (res.confirm) {
                                                console.log('用户点击确定');
                                                uni.redirectTo({
                                                    url: '/pages/caigouruku/form?OperationType=1'
                                                })
                                            } else if (res.cancel) {
                                                console.log('用户点击取消');
                                                setTimeout(() => {
                                                    uni.navigateBack();
                                                }, 50)
                                            }
                                        }
                                    });
                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform.HBillType + ';' + this.hform.HBillNo
                                    try {
                                        // 为条码设置出库单号和出库次数
                                        await this.Set_BarCodeBill(sMain)
                                        uni.showModal({
                                            title: '提示',
                                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                                            success: (res) => {
                                                if (res.confirm) {
                                                    console.log('用户点击确定');
                                                    uni.redirectTo({
                                                        url: '/pages/caigouruku/form?OperationType=1'
                                                    })
                                                } else if (res.cancel) {
                                                    console.log('用户点击取消');
                                                    setTimeout(() => {
                                                        uni.navigateBack();
                                                    }, 50)
                                                }
                                            }
                                        });
                                    }catch(err) {
                                        uni.showToast({
                                            title: err,
                                            icon: 'none'
                                        })
                                    }
                                } else {
                                    uni.showToast({
                                        title: res.data.Message,
@@ -1432,7 +1450,25 @@
            showBillList() {
                this.$refs.billList.showPopup()
            },
            Set_BarCodeBill(sMain) {
                return new Promise((resolve, reject) => {
                    CommonUtils.doRequest2({
                        method: 'POST',
                        url: 'Sc_BarCode/Set_BarCodeBill',
                        data: {
                            msg: sMain
                        },
                        resFunction: (res) => {
                            let {data, count, Message} = res.data
                            if(count == 1) {
                                resolve()
                            }else {
                                reject(Message)
                            }
                        }
                    })
                })
            },
            goBack() {
                uni.showModal({
                    title: '提示',
pages/tiaomaguanli/table_son.vue
@@ -328,7 +328,7 @@
                //获取选择的源单类型
                var HSourceBillType = "收料通知单";
                //获取选择的条码类型
                var HSelectBarCodeType = "品种条码";
                var HSelectBarCodeType = "唯一条码";
                //获取当前登录人员
                var UserName = uni.getStorageSync('HUserName');
                let listDataTemp = []
pages/xiaoshouchuku/form.vue
@@ -285,10 +285,10 @@
                <button class="btn-c" size="mini" @tap="goBack">退出</button>
            </view>
        </view>
        <PushSeOutStockBillPopupVue v-if="enableModule == 1" ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
            :HStockOrgID="hform.HStockOrgID"></PushSeOutStockBillPopupVue>
        <BillListPopupVue v-else-if="enableModule == 2" ref="billList" :HBillType="hform.HBillType" :HSourceBillType="hform.HMainSourceBillType"
            :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
        <PushSeOutStockBillPopupVue v-if="enableModule == 1" ref="billList" :HBillType="hform.HBillType"
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"></PushSeOutStockBillPopupVue>
        <BillListPopupVue v-else-if="enableModule == 2" ref="billList" :HBillType="hform.HBillType"
            :HSourceBillType="hform.HMainSourceBillType" :HStockOrgID="hform.HStockOrgID"></BillListPopupVue>
    </view>
</template>
<script>
@@ -301,6 +301,9 @@
    import {
        getUserStockRelation
    } from '../../utils/userRelationManager';
    import {
        CommonUtils
    } from '../../utils/common';
    export default {
        data() {
            return {
@@ -318,6 +321,9 @@
                showHSupName: true,
                BarCodeFocus: false,
                HSourceBillNoFocus: false,
                materMeta: [
                ],
                tabs: 0,
                HMainSourceBillType: '发货通知单',
@@ -394,14 +400,14 @@
        },
        computed: {
            enableModule: {
                get(){
                get() {
                    if (this.hform.HMainSourceBillType == 1402) {
                        return 1
                    } else {
                        return 2
                    }
                }
                // 其他条件
            },
        },
@@ -421,7 +427,7 @@
            this.getHSupList()
            this.getHEmpList()
            this.getHDeptList()
            console.log('enableModule: ',this.enableModule);
            console.log('enableModule: ', this.enableModule);
            this.getRelationStore()
            uni.$on('BillSelectComplete', (e) => {
@@ -434,7 +440,7 @@
            uni.$off('BillSelectComplete')
        },
        methods: {
            async getRelationStore() {
                let {
                    data,
@@ -1101,6 +1107,7 @@
                                    this.showHSupName = false
                                    this.tabs = 2
                                } else { //物料条码
                                    this.materMeta.push(data)
                                    this.tabs = 2
                                    if (!this.hform.HSourceBillNo) {
                                        this.hform.HSupName = data.hSupNameField
@@ -1180,6 +1187,7 @@
                        console.log('物料', res.data)
                        if (res.data.count == 1) {
                            var data = res.data.data
                            this.materMeta = data.BarCodeDetailslist
                            this.Materlist = data.Materlist
                            if (data.FIFOlist.length != 0) {
                                if (data.FIFOlist[0].HMaterID != 0) {
@@ -1410,33 +1418,42 @@
                            data: {
                                oMain: sMainStr
                            },
                            success: (res) => {
                            success: async (res) => {
                                console.log(1, res);
                                uni.hideLoading()
                                if (res.data.count == 1) {
                                    uni.showModal({
                                        title: '提示',
                                        content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                                        success: (res) => {
                                            if (res.confirm) {
                                                console.log('用户点击确定');
                                                uni.redirectTo({
                                                    url: '/pages/xiaoshouchuku/form?OperationType=1'
                                                })
                                            } else if (res.cancel) {
                                                console.log('用户点击取消');
                                                setTimeout(() => {
                                                    uni.navigateBack();
                                                }, 500)
                                    let sMain = JSON.stringify(this.materMeta) + ';' + this.hform.HBillType + ';' + this.hform.HBillNo
                                    try {
                                        await this.Set_BarCodeBill(sMain)
                                        uni.showModal({
                                            title: '提示',
                                            content: res.data.Message + '。是否继续新增?(点击取消返回上级页面)',
                                            success: (res) => {
                                                if (res.confirm) {
                                                    console.log('用户点击确定');
                                                    uni.redirectTo({
                                                        url: '/pages/xiaoshouchuku/form?OperationType=1'
                                                    })
                                                } else if (res.cancel) {
                                                    console.log('用户点击取消');
                                                    setTimeout(() => {
                                                        uni.navigateBack();
                                                    }, 50)
                                                }
                                            }
                                        }
                                    });
                                        });
                                    } catch(e) {
                                        uni.showToast({
                                            title: e,
                                            icon: 'none'
                                        })
                                    }
                                } else {
                                    uni.showToast({
                                        title: res.data.Message,
                                        icon: 'none'
                                    })
                                }
                                }
                            },
                            fail: (res) => {
                                console.log(res);
@@ -1449,7 +1466,29 @@
                    }
                }
            },
            Set_BarCodeBill(sMain) {
                return new Promise((resolve, reject) => {
                    CommonUtils.doRequest2({
                        method: 'POST',
                        url: 'Sc_BarCode/Set_BarCodeBill',
                        data: {
                            msg: sMain
                        },
                        resFunction: (res) => {
                            let {
                                data,
                                count,
                                Message
                            } = res.data
                            if (count == 1) {
                                resolve()
                            } else {
                                reject(Message)
                            }
                        }
                    })
                })
            },
            goBack() {
                uni.showModal({
                    title: '提示',