| | |
| | | <view :class="tabs == 0 ? 'on':''" @tap="tabs = 0">选择源单</view> |
| | | <view :class="tabs == 1 ? 'on':''" @tap="tabs = 1">表头信息</view> |
| | | <view :class="tabs == 2 ? 'on':''" @tap="tabs = 2">物料信息</view> |
| | | <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">条码信息</view> |
| | | <view :class="tabs == 3 ? 'on':''" @tap="tabs = 3">附件信息</view> |
| | | </view> |
| | | <!-- 页签 源单信息 --> |
| | | <view v-if="tabs == 0"> |
| | |
| | | <view v-if="tabs == 1"> |
| | | <view class="card-item-wrapper"> |
| | | <view v-for="(item, index) in materialManifest" :key="index"> |
| | | <uni-card :title="item.HSourceBillNo" @tap="toDetail(item)"> |
| | | <uni-card :title="item.HSourceBillNo" @tap="toDetail(item, index)"> |
| | | <view class="card-detail"> |
| | | <view class="detail"> |
| | | <text>物料代码:</text>{{item.HMaterNumber}} |
| | |
| | | </view> |
| | | <!-- 页签 明细清单 --> |
| | | <view v-if="tabs == 2"> |
| | | <view class="form-item-wrapper" v-if="detailManifest.length > 0"> |
| | | <!-- <view class="form-item-wrapper" v-if="detailManifest.length > 0"> |
| | | <view class="form-item"> |
| | | <view class="title">物料代码:</view> |
| | | <view class="right"> |
| | |
| | | <view class="form-item"> |
| | | <view class="title">质检员:</view> |
| | | <view class="right"> |
| | | <!-- <input v-model="detailManifest[detailManifestCursor].HKeeper" /> --> |
| | | <uni-combox :candidates="HKeeperNameList" placeholder="请选择质检员" |
| | | v-model="detailManifest[detailManifestCursor].HKeeperName" |
| | | @input="HKeeperNameChange"></uni-combox> |
| | |
| | | <view class="form-item"> |
| | | <view class="title">检验结果:</view> |
| | | <view class="right"> |
| | | <!-- <input v-model="detailManifest[detailManifestCursor].HCheckResult" /> --> |
| | | <uni-combox v-model="detailManifest[detailManifestCursor].HCheckResultName" |
| | | :candidates="HCheckResultValueList" @input="HCheckResultChangeHandle"></uni-combox> |
| | | </view> |
| | |
| | | <view class="form-item"> |
| | | <view class="title">使用决策:</view> |
| | | <view class="right"> |
| | | <!-- <input v-model="detailManifest[detailManifestCursor].HUseResult" /> --> |
| | | <uni-combox v-model="detailManifest[detailManifestCursor].HUseResultName" |
| | | :candidates="HUseResultValueList" @input="HUseResultChangeHandle"></uni-combox> |
| | | </view> |
| | |
| | | <input v-model="detailManifest[detailManifestCursor].HSupName" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <view class="form-item-wrapper" v-else> |
| | | </view> --> |
| | | |
| | | |
| | | <view class="form-item-wrapper"> |
| | | <view class="form-item"> |
| | | <view class="title">物料代码:</view> |
| | | <view class="right"> |
| | |
| | | <view class="title">质检员:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HKeeperNameList" placeholder="请选择质检员" |
| | | v-model="detailManifestItem.HKeeperName"></uni-combox> |
| | | v-model="detailManifestItem.HKeeperName" @input="HKeeperNameChange"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">检验结果:</view> |
| | | <view class="right"> |
| | | <uni-combox v-model="detailManifestItem.HCheckResult" :candidates="HCheckResultValueList" |
| | | <uni-combox v-model="detailManifestItem.HCheckResultName" :candidates="HCheckResultValueList" |
| | | @input="HCheckResultChangeHandle"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">使用决策:</view> |
| | | <view class="right"> |
| | | <uni-combox v-model="detailManifestItem.HUseResult" :candidates="HUseResultValueList" |
| | | <uni-combox v-model="detailManifestItem.HUseResultName" :candidates="HUseResultValueList" |
| | | @input="HUseResultChangeHandle"></uni-combox> |
| | | </view> |
| | | </view> |
| | |
| | | <view v-if="tabs == 3"> |
| | | <view class="card-item-wrapper"> |
| | | <view class="attachment-btns"> |
| | | <button type="primary" size="mini" @tap="fileUpload">选择文件</button> |
| | | <!-- <button type="primary" size="mini" @tap="fileUpload">选择文件</button> --> |
| | | <button type="primary" size="mini" @tap="imageUpload">拍照上传</button> |
| | | <view style="flex: 1;"></view> |
| | | </view> |
| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | EnableSubmit: true, |
| | | EnableSubmit: false, |
| | | tabs: 0, |
| | | |
| | | // 源单信息 |
| | |
| | | "HSupName": "", |
| | | "HSupNumber": "", |
| | | "HSupID": "", |
| | | HCheckResult: '保留', |
| | | HUseResult: '接收', |
| | | "HCheckResultName": '合格', |
| | | "HUseResultName": '接收', |
| | | "HSourceBillType": "", |
| | | "HSLInterID": "0", |
| | | "HSLEntryID": "1", |
| | | "HSLBillNo": "", |
| | | "HSLSeQ": "" |
| | | }, |
| | | // 附件信息 |
| | | attachmentInfo: [], |
| | |
| | | delFile(index) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!', |
| | | message: '确认要删除 " ' + this.attachmentInfo[index].fileName + ' " 删除后将不可恢复!', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | this.attachmentInfo.splice(index, 1) |
| | |
| | | }, |
| | | success: (uploadRes) => { |
| | | CommonUtils.showTips({ |
| | | content: "上传成功" |
| | | message: "上传成功" |
| | | }) |
| | | this.attachmentInfo[index].status = "上传成功" |
| | | }, |
| | | fail: (err) => { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `上传失败: ${err}` |
| | | message: `上传失败: ${err}` |
| | | }) |
| | | } |
| | | }) |
| | |
| | | }) |
| | | }, |
| | | HKeeperNameChange(e) { |
| | | if (this.detailManifest[this.detailManifestCursor]) { |
| | | console.log(e) |
| | | let keeperItem = this.HKeeperList.find(elem => elem.HName = e) |
| | | this.detailManifest[this.detailManifestCursor].HKeeperID = keeperItem.HItemID |
| | | this.detailManifest[this.detailManifestCursor].HKeeperName = keeperItem.HName |
| | | this.detailManifestItem.HKeeperID = keeperItem.HItemID |
| | | this.detailManifestItem.HKeeperName = keeperItem.HName |
| | | |
| | | } |
| | | |
| | | }, |
| | | HCheckResultChangeHandle(e) { |
| | | if (this.detailManifest[this.detailManifestCursor]) { |
| | | this.detailManifest[this.detailManifestCursor].HCheckResult = |
| | | |
| | | this.detailManifestItem.HCheckResult = |
| | | this.HCheckResultList.find(elem => elem.text = e)?.value |
| | | } |
| | | |
| | | }, |
| | | HUseResultChangeHandle(e) { |
| | | if (this.detailManifest[this.detailManifestCursor]) { |
| | | this.detailManifest[this.detailManifestCursor].HUseResult = |
| | | |
| | | this.detailManifestItem.HUseResult = |
| | | this.HUseResultList.find(elem => elem.text = e)?.value |
| | | } |
| | | |
| | | }, |
| | | toDetail(item, index) { |
| | | console.log('item: ', item); |
| | | if (!this.detailManifest[index]) { |
| | | this.detailManifest[index] = Object.assign(this.detailManifestItem, { |
| | | "HMaterNumber": item.HMaterNumber, |
| | | "HMaterID": item.HMaterID, |
| | | "HMaterName": item.HMaterName, |
| | | "HMaterModel": item.HMaterModel, |
| | | "HKeeper": getUserInfo()["HKeeperName"], |
| | | "HKeeperID": getUserInfo()["HKeeperID"], |
| | | "HCheckQty": item.HQty, |
| | | "HUnitName": item.HUnitName, |
| | | "HBatchNo": item.HBatchNo |
| | | async toDetail(item, index) { |
| | | // 获取 物料明细 |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/QCStockInCheckBill/DisBillEntryList_Webs_New_Json1', |
| | | data: { |
| | | HInterID: item.HSourceInterID, |
| | | HEntryID: item.HSourceEntryID, |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count != 1) { |
| | | throw Message |
| | | } |
| | | console.log('data: ',data); |
| | | Object.assign(this.detailManifestItem, { |
| | | HMaterNumber: data[0].HMaterNumber, |
| | | HMaterName: data[0].HMaterName, |
| | | HMaterModel: data[0].HMaterModel, |
| | | HUnitName: data[0].HUnitName, |
| | | HWHName_B: data[0].HWHName_B, |
| | | HSPName_B: data[0].HSPName_B, |
| | | HBatchNo: data[0].HBatChNo.trim(), |
| | | HZJOrgName: data[0].HZJOrgName, |
| | | HZJOrgNumber: data[0].HZJOrgNumber, |
| | | HSupName: data[0].HSupName, |
| | | HUnitNumber: data[0].HUnitNumber, |
| | | HSupNumber: data[0].HSupNumber, |
| | | HWHNumber: data[0].HWHNumber, |
| | | HSPNumber: data[0].HSPNumber, |
| | | HSeQ: data[0].HSeQ, |
| | | HSourceInterID: data[0].HSourceInterID, |
| | | HSourceEntryID: data[0].HSourceEntryID, |
| | | HSourceBillNo: data[0].HSourceBillNo, |
| | | HWHID: data[0].HWHID, |
| | | HSPID: data[0].HSPID, |
| | | HSupID: data[0].HSupID, |
| | | HMaterID: data[0].HMaterID, |
| | | HSourceBillType: data[0].HSourceBillType, |
| | | HSLInterID: data[0].HSLInterID, |
| | | HSLEntryID: data[0].HSLEntryID, |
| | | HSLBillNo: data[0].HSLBillNo, |
| | | HSLSeQ: data[0].HSLSeQ, |
| | | HCheckQty: data[0].hqty, |
| | | }) |
| | | |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取明细信息错误: ${err}` |
| | | }) |
| | | } |
| | | this.detailManifestCursor = index |
| | | // } |
| | | this.EnableSubmit = true |
| | | // this.detailManifestCursor = index |
| | | this.tabs = 2 |
| | | }, |
| | | async getCode(HSourceBillNo) { |
| | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `初始化单据号错误: ${Message}` |
| | | message: `初始化单据号错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `初始化单据号错误: ${err}` |
| | | message: `初始化单据号错误: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | |
| | | this.getCode(code) |
| | | }) |
| | | }, |
| | | async cmdSubmit() { |
| | | async cmdSubmit() { // 后端在单次上传文件提交后会删除本地文件,一次只能提交一个数据 |
| | | try { |
| | | for (let i = 0; i < this.detailManifest.length; i++) { |
| | | if (this.detailManifest[i]) { // 筛选掉数组中没有赋值的对象 |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: 'QCStockInCheckBill/set_SaveQCStockInCheckBill_Json', |
| | | url: 'QCStockInCheckBill/set_SaveQCStockInCheckBill_Json2', |
| | | data: { |
| | | "HZJOrgNumber": this.detailManifest[i].HZJOrgNumber, |
| | | "HMaterNumber": this.detailManifest[i].HMaterNumber, |
| | | "HUnitNumber": this.detailManifest[i].HUnitNumber, |
| | | "HCheckQty": this.detailManifest[i].HCheckQty, |
| | | "HRightQty": this.detailManifest[i].HRightQty, |
| | | "HBadQty": this.detailManifest[i].HBadQty, |
| | | "HCheckResult": this.detailManifest[i].HCheckResult, |
| | | "HSupNumber": this.detailManifest[i].HSupNumber, |
| | | "HUseResult": this.detailManifest[i].HUseResult, |
| | | "HSeQ": this.detailManifest[i].HSeQ, |
| | | "HSourceInterID": this.sourceBillInfo.HSourceInterID, |
| | | "HSourceEntryID": this.sourceBillInfo.HSourceEntryID, |
| | | "HSourceBillNo": this.sourceBillInfo.HSourceBillNo, |
| | | "HZJOrgNumber": this.detailManifestItem.HZJOrgNumber, |
| | | "HMaterNumber": this.detailManifestItem.HMaterNumber, |
| | | "HUnitNumber": this.detailManifestItem.HUnitNumber, |
| | | "HCheckQty": this.detailManifestItem.HCheckQty, |
| | | "HRightQty": this.detailManifestItem.HRightQty || 0, |
| | | "HBadQty": this.detailManifestItem.HBadQty || 0, |
| | | "HCheckResult": this.detailManifestItem.HCheckResult, |
| | | "HSupNumber": this.detailManifestItem.HSupNumber, |
| | | "HUseResult": this.detailManifestItem.HUseResult, |
| | | "HSeQ": this.detailManifestItem.HSeQ, |
| | | "HSourceInterID": this.detailManifestItem.HSourceInterID, |
| | | "HSourceEntryID": this.detailManifestItem.HSourceEntryID, |
| | | "HSourceBillNo": this.detailManifestItem.HSourceBillNo, |
| | | "user": getUserInfo()["Czymc"], |
| | | "HWHID": this.detailManifest[i].HWHID || 0, |
| | | "HSPID": this.detailManifest[i].HSPID || 0, |
| | | "HSupID": this.detailManifest[i].HSupID || 0, |
| | | "HKeeperID": this.detailManifest[i].HKeeperID || 0, |
| | | "HMaterID": this.detailManifest[i].HMaterID || 0, |
| | | "HSourceBillType": this.sourceBillInfo.HSourceBillType, |
| | | "HSLInterID": this.sourceBillInfo.HSLInterID, |
| | | "HSLEntryID": this.sourceBillInfo.HSLEntryID, |
| | | "HSLBillNo": this.sourceBillInfo.HSLBillNo, |
| | | "HSLSeQ": this.sourceBillInfo.HSLSeQ, |
| | | "HWHID": this.detailManifestItem.HWHID || 0, |
| | | "HSPID": this.detailManifestItem.HSPID || 0, |
| | | "HSupID": this.detailManifestItem.HSupID || 0, |
| | | "HKeeperID": this.detailManifestItem.HKeeperID || 0, |
| | | "HMaterID": this.detailManifestItem.HMaterID, |
| | | "HSourceBillType": this.detailManifestItem.HSourceBillType, |
| | | "HSLInterID": this.detailManifestItem.HSLInterID, |
| | | "HSLEntryID": this.detailManifestItem.HSLEntryID, |
| | | "HSLBillNo": this.detailManifestItem.HSLBillNo, |
| | | "HSLSeQ": this.detailManifestItem.HSLSeQ, |
| | | "HBatchNo": this.detailManifestItem.HBatchNo || '', |
| | | "HBillNo": this.sourceBillInfo.HBillNo, |
| | | "HInterID": this.sourceBillInfo.HInterID, |
| | | "HBatchNo": this.detailManifest[i].HBatchNo |
| | | }, |
| | | }) |
| | | |
| | | let {data, count, Message} = res.data |
| | | if(count == 0){ |
| | | throw Message |
| | | } |
| | | } |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | CommonUtils.showTips({ |
| | | content: `上传成功` |
| | | message: `上传成功` |
| | | }) |
| | | this.attachmentInfo = [] |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `上传失败: ${Message}` |
| | | }) |
| | | } |
| | | |
| | | |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `上传失败: ${err}` |
| | | message: `上传失败: ${err}` |
| | | }) |
| | | |
| | | |
| | | this.attachmentInfo = [] |
| | | } |
| | | |
| | | |
| | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `初始化单据号错误: ${Message}` |
| | | message: `初始化单据号错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `初始化单据号错误: ${err}` |
| | | message: `初始化单据号错误: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `初始化质检员错误: ${Message}` |
| | | message: `初始化质检员错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | content: `初始化质检员错误: ${err}` |
| | | message: `初始化质检员错误: ${err}` |
| | | }) |
| | | } |
| | | } |