| | |
| | | </uni-datetime-picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="left">源单类型</view> |
| | | <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> |
| | | <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" |
| | | @change="HSourceBillTypeNameChange"> |
| | | <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" disabled/> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="form-item"> |
| | | <view class="left">源单单号</view> |
| | | <view class="right" :class="!hasSourceBill?'':'disabled'"> |
| | |
| | | <view class="icon-wrapper-big"><uni-icons type="search" size="20" |
| | | @click="showSelectorModule(hform, 7)"></uni-icons></view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="left">批号</view> |
| | | <view class="right"> |
| | | <input type="text" value="" /> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="form-item"> |
| | | <view class="left">判断结论</view> |
| | | <view class="right none-border"> |
| | |
| | | <view class="icon-wrapper-big"><uni-icons type="search" size="20" |
| | | @click="showSelectorModule(hform, 8)"></uni-icons></view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="left">备注</view> |
| | | <view class="right"> |
| | | <input type="text" v-model="hform.HRemark" value="" /> |
| | | </view> |
| | | </view> |
| | | |
| | | </view> |
| | | <!-- 其他信息 --> |
| | | <view class="bill-main-content" v-if="mainTabSelected == 2"> |
| | | <view class="form-item"> |
| | | <view class="left">源单类型</view> |
| | | <view class="right" style="position: relative" :class="!hasSourceBill?'':'disabled'"> |
| | | <picker mode="selector" :range="HSourceBillTypeNameList" :disabled="hasSourceBill" |
| | | @change="HSourceBillTypeNameChange"> |
| | | <input type="text" placeholder="请选择源单类型" v-model="HSourceBillType" disabled/> |
| | | <view class="picker-overlay"></view> |
| | | </picker> |
| | | </view> |
| | | </view> |
| | | <view class="form-item" v-if="false"> |
| | | <view class="left">生产班次</view> |
| | | <view class="right"> |
| | |
| | | <input type="number" v-model="hform.HProcExchQty" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="left">批号</view> |
| | | <view class="right"> |
| | | <input type="text" value="" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="left">备注</view> |
| | | <view class="right"> |
| | | <input type="text" v-model="hform.HRemark" value="" /> |
| | | </view> |
| | | </view> |
| | | </view> |
| | | <!-- 制单信息 --> |
| | | <view class="bill-main-content" v-if="mainTabSelected == 3"> |
| | |
| | | <view class="detail" v-if="checkItem.HUnit"> |
| | | <text>单位:</text>{{ checkItem.HUnit }} |
| | | </view> |
| | | <view class="detail" v-if="checkItem.HQCStd"> |
| | | <text>检验值:</text>{{ checkItem.HQCStd }} |
| | | <!-- 只有定量分析才启用检验值 --> |
| | | <view class="detail editable" v-show="checkItem.HAnalysisMethod == 2"> |
| | | <text>检验值:</text> |
| | | <input type="text" class="editable-input" @blur="calcHResult(checkItem)" v-model="checkItem.HInspectValQ" /> |
| | | </view> |
| | | |
| | | <view class="detail" v-if="checkItem.HQCNote"> |
| | | <text>检验记录:</text>{{ checkItem.HQCNote }} |
| | | </view> |
| | |
| | | </view> |
| | | <view class="detail editable"> |
| | | <text>样本破坏数:</text> |
| | | <view class="sampleDestory"> |
| | | <view class="editable-input"> |
| | | <input type="number" v-model="SamplingItem.HSampleDamageQty" /> |
| | | </view> |
| | | </view> |
| | |
| | | ], |
| | | // 主表属性 |
| | | hform: { |
| | | HSourceBillType: "3790", |
| | | HSourceBillType: "3711", |
| | | HSourceBillNo: "", |
| | | HBillNo: "", |
| | | HInterID: "0", |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | // 检验值 计算是否合格 |
| | | calcHResult(item){ |
| | | // 非抽检条件下判断结论 |
| | | console.log('item: ',item); |
| | | if(item.HSampleSchemeID) { |
| | | return |
| | | } |
| | | |
| | | if(item.HInspectValQ >= item.HDownLimit && item.HInspectValQ <= item.HUpLimit){ |
| | | this.checkItems[item.num].HResult = true |
| | | return |
| | | } |
| | | |
| | | this.checkItems[item.num].HResult = false |
| | | }, |
| | | // 源单类型选择 |
| | | HSourceBillTypeNameChange(e) { |
| | | this.HSourceBillType = this.HSourceBillTypeNameList[e.detail.value]; |
| | |
| | | async getSourceBillInfo(HBarCode) { |
| | | console.log('HBarCode: ', HBarCode); |
| | | // 根据单据类型,调用不同的下推函数 |
| | | if (this.hform.HSourceBillType == 3790) { |
| | | if (this.hform.HSourceBillType == 3711) { |
| | | // 工序进站接收单列表首检 |
| | | await this.LoadingInformation_StationInBill(HBarCode); |
| | | await this.LoadingInformation_ICMOReportBill(HBarCode); |
| | | if ( |
| | | (uni.getStorageSync("OrganizationID") == "7667152" && |
| | | uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") || |
| | |
| | | } |
| | | return; |
| | | } |
| | | // if (this.hform.HSourceBillType == 3790) { |
| | | // // 工序进站接收单列表首检 |
| | | // await this.LoadingInformation_StationInBill(HBarCode); |
| | | // if ( |
| | | // (uni.getStorageSync("OrganizationID") == "7667152" && |
| | | // uni.getStorageSync("Organization") == "CMR Technology Mexico S.A. de C.V.") || |
| | | // (uni.getStorageSync("OrganizationID") == "100199" && |
| | | // uni.getStorageSync("Organization") == "杭州斯莫尔磁性材料有限公司") |
| | | // ) { |
| | | // await this.GetCheckItemID(); // 客户为斯莫尔,进入按照质检方案表头上的物料绑定带出默认方案 |
| | | // } |
| | | // return; |
| | | // } |
| | | if (this.hform.HSourceBillType == 3793) { |
| | | // 工序委外接收单列表首检 |
| | | await this.LoadingInformation_StationEntrustOutBill(HBarCode); |
| | |
| | | // 生产订单 |
| | | try { |
| | | let sWhere="and 单据号='"+HBarCode+"'" |
| | | console.log(sWhere) |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/LEMS/MES_IF_ICMOBillList_Json", |
| | | data: { |
| | |
| | | this.hform.HSourceName = data[0].生产资源; |
| | | this.hform.HSourceID = data[0].HSourceID; |
| | | this.hform.HMaterID = data[0].HMaterID; |
| | | this.hform.HMaterNumber=data[0].产品代码 |
| | | this.hform.HMaterName = data[0].产品名称; |
| | | this.hform.HMainSourceBillNo = data[0].单据号; |
| | | this.hform.HMainSourceBillType = data[0].单据类型; |
| | |
| | | this.hform.HQCSchemeName = data[0].检验方案名称; |
| | | this.hform.HQCSchemeID = data[0].检验方案ID; |
| | | this.hform.HProcName = data[0].当前工序; |
| | | //this.hasSourceBill = true |
| | | //this.get_CheckItem(); |
| | | this.hasSourceBill = true |
| | | this.get_CheckItem(); |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | |
| | | }, |
| | | //#endregion |
| | | |
| | | // async LoadingInformation_StationInBill(HBarCode) { |
| | | // // 进站接收单 |
| | | // try { |
| | | // let res = await CommonUtils.doRequest2Async({ |
| | | // url: "/QC_FirstPieceCheckBill/get_StationInBill_ByHBillNo", |
| | | // data: { |
| | | // HBillNo: HBarCode, |
| | | // user: getUserInfo()["Czymc"], |
| | | // }, |
| | | // }); |
| | | async LoadingInformation_ICMOReportBill(HBarCode) { |
| | | // 生产汇报单 |
| | | try { |
| | | let res = await CommonUtils.doRequest2Async({ |
| | | url: "/QC_LastPieceCheckBill/get_ICMOReportBill_Tmp_getByBillNo", |
| | | data: { |
| | | HBillNo: HBarCode, |
| | | user: getUserInfo()["Czymc"], |
| | | }, |
| | | }); |
| | | |
| | | // let { |
| | | // count, |
| | | // Message, |
| | | // data |
| | | // } = res.data; |
| | | let { |
| | | count, |
| | | Message, |
| | | data |
| | | } = res.data; |
| | | |
| | | // if (count != 1) { |
| | | // CommonUtils.showTips({ |
| | | // title: "温馨提示", |
| | | // message: `获取进站接收单 错误: ${Message}`, |
| | | // }); |
| | | // return; |
| | | // } |
| | | // this.hform.HProcExchBillNo = data[0].流转卡号; |
| | | // this.hform.HProcExchInterID = data[0].HProcExchInterID; |
| | | // this.hform.HProcExchEntryID = data[0].HProcExchEntryID; |
| | | // this.hform.HProcExchQty = data[0].流转卡数量 || 0; |
| | | // this.hform.HICMOBillNo = data[0].任务单; |
| | | // this.hform.HICMOInterID = data[0].HICMOInterID; |
| | | // this.hform.HICMOQty = data[0].HICMOQty; |
| | | // this.hform.HSourceName = data[0].生产资源; |
| | | // this.hform.HSourceID = data[0].HSourceID; |
| | | // this.hform.HMaterID = data[0].HMaterID; |
| | | // this.hform.HMaterName = data[0].产品名称; |
| | | // this.hform.HMainSourceBillNo = data[0].单据号; |
| | | // this.hform.HMainSourceBillType = data[0].HBillType; |
| | | // this.hform.HMainSourceInterID = data[0].HInterID; |
| | | // this.hform.HICMOEntryID = data[0].HICMOEntryID || 1; |
| | | // this.hform.HQCSchemeName = data[0].检验方案名称; |
| | | // this.hform.HQCSchemeID = data[0].检验方案ID; |
| | | // this.hform.HProcName = data[0].当前工序; |
| | | if (count != 1) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取生产汇报单 错误: ${Message}`, |
| | | }); |
| | | return; |
| | | } |
| | | //change_inlife |
| | | this.hform.HMainSourceEntryID=data[0].HEntryID||1; |
| | | this.hform.HMaterNumber=data[0].HMaterNumber; |
| | | this.hform.HICMOBillNo = data[0].HICMOBillNo; |
| | | this.hform.HICMOInterID = data[0].HICMOInterID; |
| | | this.hform.HICMOQty = data[0].HICMOQty; |
| | | this.hform.HSourceName = data[0].HSourceName; |
| | | this.hform.HSourceID = data[0].HSourceID; |
| | | this.hform.HMaterID = data[0].HMaterID; |
| | | this.hform.HMaterName = data[0].HMaterName; |
| | | this.hform.HMainSourceBillNo = data[0].HBillNo; |
| | | this.hform.HMainSourceBillType = data[0].HBillType; |
| | | this.hform.HMainSourceInterID = data[0].HInterID; |
| | | this.hform.HICMOEntryID = data[0].HICMOEntryID || 1; |
| | | this.hform.HQCSchemeName = data[0].检验方案名称; |
| | | this.hform.HQCSchemeID = data[0].检验方案ID; |
| | | |
| | | |
| | | // for (let i = 0; i < data.length; i++) { |
| | | // this.addCheckItem(data[i]) |
| | | // } |
| | | for (let i = 0; i < data.length; i++) { |
| | | this.addCheckItem(data[i]) |
| | | } |
| | | |
| | | // this.hasSourceBill = true |
| | | // this.get_CheckItem(); |
| | | // } catch (err) { |
| | | // CommonUtils.showTips({ |
| | | // title: "温馨提示", |
| | | // message: `获取进站接收单 错误: ${err}`, |
| | | // }); |
| | | // } |
| | | // }, |
| | | this.hasSourceBill = true |
| | | this.get_CheckItem(); |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `获取生产汇报单 错误: ${err}`, |
| | | }); |
| | | } |
| | | }, |
| | | // 检验员初始化 |
| | | async InitHEmp() { |
| | | try { |
| | |
| | | }, |
| | | setInspectValModule(checkItem) { |
| | | console.log("checkItem: ", checkItem); |
| | | if (!checkItem.HAnalysisMethod || !checkItem.HSampleSchemeID) { |
| | | if (!checkItem || !checkItem.HAnalysisMethod || !checkItem.HSampleSchemeID) { |
| | | return; |
| | | } |
| | | // 区分检验值页签和静态页签,检验值页签的id以_开头 |
| | |
| | | console.log("this.checkItems: ", this.checkItems); |
| | | |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: "/QC_FirstPieceCheckBill/set_SaveBill", |
| | | url: "/QC_LastPieceCheckBill/set_SaveBill", |
| | | data: { |
| | | sMainSub: sMainSub, |
| | | }, |
| | |
| | | if (res.confirm) { |
| | | console.log("用户点击确定"); |
| | | uni.redirectTo({ |
| | | url: "/pages/ZLGL/shoujianjianyan/form?operationType=1", |
| | | url: "/pages/JIAOYAN/shengchanrukujiaoyan/QC_LastPieceCheckBill_v2?operationType=1", |
| | | }); |
| | | } else if (res.cancel) { |
| | | console.log("用户点击取消"); |
| | |
| | | } else { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `首件检验单保存错误: ${Message}`, |
| | | message: `生产入库校验单保存错误: ${Message}`, |
| | | }); |
| | | } |
| | | } catch (err) { |
| | | CommonUtils.showTips({ |
| | | title: "温馨提示", |
| | | message: `首件检验单保存错误: ${err}`, |
| | | message: `生产入库校验单保存错误: ${err}`, |
| | | }); |
| | | } |
| | | }, |
| | |
| | | flex-shrink: 0; |
| | | } |
| | | |
| | | .sampleDestory { |
| | | .editable-input { |
| | | border: 1px solid #acacac; |
| | | border-radius: 5rpx; |
| | | padding: 0 12rpx; |