From 24eeecca654efa4142523343c6d137ed2f5e8eb7 Mon Sep 17 00:00:00 2001 From: zelian_wu Date: Wed, 10 Apr 2024 16:45:11 +0800 Subject: [PATCH] =?UTF-8?q?24-04-10=20=E5=87=BA=E5=BA=93=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/scss/message.scss | 7 ++++ src/element-ui/index.js | 43 +++++++++++++++++++++++ src/main.js | 1 + src/views/modules/production/scanForm.vue | 23 +++++++----- 4 files changed, 65 insertions(+), 9 deletions(-) create mode 100644 src/assets/scss/message.scss diff --git a/src/assets/scss/message.scss b/src/assets/scss/message.scss new file mode 100644 index 0000000..5317d1c --- /dev/null +++ b/src/assets/scss/message.scss @@ -0,0 +1,7 @@ +.messageMaxFont{ + font-size: 18px; +} + +.messageMaxFont .el-message__content{ + font-size: 18px; +} diff --git a/src/element-ui/index.js b/src/element-ui/index.js index 08206bc..3517dd7 100644 --- a/src/element-ui/index.js +++ b/src/element-ui/index.js @@ -146,4 +146,47 @@ Vue.prototype.$message = Message; Vue.prototype.$ELEMENT = { size: 'medium' } +Vue.prototype.$message = function (msg) { + let msgObj = { + message: msg.message ? msg.message : msg, + duration: 1000 + } + let msgType = msg.type || "" + switch (msgType) { + case 'success': + return Message.success(msgObj); + case 'warning': + return Message.error(msgObj); + case 'error': + return Message.error(msgObj); + default: + return Message(msgObj); + } +} +Vue.prototype.$message.success = function (msg) { + return Message.success({ + message: msg, + duration: 1000, + customClass: 'messageMaxFont', + dangerouslyUseHTMLString: true + }) +} + +Vue.prototype.$message.warning = function (msg) { + return Message.error({ + message: msg, + duration: 1000, + customClass: 'messageMaxFont', + dangerouslyUseHTMLString: true + }) +} + +Vue.prototype.$message.error = function (msg) { + return Message.error({ + message: msg, + duration: 1000, + customClass: 'messageMaxFont', + dangerouslyUseHTMLString: true + }) +} diff --git a/src/main.js b/src/main.js index 0a0ce69..5d72f38 100644 --- a/src/main.js +++ b/src/main.js @@ -9,6 +9,7 @@ import '@/element-ui' // api: https://github.com/ElemeFE import '@/icons' // api: http://www.iconfont.cn/ import '@/element-ui-theme' import '@/assets/scss/index.scss' +import '@/assets/scss/message.scss' import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios import { isAuth } from '@/utils' import cloneDeep from 'lodash/cloneDeep' diff --git a/src/views/modules/production/scanForm.vue b/src/views/modules/production/scanForm.vue index 4ae9586..040d71f 100644 --- a/src/views/modules/production/scanForm.vue +++ b/src/views/modules/production/scanForm.vue @@ -116,11 +116,11 @@ export default { return } if (arr[0] !== this.detail.site || arr[1] !== this.detail.partNo){ - this.$message.warning(`扫描标签有误,标签site:${arr[0]}partNo:${arr[1]},site应为:${this.detail.site}partNo应为:${this.detail.partNo}`) + this.$message.warning(`物料不匹配或每袋/每卷数量未维护`) return; } if (this.partValue===0 && this.model.flag !== 'Y'){ - this.$message.warning(`工厂编码:${this.detail.site},partNo:${this.detail.partNo},每袋/每卷数量未维护;${this.partValue}`) + this.$message.warning(`物料不匹配或每袋/每卷数量未维护`) return; } if (this.model.flag !== 'Y' && this.partValue != arr[2]){ @@ -156,6 +156,17 @@ export default { this.model.flag = ""; this.model.label = ''; }) + }, + closeScanDialog(){ + this.model = { + label: '', + flag: '', + } + if (this.total < this.notifyQty){ + this.$message.warning("出货书数量未达到通知单需求数量") + return; + } + this.scanLabelDetailList = []; } } @@ -169,13 +180,7 @@ export default { :visible.sync="flag" width="50%" @open="scanLabel" - @close="()=>{ - this.model = { - label: '', - flag: '', - } - this.scanLabelDetailList = []; - }" @opened="openScanDialog"> + @close="closeScanDialog" @opened="openScanDialog">