From 333e6ed92597825506ea1474fc1e6a9aa7401552 Mon Sep 17 00:00:00 2001 From: lijuncheng Date: Tue, 12 Dec 2023 19:55:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=A4=96=E5=85=A5=E5=BA=93?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/request2.js | 69 +++- common/basic.js | 9 + common/label.js | 20 +- common/scan.js | 40 +- mycomponents/scan/winComScan.vue | 2 +- mycomponents/scan/winScanPack.vue | 2 +- .../request/returnRequestCreate.vue | 6 +- .../unPlanned/coms/comReceiptRequestPopup.vue | 254 ++++++++++++ pages/unPlanned/job/receiptJobDetail.vue | 3 +- .../unPlanned/request/issueRequestCreate.vue | 10 +- pages/unPlanned/request/receiptRequest.vue | 133 +++++- .../request/receiptRequestCreate.vue | 382 +++++++----------- static/config.json | 2 +- 13 files changed, 643 insertions(+), 289 deletions(-) create mode 100644 pages/unPlanned/coms/comReceiptRequestPopup.vue diff --git a/api/request2.js b/api/request2.js index 0c7bb977..0c4c3b2a 100644 --- a/api/request2.js +++ b/api/request2.js @@ -1270,17 +1270,78 @@ export function unPlannedReceiptJobSubmit(params) { } /** - * 计划外入库申请 提交 + * 计划外入库申请 创建 * @param {*} params */ -export function unPlannedReceiptRequestbSubmit(params) { +export function unPlannedReceiptRequestCreate(params) { return request({ - url: baseApi + "/magic-api/pda/job/purchasereturn/jobSubmit", - method: "put", + url: baseApi + "/wms/unplannedreceipt-request-main/create", + method: "post", data: params, }); } +/** + * 计划外入库申请 提交审批 + * @param {*} params + */ +export function unPlannedReceiptRequestApprove(id) { + return request({ + url: baseApi + "/wms/unplannedreceipt-request-main/submit?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 计划外入库申请 关闭 + * @param {*} params + */ +export function unPlannedReceiptRequestClose(id) { + return request({ + url: baseApi + "/wms/unplannedreceipt-request-main/close?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 计划外入库申请 审批通过 + * @param {*} params + */ +export function unPlannedReceiptRequestApproveAgree(id) { + return request({ + url: baseApi + "/wms/unplannedreceipt-request-main/agree?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 计划外入库申请 审批驳回 + * @param {*} params + */ +export function unPlannedReceiptRequestApproveRefused(id) { + return request({ + url: baseApi + "/wms/unplannedreceipt-request-main/refusedd?id="+id, + method: "put", + data: {}, + }); +} + +/** + * 计划外入库申请 处理 + * @param {*} params + */ +export function unPlannedReceiptRequestHandle(id) { + return request({ + url: baseApi + "/wms/unplannedreceipt-request-main/handle?id="+id, + method: "put", + data: {}, + }); +} + + /** * 计划外入库记录 提交 * @param {*} params diff --git a/common/basic.js b/common/basic.js index 35db63a2..f3507b2a 100644 --- a/common/basic.js +++ b/common/basic.js @@ -775,6 +775,15 @@ export function getCurrDateTimes() { return time; } +export function getBatch() { + var date = new Date(); + var year = date.getFullYear(); //年 + var month = date.getMonth() + 1; //月 + var day = date.getDate(); //日 + var batch =year.toString()+month.toString()+day.toString() + return batch; +} + export function getCurrDate() { var date = new Date(); return getDate(date); diff --git a/common/label.js b/common/label.js index ddecb4dd..b720c6a6 100644 --- a/common/label.js +++ b/common/label.js @@ -34,7 +34,7 @@ export function getLabelInfo(scanMsg, callBack) { code:"" }, package: null, - sucess: false, + success: false, message: '标签格式不正确', } callBack(labelResult); @@ -50,12 +50,12 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) { barType: 'QRCode', }, package: {}, - sucess: true, + success: true, message: '' } getLabelByHeader(header, version).then(res => { if (res.data==null) { - labelResult.sucess = false; + labelResult.success = false; labelResult.message = '未查找到标签头为[' + header + ']的标签类型'; callBack(labelResult); } else { @@ -69,7 +69,7 @@ export function getQRCodeInfo(header, version, scanMsg, callBack) { getLabelItems(newItem, scanMsg, callBack); } }).catch(err => { - labelResult.sucess = false; + labelResult.success = false; labelResult.message = err; callBack(err); }) @@ -86,7 +86,7 @@ export function getLabelItems(labelItem, scanMsg, callBack) { if (packingNumber != undefined) { getPackageByNumber(packingNumber).then(pack => { if (pack.data.list.length == 0) { - labelResult.sucess = false; + labelResult.success = false; labelResult.message = '包装号[' + packingNumber + ']没有包装信息'; } else { labelResult.package = pack.data.list[0]; @@ -94,12 +94,12 @@ export function getLabelItems(labelItem, scanMsg, callBack) { } callBack(labelResult); }).catch(err => { - labelResult.sucess = false; + labelResult.success = false; labelResult.message = err; callBack(labelResult); }) } else { - labelResult.sucess = false; + labelResult.success = false; labelResult.message = '在条码中未解析到箱码'; callBack(labelResult); } @@ -115,7 +115,7 @@ export function analysisQRCodeLabel(labelItem, scanMsg) { barType: 'QRCode', }, package: {}, - sucess: true, + success: true, message: '' } @@ -124,7 +124,7 @@ export function analysisQRCodeLabel(labelItem, scanMsg) { labelResult.message = "未读取到分隔符"; } else { if (scanMsg.indexOf(separators) < 0) { - labelResult.sucess = false; + labelResult.success = false; labelResult.message = "标签格式不正确"; } else { try { @@ -165,7 +165,7 @@ export function getBarCodeInfo(header, version, value, callBack) { code:value }, package: null, - sucess: true, + success: true, message: '', } callBack(labelResult); diff --git a/common/scan.js b/common/scan.js index 93a3e8c5..73fe2759 100644 --- a/common/scan.js +++ b/common/scan.js @@ -13,12 +13,12 @@ //B:supplierBatch 供应商批次 //返回结果 -//sucess true:成功 false:失败 +//success true:成功 false:失败 //scanType barcode:条码 qrcode:二维码 //isPack true:箱码 false:托码 export function analyseScanInfo(scanMsg) { let scanResult = { - sucess: false, + success: false, message: "", data: { isPack: null, @@ -41,7 +41,7 @@ export function analyseScanInfo(scanMsg) { console.log('1.扫描到的内容:', scanMsg); //条码 if (scanMsg.indexOf(';') < 0) { - scanResult.sucess = true; + scanResult.success = true; scanResult.data.code = scanMsg; scanResult.data.scanType = 'barcode'; //条码 } else { @@ -107,15 +107,15 @@ export function analyseScanInfo(scanMsg) { } }) - scanResult.sucess = true; + scanResult.success = true; } else { //扫描的是条码,直接返回接收到的内容 - scanResult.sucess = true; + scanResult.success = true; scanResult.data.code = scanMsg; scanResult.data.scanType = 'barcode'; } } } catch (ex) { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "解析遇到异常" + ex.message; } } @@ -138,12 +138,12 @@ export function analyseScanInfo(scanMsg) { //E:produceDate日期 //返回结果 -//sucess true:成功 false:失败 +//success true:成功 false:失败 //scanType barcode:条码 qrcode:二维码 //isPack true:箱码 false:托码 export function analyseProductLabelInfo(scanMsg) { let scanResult = { - sucess: false, + success: false, message: "", data: { itemCode: null, @@ -163,7 +163,7 @@ export function analyseProductLabelInfo(scanMsg) { try { //条码 if (scanMsg.indexOf(';') < 0) { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "标签格式不正确"; } else { let arrayItems = scanMsg.split(';'); @@ -211,13 +211,13 @@ export function analyseProductLabelInfo(scanMsg) { scanResult.data.produceDate = value; break; default: - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "无法识别的前缀" + type; break; } - scanResult.sucess = true; + scanResult.success = true; } else { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "标签信息不能为空" + type; } } @@ -225,12 +225,12 @@ export function analyseProductLabelInfo(scanMsg) { } else { //扫描的是条码,直接返回接收到的内容 - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "标签分隔符错误"; } } } catch (ex) { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "解析遇到异常" + ex.message; } } @@ -243,7 +243,7 @@ export function analyseProductLabelInfo(scanMsg) { //1.序号1,2.生产号2546311FL,3.零件号254FL004,4.批序号202207110009 export function analyseTJMesQRCode(scanMsg) { let scanResult = { - sucess: false, + success: false, message: "", items: [] }; @@ -252,7 +252,7 @@ export function analyseTJMesQRCode(scanMsg) { } else { try { if (scanMsg.indexOf(':') < 0) { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "标签格式不正确"; } else { let arrayItems = scanMsg.split(':'); @@ -290,18 +290,18 @@ export function analyseTJMesQRCode(scanMsg) { } } } else { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "标签信息不能为空"; } }) - scanResult.sucess = true; + scanResult.success = true; } else { //扫描的是条码,直接返回接收到的内容 - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "标签分隔符错误"; } } } catch (ex) { - scanResult.sucess = false; + scanResult.success = false; scanResult.message = "解析遇到异常" + ex.message; } } diff --git a/mycomponents/scan/winComScan.vue b/mycomponents/scan/winComScan.vue index b8757707..573f2281 100644 --- a/mycomponents/scan/winComScan.vue +++ b/mycomponents/scan/winComScan.vue @@ -152,7 +152,7 @@ } getLabelInfo(content, callback => { let scanResult = callback; - if (scanResult.sucess) { + if (scanResult.success) { that.clear(); // that.getfocus();//不能自动获取焦点 that.$emit("getResult", scanResult); diff --git a/mycomponents/scan/winScanPack.vue b/mycomponents/scan/winScanPack.vue index 82058c80..7b8c9daf 100644 --- a/mycomponents/scan/winScanPack.vue +++ b/mycomponents/scan/winScanPack.vue @@ -74,7 +74,7 @@ }, getScanResult(result) { - if (result.sucess) { + if (result.success) { this.$emit("getResult", result); } else { this.showMessage(result.message) diff --git a/pages/productionReturn/request/returnRequestCreate.vue b/pages/productionReturn/request/returnRequestCreate.vue index b78163de..d522f378 100644 --- a/pages/productionReturn/request/returnRequestCreate.vue +++ b/pages/productionReturn/request/returnRequestCreate.vue @@ -5,8 +5,8 @@ - - + + @@ -44,7 +44,7 @@ import comScanReturnPack from '@/pages/productionReturn/coms/comScanReturnPack.vue' import comMessage from '@/mycomponents/common/comMessage.vue' import comReturnRequestCreator from '@/pages/productionReturn/coms/comReturnRequestCreator.vue' - + import comIssueRequestInfo from '@/pages/issue/coms/comIssueRequestInfo.vue' export default { name: '', components: { diff --git a/pages/unPlanned/coms/comReceiptRequestPopup.vue b/pages/unPlanned/coms/comReceiptRequestPopup.vue new file mode 100644 index 00000000..aee41088 --- /dev/null +++ b/pages/unPlanned/coms/comReceiptRequestPopup.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/pages/unPlanned/job/receiptJobDetail.vue b/pages/unPlanned/job/receiptJobDetail.vue index acd0fae8..e95ec319 100644 --- a/pages/unPlanned/job/receiptJobDetail.vue +++ b/pages/unPlanned/job/receiptJobDetail.vue @@ -313,7 +313,7 @@ console.log("提交参数", JSON.stringify(params)); // unPlannedReceiptJobSubmit(params).then(res => { // if (res.data) { - // this.showCommitSuccessMessage("提交成功
生成计划外入库记录" + res.data) + // this.showCommitSuccessMessage("提交成功
生成计划外入库记录
" + res.data) // } else { // this.showErrorMessage("提交失败[" + res.msg + "]") // } @@ -340,6 +340,7 @@ detail.packingNumber, detail.batch); detail.toPackingNumber = info.packingNumber; detail.toBatch = info.batch; + detail.toContainerNumber = ''; subList.push(detail) } }) diff --git a/pages/unPlanned/request/issueRequestCreate.vue b/pages/unPlanned/request/issueRequestCreate.vue index 065e3cfb..8f28e1d4 100644 --- a/pages/unPlanned/request/issueRequestCreate.vue +++ b/pages/unPlanned/request/issueRequestCreate.vue @@ -226,12 +226,14 @@ this.showErrorMessage("请选择出库原因") return; } + + uni.showLoading({ + title: "提交中....", + mask: true + }); var params = this.setRequestParams(); console.log("提交参数", JSON.stringify(params)); - uni.showLoading({ - title:"提交中" - }) unPlannedIssueRequestCreate(params).then(res => { uni.hideLoading() if (res.data) { @@ -252,7 +254,7 @@ item.subList.forEach(detail => { if (detail.scaned) { detail.fromLocationCode = detail.locationCode; - detail.reasonText = this.reasonCode; + detail.reason = this.reasonCode; detail.containerNumber =""; subList.push(detail) } diff --git a/pages/unPlanned/request/receiptRequest.vue b/pages/unPlanned/request/receiptRequest.vue index 92f062af..600eaddc 100644 --- a/pages/unPlanned/request/receiptRequest.vue +++ b/pages/unPlanned/request/receiptRequest.vue @@ -35,11 +35,17 @@ } from '@/common/record.js'; import { goHome, - updateTitle + updateTitle, + clearTirmAndWrap } from '@/common/basic.js'; import { getUnPlannedReceiptRequestList, + unPlannedReceiptRequestApprove, + unPlannedReceiptRequestClose, + unPlannedReceiptRequestApproveAgree, + unPlannedReceiptRequestApproveRefused, + unPlannedReceiptRequestHandle } from '@/api/request2.js'; import { getDetailOption, @@ -82,7 +88,7 @@ this.detailOptions = getDetailOption(); this.detailAndApproveOptions = getDetailAndApproveOption() this.detailAndApprovePassAndApproveNoOption = getDetailAndApprovePassAndApproveNoOption(), - this.detailAndHandleOption = getDetailAndHandleOption() + this.detailAndHandleOption = getDetailAndHandleOption() this.detailAndCloseOption = getDetailAndCloseOption() }, @@ -197,27 +203,45 @@ openScanDetailPopup() { uni.navigateTo({ - url: "./receiptRequest?fromType=" + this.fromType + url: "./receiptRequestCreate" }) }, - swipeClick(e, dataContent) { - if (e.content.text == "详情") { - console.log("详情", dataContent.id) + var text = clearTirmAndWrap(e.content.text) + if (text == "详情") { this.openRequestInfoPopup(dataContent); - } else if (e.content.text == "处理") { - console.log("处理") - } else if (e.content.text == "审批") { - console.log("审批") - } else if (e.content.text == "审批通过") { - console.log("审批通过") - } else if (e.content.text == "审批驳回") { - console.log("审批驳回") - } else if (e.content.text == "关闭") { - console.log("关闭") + } else if (text == "处理") { + this.showQuestionMessage("确定要处理当前申请吗?",res=>{ + this.unPlannedReceiptRequestHandle(dataContent.id) + }) + } else if (text == "提交审批") { + this.showQuestionMessage("确定要审批当前申请吗?",res=>{ + this.unPlannedReceiptRequestApprove(dataContent.id) + }) + } else if (text == "审批通过") { + this.showQuestionMessage("确定要审批通过当前申请吗?",res=>{ + this.unPlannedReceiptRequestApproveAgree(dataContent.id) + }) + } else if (text == "审批驳回") { + this.showQuestionMessage("确定要审批驳回当前申请吗?",res=>{ + this.unPlannedReceiptRequestApproveRefused(dataContent.id) + }) + } else if (text == "关闭") { + this.showQuestionMessage("确定要关闭当前申请吗?",res=>{ + this.unPlannedReceiptRequestClose(dataContent.id) + }) } }, + showQuestionMessage(hint,callBack){ + this.$refs.comMessage.showQuestionMessage(hint, + res => { + if (res) { + callBack() + } + }); + }, + switchChangeWait(state, jobStatus) { this.checkedWaitTask = state; this.status = jobStatus; @@ -266,6 +290,83 @@ } }); }, + unPlannedReceiptRequestApprove(id) { + unPlannedReceiptRequestApprove(id).then(res => { + if (res.data) { + this.getList("refresh") + uni.showToast({ + title: "申请提交审批成功" + }) + } else { + this.showMessage("申请提交审批失败") + } + + }).catch(error => { + this.showMessage(error) + }) + + }, + + unPlannedReceiptRequestClose(id) { + unPlannedReceiptRequestClose(id).then(res => { + if (res.data) { + this.getList("refresh") + uni.showToast({ + title: "申请关闭成功" + }) + } else { + this.showMessage("申请关闭失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + unPlannedReceiptRequestApproveAgree(id) { + unPlannedReceiptRequestApproveAgree(id).then(res => { + if (res.data) { + this.getList("refresh") + uni.showToast({ + title: "申请审批通过成功" + }) + } else { + this.showMessage("申请审批通过失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + unPlannedReceiptRequestApproveRefused(id) { + unPlannedReceiptRequestApproveRefused(id).then(res => { + if (res.data) { + this.getList("refresh") + uni.showToast({ + title: "申请审批驳回成功" + }) + } else { + this.showMessage("申请审批驳回失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, + unPlannedReceiptRequestHandle(id) { + unPlannedReceiptRequestHandle(id).then(res => { + if (res.data) { + this.getList("refresh") + uni.showToast({ + title: "申请处理成功" + }) + } else { + this.showMessage("申请处理失败") + } + + }).catch(error => { + this.showMessage(error) + }) + }, } } diff --git a/pages/unPlanned/request/receiptRequestCreate.vue b/pages/unPlanned/request/receiptRequestCreate.vue index affe5205..14147d85 100644 --- a/pages/unPlanned/request/receiptRequestCreate.vue +++ b/pages/unPlanned/request/receiptRequestCreate.vue @@ -1,297 +1,223 @@ diff --git a/static/config.json b/static/config.json index 4f688e61..471c6bba 100644 --- a/static/config.json +++ b/static/config.json @@ -18,7 +18,7 @@ "request_url": { "name": "request_url", - "value": "http://dev.ccwin-in.com:25100/api/admin-api", + "value": "http://192.168.0.178:12080/admin-api", "dev2": "http://192.168.0.157:12080/admin-api", "chefang": "http://192.168.0.178:12080/admin-api", "chenxinming": "http://192.168.0.230:12080/admin-api",