| | |
| | | "type" : "uni-app:app-ios" |
| | | }, |
| | | { |
| | | "customPlaygroundType" : "device", |
| | | "customPlaygroundType" : "local", |
| | | "localRepoPath" : "D:/WorkBench/ZY_APP_Dev/STUWMS/unpackage/debug", |
| | | "openVueDevtools" : true, |
| | | "packageName" : "com.shebeiguanli.www", |
| | | "playground" : "standard", |
| | | "playground" : "custom", |
| | | "type" : "uni-app:app-android" |
| | | } |
| | | ] |
| | |
| | | <template> |
| | | <view> |
| | | <view class="inspect-value-content"> |
| | | <view class="InSpect-value-content"> |
| | | <view class="form-item"> |
| | | <view class="left">项目序号</view> |
| | | <view class="right disabled"> |
| | |
| | | <view class="form-item"> |
| | | <view class="left">检验值</view> |
| | | <view class="right disabled"> |
| | | <input type="text" v-model="checkData.HInspectVal" disabled /> |
| | | <input type="text" v-model="checkData.HInSpectVal" disabled /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | |
| | | </view> |
| | | </view> |
| | | <view style="width: 100%;border-bottom: 1px solid #e3e3e3;"></view> |
| | | <view class="inspect-value-list"> |
| | | <view style="width: 100%;text-align: right;"> |
| | | <button type="default" size="mini" class="btn-a" @click="storeInspectValue">缓存检验值</button> |
| | | </view> |
| | | <view class="InSpect-value-list"> |
| | | <!-- <view style="width: 100%;text-align: right;"> |
| | | <button type="default" size="mini" class="btn-a" @click="storeInSpectValue">缓存检验值</button> |
| | | </view> --> |
| | | <view class="item" style="border-top: 2px solid #e3e3e3 ;"> |
| | | <view class="th1">序号</view> |
| | | <view class="th2" style="display: flex; flex-direction: row; align-items: center;"> |
| | |
| | | 检验值({{getAnalysisMethodTitle(checkData.HAnalysisMethod)}}) |
| | | </view> |
| | | </view> |
| | | <view class="item" v-for="(item, index) in inspectValues"> |
| | | <view class="item" v-for="(item, index) in InSpectValues"> |
| | | <view class="th1">{{item.HSEQ}}</view> |
| | | <view class="th2" style="display: flex; flex-direction: row; align-items: center;"> |
| | | <view style="width: 3em; "> |
| | | {{ item.HInspectResult?"合格":"不合格" }} |
| | | {{ item.HInSpectResult == 1?"合格":"不合格" }} |
| | | </view> |
| | | <view> |
| | | <switch style="width: 3em; transform:scale(0.7);" :checked="item.HInspectResult?'checked':''" |
| | | @change="HInspectResultChange(index, $event)" /> |
| | | <switch style="width: 3em; transform:scale(0.7);" |
| | | :checked="item.HInSpectResult == 1?'checked':''" |
| | | @change="HInSpectResultChange(index, $event)" /> |
| | | </view> |
| | | </view> |
| | | <view class="th3"> |
| | | <input type="number" v-model="item.HInspectValue" /> |
| | | <uni-combox v-if="checkData.HAnalysisMethod == 1" :candidates="InitInSpectValNameList" |
| | | v-model="item.HInSpectValueB_Text" |
| | | @update:modelValue="HInSpectValueBChange(index, $event)"></uni-combox> |
| | | <input v-else-if="checkData.HAnalysisMethod == 2" type="number" v-model="item.HInSpectValue" /> |
| | | <input v-else type="number" v-model="item.HInSpectValueT" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | getUserInfo |
| | | } from '../../utils/auth'; |
| | | import { |
| | | CommonUtils |
| | | } from '../../utils/common'; |
| | | // 检验值模板 |
| | | export default { |
| | | name: "InspectValueTemplate", |
| | | name: "InSpectValueTemplate", |
| | | data() { |
| | | return { |
| | | checkData: { |
| | |
| | | HResult2: '', |
| | | HStatus: true, |
| | | }, |
| | | inspectValues: [] |
| | | InSpectValues: [], |
| | | InitInSpectValNameList: [], |
| | | InitInSpectValList: [], |
| | | }; |
| | | }, |
| | | props: { |
| | |
| | | }, |
| | | mounted() { |
| | | console.log('bingData: ', this.bindData); |
| | | let {data, list} = this.bindData |
| | | let { |
| | | data, |
| | | list |
| | | } = this.bindData |
| | | this.checkData = Object.assign(data, JSON.parse(JSON.stringify(this.bindData))) |
| | | // 判断是否有缓存数据或者缓存数据是否与样本数一致 |
| | | if(!list || list.length != this.checkData.HSampleQty ){ |
| | | for (let index = 0; index < this.checkData.HSampleQty; index++) { |
| | | this.inspectValues.push({ |
| | | this.InSpectValues.push({ |
| | | HSEQ: index + 1, |
| | | HInspectResult: true, |
| | | HInspectValue: 0, |
| | | HInSpectResult: 1, |
| | | HInSpectValue: 0, // 定量检测值 |
| | | HInSpectValueB: 0, // 定性检测ID |
| | | HInSpectValueB_Text: '', // 定性检测(内容) |
| | | HInSpectValueT: 0, // 其他检测值 |
| | | }) |
| | | } |
| | | }else { |
| | | this.inspectValues = list |
| | | this.InSpectValues = list |
| | | } |
| | | this.InitInSpectVal() |
| | | // 实例挂载后,获取InterID 和 EntryID 对应的检验项目的检验值 |
| | | this.getValueList() |
| | | |
| | | this.$forceUpdate() |
| | | }, |
| | | beforeDestroy() { |
| | | // 注销前,提交数据的检验值, 并将最后一次提交的检验值同步至父模块 |
| | | this.set_SaveValue() |
| | | }, |
| | | methods: { |
| | | storeInspectValue(){ |
| | | async set_SaveValue() { |
| | | console.log("InSpect Values: ", this.InSpectValues) |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/QC_FirstPieceCheckBill/set_SaveValue', |
| | | data: { |
| | | msg: `${JSON.stringify(this.InSpectValues)};${this.checkData.HInterID};${this.checkData.num}` |
| | | }, |
| | | method: "POST" |
| | | }) |
| | | |
| | | if (res) { |
| | | return |
| | | } |
| | | let { |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count != 1) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `保存检验值错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `保存检验值错误: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | async getValueList() { |
| | | console.log('checkData: ', this.checkData); |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/QC_ValueTable/getValueList", |
| | | data: { |
| | | HInterID: this.checkData.HInterID, |
| | | HEntryID: this.checkData.num, |
| | | user: getUserInfo()['Czymc'] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count |
| | | } = res.data |
| | | if (count == 1) { |
| | | // if (this.InSpectValues.length >= data.length) { |
| | | // console.log('data: ',data); |
| | | |
| | | |
| | | // console.log('this.InSpectValues: ',this.InSpectValues); |
| | | |
| | | // } else { |
| | | // this.InSpectValues = data.slice(0, this.InSpectValues.length) |
| | | // } |
| | | this.InSpectValues = data |
| | | |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | tite: '温馨提示', |
| | | message: `获取检测值错误: ${err}` |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | async InitInSpectVal() { // 初始化定性检测内容 |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/Gy_BadReason/Gy_InSpectValueList', |
| | | data: { |
| | | sWhere: ` and 使用组织名称 = '${uni.getStorageSync("Organization")}' and 禁用标志 = '否' and 审核人 !='' `, |
| | | user: getUserInfo()['Czymc'] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | count, |
| | | Message, |
| | | data |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | this.InitInSpectValNameList = Array.from(data).map(e => e["检测值名称"]) |
| | | this.InitInSpectValList = data |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `检测值初始化错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `检测值初始化错误: ${err}` |
| | | }) |
| | | } |
| | | }, |
| | | // 检测值修改 |
| | | HInSpectValueBChange(index, e) { |
| | | let InSpectVal = this.InitInSpectValList.find(elem => elem["检测值名称"] == e) |
| | | if (!InSpectVal) { |
| | | this.InSpectValues[index].HInSpectValueB = 0 |
| | | this.InSpectValues[index].HInSpectValueB_Text = '' |
| | | return |
| | | } |
| | | this.InSpectValues[index].HInSpectValueB = InSpectVal["HItemID"] |
| | | this.InSpectValues[index].HInSpectValueB_Text = InSpectVal["检测值名称"] |
| | | }, |
| | | storeInSpectValue() { |
| | | this.$emit("update", { |
| | | data: this.checkData, |
| | | list: this.inspectValues |
| | | list: this.InSpectValues |
| | | }) |
| | | }, |
| | | getAnalysisMethodTitle(type){ |
| | |
| | | HStatusChange(e) { |
| | | this.checkData.HStatus = e.detail.value |
| | | }, |
| | | HInspectResultChange(index, e) { |
| | | HInSpectResultChange(index, e) { |
| | | console.log('e: ',e.detail.value); |
| | | this.inspectValues[index].HInspectResult = e.detail.value |
| | | this.InSpectValues[index].HInSpectResult = e.detail.value?1:2 |
| | | }, |
| | | |
| | | } |
| | | }, |
| | | |
| | | } |
| | | </script> |
| | | |
| | |
| | | font-size: 26rpx; |
| | | } |
| | | |
| | | .inspect-value-content { |
| | | .InSpect-value-content { |
| | | box-sizing: border-box; |
| | | padding: 20rpx 10rpx; |
| | | display: flex; |
| | |
| | | } |
| | | } |
| | | |
| | | .inspect-value-list { |
| | | .InSpect-value-list { |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | flex-direction: column; |
| | |
| | | <view class="bill-main-contents"> |
| | | <!-- 检验项目 呈现 --> |
| | | <view v-if="subTabSelected == 1"> |
| | | <view class="buttons" @tap="addCheckItem"> |
| | | <!-- 需通过显式调用忽略$event参数 --> |
| | | <view class="buttons" @tap="addCheckItem()"> |
| | | <uni-icons type="plus" style="margin-right: 10rpx;" size="22"></uni-icons>新增 |
| | | </view> |
| | | <view class="over" v-if="!checkItems || getObjLength(checkItems) == 0">暂无数据</view> |
| | |
| | | <!-- 检测值 呈现 --> |
| | | <view v-else v-for="item in InspectModules" :key="item.id"> |
| | | <view v-if="subTabSelected == item.id"> |
| | | <InspectValueTemplateVue :bind-key="item.id" |
| | | :bind-data="{data: checkItems[item.checkItemId], list: InspectValues[item.checkItemId]}" |
| | | @update="InspectValueUpdate"></InspectValueTemplateVue> |
| | | <InspectValueTemplateVue ref="InspectValueModules" :bind-key="item.id" |
| | | :bind-data="{data: checkItems[item.checkItemId], list: InspectValues[item.checkItemId]}"> |
| | | </InspectValueTemplateVue> |
| | | </view> |
| | | </view> |
| | | |
| | |
| | | data() { |
| | | return { |
| | | operationType: 1, |
| | | linterid: 0, |
| | | |
| | | mainTabSelected: 1, |
| | | subTabSelected: 1, |
| | |
| | | "HDeleteMan": "", |
| | | "HUpDateDate": "", |
| | | "HDeleteDate": "", |
| | | // "HResult": "2", |
| | | // "HAnalysisMethod": "1", |
| | | // "layTableCheckbox": "on", |
| | | // "HEntryID": "1", |
| | | // "HQCCheckItemName": "外观", |
| | | // "HQCCheckItemID": "2", |
| | | // "HSampleSchemeName": "", |
| | | // "HSampleSchemeID": "0", |
| | | // "HSampleQty": "0", |
| | | // "HSampleDamageQty": "0", |
| | | // "HSamplingType": "", |
| | | // "HAcceptQty": "", |
| | | // "HInspectResultToSee": "", |
| | | // "HInspectionLevel": "", |
| | | // "HRejectQty": "", |
| | | // "HStrictness": "", |
| | | // "HSampleUnRightQty": "0", |
| | | // "HAQL": "", |
| | | // "HSampleQty2": "0", |
| | | // "HInspectResultToSee2": "", |
| | | // "HSampleUnRightQty2": "0", |
| | | // "HResDec": "2", |
| | | // "HStatus": "1", |
| | | // "HComparator": "=", |
| | | // "HUnit": "", |
| | | // "HUnitID": "0", |
| | | // "HInspectVal": "", |
| | | // "HInspectValB": "", |
| | | // "HTargetVal": "", |
| | | // "HTargetValB": "", |
| | | // "HUpLimit": "0", |
| | | // "HDownLimit": "0", |
| | | // "HUpOffSet": "", |
| | | // "HDownOffSet": "", |
| | | // "HInSpectResult": "", |
| | | "HResult": "", |
| | | "HAnalysisMethod": "", |
| | | |
| | | "HResDec": "", |
| | | "HStatus": "", |
| | | |
| | | "HMainSourceBillType": "", |
| | | "HMainSourceInterID": "0", |
| | | "HMainSourceEntryID": "1", |
| | |
| | | }, |
| | | // 检验项目新增行 |
| | | addCheckItem(resource) { |
| | | |
| | | let ordinal = this.getObjLength(this.checkItems) + 1 |
| | | let checkItem = { |
| | | "num": ordinal, |
| | | "HInterID": this.hform.HInterID, |
| | | "HQCCheckItemID": "", |
| | | "HQCCheckItemNumber": "", |
| | | "HQCCheckItemName": "", |
| | |
| | | "HSamplingType": "", |
| | | "HInspectResultToSee": "" |
| | | } |
| | | |
| | | if (resource) { // 通过主表检验方案带出的检验项目 |
| | | Object.assign(checkItem, resource) |
| | | } |
| | | |
| | | this.$set(this.checkItems, ordinal, checkItem) |
| | | |
| | | this.$nextTick(() => { |
| | | // 检查是否可以新增检验值项 |
| | | this.setInspectValModule(this.checkItems[ordinal]) |
| | |
| | | await this.$nextTick() |
| | | // 重排序号 |
| | | let num = 1 |
| | | let checkItemsCache = {} |
| | | for (let s in this.checkItems) { |
| | | console.log('s: ', s); |
| | | this.checkItems[s].num = num |
| | | checkItemsCache[num] = this.checkItems[s] |
| | | checkItemsCache[num].num = num |
| | | num++ |
| | | } |
| | | this.checkItems = checkItemsCache |
| | | }, |
| | | getObjLength(obj) { |
| | | return Object.keys(obj).length |
| | |
| | | .name |
| | | this.$set(this.subTabs, `_${checkItem.num}`, { |
| | | id: `_${checkItem.num}`, |
| | | name: `${analysisMethodName}-${checkItem.HSampleSchemeName}` |
| | | name: `${analysisMethodName}-${checkItem.HQCCheckItemName}` |
| | | }) |
| | | }, |
| | | InspectValueUpdate(e) { |
| | |
| | | message: "获取单据号异常: " + err |
| | | }) |
| | | } |
| | | }, |
| | | checkSubmitValidate() { |
| | | if (this.hform.HICMOQty == "" || this.hform.HICMOQty <= 0) { |
| | | CommonUtils.showTips({ |
| | | message: "任务单数量不能为空且不能小于等于0!" |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | if (this.hform.HFirstCheckEmp) { |
| | | CommonUtils.showTips({ |
| | | message: "检验员未选择!" |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | for (let key in this.checkItems) { |
| | | if (this.checkItems[key].HQCCheckItemID) { |
| | | CommonUtils.showTips({ |
| | | message: `第${this.checkItems[key].num}行检验项目不能为空!` |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | if (this.checkItems[key].HSampleSchemeID == '' || this.checkItems[key].HSampleSchemeID == null) { |
| | | this.checkItems[key].HSampleSchemeID = 0 |
| | | } |
| | | if (this.checkItems[key].HSampleQty == '' || this.checkItems[key].HSampleQty == null) { |
| | | this.checkItems[key].HSampleQty = 0 |
| | | } |
| | | if (this.checkItems[key].HSampleDamageQty == '' || this.checkItems[key].HSampleDamageQty == null) { |
| | | this.checkItems[key].HSampleDamageQty = 0 |
| | | } |
| | | if (this.checkItems[key].HAcceptQty == '' || this.checkItems[key].HAcceptQty == null) { |
| | | this.checkItems[key].HAcceptQty = 0 |
| | | } |
| | | if (this.checkItems[key].HRejectQty == '' || this.checkItems[key].HRejectQty == null) { |
| | | this.checkItems[key].HRejectQty = 0 |
| | | } |
| | | if (this.checkItems[key].HSampleUnRightQty == '' || this.checkItems[key].HSampleUnRightQty == |
| | | null) { |
| | | this.checkItems[key].HSampleUnRightQty = 0 |
| | | } |
| | | if (this.checkItems[key].HUnitID == '') { |
| | | this.checkItems[key].HUnitID = 0 |
| | | } |
| | | } |
| | | |
| | | return true |
| | | }, |
| | | async submit() { |
| | | if (!this.checkSubmitValidate) { |
| | | return |
| | | } |
| | | try { |
| | | // 检查是否有未切换的检验值模块(是否包含set_SaveValue方法),如果有,则运行一次保存检验值的方法,根据检验值是否保存成功再执行下一步 |
| | | if (typeof this.$refs.InspectValueModules != 'undefined') { |
| | | // 加载有检验值模块 |
| | | await this.$refs.InspectValueModules[0].set_SaveValue() |
| | | this.InspectValues[0] = this.$refs.InspectValueModules[0].InSpectValues |
| | | } |
| | | let InspectValuesTrans = [] |
| | | let HInterID = this.hform.HInterID |
| | | for (let key in this.InspectValues) { |
| | | let HEntryID = key |
| | | |
| | | InspectValuesTrans.push( |
| | | `${JSON.stringify(this.InspectValues[key])};${HInterID};${HEntryID}`) |
| | | } |
| | | let checkItemsArray = [] |
| | | for (var key in this.checkItems) { |
| | | checkItemsArray.push(this.checkItems[key].data) |
| | | } |
| | | |
| | | let sMainSub = |
| | | `${JSON.stringify(this.hform)};${JSON.stringify(checkItemsArray)};${this.operationType};${getUserInfo()["Czymc"]};${InspectValuesTrans[0]}` |
| | | console.log('this.checkItems: ', this.checkItems); |
| | | |
| | | let msg = { |
| | | sMainSub: sMainSub, |
| | | sValues: InspectValuesTrans |
| | | } |
| | | |
| | | console.log('msg: ', msg); |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/QC_FirstPieceCheckBill/set_SaveBill", |
| | | data: { |
| | | sMainSub: sMainSub, |
| | | }, |
| | | method: 'POST' |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | let { |
| | | count, |
| | | Message, |
| | | data |
| | | } = res.data |
| | | if (count == 1) { |
| | | uni.showModal({ |
| | | title: '提示', |
| | | content: res.data.Message + '。是否继续新增?', |
| | | success: (res) => { |
| | | if (res.confirm) { |
| | | console.log('用户点击确定'); |
| | | uni.redirectTo({ |
| | | url: '/pages/ZLGL/shoujianjianyan/form?operationType=1' |
| | | }) |
| | | } else if (res.cancel) { |
| | | console.log('用户点击取消'); |
| | | // setTimeout(() => { |
| | | // uni.navigateBack(); |
| | | // }, 50) |
| | | } |
| | | } |
| | | }); |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `首件检验单保存错误: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `首件检验单保存错误: ${err}` |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: "pages/ZLGL/shoujianjianyan/form?operationType=1" |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | async RoadBillMain() { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: '/QC_FirstPieceCheckBill/QC_FirstPieceCheckBill_Edit', |
| | | data: { |
| | | sWhere: ` and hmainid=${this.hform.HInterID}`, |
| | | user: getUserInfo()["Czymc"] |
| | | } |
| | | }) |
| | | |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | |
| | | if (count == 1) { |
| | | console.log('RoadBillMain: : ',data ); |
| | | Object.assign(this.hform, { |
| | | "HInterID": data[0].hmainid, |
| | | "HBillNo": data[0].单据号, |
| | | "HDate": dayjs(data[0].日期).format("YYYY-MM-DD"), |
| | | "HSourceID": data[0].HSourceID, |
| | | "HSourceName": data[0].生产资源名称, |
| | | "HICMOBillNo": data[0].任务单号, |
| | | "HICMOQty": data[0].任务单数量, |
| | | "HICMOInterID": data[0].HICMOInterID, |
| | | "HICMOEntryID": data[0].HICMOEntryID, |
| | | "HMaterID": data[0].HMaterID, |
| | | "HMaterName": data[0].物料名称, |
| | | "HMaterNumber": data[0].物料代码, |
| | | "HProcID": data[0].HProcID, |
| | | "HProcName": data[0].HProcName, |
| | | "HProcExchQty": data[0].HProcExchQty, |
| | | "HProcExchBillNo": data[0].HProcExchBillNo, |
| | | "HProcExchInterID": data[0].HProcExchInterID, |
| | | "HProcExchEntryID": data[0].HProcExchEntryID, |
| | | "HFirstCheckEmp": data[0].HFirstCheckEmp, |
| | | "HFirstCheckEmpName": data[0].质检员名称, |
| | | "HQCSchemeID": data[0].检验方案ID, |
| | | "HQCSchemeName": data[0].检验方案名称, |
| | | "HRemark": data[0].表头备注, |
| | | "HMaker": data[0].制单人, |
| | | "HMakeDate": data[0].制单日期, |
| | | "HChecker": data[0].审核人, |
| | | "HCheckDate": data[0].审核日期, |
| | | "HCloseMan": data[0].关闭人, |
| | | "HCloseDate": data[0].关闭日期, |
| | | "HUpDateDate": data[0].修改日期, |
| | | "HDeleteDate": data[0].作废日期, |
| | | "HSampleSchemeID": data[0].HSampleSchemeID, |
| | | "HSampleSchemeName": data[0].抽样方案名称, |
| | | "HSampleQty": data[0].样本量, |
| | | "HSampleQty2": data[0].样本量, |
| | | "HSampleDamageQty": data[0].样本破坏数, |
| | | "HSamplingType": data[0].抽样类型, |
| | | "HAcceptQty": data[0].允许数, |
| | | "HInspectionLevel": data[0].检验水平, |
| | | "HRejectQty": data[0].拒绝数, |
| | | "HStrictness": data[0].严格度, |
| | | "HSampleUnRightQty": data[0].样本不合格数, |
| | | "HSampleUnRightQty2": data[0].样本不合格数, |
| | | "HAQL": data[0].AQL, |
| | | "HUnitID": data[0].HUnitID, |
| | | "HUnit": data[0].单位, |
| | | "HInspectValB": data[0].检测值基础资料, |
| | | "HInspectVal": data[0].检测值, |
| | | "HTargetValB": data[0].目标值基础资料, |
| | | "HTargetVal": data[0].目标值, |
| | | "HUpLimit": data[0].上限值, |
| | | "HDownLimit": data[0].下限值, |
| | | "HUpOffSet": data[0].上偏差, |
| | | "HDownOffSet": data[0].下偏差, |
| | | "HEntryID": data[0].hsubid, |
| | | "HQCCheckItemName": data[0].检验项目名称, |
| | | "HQCCheckItemID": data[0].HQCCheckItemID, |
| | | "HShiftsID": data[0].HShiftsID, |
| | | "HShiftsName": data[0].班次名称, |
| | | "HErrTreatment": data[0].异常临时处理方案, |
| | | "HBatchNo": data[0].批号, |
| | | "HLastResult": data[0].判定结论 == "合格" ? "true" : "false", |
| | | "HTakeSampleCheckBillID": data[0].HTakeSampleCheckBillID, |
| | | "HTakeSampleCheckBillNo": data[0].HTakeSampleCheckBillNo |
| | | }) |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.addCheckItem({ |
| | | |
| | | "HQCCheckItemID": data[i].HQCCheckItemID, |
| | | "HQCCheckItemNumber": data[i].检验项目代码, |
| | | "HQCCheckItemName": data[i].检验项目名称, |
| | | "HInspectInstruMentID": data[i].HInspectInstruMentID, |
| | | "HInspectInstruMentNumber": data[i].检验仪器代码, |
| | | "HInspectInstruMentName": data[i].检验仪器名称, |
| | | "HQCStd": data[i].检验标准, |
| | | "HUnit": data[i].单位名称, |
| | | "HQCNote": data[i].检验记录, |
| | | "HResult": data[i].结论 == "合格" ? 1 : 2, |
| | | "HMax": data[i].最大值, |
| | | "HMin": data[i].最小值, |
| | | "HAvg": data[i].平均值, |
| | | "HRemark": data[i].表体备注, |
| | | "HAnalysisMethod": data[i].分析方法 == "定性分析" ? 1 : (data[i].分析方法 == "定量分析" ? |
| | | 2 : |
| | | 3), |
| | | "HKeyInspect": data[i].重点检查 == "否" ? false : true, |
| | | "HSampleSchemeID": data[i].HSampleSchemeID, |
| | | "HUnitID": data[i].HUnitID, |
| | | "HInspectVal": data[i].检测值, |
| | | "HTargetVal": data[i].目标值, |
| | | "HUpLimit": data[i].上限值, |
| | | "HDownLimit": data[i].下限值, |
| | | "HUpOffSet": data[i].上偏差, |
| | | "HDownOffSet": data[i].下偏差, |
| | | "HSampleDamageQty": data[i].样本破坏数, |
| | | "HSampleSchemeName": data[i].抽样方案名称, |
| | | "HSampleQty": data[i].样本量, |
| | | "HSampleDamageQty": data[i].样本破坏数, |
| | | "HAcceptQty": data[i].允许数, |
| | | "HInspectionLevel": 0, |
| | | "HRejectQty": data[i].拒绝数, |
| | | "HStrictness": 0, |
| | | "HSampleUnRightQty": data[i].样本不合格数, |
| | | "HAQL": data[i].AQL, |
| | | "HSamplingType": 0, |
| | | "HSamplingType": data[i].抽样类型, |
| | | "HStrictness": data[i].严格度 |
| | | }) |
| | | } |
| | | |
| | | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `加载单据失败: ${Message}` |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: '温馨提示', |
| | | message: `加载单据失败: ${err}` |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | async onLoad(e) { |
| | | this.operationType = e.operationType || 1 |
| | | this.linterid = e.linterid || 0 |
| | | this.hform.HInterID = e.linterid || 0 |
| | | if (this.operationType == 1) { |
| | | await this.getMaxBillNo() |
| | | } else if (this.operationType == 2) { |
| | | |
| | | await this.RoadBillMain() |
| | | } else if (this.operationType == 3) { |
| | | |
| | | } |
| | |
| | | <view class="detail" v-if="item['物料名称']"> |
| | | <text>物料名称:</text>{{item['物料名称']}} |
| | | </view> |
| | | <view class="detail" v-if="item['规格型号'].trim()"> |
| | | <view class="detail" v-if="item['规格型号']"> |
| | | <text>规格型号:</text>{{item['规格型号']}} |
| | | </view> |
| | | <view class="detail" v-if="item['检验方案'].trim()"> |
| | | <view class="detail" v-if="item['检验方案']"> |
| | | <text>检验方案:</text>{{item['检验方案']}} |
| | | </view> |
| | | <view class="detail" v-if="item['规格型号'].trim()"> |
| | | <view class="detail" v-if="item['规格型号']"> |
| | | <text>规格型号:</text>{{item['规格型号']}} |
| | | </view> |
| | | </view> |
| | |
| | | } |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/QC_POStockInCheckBill/GetPOStockInCheckBill', |
| | | url: '/QC_FirstPieceCheckBill/QC_FirstPieceCheckBillList', |
| | | data: { |
| | | "sWhere": sWhere, |
| | | "user": getUserInfo()["Czymc"] |
| | |
| | | console.log('用户点击确定'); |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/Sc_MouldConkBookBill/DeltetMouldConkBookBill', |
| | | url: '/DeltetQC_FirstPieceCheck', |
| | | data: { |
| | | "HInterID": item.hmainid, |
| | | "user": getUserInfo()["Czymc"] |
| | |
| | | <input type="text" :disabled="barcodeReadOnly" :focus="barCodeFocus" v-model="hform.HBarCode" |
| | | @confirm="getHBarCodeData(hform.HBarCode)" /> |
| | | </view> |
| | | <uni-icons type="scan" |
| | | style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;flex-shrink: 0;" |
| | | size="20" @click="toScanCode"></uni-icons> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">故障发生日期</view> |
| | |
| | | import BarCodePopupVue from "../../components/BarCodePopup/BarCodePopup.vue"; |
| | | import BillSelectPopupXiaoWeiVue from '../../components/BillSelectPopupXiaoWei/BillSelectPopupXiaoWei.vue'; |
| | | import dayjs from 'dayjs'; |
| | | import { MpaasScan } from '../../utils/mpaasScan'; |
| | | export default { |
| | | components: { |
| | | BillListPopupVue, |
| | |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | //扫条码处理 |
| | | async getCode(HBarCode) { |
| | | //仓库、仓位文本框为空时,清空对应ID |
| | | if (!this.hform.HWHName) { |
| | | this.hform.HWHID = 0 |
| | | } |
| | | if (!this.hform.HStockPlaceName) { |
| | | this.hform.HStockPlaceID = 0 |
| | | } |
| | | var sOldBarCode = HBarCode |
| | | var HDeleteFlag = sOldBarCode.substring(0, 1); |
| | | var sBarCode = sOldBarCode.slice(1); |
| | | |
| | | var sHWHID = this.hform.HWHID |
| | | var sHSPID = this.hform.HStockPlaceID |
| | | var sHQty = this.hform.HQty |
| | | var sSourceBillNo = this.hform.HSourceBillNo |
| | | var sSourceBillType = this.hform.HMainSourceBillType |
| | | var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true |
| | | console.log(this.hform.HSourceBillNo, HSourceFlag) |
| | | if (HDeleteFlag == "*") { |
| | | if (sBarCode == "") { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: '请扫描要删除的条码', |
| | | icon: 'none' |
| | | }) |
| | | } else { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json', |
| | | data: { |
| | | HInterID: this.hform.HInterID, |
| | | HBillType: this.hform.HBillType, |
| | | HBarCode: sBarCode |
| | | } |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | console.log('删除条码', res.data); |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | this.playSound(1) |
| | | this.hform.HQty = '' |
| | | this.DisBillEntryList() |
| | | } else { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | this.refreshBarCodeState() |
| | | this.playSound(0) |
| | | uni.showToast({ |
| | | title: '接口请求失败: ' + err, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | // uni.request({ |
| | | // url: this.serverUrl + |
| | | // '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json', |
| | | // data: { |
| | | // HInterID: this.hform.HInterID, |
| | | // HBillType: this.hform.HBillType, |
| | | // HBarCode: sBarCode |
| | | // }, |
| | | // success: (res) => { |
| | | // console.log('删除条码', res.data); |
| | | // this.hform.HBarCode = '' |
| | | // if (res.data.count == 1) { |
| | | // this.playSound(1) |
| | | // this.hform.HQty = '' |
| | | // CommonUtils.playSound(1) |
| | | // this.DisBillEntryList() |
| | | // } else { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // uni.showToast({ |
| | | // title: res.data.Message, |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | // }, |
| | | // fail: (res) => { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // console.log(res); |
| | | // uni.showToast({ |
| | | // title: '接口请求失败', |
| | | // icon: 'none' |
| | | // }) |
| | | // }, |
| | | // }); |
| | | } |
| | | } else { |
| | | var sBarCode = this.hform.HBarCode |
| | | if (sHQty == "") { |
| | | sHQty = 0; |
| | | } |
| | | |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/WEBSController/Get_BarCode_Json', |
| | | data: { |
| | | sBarCode: sBarCode, |
| | | HInterID: this.hform.HInterID, |
| | | HBillType: this.hform.HBillType, |
| | | HBillNo: this.hform.HBillNo, |
| | | HMaker: this.hform.HMaker, |
| | | HWhID: sHWHID, |
| | | HSPID: sHSPID, |
| | | HQty: sHQty, |
| | | HRedBlueFlag: this.hform.HRedBlueFlag, |
| | | SourceFlag: HSourceFlag, |
| | | HSourceBillNo: sSourceBillNo, |
| | | HSourceBillType: sSourceBillType, |
| | | HStockOrgID: this.hform.HStockOrgID, |
| | | HScanStyle: "", |
| | | HCustom1: "", |
| | | HCustom2: "" |
| | | }, |
| | | }) |
| | | if (!res) { |
| | | return |
| | | } |
| | | console.log('扫码返回', res.data); |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | this.playSound(1) |
| | | var data = res.data.data |
| | | if (data.hBarTypeField == '仓库条码') { |
| | | this.hform.HWHName = data.hWhNameField |
| | | this.hform.HWHID = data.hWhIDField |
| | | this.hform.HStockPlaceName = '' |
| | | this.hform.HStockPlaceID = 0 |
| | | if (data.hSPFlagField == 0) { |
| | | this.showHStockPlaceName = false |
| | | } else { |
| | | this.showHStockPlaceName = true |
| | | } |
| | | } else if (data.hBarTypeField == '仓位条码') { |
| | | this.hform.HWHName = data.hWhNameField |
| | | this.hform.HWHID = data.hWhIDField |
| | | this.hform.HStockPlaceName = data.hSPNameField |
| | | this.hform.HStockPlaceID = data.hSPIDField |
| | | } else if (data.hBarTypeField == '部门条码') { |
| | | this.hform.HDeptName = data.hDeptNameField |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.tabs = 1 |
| | | } else if (data.hBarTypeField == '源单条码') { |
| | | this.hform.HSupName = data.hSupNameField |
| | | this.hform.HSupID = data.hSupIDField |
| | | if (data.hDeptIDField != 0) { |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.hform.HDeptName = data.hDeptNameField |
| | | } |
| | | this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | //获取源单类型、源单单号 |
| | | this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | if (data.hSourceBillTypeField == "1105") { |
| | | this.HMainSourceBillType = '退料通知单' |
| | | this.hform.HMainSourceBillType = 1105 |
| | | this.showHMainSourceBillType = false |
| | | } else if (data.hSourceBillTypeField == "1102") { |
| | | this.HMainSourceBillType = '采购订单' |
| | | this.hform.HMainSourceBillType = 1102 |
| | | this.showHMainSourceBillType = false |
| | | } else if (data.hSourceBillType == 1201) { |
| | | this.HMainSourceBillType = '采购入库单' |
| | | this.hform.HMainSourceBillType = 1201 |
| | | this.showHMainSourceBillType = false |
| | | } else { |
| | | this.HMainSourceBillType = '手工录入' |
| | | this.hform.HMainSourceBillType = -1 |
| | | this.showHMainSourceBillType = false |
| | | } |
| | | if (data.hMulSourceFlagField == 0) { |
| | | this.showHSourceBillNo = false |
| | | } |
| | | //供应商不可编辑 |
| | | this.showHSupName = false |
| | | this.tabs = 2 |
| | | } else { //物料条码 |
| | | this.tabs = 2 |
| | | if (!this.hform.HSourceBillNo) { |
| | | this.hform.HSupName = data.hSupNameField |
| | | this.hform.HSupID = data.hSupIDField |
| | | this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | if (data.hDeptIDField != 0) { |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.hform.HDeptName = data.hDeptNameField |
| | | } |
| | | console.log(data) |
| | | //获取源单类型、源单单号 |
| | | this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | |
| | | let index = this.arrayHMainSourceBillValue.findIndex(e => e == |
| | | data |
| | | .hSourceBillTypeField) |
| | | if (index != -1) { |
| | | this.HMainSourceBillType = this.arrayHMainSourceBillType[ |
| | | index] |
| | | this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | this.showHMainSourceBillType = false |
| | | } |
| | | // if (data.hSourceBillTypeField == "1103") { |
| | | // this.HMainSourceBillType = '收料通知单' |
| | | // this.hform.HMainSourceBillType = 1103 |
| | | // this.showHMainSourceBillType = false |
| | | // } else if (data.hSourceBillTypeField == "1102") { |
| | | // this.HMainSourceBillType = '采购订单' |
| | | // this.hform.HMainSourceBillType = 1102 |
| | | // this.showHMainSourceBillType = false |
| | | // } else { |
| | | // this.HMainSourceBillType = '手工录入' |
| | | // this.hform.HMainSourceBillType = -1 |
| | | // this.showHMainSourceBillType = false |
| | | // } |
| | | if (data.hMulSourceFlagField == 0) { |
| | | this.showHSourceBillNo = false |
| | | } |
| | | //供应商不可编辑 |
| | | this.showHSupName = false |
| | | } |
| | | } |
| | | //显示表体明细 |
| | | this.DisBillEntryList() |
| | | //清空数量 |
| | | this.hform.HQty = '' |
| | | } else { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | console.log(err); |
| | | uni.showToast({ |
| | | title: '接口请求失败: ' + err, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | // uni.request({ |
| | | // url: this.serverUrl + '/WEBSController/Get_BarCode_Json', |
| | | // data: { |
| | | // sBarCode: sBarCode, |
| | | // HInterID: this.hform.HInterID, |
| | | // HBillType: this.hform.HBillType, |
| | | // HBillNo: this.hform.HBillNo, |
| | | // HMaker: this.hform.HMaker, |
| | | // HWhID: sHWHID, |
| | | // HSPID: sHSPID, |
| | | // HQty: sHQty, |
| | | // HRedBlueFlag: this.hform.HRedBlueFlag, |
| | | // SourceFlag: HSourceFlag, |
| | | // HSourceBillNo: sSourceBillNo, |
| | | // HSourceBillType: sSourceBillType, |
| | | // HStockOrgID: this.hform.HStockOrgID, |
| | | // HScanStyle: "", |
| | | // HCustom1: "", |
| | | // HCustom2: "" |
| | | // }, |
| | | // success: (res) => { |
| | | // console.log('扫码返回', res.data); |
| | | // this.hform.HBarCode = '' |
| | | // if (res.data.count == 1) { |
| | | // this.playSound(1) |
| | | // var data = res.data.data |
| | | // if (data.hBarTypeField == '仓库条码') { |
| | | // this.hform.HWHName = data.hWhNameField |
| | | // this.hform.HWHID = data.hWhIDField |
| | | // this.hform.HStockPlaceName = '' |
| | | // this.hform.HStockPlaceID = 0 |
| | | // if (data.hSPFlagField == 0) { |
| | | // this.showHStockPlaceName = false |
| | | // } else { |
| | | // this.showHStockPlaceName = true |
| | | // } |
| | | // } else if (data.hBarTypeField == '仓位条码') { |
| | | // this.hform.HWHName = data.hWhNameField |
| | | // this.hform.HWHID = data.hWhIDField |
| | | // this.hform.HStockPlaceName = data.hSPNameField |
| | | // this.hform.HStockPlaceID = data.hSPIDField |
| | | // } else if (data.hBarTypeField == '部门条码') { |
| | | // this.hform.HDeptName = data.hDeptNameField |
| | | // this.hform.HDeptID = data.hDeptIDField |
| | | // this.tabs = 1 |
| | | // } else if (data.hBarTypeField == '源单条码') { |
| | | // this.hform.HSupName = data.hSupNameField |
| | | // this.hform.HSupID = data.hSupIDField |
| | | // if (data.hDeptIDField != 0) { |
| | | // this.hform.HDeptID = data.hDeptIDField |
| | | // this.hform.HDeptName = data.hDeptNameField |
| | | // } |
| | | // this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | // //获取源单类型、源单单号 |
| | | // this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | // if (data.hSourceBillTypeField == "1105") { |
| | | // this.HMainSourceBillType = '退料通知单' |
| | | // this.hform.HMainSourceBillType = 1105 |
| | | // this.showHMainSourceBillType = false |
| | | // } else if (data.hSourceBillTypeField == "1102") { |
| | | // this.HMainSourceBillType = '采购订单' |
| | | // this.hform.HMainSourceBillType = 1102 |
| | | // this.showHMainSourceBillType = false |
| | | // } else if (data.hSourceBillType == 1201) { |
| | | // this.HMainSourceBillType = '采购入库单' |
| | | // this.hform.HMainSourceBillType = 1201 |
| | | // this.showHMainSourceBillType = false |
| | | // } else { |
| | | // this.HMainSourceBillType = '手工录入' |
| | | // this.hform.HMainSourceBillType = -1 |
| | | // this.showHMainSourceBillType = false |
| | | // } |
| | | // if (data.hMulSourceFlagField == 0) { |
| | | // this.showHSourceBillNo = false |
| | | // } |
| | | // //供应商不可编辑 |
| | | // this.showHSupName = false |
| | | // this.tabs = 2 |
| | | // } else { //物料条码 |
| | | // this.tabs = 2 |
| | | // if (!this.hform.HSourceBillNo) { |
| | | // this.hform.HSupName = data.hSupNameField |
| | | // this.hform.HSupID = data.hSupIDField |
| | | // this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | // if (data.hDeptIDField != 0) { |
| | | // this.hform.HDeptID = data.hDeptIDField |
| | | // this.hform.HDeptName = data.hDeptNameField |
| | | // } |
| | | // console.log(data) |
| | | // //获取源单类型、源单单号 |
| | | // this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | // |
| | | // let index = this.arrayHMainSourceBillValue.findIndex(e => e == |
| | | // data |
| | | // .hSourceBillTypeField) |
| | | // if (index != -1) { |
| | | // this.HMainSourceBillType = this.arrayHMainSourceBillType[ |
| | | // index] |
| | | // this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | // this.showHMainSourceBillType = false |
| | | // } |
| | | // // if (data.hSourceBillTypeField == "1103") { |
| | | // // this.HMainSourceBillType = '收料通知单' |
| | | // // this.hform.HMainSourceBillType = 1103 |
| | | // // this.showHMainSourceBillType = false |
| | | // // } else if (data.hSourceBillTypeField == "1102") { |
| | | // // this.HMainSourceBillType = '采购订单' |
| | | // // this.hform.HMainSourceBillType = 1102 |
| | | // // this.showHMainSourceBillType = false |
| | | // // } else { |
| | | // // this.HMainSourceBillType = '手工录入' |
| | | // // this.hform.HMainSourceBillType = -1 |
| | | // // this.showHMainSourceBillType = false |
| | | // // } |
| | | // if (data.hMulSourceFlagField == 0) { |
| | | // this.showHSourceBillNo = false |
| | | // } |
| | | // //供应商不可编辑 |
| | | // this.showHSupName = false |
| | | // } |
| | | // } |
| | | // //显示表体明细 |
| | | // this.DisBillEntryList() |
| | | // //清空数量 |
| | | // this.hform.HQty = '' |
| | | // } else { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // uni.showToast({ |
| | | // title: res.data.Message, |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | // }, |
| | | // fail: (res) => { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // console.log(res); |
| | | // uni.showToast({ |
| | | // title: '接口请求失败', |
| | | // icon: 'none' |
| | | // }) |
| | | // }, |
| | | // }); |
| | | } |
| | | }, |
| | | //物料信息 |
| | | DisBillEntryList() { |
| | |
| | | <input type="text" name="HBarCode" v-model="hform.HBarCode" |
| | | @confirm="getHBarCodeData(hform.HBarCode)" /> |
| | | </view> |
| | | <uni-icons type="scan" |
| | | style="background-color: #3A78FF;padding: 6rpx;color: #fff;border-radius: 100%;flex-shrink: 0;" |
| | | size="20" @click="toScanCode"></uni-icons> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">源单类型</view> |
| | |
| | | this.hform.HBarCode = ret.resp_result |
| | | } |
| | | |
| | | this.getCode(this.hform.HBarCode) |
| | | this.getHBarCodeData(this.hform.HBarCode) |
| | | }) |
| | | }, |
| | | //日期 |
| | |
| | | } |
| | | |
| | | |
| | | }, |
| | | //扫条码处理 |
| | | async getCode(HBarCode) { |
| | | //仓库、仓位文本框为空时,清空对应ID |
| | | if (!this.hform.HWHName) { |
| | | this.hform.HWHID = 0 |
| | | } |
| | | if (!this.hform.HStockPlaceName) { |
| | | this.hform.HStockPlaceID = 0 |
| | | } |
| | | var sOldBarCode = HBarCode |
| | | var HDeleteFlag = sOldBarCode.substring(0, 1); |
| | | var sBarCode = sOldBarCode.slice(1); |
| | | |
| | | var sHWHID = this.hform.HWHID |
| | | var sHSPID = this.hform.HStockPlaceID |
| | | var sHQty = this.hform.HQty |
| | | var sSourceBillNo = this.hform.HSourceBillNo |
| | | var sSourceBillType = this.hform.HMainSourceBillType |
| | | var HSourceFlag = this.hform.HSourceBillNo == '' ? false : true |
| | | console.log(this.hform.HSourceBillNo, HSourceFlag) |
| | | if (HDeleteFlag == "*") { |
| | | if (sBarCode == "") { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: '请扫描要删除的条码', |
| | | icon: 'none' |
| | | }) |
| | | } else { |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json', |
| | | data: { |
| | | HInterID: this.hform.HInterID, |
| | | HBillType: this.hform.HBillType, |
| | | HBarCode: sBarCode |
| | | } |
| | | }) |
| | | |
| | | if (!res) { |
| | | return |
| | | } |
| | | |
| | | console.log('删除条码', res.data); |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | this.playSound(1) |
| | | this.hform.HQty = '' |
| | | this.DisBillEntryList() |
| | | } else { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | this.refreshBarCodeState() |
| | | this.playSound(0) |
| | | uni.showToast({ |
| | | title: '接口请求失败: ' + err, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | // uni.request({ |
| | | // url: this.serverUrl + |
| | | // '/WEBSController/set_DelPonderationBillMain_Temp_BarCode_Json', |
| | | // data: { |
| | | // HInterID: this.hform.HInterID, |
| | | // HBillType: this.hform.HBillType, |
| | | // HBarCode: sBarCode |
| | | // }, |
| | | // success: (res) => { |
| | | // console.log('删除条码', res.data); |
| | | // this.hform.HBarCode = '' |
| | | // if (res.data.count == 1) { |
| | | // this.playSound(1) |
| | | // this.hform.HQty = '' |
| | | // CommonUtils.playSound(1) |
| | | // this.DisBillEntryList() |
| | | // } else { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // uni.showToast({ |
| | | // title: res.data.Message, |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | // }, |
| | | // fail: (res) => { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // console.log(res); |
| | | // uni.showToast({ |
| | | // title: '接口请求失败', |
| | | // icon: 'none' |
| | | // }) |
| | | // }, |
| | | // }); |
| | | } |
| | | } else { |
| | | var sBarCode = this.hform.HBarCode |
| | | if (sHQty == "") { |
| | | sHQty = 0; |
| | | } |
| | | |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/WEBSController/Get_BarCode_Json', |
| | | data: { |
| | | sBarCode: sBarCode, |
| | | HInterID: this.hform.HInterID, |
| | | HBillType: this.hform.HBillType, |
| | | HBillNo: this.hform.HBillNo, |
| | | HMaker: this.hform.HMaker, |
| | | HWhID: sHWHID, |
| | | HSPID: sHSPID, |
| | | HQty: sHQty, |
| | | HRedBlueFlag: this.hform.HRedBlueFlag, |
| | | SourceFlag: HSourceFlag, |
| | | HSourceBillNo: sSourceBillNo, |
| | | HSourceBillType: sSourceBillType, |
| | | HStockOrgID: this.hform.HStockOrgID, |
| | | HScanStyle: "", |
| | | HCustom1: "", |
| | | HCustom2: "" |
| | | }, |
| | | }) |
| | | if (!res) { |
| | | return |
| | | } |
| | | console.log('扫码返回', res.data); |
| | | this.hform.HBarCode = '' |
| | | if (res.data.count == 1) { |
| | | this.playSound(1) |
| | | var data = res.data.data |
| | | if (data.hBarTypeField == '仓库条码') { |
| | | this.hform.HWHName = data.hWhNameField |
| | | this.hform.HWHID = data.hWhIDField |
| | | this.hform.HStockPlaceName = '' |
| | | this.hform.HStockPlaceID = 0 |
| | | if (data.hSPFlagField == 0) { |
| | | this.showHStockPlaceName = false |
| | | } else { |
| | | this.showHStockPlaceName = true |
| | | } |
| | | } else if (data.hBarTypeField == '仓位条码') { |
| | | this.hform.HWHName = data.hWhNameField |
| | | this.hform.HWHID = data.hWhIDField |
| | | this.hform.HStockPlaceName = data.hSPNameField |
| | | this.hform.HStockPlaceID = data.hSPIDField |
| | | } else if (data.hBarTypeField == '部门条码') { |
| | | this.hform.HDeptName = data.hDeptNameField |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.tabs = 1 |
| | | } else if (data.hBarTypeField == '源单条码') { |
| | | this.hform.HSupName = data.hSupNameField |
| | | this.hform.HSupID = data.hSupIDField |
| | | if (data.hDeptIDField != 0) { |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.hform.HDeptName = data.hDeptNameField |
| | | } |
| | | this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | //获取源单类型、源单单号 |
| | | this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | if (data.hSourceBillTypeField == "1105") { |
| | | this.HMainSourceBillType = '退料通知单' |
| | | this.hform.HMainSourceBillType = 1105 |
| | | this.showHMainSourceBillType = false |
| | | } else if (data.hSourceBillTypeField == "1102") { |
| | | this.HMainSourceBillType = '采购订单' |
| | | this.hform.HMainSourceBillType = 1102 |
| | | this.showHMainSourceBillType = false |
| | | } else if (data.hSourceBillType == 1201) { |
| | | this.HMainSourceBillType = '采购入库单' |
| | | this.hform.HMainSourceBillType = 1201 |
| | | this.showHMainSourceBillType = false |
| | | } else { |
| | | this.HMainSourceBillType = '手工录入' |
| | | this.hform.HMainSourceBillType = -1 |
| | | this.showHMainSourceBillType = false |
| | | } |
| | | if (data.hMulSourceFlagField == 0) { |
| | | this.showHSourceBillNo = false |
| | | } |
| | | //供应商不可编辑 |
| | | this.showHSupName = false |
| | | this.tabs = 2 |
| | | } else { //物料条码 |
| | | this.tabs = 2 |
| | | if (!this.hform.HSourceBillNo) { |
| | | this.hform.HSupName = data.hSupNameField |
| | | this.hform.HSupID = data.hSupIDField |
| | | this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | if (data.hDeptIDField != 0) { |
| | | this.hform.HDeptID = data.hDeptIDField |
| | | this.hform.HDeptName = data.hDeptNameField |
| | | } |
| | | console.log(data) |
| | | //获取源单类型、源单单号 |
| | | this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | |
| | | let index = this.arrayHMainSourceBillValue.findIndex(e => e == |
| | | data |
| | | .hSourceBillTypeField) |
| | | if (index != -1) { |
| | | this.HMainSourceBillType = this.arrayHMainSourceBillType[ |
| | | index] |
| | | this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | this.showHMainSourceBillType = false |
| | | } |
| | | // if (data.hSourceBillTypeField == "1103") { |
| | | // this.HMainSourceBillType = '收料通知单' |
| | | // this.hform.HMainSourceBillType = 1103 |
| | | // this.showHMainSourceBillType = false |
| | | // } else if (data.hSourceBillTypeField == "1102") { |
| | | // this.HMainSourceBillType = '采购订单' |
| | | // this.hform.HMainSourceBillType = 1102 |
| | | // this.showHMainSourceBillType = false |
| | | // } else { |
| | | // this.HMainSourceBillType = '手工录入' |
| | | // this.hform.HMainSourceBillType = -1 |
| | | // this.showHMainSourceBillType = false |
| | | // } |
| | | if (data.hMulSourceFlagField == 0) { |
| | | this.showHSourceBillNo = false |
| | | } |
| | | //供应商不可编辑 |
| | | this.showHSupName = false |
| | | } |
| | | } |
| | | //显示表体明细 |
| | | this.DisBillEntryList() |
| | | //清空数量 |
| | | this.hform.HQty = '' |
| | | } else { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | this.playSound(0) |
| | | this.refreshBarCodeState() |
| | | console.log(err); |
| | | uni.showToast({ |
| | | title: '接口请求失败: ' + err, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | // uni.request({ |
| | | // url: this.serverUrl + '/WEBSController/Get_BarCode_Json', |
| | | // data: { |
| | | // sBarCode: sBarCode, |
| | | // HInterID: this.hform.HInterID, |
| | | // HBillType: this.hform.HBillType, |
| | | // HBillNo: this.hform.HBillNo, |
| | | // HMaker: this.hform.HMaker, |
| | | // HWhID: sHWHID, |
| | | // HSPID: sHSPID, |
| | | // HQty: sHQty, |
| | | // HRedBlueFlag: this.hform.HRedBlueFlag, |
| | | // SourceFlag: HSourceFlag, |
| | | // HSourceBillNo: sSourceBillNo, |
| | | // HSourceBillType: sSourceBillType, |
| | | // HStockOrgID: this.hform.HStockOrgID, |
| | | // HScanStyle: "", |
| | | // HCustom1: "", |
| | | // HCustom2: "" |
| | | // }, |
| | | // success: (res) => { |
| | | // console.log('扫码返回', res.data); |
| | | // this.hform.HBarCode = '' |
| | | // if (res.data.count == 1) { |
| | | // this.playSound(1) |
| | | // var data = res.data.data |
| | | // if (data.hBarTypeField == '仓库条码') { |
| | | // this.hform.HWHName = data.hWhNameField |
| | | // this.hform.HWHID = data.hWhIDField |
| | | // this.hform.HStockPlaceName = '' |
| | | // this.hform.HStockPlaceID = 0 |
| | | // if (data.hSPFlagField == 0) { |
| | | // this.showHStockPlaceName = false |
| | | // } else { |
| | | // this.showHStockPlaceName = true |
| | | // } |
| | | // } else if (data.hBarTypeField == '仓位条码') { |
| | | // this.hform.HWHName = data.hWhNameField |
| | | // this.hform.HWHID = data.hWhIDField |
| | | // this.hform.HStockPlaceName = data.hSPNameField |
| | | // this.hform.HStockPlaceID = data.hSPIDField |
| | | // } else if (data.hBarTypeField == '部门条码') { |
| | | // this.hform.HDeptName = data.hDeptNameField |
| | | // this.hform.HDeptID = data.hDeptIDField |
| | | // this.tabs = 1 |
| | | // } else if (data.hBarTypeField == '源单条码') { |
| | | // this.hform.HSupName = data.hSupNameField |
| | | // this.hform.HSupID = data.hSupIDField |
| | | // if (data.hDeptIDField != 0) { |
| | | // this.hform.HDeptID = data.hDeptIDField |
| | | // this.hform.HDeptName = data.hDeptNameField |
| | | // } |
| | | // this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | // //获取源单类型、源单单号 |
| | | // this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | // if (data.hSourceBillTypeField == "1105") { |
| | | // this.HMainSourceBillType = '退料通知单' |
| | | // this.hform.HMainSourceBillType = 1105 |
| | | // this.showHMainSourceBillType = false |
| | | // } else if (data.hSourceBillTypeField == "1102") { |
| | | // this.HMainSourceBillType = '采购订单' |
| | | // this.hform.HMainSourceBillType = 1102 |
| | | // this.showHMainSourceBillType = false |
| | | // } else if (data.hSourceBillType == 1201) { |
| | | // this.HMainSourceBillType = '采购入库单' |
| | | // this.hform.HMainSourceBillType = 1201 |
| | | // this.showHMainSourceBillType = false |
| | | // } else { |
| | | // this.HMainSourceBillType = '手工录入' |
| | | // this.hform.HMainSourceBillType = -1 |
| | | // this.showHMainSourceBillType = false |
| | | // } |
| | | // if (data.hMulSourceFlagField == 0) { |
| | | // this.showHSourceBillNo = false |
| | | // } |
| | | // //供应商不可编辑 |
| | | // this.showHSupName = false |
| | | // this.tabs = 2 |
| | | // } else { //物料条码 |
| | | // this.tabs = 2 |
| | | // if (!this.hform.HSourceBillNo) { |
| | | // this.hform.HSupName = data.hSupNameField |
| | | // this.hform.HSupID = data.hSupIDField |
| | | // this.hform.HSourceBillNo = data.hSourceBillNoField |
| | | // if (data.hDeptIDField != 0) { |
| | | // this.hform.HDeptID = data.hDeptIDField |
| | | // this.hform.HDeptName = data.hDeptNameField |
| | | // } |
| | | // console.log(data) |
| | | // //获取源单类型、源单单号 |
| | | // this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | // |
| | | // let index = this.arrayHMainSourceBillValue.findIndex(e => e == |
| | | // data |
| | | // .hSourceBillTypeField) |
| | | // if (index != -1) { |
| | | // this.HMainSourceBillType = this.arrayHMainSourceBillType[ |
| | | // index] |
| | | // this.hform.HMainSourceBillType = data.hSourceBillTypeField |
| | | // this.showHMainSourceBillType = false |
| | | // } |
| | | // // if (data.hSourceBillTypeField == "1103") { |
| | | // // this.HMainSourceBillType = '收料通知单' |
| | | // // this.hform.HMainSourceBillType = 1103 |
| | | // // this.showHMainSourceBillType = false |
| | | // // } else if (data.hSourceBillTypeField == "1102") { |
| | | // // this.HMainSourceBillType = '采购订单' |
| | | // // this.hform.HMainSourceBillType = 1102 |
| | | // // this.showHMainSourceBillType = false |
| | | // // } else { |
| | | // // this.HMainSourceBillType = '手工录入' |
| | | // // this.hform.HMainSourceBillType = -1 |
| | | // // this.showHMainSourceBillType = false |
| | | // // } |
| | | // if (data.hMulSourceFlagField == 0) { |
| | | // this.showHSourceBillNo = false |
| | | // } |
| | | // //供应商不可编辑 |
| | | // this.showHSupName = false |
| | | // } |
| | | // } |
| | | // //显示表体明细 |
| | | // this.DisBillEntryList() |
| | | // //清空数量 |
| | | // this.hform.HQty = '' |
| | | // } else { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // uni.showToast({ |
| | | // title: res.data.Message, |
| | | // icon: 'none' |
| | | // }) |
| | | // } |
| | | // }, |
| | | // fail: (res) => { |
| | | // this.playSound(0) |
| | | // this.refreshBarCodeState() |
| | | // console.log(res); |
| | | // uni.showToast({ |
| | | // title: '接口请求失败', |
| | | // icon: 'none' |
| | | // }) |
| | | // }, |
| | | // }); |
| | | } |
| | | }, |
| | | //物料信息 |
| | | DisBillEntryList() { |
| | |
| | | // 新增回调 |
| | | addNew() { |
| | | uni.redirectTo({ |
| | | url: '/pages/caigoutuiliao/form?OperationType=1' |
| | | url: '/pages/weixiujilu/form?OperationType=1' |
| | | }) |
| | | }, |
| | | //新增 |