From f22e43207f22b342e69b32311d34e0332d5ea64e Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Sun, 7 Apr 2024 15:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=82=E6=95=B0=E5=92=8C?= =?UTF-8?q?=E5=BC=B9=E5=87=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/request2.js | 72 +++- src/common/directory.js | 2 - src/common/utils.js | 19 + src/mycomponents/form/customerFrom.vue | 73 +++- src/pages/foam/check.vue | 23 +- src/pages/foam/input.vue | 115 ++---- src/pages/plastics/check.vue | 88 ++-- src/pages/plastics/input.vue | 377 +++++++----------- src/pages/setter/index.vue | 10 +- .../components/wz-select-popup/wz-list.vue | 18 +- .../wz-select-popup/wz-select-popup.vue | 5 - 11 files changed, 379 insertions(+), 423 deletions(-) create mode 100644 src/common/utils.js diff --git a/src/api/request2.js b/src/api/request2.js index 1de769d..f383a39 100644 --- a/src/api/request2.js +++ b/src/api/request2.js @@ -197,9 +197,9 @@ export function appCheckUpdate() { }) } /** - * @param params获取原料信息 + * @param params 泡沫获取信息 */ -export function getDeviceInfo(machineCode) { +export function getFoamDeviceInfo(machineCode) { return request({ url: baseApi + "/MachineClass/Get?MachineCode="+machineCode, method: "get", @@ -208,23 +208,45 @@ export function getDeviceInfo(machineCode) { } /** - * @param params获取计划单号 + * @param params 注塑获取信息 */ -export function getPlaneNumberList(params) { +export function getPlasticsDeviceInfo(machineCode) { return request({ - url: baseApi + "/system/captcha/captchaImage", + url: baseApi + "/MachineClass/GZhuSuItem?Machine="+machineCode, method: "get", - data: params, + data: {}, + }); +} + +/** + * @param params获取泡沫生产计划 + */ +export function getFoamPlaneNumberList() { + return request({ + url: baseApi + "/Plan/GetList?Type=paomo", + method: "get", + data: {}, + }); +} + +/** + * @param params获取注塑生产计划 + */ +export function getPlasticsPlaneNumberList() { + return request({ + url: baseApi + "/Plan/GetList?Type=paomo", + method: "get", + data: {}, }); } /** * @param params获取原料信息 */ -export function getMaterialLists(params) { +export function getMaterialLists() { return request({ - url: baseApi + "/system/captcha/captchaImage", + url: baseApi + "/Ware/GetTypeList", method: "get", - data: params, + data: {}, }); } /** @@ -249,6 +271,28 @@ export function foamCheckSubmit(params) { }); } +/** + * @param params 原料投入泡沫提交 + */ +export function foamInputSubmit(params) { + return request({ + url: baseApi + "/MachineClass/Insert", + method: "post", + data: params, + }); +} + +/** + * @param params 原料投入注塑提交 + */ +export function plasticsInputSubmit(params) { + return request({ + url: baseApi + "/MachineClass/Insert", + method: "post", + data: params, + }); +} + /** * @param params 获取料筒号 */ @@ -272,13 +316,13 @@ export function getItemCode(code) { } /** - * @param params 泡沫投入提交 + * @param params 查询料筒号与物料号是否匹配 */ -export function foamInputSubmit(params) { +export function checkItemCodeByBucket(BucketCode,itemCode) { return request({ - url: baseApi + "/system/captcha/captchaImage", - method: "post", - data: params, + url: baseApi + "/WareHouse/IsPass?BucketCode="+BucketCode+"&RawMaterial="+itemCode, + method: "get", + data: {}, }); } diff --git a/src/common/directory.js b/src/common/directory.js index 5eae6dc..fb6436e 100644 --- a/src/common/directory.js +++ b/src/common/directory.js @@ -568,5 +568,3 @@ export function getPackUnitName(value) { return resultInfo } - -locationAreaTypeList \ No newline at end of file diff --git a/src/common/utils.js b/src/common/utils.js new file mode 100644 index 0000000..8e74f52 --- /dev/null +++ b/src/common/utils.js @@ -0,0 +1,19 @@ +//提示是否消息 +export function showConfirmMsg(title, content, callback) { + uni.showModal({ + title: title, + cancelText: '否', + confirmText: '是', + content: content, + customStyle: { + content: 'color: red;' // 这里设置对话框内容的颜色为红色 + }, + success: function(res) { + if (res.confirm) { + callback(true); + } else { + callback(false); + } + } + }) +} \ No newline at end of file diff --git a/src/mycomponents/form/customerFrom.vue b/src/mycomponents/form/customerFrom.vue index 189e984..e7ab561 100644 --- a/src/mycomponents/form/customerFrom.vue +++ b/src/mycomponents/form/customerFrom.vue @@ -186,6 +186,9 @@ import { deepCopyData } from "@/common/basic.js" + import { + showConfirmMsg + } from "@/common/utils.js" export default { components: { @@ -286,18 +289,19 @@ submit(callBack) { try { + var hintResult="" for (var i = 0; i < this.formData.length; i++) { var item = this.formData[i]; var hintIndex = i + 1 if (item.Type == 1) { if (item.SelectName == "") { - var hint = hintIndex + ".点检内容 : " + item.Content; + var hint ="【"+hintIndex + "】.点检内容 : " + item.Content; throw new Error(hint) } } else if (item.Type == 2) { //空值提示 if (item.SelectName == "") { - var hint = hintIndex + ".点检内容 : " + item.Content; + var hint = "【"+hintIndex + "】.点检内容 : "+ item.Content; throw new Error(hint) } //如果不在选择中,输入的内容。对数值进行校验 @@ -305,38 +309,41 @@ if (!this.isWithinInterval(item.SelectName, item.putMachine[0].Limit, item .putMachine[0] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + var hint = "【"+hintIndex + "】.点检内容 : " + item.Content + "输入数量【" + item.SelectName + "】不在【" + item.putMachine[0].Limit + "】和【" + item.putMachine[0].Floor + "】之间" - throw new Error(hint) + // throw new Error(hint) + hintResult=hintResult+"\n"+hint; } } } else if (item.Type == 3) { if (item.SelectName == "") { if (item.putMachine[0].SelectName == "") { - var hint = hintIndex + ".点检内容 : " + item.Content; + var hint = "【"+hintIndex + "】.点检内容 : "+ item.Content; throw new Error(hint) } else { if (!this.isWithinInterval(item.putMachine[0].SelectName, item.putMachine[0].Limit, item .putMachine[0] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.putMachine[0].SelectName + + var hint ="【"+hintIndex + "】.点检内容 : " + item.Content + "输入数量【" + item.putMachine[0].SelectName + "】不在【" + item.putMachine[0].Limit + "】和【" + item.putMachine[0].Floor + "】之间" - throw new Error(hint) + // throw new Error(hint) + hintResult=hintResult+"\n"+hint; } } if (item.putMachine[1].SelectName == "") { - var hint = hintIndex + ".点检内容 : " + item.Content; + var hint = "【"+hintIndex + "】.点检内容 : "+ item.Content; throw new Error(hint) } else { if (!this.isWithinInterval(item.putMachine[1].SelectName, item.putMachine[1].Limit, item .putMachine[1] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.putMachine[1].SelectName + + var hint = "【"+hintIndex + "】.点检内容 : " + item.Content + "输入数量【" + item.putMachine[1].SelectName + "】不在【" + item.putMachine[1].Limit + "】和【" + item.putMachine[1].Floor + "】之间" - throw new Error(hint) + // throw new Error(hint) + hintResult=hintResult+"\n"+hint; } } @@ -347,28 +354,59 @@ item .putMachine[0] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + var hint = "【"+hintIndex + "】.点检内容 : " + item.Content + "输入数量【" + item.SelectName + "】不在【" + item.putMachine[0].Limit + "】和【" + item.putMachine[0].Floor + "】之间" - throw new Error(hint) + // throw new Error(hint) + hintResult=hintResult+"\n"+hint; } if (!this.isWithinInterval(item.putMachine[1].SelectName, item.putMachine[1].Limit, item .putMachine[1] .Floor)) { - var hint = hintIndex + ".点检内容 : " + item.Content + "输入数量【" + item.SelectName + + var hint = "【"+hintIndex + "】.点检内容 : " + item.Content + "输入数量【" + item.SelectName + "】不在【" + item.putMachine[1].Limit + "】和【" + item.putMachine[1].Floor + "】之间" - throw new Error(hint) + // throw new Error(hint) + hintResult=hintResult+"\n"+hint; } } } }else if(item.Type == 4){ if (item.SelectName == "") { - var hint = hintIndex + ".点检内容 : " + item.Content; + var hint = "【"+hintIndex + "】.点检内容 : " + item.Content; throw new Error(hint) } } } + + if(hintResult.length>0){ + showConfirmMsg("是否提交?",hintResult,callback=>{ + if(callback){ + this.formData.forEach(res => { + if(res.SelectName){ + if (res.SelectName.includes("班")) { + var value = this.dataClassList.filter(item => item.name == res.SelectName) + if (value.length > 0) { + res.SelectValue = value[0].value + } else { + res.SelectValue = "" + } + } else { + var value = this.dataList.filter(item => item.name == res.SelectName) + if (value.length > 0) { + res.SelectValue = value[0].value + } else { + res.SelectValue = res.SelectName + } + } + } + }) + callBack(this.formData) + } + }) + return; + } + this.formData.forEach(res => { if(res.SelectName){ @@ -420,7 +458,10 @@ // title: title, // Content: hint // }) - this.$refs.comMessage.showMessage("提示", hint) + // this.$refs.comMessage.showMessage("提示", hint) + showConfirmMsg("提示",hint,callback=>{ + + }) }, isNumber(val) { diff --git a/src/pages/foam/check.vue b/src/pages/foam/check.vue index b094d91..9dc5226 100644 --- a/src/pages/foam/check.vue +++ b/src/pages/foam/check.vue @@ -87,10 +87,9 @@ deepCopyData } from "@/common/basic.js" import { - getPlaneNumberList, getMaterialLists, foamCheckSubmit, - getDeviceInfo + getFoamDeviceInfo } from '@/api/request2.js'; export default { components: { @@ -242,11 +241,10 @@ title: "加载中", mask: true }) - getDeviceInfo(result).then(res => { + getFoamDeviceInfo(result).then(res => { uni.hideLoading() this.deviceCode = result; console.log(result) - this.closeScanPopup(); var groupSelect = { Type: "4", Content: "选择班组", @@ -255,7 +253,7 @@ } // this.dataList = this.formData this.dataList = res.Result; - this.dataList.push(groupSelect) + this.dataList.unshift(groupSelect) this.deviceName=this.dataList[0].Name; this.dateTime = getCurrDateTime() @@ -264,14 +262,6 @@ uni.hideLoading() this.showMessage(error) }) - // this.deviceCode = result; - // this.deviceName = "自配料系统" - // console.log(result) - // this.reset(); - // this.closeScanPopup(); - // this.dataList = this.formData; - // this.dateTime = getCurrDateTime() - }, submit() { @@ -346,12 +336,11 @@ title: "加载中", mask: true }) - getDeviceInfo(data).then(res => { + getFoamDeviceInfo(data).then(res => { uni.hideLoading() this.deviceCode = data; this.deviceCheckCode = data; console.log(data) - this.closeScanPopup(); var groupSelect = { Type: "4", Content: "选择班组", @@ -359,8 +348,8 @@ SelectValue: "", } this.dataList = res.Result; - this.dataList.push(groupSelect) - this.deviceName=this.dataList[0].Name; + this.dataList.unshift(groupSelect) + this.deviceName=this.dataList[1].Name; this.dateTime = getCurrDateTime() }).catch(error => { uni.hideLoading() diff --git a/src/pages/foam/input.vue b/src/pages/foam/input.vue index 431baec..d6f1107 100644 --- a/src/pages/foam/input.vue +++ b/src/pages/foam/input.vue @@ -45,7 +45,7 @@ - + @@ -64,8 +64,6 @@ - - @@ -83,7 +81,7 @@ - + @@ -108,7 +106,7 @@ getMaterialList } from "./mock.js" import { - getPlaneNumberList, + getFoamPlaneNumberList, getMaterialLists, foamInputSubmit } from '@/api/request2.js'; @@ -157,7 +155,7 @@ console.log(event.detail); }, submit() { - if (this.planNumber == "123") { + if (this.planNumber == "") { this.showMessage("请选择计划单号") return } @@ -177,7 +175,7 @@ planNumber: this.planNumber, materialName: this.materialName, materialQty: this.materialQty, - UserName:this.$store.state.user.id, + id:this.$store.state.user.id, createTime:getCurrDateTime(), } console.log("提交", JSON.stringify(param)) @@ -204,11 +202,13 @@ title: "加载中", mask: true }) - getPlaneNumberList().then(res => { + getFoamPlaneNumberList().then(res => { + var list = []; + list =res.Result; uni.hideLoading() this.$refs.selectPopup.open({ mode: 'radio', //radio checkbox 单选、多选 - dataList: getDataList(), //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig + dataList: list, //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig // selected: this.userForm.values, //已选中的数据 // proxyConfig: { //组件内部代理请求数据配置 // reqFun: this.reqGetList, //请求方法 @@ -218,86 +218,59 @@ type: 'local', //local本地数据搜索 | remote请求接口 }, fields: { - label: 'name', - value: 'code' + label: 'PLAN_NO', + value: 'SHIFT_CODE' } }) }).catch(error => { uni.hideLoading() this.showMessage(error) }) - // this.$refs.selectPopup.open({ - // mode: 'radio', //radio checkbox 单选、多选 - // dataList: getDataList(), //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig - // // selected: this.userForm.values, //已选中的数据 - // // proxyConfig: { //组件内部代理请求数据配置 - // // reqFun: this.reqGetList, //请求方法 - // // localPaging: false //前端本地分页 - // // }, - // search: { - // type: 'local', //local本地数据搜索 | remote请求接口 - // }, - // fields: { - // label: 'name', - // value: 'code' - // } - // }) }, - select(mode, data) { - this.planNumber = data.code - this.planName = data.name + selectPlan(mode, data) { + this.planNumber = data.PLAN_NO + this.planName = data.SHIFT_CODE console.log(mode) console.log(data) }, showMaterialSelect() { - // getMaterialLists().then(res=>{ - // uni.hideLoading() - // var dataList =getMaterialList(); - // this.$refs.selectPopupMaterial.open({ - // mode: 'radio', //radio checkbox 单选、多选 - // dataList: dataList, //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig - // // selected: this.userForm.values, //已选中的数据 - // // proxyConfig: { //组件内部代理请求数据配置 - // // reqFun: this.reqGetList, //请求方法 - // // localPaging: false //前端本地分页 - // // }, - // search: { - // type: 'local', //local本地数据搜索 | remote请求接口 - // }, - // fields: { - // label: 'name', - // value: 'code' - // } - // }) - - // }).catch(error=>{ - // uni.hideLoading() - // this.showMessage(error) - // }) - - this.$refs.selectPopupMaterial.open({ - mode: 'radio', //radio checkbox 单选、多选 - dataList: this.materialList, //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig - // selected: this.userForm.values, //已选中的数据 - // proxyConfig: { //组件内部代理请求数据配置 - // reqFun: this.reqGetList, //请求方法 - // localPaging: false //前端本地分页 - // }, - search: { - type: 'local', //local本地数据搜索 | remote请求接口 - }, - fields: { - label: 'name', - value: 'code' - } + uni.showLoading({ + title: "加载中", + mask: true }) + getMaterialLists().then(res => { + var list = []; + list =res.Result; + uni.hideLoading() + this.$refs.selectPopupMaterial.open({ + mode: 'radio', //radio checkbox 单选、多选 + dataList: list, //如果dataList传入了数组则直接使用传入的数组渲染,无需再配置proxyConfig + // selected: this.userForm.values, //已选中的数据 + // proxyConfig: { //组件内部代理请求数据配置 + // reqFun: this.reqGetList, //请求方法 + // localPaging: false //前端本地分页 + // }, + search: { + type: 'local', //local本地数据搜索 | remote请求接口 + }, + fields: { + label: 'Name', + value: 'Code' + } + }) + }).catch(error => { + uni.hideLoading() + this.showMessage(error) + }) + }, selectMaterial(mode, data) { - this.materialName = data.name + this.materialName = data.Name + this.materialCode = data.Code this.$refs.inputQty.focused = true console.log("selectPopupMaterial") }, diff --git a/src/pages/plastics/check.vue b/src/pages/plastics/check.vue index 0312601..40f1855 100644 --- a/src/pages/plastics/check.vue +++ b/src/pages/plastics/check.vue @@ -30,7 +30,7 @@ 设备编号: - - @@ -66,7 +64,7 @@ - + @@ -89,10 +87,8 @@ deepCopyData } from "@/common/basic.js" import { - getPlaneNumberList, - getMaterialLists, foamCheckSubmit, - getDeviceInfo + getPlasticsDeviceInfo } from '@/api/request2.js'; export default { components: { @@ -244,11 +240,10 @@ title: "加载中", mask: true }) - getDeviceInfo(result).then(res => { + getPlasticsDeviceInfo(result).then(res => { uni.hideLoading() this.deviceCode = result; console.log(result) - this.reset(); this.closeScanPopup(); var groupSelect = { Type: "4", @@ -259,31 +254,14 @@ // this.dataList = this.formData this.dataList = res.Result; this.dataList.push(groupSelect) - this.dataList.forEach(res=>{ - res.SelectName="" - res.SelectValue="" - if(res.putMachine){ - res.putMachine.forEach(item=>{ - item.SelectName="" - item.SelectValue="" - }) - } - - }) + this.deviceName=this.dataList[0].Name; this.dateTime = getCurrDateTime() + this.worker = this.$store.state.user.name }).catch(error => { uni.hideLoading() this.showMessage(error) }) - // this.deviceCode = result; - // this.deviceName = "自配料系统" - // console.log(result) - // this.reset(); - // this.closeScanPopup(); - // this.dataList = this.formData; - // this.dateTime = getCurrDateTime() - }, submit() { @@ -302,34 +280,35 @@ } }) var commitData={ - LoginUserID:this.$store.state.user.id, - UserName:this.$store.state.user.name, + id:this.$store.state.user.id, createTime:getCurrDateTime(), groupName:groupName, groupValue:groupValue, dataList:data } - var param = commitData - console.log("提交", JSON.stringify(param)) - // foamCheckSubmit(param).then(res=>{ - // uni.hideLoading() - // this.showMessage("提交成功") - // this.clearData() - // }).catch(error=>{ - // uni.hideLoading() - // this.showMessage(error) - // }) - + console.log("提交", JSON.stringify(commitData)) + foamCheckSubmit(commitData).then(res=>{ + uni.hideLoading() + this.showMessage("提交成功") + this.clearData() + }).catch(error=>{ + uni.hideLoading() + this.showMessage(error) + }) }) }, clearData() { this.deviceCode = "" + this.deviceName=""; + this.dateTime =""; this.dateTime = "", - this.deviceCode = "", - this.deviceName = "", - this.reset(); - }, + this.deviceCode = "", + this.deviceName = "", + this.worker="" + this.dataList=[] + // this.reset(); + }, reset() { this.$refs.customerFrom.reset() }, @@ -357,12 +336,11 @@ title: "加载中", mask: true }) - getDeviceInfo(data).then(res => { + getPlasticsDeviceInfo(data).then(res => { uni.hideLoading() this.deviceCode = data; this.deviceCheckCode = data; console.log(data) - this.reset(); this.closeScanPopup(); var groupSelect = { Type: "4", @@ -370,21 +348,9 @@ SelectName: "", SelectValue: "", } - // this.dataList = this.formData this.dataList = res.Result; - this.dataList.push(groupSelect) - this.dataList.forEach(res=>{ - res.SelectName="" - res.SelectValue="" - if(res.putMachine){ - res.putMachine.forEach(item=>{ - item.SelectName="" - item.SelectValue="" - }) - } - - }) - this.deviceName=this.dataList[0].Name; + this.dataList.unshift(groupSelect) + this.deviceName=this.dataList[1].Name; this.dateTime = getCurrDateTime() }).catch(error => { uni.hideLoading() diff --git a/src/pages/plastics/input.vue b/src/pages/plastics/input.vue index b2c82b8..8f8d443 100644 --- a/src/pages/plastics/input.vue +++ b/src/pages/plastics/input.vue @@ -4,7 +4,7 @@ style="font-size: 32rpx; padding-left: 10rpx; padding-top: 10rpx; flex-direction: column;"> + {{requestUrl}} {{version}} {{version}} @@ -21,7 +21,7 @@ - + @@ -40,6 +40,8 @@ removeToken } from '@/common/utils/auth' + import config from '@/static/config.js' + // #ifdef APP-PLUS import { appUpdate @@ -60,7 +62,9 @@ const userName = ref(store.state.user.name); let version = ref(); let userInfo = ref(null); + let requestUrl =ref(null) onLoad(() => { + requestUrl =config.request_url getAppVersion() getUserProfile().then(res => { userInfo.value = res.data diff --git a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue index b5d8bf2..ef6a01b 100644 --- a/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue +++ b/src/uni_modules/wz-select-popup/components/wz-select-popup/wz-list.vue @@ -1,12 +1,14 @@