chenhaozhe
2025-09-01 5a5811e85ae92a93319fbd5b1fa7f6bdd3aac336
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: '提示',