Merge branch 'Dev' of http://101.37.171.70:10101/r/~jhz/STUWMS into Dev
2个文件已删除
2个文件已添加
2 文件已重命名
6个文件已修改
| | |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/quyangdan/TakeSampleCheckBillList", |
| | | "path": "pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "取样单" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/quyangdan/TakeSampleCheckBill", |
| | | "path": "pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill", |
| | | "style": { |
| | | "navigationBarTitleText": "取样单" |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/huanyangdan/BackSampleCheckBillList", |
| | | "path": "pages/ZLGL/QuYangHuangYang/QC_BackSampleCheckBill/QC_BackSampleCheckBillList", |
| | | "style": { |
| | | "navigationBarTitleText": "还样单", |
| | | "enablePullDownRefresh": true |
| | | } |
| | | }, |
| | | { |
| | | "path": "pages/huanyangdan/BackSampleCheckBill", |
| | | "path": "pages/ZLGL/QuYangHuangYang/QC_BackSampleCheckBill/QC_BackSampleCheckBill", |
| | | "style": { |
| | | "navigationBarTitleText": "还样单", |
| | | "enablePullDownRefresh": true |
| New file |
| | |
| | | <template> |
| | | <view> |
| | | <scroll-view scroll-y id="scroll-content" class="scroll-content" :style="{height: scrollContentHeight + 'px'}"> |
| | | <view class="form-item"> |
| | | <view class="title">条形码:</view> |
| | | <view class="right"> |
| | | <input type="text" name="HBarCode" id="HBarCode" v-model="HBarCode" @confirm="getCode(HBarCode)" /> |
| | | </view> |
| | | <view class="right-icon" @click="toScanCode"> |
| | | <uni-icons color="#fff" type="scan" size="24"></uni-icons> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">还样数量:</view> |
| | | <view class="right"> |
| | | <input type="number" name="HQty" id="HQty" v-model="hform.HQty" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">还样内容:</view> |
| | | <view class="right"> |
| | | <input type="text" name="HRemark" id="HRemark" v-model="hform.HRemark" /> |
| | | </view> |
| | | </view> |
| | | |
| | | |
| | | <view class="form-item"> |
| | | <view class="title">还样员:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HCheckEmpNameArray" name="HCheckEmpName" id="HCheckEmpName" |
| | | placeholder="请选择还样员" v-model="hform.HCheckEmpName" |
| | | @input="HCheckEmpNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">部门:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HDeptNameArray" name="HDeptName" id="HDeptName" placeholder="请选择部门" |
| | | v-model="hform.HDeptName" @input="HDeptNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">生产班次:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HShiftsNameArray" name="HShiftsName" id="HShiftsName" placeholder="请选择生产班次" |
| | | v-model="hform.HShiftsName" @input="HShiftsNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="form-item"> |
| | | <view class="title">单据日期:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" name="HDate" id="HDate" v-model="hform.HDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" name="HBillNo" id="HBillNo" v-model="hform.HBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">生产订单:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HICMOBillNo" name="HICMOBillNo" id="HICMOBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">流转卡:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HProcExchBillNo" name="HProcExchBillNo" |
| | | id="HProcExchBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">物料代码:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HMaterCode" name="HMaterCode" id="HMaterCode" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">物料名称:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HMaterName" name="HMaterName" id="HMaterName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">规格型号:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HMaterSpec" name="HMaterSpec" id="HMaterSpec" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">计量单位:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HUnitName" name="HUnitName" id="HUnitName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">工序:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HProcName" name="HProcName" id="HProcName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">流转卡批号:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HBatchNo" name="HBatchNo" id="HBatchNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">流转卡数量:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HProcExchQty" name="HProcExchQty" id="HProcExchQty" /> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <view class="bottom-btn" id="bottom-btn"> |
| | | <view><button class="btn-a" size="mini" @tap="submit">提交</button></view> |
| | | <view><button class="btn-b" size="mini" @tap="onAddNewHandler">新增</button></view> |
| | | <view class="placeholder__view"></view> |
| | | <view><button class="btn-c" size="mini" @tap="goBack">退出</button></view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | getUserInfo |
| | | } from '../../../../utils/auth' |
| | | |
| | | |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageMeta: { |
| | | scrollContentTop: 0, |
| | | bottomBtnTop: 0, |
| | | }, |
| | | refSav: 'Add', |
| | | showMask: true, |
| | | TestTypeArray: ["首检", "巡检", "未检", "实验"], |
| | | |
| | | HBillType: '7522', |
| | | HProcNameArray: [], |
| | | HProcNameArraySource: [], |
| | | |
| | | HDeptNameArray: [], |
| | | HDeptNameArraySource: [], |
| | | |
| | | HShiftsNameArray: [], |
| | | HShiftsNameArraySource: [], |
| | | |
| | | HGroupNameArray: [], |
| | | HGroupNameArraySource: [], |
| | | |
| | | HCheckEmpNameArray: [], |
| | | HCheckEmpNameSource: [], |
| | | |
| | | HSourceNameArray: [], |
| | | HSourceNameSource: [], |
| | | |
| | | HBarCode: '', |
| | | hform: { |
| | | HBarCode: '', |
| | | HQty: '', |
| | | HRemark: '', |
| | | HEmpName: getUserInfo()['HEmpName'], |
| | | HEmp: getUserInfo()['HEmpID'], |
| | | HDeptName: '', |
| | | HDeptID: 0, |
| | | HWorkShiftName: '', |
| | | HWorkShiftID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HBillNo: '', |
| | | HInterID: '', |
| | | HICMOBillNo: '', |
| | | HICMOInterID: '', |
| | | HICMOEntryID: '', |
| | | HProcExchBillNo: '', |
| | | HProcExchInterID: '', |
| | | HProcExchEntryID: '', |
| | | HMaterNumber: '', |
| | | HMaterID: 0, |
| | | HMaterName: '', |
| | | HModel: '', |
| | | HUnitName: '', |
| | | HUnitID: '', |
| | | HProcName: '', |
| | | HProcID: '', |
| | | HBatchNo: '', |
| | | HProcExchQty: '', |
| | | HICMOQty: '', |
| | | HMaker: getUserInfo()['Czymc'], |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD hh:mm:ss"), |
| | | HUpDater: '', |
| | | HUpDateDate: '', |
| | | HChecker: '', |
| | | HCheckDate: '', |
| | | HDeleteMan: '', |
| | | HDeleteDate: '', |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | scrollContentHeight: { |
| | | get() { |
| | | return this.pageMeta.bottomBtnTop - this.pageMeta.scrollContentTop |
| | | } |
| | | } |
| | | }, |
| | | onReady() { |
| | | // #ifndef MP-WEIXIN |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query.select("#scroll-content").boundingClientRect((data) => { |
| | | this.pageMeta.scrollContentTop = data.top |
| | | }).exec() |
| | | query.select("#bottom-btn").boundingClientRect((data) => { |
| | | this.pageMeta.bottomBtnTop = data.top |
| | | }).exec() |
| | | // #endif |
| | | // #ifdef MP-WEIXIN |
| | | // 微信不支持 uni.createSelectorQuery().in(this) |
| | | // #endif |
| | | |
| | | }, |
| | | async onLoad(e) { |
| | | let { |
| | | operationType |
| | | } = e |
| | | if (operationType == 0) { |
| | | this.getMaxNum() |
| | | this.refSav = 'Add' |
| | | } else { |
| | | this.refSav = 'Update' |
| | | } |
| | | |
| | | this.getProcessList() |
| | | this.get_Gy_WorkShiftList() |
| | | this.GetGroupList() |
| | | this.GetEmployeeList() |
| | | this.getSourceList() |
| | | this.GetDepartmentList() |
| | | }, |
| | | methods: { |
| | | HDeptNameChangeHandler() { |
| | | let index = this.HDeptNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HDeptID = this.HDeptNameArraySource[index]["HItemID"] |
| | | this.hform.HDeptName = this.HDeptNameArraySource[index]["HName"] |
| | | } |
| | | }, |
| | | GetDepartmentList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Web/GetDepartmentList_Json', |
| | | data: { |
| | | Department: '', |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message, |
| | | code |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptNameArray = Array.from(data).map(item => item['HName']) |
| | | this.HDeptNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HSourceNameChangeHandler(e) { |
| | | let index = this.HSourceNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HSourceID = this.HSourceNameArraySource[index]["HItemID"] |
| | | this.hform.HSourceName = this.HSourceNameArraySource[index]["生产资源"] |
| | | } |
| | | |
| | | console.log('this.hform: ', this.hform); |
| | | }, |
| | | // 获取生产资源 |
| | | getSourceList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/api/newBill/getSourceList', |
| | | data: { |
| | | sWhere: '', |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | msg, |
| | | code |
| | | } = res.data |
| | | if (code == 1) { |
| | | let data1 = data.Gy_Source |
| | | this.HSourceNameArray = Array.from(data1).map(item => item['生产资源']) |
| | | this.HSourceNameArraySource = data1 |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HCheckEmpNameChangeHandler(e) { |
| | | let index = this.HCheckEmpNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HCheckEmp = this.HCheckEmpNameArraySource[index]["HItemID"] |
| | | this.hform.HCheckEmpName = this.HCheckEmpNameArraySource[index]["HName"] |
| | | } |
| | | }, |
| | | // 获取职员信息 |
| | | GetEmployeeList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Web/GetEmployeeList_Json', |
| | | data: { |
| | | Employee: '', |
| | | HGroupID: 0 |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HCheckEmpNameArray = Array.from(data).map(item => item['HName']) |
| | | this.HCheckEmpNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HGroupNameChangeHandler(e) { |
| | | let index = this.HGroupNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HGroupID = this.HGroupNameArraySource[index]["HItemID"] |
| | | this.hform.HGroupName = this.HGroupNameArraySource[index]["HName"] |
| | | } |
| | | }, |
| | | // 获取生产班组 |
| | | GetGroupList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/WEBSController/GetGroupList_Json', |
| | | data: { |
| | | Group: '', |
| | | HStockOrgID: uni.getStorageSync('OrganizationID') |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HGroupNameArray = Array.from(data).map(item => item['HName']) |
| | | this.HGroupNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 获取最新单据号和HInterID |
| | | getMaxNum() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Web/GetMAXNum', |
| | | data: { |
| | | HBillType: this.HBillType |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.hform.HBillNo = data[0].HBillNo |
| | | this.hform.HInterID = data[0].HInterID |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HShiftsNameChangeHandler(e) { |
| | | let index = this.HShiftsNameArray.findIndex(item => item == e) |
| | | if (index != -1) { |
| | | this.hform.HShiftsID = this.HShiftsNameArraySource[index]['HInterID'] |
| | | this.hform.HShiftsName = this.HShiftsNameArraySource[index]['班次名称'] |
| | | } |
| | | }, |
| | | // 初始化班次信息 |
| | | get_Gy_WorkShiftList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Gy_ShiftsController/Get_Gy_WorkShiftList', |
| | | data: { |
| | | sWhere: ` and 使用组织名称 = '${uni.getStorageSync('Organization')}' and 禁用标记='' and ISNULL(审核人 ,'') !=''`, |
| | | HMaker: getUserInfo()['Czymc'] |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HShiftsNameArray = Array.from(data).map(item => item['班次名称']) |
| | | this.HShiftsNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 获取班次 |
| | | get_HWorkShift() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Gy_ShiftsController/Get_HWorkShift', |
| | | data: { |
| | | "HDeptID": this.hform.HDeptID, |
| | | "HCenterID": this.hform.HCenterID |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | |
| | | this.hform.HShiftsID = data[0]['HInterID'] |
| | | this.hform.HShiftsName = data[0]['班次'] |
| | | } |
| | | }) |
| | | }, |
| | | ProcessExchangeBillQuerySub() { |
| | | let HProcID = this.hform.HProcID |
| | | let HBarCode = this.hform.HProcExchInterID |
| | | let sWhere = ` ${HBarCode} and HProcID = ${HProcID} ` |
| | | CommonUtils.doRequest2({ |
| | | url: '/LEMS/MES_Sc_ProcessExchangeBillQuerySub_Json', |
| | | data: { |
| | | sWhere: sWhere |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count == 1 && data.length > 0) { |
| | | this.hform = Object.assign(this.hform, { |
| | | HProcID: data[0]['HProcID'], |
| | | HProcName: data[0]['工序名称'], |
| | | HSourceID: data[0]['HSourceID'] || 0, |
| | | HSourceName: data[0]['生产资源'] || '', |
| | | HMainSourceEntryID: data[0]['hsubid'], |
| | | HProcExchEntryID: data[0]['hsubid'], |
| | | HProcExchQty: data[0]['流转卡数量'], |
| | | HCenterID: data[0]['HCenterID'] || getUserInfo()['HWorkCenterID'], |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | onHProcNameChangeHandler(e) { |
| | | let index = this.HProcNameArray.findIndex(item => item == e) |
| | | if (index != -1) { |
| | | this.hform.HProcName = this.HProcNameArraySource[index]['HName'] |
| | | this.hform.HProcID = this.HProcNameArraySource[index]['HItemID'] |
| | | this.ProcessExchangeBillQuerySub() |
| | | } |
| | | }, |
| | | getProcessList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/WEBSController/GetProcessList_Json', |
| | | data: { |
| | | Process: '', |
| | | HStockOrgID: uni.getStorageSync("OrganizationID") |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HProcNameArray = Array.from(data).map(item => item.HName) |
| | | this.HProcNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | TestTypeChange(e) { |
| | | console.log('e: ', e); |
| | | }, |
| | | toScanCode() { |
| | | var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") |
| | | mpaasScanModule.mpaasScan({ |
| | | 'hideAlbum': true, |
| | | 'timeoutInterval': '10', //超时时间 |
| | | 'timeoutText': '未识别到二维码' //超时提醒 |
| | | }, (ret) => { |
| | | console.log(ret.resp_result) |
| | | if (this.hform.HBarCode == '*') { |
| | | this.hform.HBarCode = this.hform.HBarCode + ret.resp_result |
| | | } else { |
| | | this.HBarCode = ret.resp_result |
| | | this.hform.HBarCode = ret.resp_result |
| | | } |
| | | |
| | | this.getCode(this.hform.HBarCode) |
| | | }) |
| | | }, |
| | | getCode(HBarCode) { |
| | | console.log('HBarCode: ', HBarCode); |
| | | if (!HBarCode) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '条形码不能为空' |
| | | }) |
| | | } |
| | | let sWhere = " and 工序流转卡号='" + HBarCode + "'"; |
| | | CommonUtils.doRequest2({ |
| | | url: '/QC_TakeSampleCheckBill/Get_BackSampleList', |
| | | data: { |
| | | "sWhere": sWhere |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | code, |
| | | Message, |
| | | count, |
| | | data |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.hform = Object.assign(this.hform, { |
| | | "HMaterID": data[0].HMaterID, //产品ID |
| | | "HMaterNumber": data[0].产品编码, //产品代码 |
| | | "HMaterName": data[0].产品名称, //产品名称 |
| | | "HModel": data[0].规格型号, //产品规格 |
| | | "HUnitID": data[0].HUnitID, //计量单位id |
| | | "HUnitName": data[0].计量单位, //计量单位 |
| | | "HProcExchBillNo": data[0].工序流转卡号, //流转卡号 |
| | | "HProcExchInterID": data[0].工序流转卡主内码, //流转卡主内码(取值HInterID) |
| | | "HBatchNo": data[0].工序流转卡批次号, //流转卡批次 |
| | | "HICMOInterID": data[0].任务单内码, //生产订单ID |
| | | "HICMOEntryID": data[0].任务单子内码, //生产订单子ID |
| | | "HICMOBillNo": data[0].任务单号, //生产订单 |
| | | "HDeptID": data[0].HDeptID, //车间ID |
| | | "HDeptName": data[0].部门, //车间 |
| | | "HProcID": data[0].HProcID, //当前工序ID |
| | | "HProcName": data[0].工序, //当前工序 |
| | | "HProcExchEntryID": data[0].工序流转卡子内码, //流转卡子内码(源单行号) |
| | | "HProcExchQty": data[0].工序流转卡数量, //流转卡数量 |
| | | "HICMOQty": data[0].任务单数量, |
| | | "WorkShiftName": data[0].生产班次, |
| | | "HWorkShiftID": data[0].HShiftsID, |
| | | "HBarCode": "", |
| | | }) |
| | | |
| | | console.log('this.hform: ', this.hform); |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: '获取成功!' |
| | | }) |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | submit() { |
| | | if (this.hform.HProcID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '工序没有选择' |
| | | }) |
| | | } |
| | | if (this.hform.HQty == '') { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '取样数量为空' |
| | | }) |
| | | } |
| | | if (this.hform.HProcID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '工序没有选择' |
| | | }) |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '部门没有选择' |
| | | }) |
| | | } |
| | | if (this.hform.HShiftsID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '班次未选择' |
| | | }) |
| | | } |
| | | if (this.hform.HGroupID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '生产班组未选择' |
| | | }) |
| | | } |
| | | if (this.hform.HCheckEmp == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '取样员未选择' |
| | | }) |
| | | } |
| | | if (this.hform.HSourceID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '生产资源未选择' |
| | | }) |
| | | } |
| | | |
| | | console.log('this.hform: ', this.hform); |
| | | let sMainStr = JSON.stringify(this.hform) |
| | | let numData = [{ |
| | | "HMaterID": this.hform.HMaterID, |
| | | "HUnitID": this.hform.HUnitID, |
| | | "HProcExchBillNo": this.hform.HProcExchBillNo, |
| | | "HProcExchInterID": this.hform.HProcExchInterID, |
| | | "HProcExchEntryID": this.hform.HProcExchEntryID, |
| | | "HICMOInterID": this.hform.HICMOInterID, |
| | | "HICMOEntryID": this.hform.HICMOEntryID, |
| | | "HICMOBillNo": this.hform.HICMOBillNo, |
| | | "HDeptID": this.hform.HDeptID, |
| | | "HProcID": this.hform.HProcID, |
| | | "HProcExchQty": this.hform.HProcExchQty, |
| | | "HWorkShiftID": this.hform.HWorkShiftID, |
| | | "HBatchNo": this.hform.HBatchNo, |
| | | "HICMOQty": this.hform.HICMOQty, |
| | | "HQty": this.hform.HQty |
| | | }] |
| | | let sSubStr = JSON.stringify(numData) |
| | | let sMainSub = sMainStr + ';' + sSubStr + ';' + this.refSav + ';' + getUserInfo()['Czymc']; |
| | | CommonUtils.doRequest2({ |
| | | method: 'POST', |
| | | url: '/QC_TakeSampleCheckBill/SaveQC_BackSampleCheckBillMain', |
| | | data: { |
| | | msg: sMainSub |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: "提交成功!" |
| | | }) |
| | | } else { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | onAddNewHandler() { |
| | | uni.redirectTo({ |
| | | url: "/pages/quyangdan/TakeSampleCheckBillList?operationType=0" |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .scroll-content { |
| | | box-sizing: border-box; |
| | | padding: 20rpx; |
| | | |
| | | ::v-deep .uni-scroll-view-content { |
| | | box-sizing: border-box; |
| | | padding: 0 40rpx; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20rpx; |
| | | } |
| | | |
| | | .form-item { |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | gap: 20rpx; |
| | | |
| | | input { |
| | | width: inherit; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .title { |
| | | width: 5em; |
| | | font-size: 30rpx; |
| | | flex-shrink: 0; |
| | | text-align: right; |
| | | } |
| | | |
| | | .right { |
| | | flex: 1; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | } |
| | | |
| | | .right-icon { |
| | | width: 54rpx; |
| | | height: 54rpx; |
| | | border-radius: 50%; |
| | | background-color: #3A78FF; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | flex-shrink: 0; |
| | | |
| | | } |
| | | |
| | | .disabled { |
| | | border: 1px solid #e4e4e4; |
| | | background-color: #e4e4e4; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .bottom-btn { |
| | | position: fixed; |
| | | bottom: 0; |
| | | box-sizing: border-box; |
| | | background-color: #fff; |
| | | box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4); |
| | | padding: 30rpx 40rpx 40rpx 40rpx; |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 20rpx; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a { |
| | | background-color: #3A78FF; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | .placeholder__view { |
| | | flex: 1; |
| | | } |
| | | </style> |
| File was renamed from pages/huanyangdan/BackSampleCheckBillList.vue |
| | |
| | | } from '@/utils/common.js' |
| | | import { |
| | | getUserInfo |
| | | } from '../../utils/auth' |
| | | } from '../../../../utils/auth' |
| | | export default { |
| | | data() { |
| | | return { |
| New file |
| | |
| | | <template> |
| | | <view> |
| | | <scroll-view scroll-y id="scroll-content" class="scroll-content" :style="{height: scrollContentHeight + 'px'}"> |
| | | <view class="form-item"> |
| | | <view class="title">条形码:</view> |
| | | <view class="right"> |
| | | <input type="text" name="HBarCode" id="HBarCode" v-model="HBarCode" @confirm="getCode(HBarCode)" /> |
| | | </view> |
| | | <view class="right-icon" @click="toScanCode"> |
| | | <uni-icons color="#fff" type="scan" size="24"></uni-icons> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">工序:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HProcNameArray" name="HProcName" id="HProcName" placeholder="请选择工序号" |
| | | v-model="hform.HProcName" @input="onHProcNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">取样数量:</view> |
| | | <view class="right"> |
| | | <input type="number" name="HQty" id="HQty" v-model="hform.HQty" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">破坏性实验数量:</view> |
| | | <view class="right"> |
| | | <input type="number" name="HSampleDamageQty" id="HSampleDamageQty" |
| | | v-model="hform.HSampleDamageQty" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">送测类型:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="TestTypeArray" v-model="hform.TestType" |
| | | @input="TestTypeChange"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">送测内容:</view> |
| | | <view class="right"> |
| | | <input type="text" name="HBadNote" id="HBadNote" v-model="hform.HBadNote" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">部门:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HDeptNameArray" name="HDeptName" id="HDeptName" placeholder="请选择部门" |
| | | v-model="hform.HDeptName" @input="HDeptNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">生产班次:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HShiftsNameArray" name="HShiftsName" id="HShiftsName" placeholder="请选择生产班次" |
| | | v-model="hform.HShiftsName" @input="HShiftsNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">生产班组:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HGroupNameArray" name="HShiftsName" id="HShiftsName" placeholder="请选择生产班组" |
| | | v-model="hform.HGroupName" @input="HGroupNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">取样员:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HCheckEmpNameArray" name="HCheckEmpName" id="HCheckEmpName" |
| | | placeholder="请选择取样员" v-model="hform.HCheckEmpName" |
| | | @input="HCheckEmpNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">生产资源:</view> |
| | | <view class="right"> |
| | | <uni-combox :candidates="HSourceNameArray" name="HSourceName" id="HSourceName" placeholder="请选择生产资料" |
| | | v-model="hform.HSourceName" @input="HSourceNameChangeHandler"></uni-combox> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">单据日期:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" name="HDate" id="HDate" v-model="hform.HDate" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">单据号:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" name="HBillNo" id="HBillNo" v-model="hform.HBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">生产订单:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HICMOBillNo" name="HICMOBillNo" id="HICMOBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">流转卡:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HProcExchBillNo" name="HProcExchBillNo" |
| | | id="HProcExchBillNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">物料代码:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HMaterCode" name="HMaterCode" id="HMaterCode" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">物料名称:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HMaterName" name="HMaterName" id="HMaterName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">规格型号:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HMaterSpec" name="HMaterSpec" id="HMaterSpec" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">计量单位:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HUnitName" name="HUnitName" id="HUnitName" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">流转卡批号:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HBatchNo" name="HBatchNo" id="HBatchNo" /> |
| | | </view> |
| | | </view> |
| | | <view class="form-item"> |
| | | <view class="title">流转卡数量:</view> |
| | | <view class="right disabled"> |
| | | <input disabled type="text" v-model="hform.HProcExchQty" name="HProcExchQty" id="HProcExchQty" /> |
| | | </view> |
| | | </view> |
| | | </scroll-view> |
| | | <view class="bottom-btn" id="bottom-btn"> |
| | | <view><button class="btn-a" size="mini" @tap="submit">提交</button></view> |
| | | <view><button class="btn-b" size="mini" @tap="onAddNewHandler">新增</button></view> |
| | | <view class="placeholder__view"></view> |
| | | <view><button class="btn-c" size="mini" @tap="goBack">退出</button></view> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from "dayjs"; |
| | | import { |
| | | CommonUtils |
| | | } from "@/utils/common"; |
| | | import { |
| | | getUserInfo |
| | | } from '../../../../utils/auth' |
| | | |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | pageMeta: { |
| | | scrollContentTop: 0, |
| | | bottomBtnTop: 0, |
| | | }, |
| | | refSav: 'Add', |
| | | showMask: true, |
| | | TestTypeArray: ["首检", "巡检", "未检", "实验"], |
| | | |
| | | HBillType: '7521', |
| | | HProcNameArray: [], |
| | | HProcNameArraySource: [], |
| | | |
| | | HDeptNameArray: [], |
| | | HDeptNameArraySource: [], |
| | | |
| | | HShiftsNameArray: [], |
| | | HShiftsNameArraySource: [], |
| | | |
| | | HGroupNameArray: [], |
| | | HGroupNameArraySource: [], |
| | | |
| | | HCheckEmpNameArray: [], |
| | | HCheckEmpNameSource: [], |
| | | |
| | | HSourceNameArray: [], |
| | | HSourceNameSource: [], |
| | | |
| | | HBarCode: '', |
| | | hform: { |
| | | HBarCode: '', |
| | | HProcName: '', |
| | | HProcID: 0, |
| | | HQty: '', |
| | | HSampleDamageQty: 0, |
| | | TestType: '首检', |
| | | HBadNote: '', |
| | | HDeptName: '', |
| | | HDeptID: 0, |
| | | HCenterID: 0, |
| | | HShiftsName: '', |
| | | HShiftsID: 0, |
| | | HGroupName: '', |
| | | HGroupID: 0, |
| | | HCheckEmpName: '', |
| | | HCheckEmp: '', |
| | | HSourceName: '', |
| | | HSourceID: 0, |
| | | HDate: dayjs(new Date()).format("YYYY-MM-DD"), |
| | | HBillNo: '', |
| | | HInterID: 0, |
| | | HICMOBillNo: '', |
| | | HICMOInterID: 0, |
| | | HICMOEntryID: 0, |
| | | HProcExchBillNo: '', |
| | | HProcExchInterID: 0, |
| | | HProcExchEntryID: 0, |
| | | HMainSourceBillNo: '', |
| | | HMainSourceInterID: 0, |
| | | HMainSourceBillType: '', |
| | | HMainSourceEntryID: 0, |
| | | HMaterCode: '', |
| | | HMaterID: 0, |
| | | HMaterName: '', |
| | | HMaterSpec: '', |
| | | HUnitName: '', |
| | | HUnitID: 0, |
| | | HBatchNo: '', |
| | | HProcExchQty: '', |
| | | HMaker: getUserInfo()['Czymc'], |
| | | HMakeDate: dayjs(new Date()).format("YYYY-MM-DD hh:mm:ss"), |
| | | HUpDater: '', |
| | | HUpDateDate: '', |
| | | HChecker: '', |
| | | HCheckDate: '', |
| | | HDeleteMan: '', |
| | | HDeleteDate: '', |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | scrollContentHeight: { |
| | | get() { |
| | | return this.pageMeta.bottomBtnTop - this.pageMeta.scrollContentTop |
| | | } |
| | | } |
| | | }, |
| | | onReady() { |
| | | // #ifndef MP-WEIXIN |
| | | let query = uni.createSelectorQuery().in(this) |
| | | query.select("#scroll-content").boundingClientRect((data) => { |
| | | this.pageMeta.scrollContentTop = data.top |
| | | }).exec() |
| | | query.select("#bottom-btn").boundingClientRect((data) => { |
| | | this.pageMeta.bottomBtnTop = data.top |
| | | }).exec() |
| | | // #endif |
| | | // #ifdef MP-WEIXIN |
| | | // 微信不支持 uni.createSelectorQuery().in(this) |
| | | // #endif |
| | | |
| | | }, |
| | | async onLoad(e) { |
| | | let { |
| | | operationType |
| | | } = e |
| | | if (operationType == 0) { |
| | | this.getMaxNum() |
| | | this.refSav = 'Add' |
| | | } else { |
| | | this.refSav = 'Update' |
| | | } |
| | | |
| | | this.getProcessList() |
| | | this.get_Gy_WorkShiftList() |
| | | this.GetGroupList() |
| | | this.GetEmployeeList() |
| | | this.getSourceList() |
| | | this.GetDepartmentList() |
| | | }, |
| | | methods: { |
| | | HDeptNameChangeHandler() { |
| | | let index = this.HDeptNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HDeptID = this.HDeptNameArraySource[index]["HItemID"] |
| | | this.hform.HDeptName = this.HDeptNameArraySource[index]["HName"] |
| | | } |
| | | }, |
| | | GetDepartmentList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Web/GetDepartmentList_Json', |
| | | data: { |
| | | Department: '', |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message, |
| | | code |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HDeptNameArray = Array.from(data).map(item => item['HName']) |
| | | this.HDeptNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HSourceNameChangeHandler(e) { |
| | | let index = this.HSourceNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HSourceID = this.HSourceNameArraySource[index]["HItemID"] |
| | | this.hform.HSourceName = this.HSourceNameArraySource[index]["生产资源"] |
| | | } |
| | | |
| | | console.log('this.hform: ', this.hform); |
| | | }, |
| | | // 获取生产资源 |
| | | getSourceList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/api/newBill/getSourceList', |
| | | data: { |
| | | sWhere: '', |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | msg, |
| | | code |
| | | } = res.data |
| | | if (code == 1) { |
| | | let data1 = data.Gy_Source |
| | | this.HSourceNameArray = Array.from(data1).map(item => item['生产资源']) |
| | | this.HSourceNameArraySource = data1 |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HCheckEmpNameChangeHandler(e) { |
| | | let index = this.HCheckEmpNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HCheckEmp = this.HCheckEmpNameArraySource[index]["HItemID"] |
| | | this.hform.HCheckEmpName = this.HCheckEmpNameArraySource[index]["HName"] |
| | | } |
| | | }, |
| | | // 获取职员信息 |
| | | GetEmployeeList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Web/GetEmployeeList_Json', |
| | | data: { |
| | | Employee: '', |
| | | HGroupID: this.hform.HGroupID |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HCheckEmpNameArray = Array.from(data).map(item => item['HName']) |
| | | this.HCheckEmpNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HGroupNameChangeHandler(e) { |
| | | let index = this.HGroupNameArray.findIndex(item => item == e) |
| | | |
| | | if (index != -1) { |
| | | this.hform.HGroupID = this.HGroupNameArraySource[index]["HItemID"] |
| | | this.hform.HGroupName = this.HGroupNameArraySource[index]["HName"] |
| | | } |
| | | }, |
| | | // 获取生产班组 |
| | | GetGroupList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/WEBSController/GetGroupList_Json', |
| | | data: { |
| | | Group: '', |
| | | HStockOrgID: uni.getStorageSync('OrganizationID') |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HGroupNameArray = Array.from(data).map(item => item['HName']) |
| | | this.HGroupNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // 获取最新单据号和HInterID |
| | | getMaxNum() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Web/GetMAXNum', |
| | | data: { |
| | | HBillType: this.HBillType |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | count, |
| | | data, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.hform.HBillNo = data[0].HBillNo |
| | | this.hform.HInterID = data[0].HInterID |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | HShiftsNameChangeHandler(e) { |
| | | let index = this.HShiftsNameArray.findIndex(item => item == e) |
| | | if (index != -1) { |
| | | this.hform.HShiftsID = this.HShiftsNameArraySource[index]['HInterID'] |
| | | this.hform.HShiftsName = this.HShiftsNameArraySource[index]['班次名称'] |
| | | } |
| | | }, |
| | | // 初始化班次信息 |
| | | get_Gy_WorkShiftList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Gy_ShiftsController/Get_Gy_WorkShiftList', |
| | | data: { |
| | | sWhere: ` and 使用组织名称 = '${uni.getStorageSync('Organization')}' and 禁用标记='' and ISNULL(审核人 ,'') !=''`, |
| | | HMaker: getUserInfo()['Czymc'] |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HShiftsNameArray = Array.from(data).map(item => item['班次名称']) |
| | | this.HShiftsNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 获取班次 |
| | | get_HWorkShift() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/Gy_ShiftsController/Get_HWorkShift', |
| | | data: { |
| | | "HDeptID": this.hform.HDeptID, |
| | | "HCenterID": this.hform.HCenterID |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | |
| | | this.hform.HShiftsID = data[0]['HInterID'] |
| | | this.hform.HShiftsName = data[0]['班次'] |
| | | } |
| | | }) |
| | | }, |
| | | ProcessExchangeBillQuerySub() { |
| | | let HProcID = this.hform.HProcID |
| | | let HBarCode = this.hform.HProcExchInterID |
| | | let sWhere = ` ${HBarCode} and HProcID = ${HProcID} ` |
| | | CommonUtils.doRequest2({ |
| | | url: '/LEMS/MES_Sc_ProcessExchangeBillQuerySub_Json', |
| | | data: { |
| | | sWhere: sWhere |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | Message, |
| | | count |
| | | } = res.data |
| | | if (count == 1 && data.length > 0) { |
| | | this.hform = Object.assign(this.hform, { |
| | | HProcID: data[0]['HProcID'], |
| | | HProcName: data[0]['工序名称'], |
| | | HSourceID: data[0]['HSourceID'] || 0, |
| | | HSourceName: data[0]['生产资源'] || '', |
| | | HMainSourceEntryID: data[0]['hsubid'], |
| | | HProcExchEntryID: data[0]['hsubid'], |
| | | HProcExchQty: data[0]['流转卡数量'], |
| | | HCenterID: data[0]['HCenterID'] || getUserInfo()['HWorkCenterID'], |
| | | }) |
| | | |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | onHProcNameChangeHandler(e) { |
| | | let index = this.HProcNameArray.findIndex(item => item == e) |
| | | if (index != -1) { |
| | | this.hform.HProcName = this.HProcNameArraySource[index]['HName'] |
| | | this.hform.HProcID = this.HProcNameArraySource[index]['HItemID'] |
| | | this.ProcessExchangeBillQuerySub() |
| | | } |
| | | }, |
| | | getProcessList() { |
| | | CommonUtils.doRequest2({ |
| | | url: '/WEBSController/GetProcessList_Json', |
| | | data: { |
| | | Process: '', |
| | | HStockOrgID: uni.getStorageSync("OrganizationID") |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | this.HProcNameArray = Array.from(data).map(item => item.HName) |
| | | this.HProcNameArraySource = data |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | TestTypeChange(e) { |
| | | console.log('e: ', e); |
| | | }, |
| | | toScanCode() { |
| | | var mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module") |
| | | mpaasScanModule.mpaasScan({ |
| | | 'hideAlbum': true, |
| | | 'timeoutInterval': '10', //超时时间 |
| | | 'timeoutText': '未识别到二维码' //超时提醒 |
| | | }, (ret) => { |
| | | console.log(ret.resp_result) |
| | | if (this.hform.HBarCode == '*') { |
| | | this.hform.HBarCode = this.hform.HBarCode + ret.resp_result |
| | | } else { |
| | | this.HBarCode = ret.resp_result |
| | | this.hform.HBarCode = ret.resp_result |
| | | } |
| | | |
| | | this.getCode(this.hform.HBarCode) |
| | | }) |
| | | }, |
| | | getCode(HBarCode) { |
| | | if (!HBarCode) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '条形码不能为空' |
| | | }) |
| | | } |
| | | CommonUtils.doRequest2({ |
| | | url: '/api/newBill/getHbarCodeDetail', |
| | | data: { |
| | | "sBillBarCode": HBarCode |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | code, |
| | | msg, |
| | | count, |
| | | data |
| | | } = res.data |
| | | if (code == 1) { |
| | | this.HBarCode = '' |
| | | let data1 = data.h_v_Sc_ProcessExchangeBillList |
| | | this.hform = Object.assign(this.hform, { |
| | | "HMaterID": data1[0].HMaterID, //产品ID |
| | | "HMaterCode": data1[0].产品代码, //产品代码 |
| | | "HMaterName": data1[0].产品, //产品名称 |
| | | "HMaterSpec": data1[0].规格型号, //产品规格 |
| | | "HUnitID": data1[0].HUnitID, //计量单位id |
| | | "HUnitName": data1[0].单位, //计量单位 |
| | | "HMainSourceBillNo": data1[0].单据号, //源单单号 |
| | | "HMainSourceInterID": data1[0].hmainid, //源单主内码 |
| | | "HMainSourceBillType": 3772, //源单类型 |
| | | "HProcExchBillNo": data1[0].单据号, //流转卡号 |
| | | "HProcExchInterID": data1[0].hmainid, //流转卡主内码(取值HInterID) |
| | | "HBatchNo": data1[0].批号, //流转卡批次 |
| | | "HICMOInterID": data1[0].hicmointerid, //生产订单ID |
| | | "HICMOEntryID": data1[0].HICMOEntryID, //生产订单子ID |
| | | "HICMOBillNo": data1[0].任务单号, //生产订单 |
| | | "HDeptID": data1[0].HWorkShopID, //车间ID |
| | | "HDeptName": data1[0].生产车间, //车间 |
| | | }) |
| | | |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: msg |
| | | }) |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: msg |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | submit() { |
| | | if (this.hform.HProcID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '工序没有选择' |
| | | }) |
| | | } |
| | | if (this.hform.HQty == '') { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '取样数量为空' |
| | | }) |
| | | } |
| | | if (this.hform.HProcID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '工序没有选择' |
| | | }) |
| | | } |
| | | if (this.hform.HDeptID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '部门没有选择' |
| | | }) |
| | | } |
| | | if (this.hform.HShiftsID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '班次未选择' |
| | | }) |
| | | } |
| | | if (this.hform.HGroupID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '生产班组未选择' |
| | | }) |
| | | } |
| | | if (this.hform.HCheckEmp == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '取样员未选择' |
| | | }) |
| | | } |
| | | if (this.hform.HSourceID == 0) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: '生产资源未选择' |
| | | }) |
| | | } |
| | | |
| | | console.log('this.hform: ', this.hform); |
| | | let sMainStr = JSON.stringify(this.hform) |
| | | console.log('sMainStr: ', sMainStr); |
| | | let sMainSub = sMainStr + ';' + this.refSav + ';' + getUserInfo()['Czymc']; |
| | | CommonUtils.doRequest2({ |
| | | method: 'POST', |
| | | url: '/QC_TakeSampleCheckBill/SaveQC_TakeSampleCheckBillMain', |
| | | data: { |
| | | msg: sMainSub |
| | | }, |
| | | resFunction: (res) => { |
| | | let { |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count == 1) { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: "提交成功!" |
| | | }) |
| | | } else { |
| | | return uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | onAddNewHandler() { |
| | | uni.redirectTo({ |
| | | url: "/pages/quyangdan/TakeSampleCheckBillList?operationType=0" |
| | | }) |
| | | }, |
| | | goBack() { |
| | | uni.navigateBack() |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .scroll-content { |
| | | box-sizing: border-box; |
| | | padding: 20rpx; |
| | | |
| | | ::v-deep .uni-scroll-view-content { |
| | | box-sizing: border-box; |
| | | padding: 0 40rpx; |
| | | display: flex; |
| | | flex-direction: column; |
| | | gap: 20rpx; |
| | | } |
| | | |
| | | .form-item { |
| | | display: flex; |
| | | flex-direction: row; |
| | | align-items: center; |
| | | gap: 20rpx; |
| | | |
| | | input { |
| | | width: inherit; |
| | | padding: 8rpx 20rpx; |
| | | font-size: 30rpx; |
| | | } |
| | | |
| | | .title { |
| | | width: 5em; |
| | | font-size: 30rpx; |
| | | flex-shrink: 0; |
| | | text-align: right; |
| | | } |
| | | |
| | | .right { |
| | | flex: 1; |
| | | border-radius: 22rpx; |
| | | border: 1px solid #acacac; |
| | | } |
| | | |
| | | .right-icon { |
| | | width: 54rpx; |
| | | height: 54rpx; |
| | | border-radius: 50%; |
| | | background-color: #3A78FF; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | flex-shrink: 0; |
| | | |
| | | } |
| | | |
| | | .disabled { |
| | | border: 1px solid #e4e4e4; |
| | | background-color: #e4e4e4; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .bottom-btn { |
| | | position: fixed; |
| | | bottom: 0; |
| | | box-sizing: border-box; |
| | | background-color: #fff; |
| | | box-shadow: 0 2rpx 10rpx 2rpx rgba(0, 0, 0, 0.4); |
| | | padding: 30rpx 40rpx 40rpx 40rpx; |
| | | display: flex; |
| | | flex-direction: row; |
| | | gap: 20rpx; |
| | | justify-content: space-between; |
| | | width: 100%; |
| | | |
| | | button { |
| | | border-radius: 50rpx; |
| | | width: 180rpx; |
| | | height: 66rpx; |
| | | line-height: 66rpx; |
| | | font-size: 28rpx; |
| | | } |
| | | |
| | | .btn-a { |
| | | background-color: #3A78FF; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-b { |
| | | background-color: #41a863; |
| | | color: #fff; |
| | | } |
| | | |
| | | .btn-c { |
| | | background-color: #acacac; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | | .placeholder__view { |
| | | flex: 1; |
| | | } |
| | | </style> |
| File was renamed from pages/quyangdan/TakeSampleCheckBillList.vue |
| | |
| | | } from '@/utils/common.js' |
| | | import { |
| | | getUserInfo |
| | | } from '../../utils/auth' |
| | | } from '../../../../utils/auth' |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | <view class="op" v-if="operations == index"> |
| | | <button class="op3" size="mini" plain @tap.stop="audit(item, 0)">审核</button> |
| | | <button class="op3" size="mini" plain @tap.stop="audit(item, 1)">反审核</button> |
| | | <button class="op3" size="mini" plain @tap.stop="fileUpload()">文件上传</button> |
| | | <button class="op3" size="mini" plain @tap.stop="fileUpload(item)">文件上传</button> |
| | | <button class="op3" size="mini" plain @tap.stop="getImage(item)">预览图片</button> |
| | | <!-- <button class="op3" size="mini" plain @tap.stop="Reject(item)">驳回</button> --> |
| | | <button class="op5" size="mini" plain @tap.stop="operations = -1">取消操作</button> |
| | | </view> |
| | |
| | | return { |
| | | showDetail: -1, |
| | | operations : -1, |
| | | serverUrl: uni.getStorageSync('serverUrl') || 'http://47.96.97.237/API', |
| | | //上传参数 |
| | | uploadOptions: {}, |
| | | uploadOptions: { |
| | | url: CommonUtils.getServerUrl() + "/LMES/UploadFile", |
| | | formData: { |
| | | HBillNo:"", |
| | | HRemark: "", |
| | | HUserName: getUserInfo()["Czymc"] |
| | | } |
| | | |
| | | }, |
| | | hform: { |
| | | HSourceBillType:'8505', |
| | | HSourceBillTypeName: "首件检验单", |
| | |
| | | let {count, data, Message} = res.data |
| | | |
| | | if(count == 1) { |
| | | |
| | | CommonUtils.showTips({ |
| | | message: `审核成功` |
| | | }) |
| | | if(mode==1){ |
| | | this.showDialog(item["hmainid"]); |
| | | } |
| | | this.$forceUpdate() |
| | | setTimeout(() => { |
| | | this.cmdSearch() |
| | |
| | | }) |
| | | |
| | | }, |
| | | |
| | | //反审核提交意见 |
| | | showDialog(HInterID) { |
| | | uni.showModal({ |
| | | title: '请提交反审核意见', |
| | | editable: true, |
| | | placeholderText: '请输入内容', |
| | | success: (result) => { |
| | | if (result.confirm) { |
| | | try { |
| | | let res = CommonUtils.doRequest2Sync({ |
| | | url: '/LMES/AuditFlowOpinion', |
| | | data: { |
| | | "sWhere": result.content, |
| | | "billType":this.hform.HSourceBillType, |
| | | "HInterID":HInterID, |
| | | "type":1, |
| | | "user": getUserInfo()["Czymc"] |
| | | }, |
| | | }) |
| | | if (!res) { |
| | | return |
| | | } |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count > 0) { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | console.warn(err); |
| | | uni.showToast({ |
| | | title: '接口请求失败:' + err, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | | // 上传文件 |
| | | fileUpload(item) { |
| | | this.uploadOptions.formData.HBillNo = item.单据号 |
| | | this.$refs.XeUpload.upload('image', {});// image, video, file |
| | | }, |
| | | handleUploadCallback(e) { // 文件上传回调 |
| | | console.log('file: ', e); |
| | | if (['choose', 'success'].includes(e.type)) { |
| | | // 根据接口返回修改对应的response相关的逻辑 |
| | | const tmpFiles = (e.data || []).map(({ response, tempFilePath, name, fileType }) => { |
| | | |
| | | if(response.code=="1"){ |
| | | CommonUtils.showTips({ |
| | | message: "上传成功" |
| | | }) |
| | | }else{ |
| | | CommonUtils.showTips({ |
| | | message: "上传失败"+response.Message |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | async getImage(item) {//预览图片 |
| | | try { |
| | | let res = await CommonUtils.doRequest2Sync({ |
| | | url: '/LMES/Filelist', |
| | | data: { |
| | | "HBillNo": item.单据号, |
| | | }, |
| | | }) |
| | | if (!res) { |
| | | return |
| | | } |
| | | let { |
| | | data, |
| | | count, |
| | | Message |
| | | } = res.data |
| | | if (count > 0) { |
| | | if(data.length>0){ |
| | | const imageUrl = res.data.data[0]["url"]; |
| | | //正则表达式获取服务器路径倒数第二个内容 |
| | | const regex = /^(.*\/)[^\/]+\/[^\/]*\/?$/; |
| | | const match = this.serverUrl.match(regex); |
| | | console.log(match[1],imageUrl) |
| | | // 或者直接预览图片 |
| | | uni.previewImage({ |
| | | urls: [match[1]+imageUrl] |
| | | }) |
| | | }else{ |
| | | CommonUtils.showTips({ |
| | | message: "无图片请先上传图片" |
| | | }) |
| | | } |
| | | |
| | | |
| | | } else { |
| | | uni.showToast({ |
| | | icon: 'none', |
| | | title: Message |
| | | }) |
| | | } |
| | | } catch (err) { |
| | | console.warn(err); |
| | | uni.showToast({ |
| | | title: '接口请求失败:' + err, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | onShow() { |
| | | this.$nextTick(() => { |
| | |
| | | { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "取样单列表", |
| | | "url": "/pages/quyangdan/TakeSampleCheckBillList", |
| | | "url": "/pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBillList", |
| | | "id": 60, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "还样单列表", |
| | | "url": "/pages/huanyangdan/BackSampleCheckBillList", |
| | | "url": "/pages/ZLGL/QuYangHuangYang/QC_BackSampleCheckBill/QC_BackSampleCheckBillList", |
| | | "id": 61, |
| | | "hidden": false |
| | | }, |
| | |
| | | "id": 62, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon15.png", |
| | | "text": "工作联系单列表", |
| | | "url": "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList?OperationType=1", |
| | | "id": 63, |
| | | "hidden": false |
| | | }, |
| | | ] |
| | | } |
| | | }, |
| | |
| | | "url": "/pages/MJGL/Sb_EquipRepairCheckBill/Sb_EquipRepairCheckBill", |
| | | "id": 23, |
| | | "hidden": false |
| | | }, { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "器具维修派工单", |
| | | "url": "/pages/MJGL/Sc_MouldRepairSendWork/Sc_MouldRepairSendWorkBill", |
| | | "id": 29, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "器具维修验收单", |
| | | "url": "/pages/MJGL/SC_MouldRepairCheck/Sc_MouldRepairCheckBill", |
| | | "id": 30, |
| | | "hidden": false |
| | | }, |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "设备保养任务", |
| | |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon8.png", |
| | | "text": "器具维修任务", |
| | | "text": "模具维修任务", |
| | | "url": "/pages/MJGL/Sc_MouldRepairTaskReport/Sc_MouldRepairTaskReport", |
| | | "id": 27, |
| | | "hidden": false |
| | |
| | | "id": 16, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon15.png", |
| | | "text": "工作联系单列表", |
| | | "url": "/pages/ZLGL/OA_WorkLink/OA_WorkLinkBillList?OperationType=1", |
| | | "id": 16, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon15.png", |
| | | "text": "取样单", |
| | | "url": "/pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill", |
| | | "id": 17, |
| | | "hidden": false |
| | | }, |
| | | { |
| | | "img": "../../static/icon/icon15.png", |
| | | "text": "还样单", |
| | | "url": "/pages/ZLGL/QuYangHuangYang/QC_TakeSampleCheckBill/QC_TakeSampleCheckBill", |
| | | "id": 18, |
| | | "hidden": false |
| | | }, |
| | | |
| | | ] |
| | | } |
| | |
| | | } |
| | | ) |
| | | }, |
| | | //红外扫条码 |
| | | getCode(HBarCode) { |
| | | if (!HBarCode) { |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: '条码不能为空', |
| | | icon: 'none' |
| | | }) |
| | | } else { |
| | | uni.request({ |
| | | url: this.serverUrl + '/Gy_BarCodeBillList/page', |
| | | data: { |
| | | sWhere: ` and 条码编号=''${this.barCodeInfoMeta.barCodeNo}''`, |
| | | user: this.userInfo.HEmpName, |
| | | page: 1, |
| | | size: 1 |
| | | }, |
| | | success: (res) => { |
| | | console.log('扫码返回', res.data.data); |
| | | if (res.data.count == 1) { |
| | | CommonUtils.playSound(1) |
| | | this.barCodeInfo = res.data.data[0] |
| | | this.barCodeSplitInfo = [] |
| | | // 扫描条码后重置按钮状态 |
| | | this.resetButtonState(); |
| | | } else { |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | uni.showToast({ |
| | | title: res.data.Message, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | }, |
| | | fail: (res) => { |
| | | CommonUtils.playSound(0) |
| | | this.refreshBarCodeState() |
| | | console.log(res); |
| | | uni.showToast({ |
| | | title: '接口请求失败', |
| | | icon: 'none' |
| | | }) |
| | | }, |
| | | }); |
| | | } |
| | | }, |
| | | |
| | | dialogInputConfirm(val) { |
| | | this.itemCache["HSplitNum"] = val |
| | | |