添加 记录当前提交保存 单据 次数,单号,时间 请求函数
| | |
| | | HPageTitle: '采购入库单', |
| | | |
| | | |
| | | materMeta: [ |
| | | |
| | | ], |
| | | |
| | | showHStockPlaceName: false, |
| | | showHMainSourceBillType: true, |
| | | showHSourceBillNo: true, |
| | |
| | | this.showHSupName = false |
| | | this.tabs = 2 |
| | | } else { //物料条码 |
| | | this.materMeta.push(data) |
| | | this.tabs = 2 |
| | | if (!this.hform.HSourceBillNo) { |
| | | this.hform.HSupName = data.hSupNameField |
| | |
| | | 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 = '' |
| | |
| | | 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, |
| | |
| | | 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: '提示', |
| | |
| | | //获取选择的源单类型 |
| | | var HSourceBillType = "收料通知单"; |
| | | //获取选择的条码类型 |
| | | var HSelectBarCodeType = "品种条码"; |
| | | var HSelectBarCodeType = "唯一条码"; |
| | | //获取当前登录人员 |
| | | var UserName = uni.getStorageSync('HUserName'); |
| | | let listDataTemp = [] |
| | |
| | | <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> |
| | |
| | | import { |
| | | getUserStockRelation |
| | | } from '../../utils/userRelationManager'; |
| | | import { |
| | | CommonUtils |
| | | } from '../../utils/common'; |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | showHSupName: true, |
| | | BarCodeFocus: false, |
| | | HSourceBillNoFocus: false, |
| | | materMeta: [ |
| | | |
| | | ], |
| | | |
| | | tabs: 0, |
| | | HMainSourceBillType: '发货通知单', |
| | |
| | | }, |
| | | computed: { |
| | | enableModule: { |
| | | get(){ |
| | | get() { |
| | | if (this.hform.HMainSourceBillType == 1402) { |
| | | return 1 |
| | | } else { |
| | | return 2 |
| | | } |
| | | } |
| | | |
| | | |
| | | // 其他条件 |
| | | }, |
| | | }, |
| | |
| | | this.getHSupList() |
| | | this.getHEmpList() |
| | | this.getHDeptList() |
| | | console.log('enableModule: ',this.enableModule); |
| | | console.log('enableModule: ', this.enableModule); |
| | | this.getRelationStore() |
| | | |
| | | uni.$on('BillSelectComplete', (e) => { |
| | |
| | | uni.$off('BillSelectComplete') |
| | | }, |
| | | methods: { |
| | | |
| | | |
| | | async getRelationStore() { |
| | | let { |
| | | data, |
| | |
| | | this.showHSupName = false |
| | | this.tabs = 2 |
| | | } else { //物料条码 |
| | | this.materMeta.push(data) |
| | | this.tabs = 2 |
| | | if (!this.hform.HSourceBillNo) { |
| | | this.hform.HSupName = data.hSupNameField |
| | |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | } |
| | | } |
| | | }, |
| | | |
| | | 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: '提示', |