From 780e762ed6d25e1b8f4690ac8825d3fc61977b0d Mon Sep 17 00:00:00 2001 From: hzz Date: Sat, 13 Apr 2024 14:47:57 +0800 Subject: [PATCH] update --- src/api/home.js | 12 ++++++- src/lang/i18n-en-US.js | 6 +++- src/lang/i18n-zh-CN.js | 4 +++ src/views/dashboard.vue | 5 +-- src/views/index.vue | 45 ++++++++++++++++++++++---- src/views/produce/add_edit.vue | 21 ++++++++++++ src/views/produce/index.vue | 4 +-- src/views/product/product/index.vue | 4 +-- src/views/product/working/add_edit.vue | 14 ++++++++ src/views/quality/index.vue | 8 +++-- 10 files changed, 106 insertions(+), 17 deletions(-) diff --git a/src/api/home.js b/src/api/home.js index 2a974e7..16e6b3e 100644 --- a/src/api/home.js +++ b/src/api/home.js @@ -37,4 +37,14 @@ export function qualitynewDeviceOutputQuality() { url: '/casm/quality/newDeviceOutputQuality', method: 'get' }) -} \ No newline at end of file +} + +//首页 产量堆叠图 +export function getNewestFiveInfo() { + return request({ + url: '/casm/quality/getNewestFiveInfo', + method: 'get' + }) +} + + diff --git a/src/lang/i18n-en-US.js b/src/lang/i18n-en-US.js index cb241a0..edd3372 100644 --- a/src/lang/i18n-en-US.js +++ b/src/lang/i18n-en-US.js @@ -64,6 +64,7 @@ export default { "合格": "Pass", "不合格": "Fail", "未完成": "Unfinished", + "下载": "Download", }, "validate": { "不能为空": "Can not be empty ", @@ -71,7 +72,9 @@ export default { "长度不正确": "Length is incorrect", "范围不正确": "Range is incorrect", "最大值为": "Maximum value is", - "最小值为": "Minimum value is" + "最小值为": "Minimum value is", + "最小针数不能大于最大针数": "Min needle can not be greater than max needle", + "开始时间不能大于结束时间": "Start time can not be greater than end time", }, "tip": { "确定删除选中记录?": "Are you sure to delete the selected record?", @@ -166,6 +169,7 @@ export default { "类型": "Type", "第几次": "Needle No.", "步骤": "Step", + "二维码": "QRCode", }, "produce": { "产品编码": "ProductCode", diff --git a/src/lang/i18n-zh-CN.js b/src/lang/i18n-zh-CN.js index b365bfc..74206f9 100644 --- a/src/lang/i18n-zh-CN.js +++ b/src/lang/i18n-zh-CN.js @@ -65,6 +65,7 @@ export default { '合格': '合格', '不合格': '不合格', "未完成": "未完成", + "下载": "下载", }, "validate": { "不能为空": "不能为空", @@ -73,6 +74,8 @@ export default { "范围不正确": "范围不正确", "最大值为": "最大值为", "最小值为": "最小值为", + "最小针数不能大于最大针数": "最小针数不能大于最大针数", + "开始时间不能大于结束时间": "开始时间不能大于结束时间", }, "tip": { "确定删除选中记录?": "确定删除选中记录?", @@ -166,6 +169,7 @@ export default { "类型": "类型", "第几针": "第几针", "步骤": "步骤", + "二维码": "二维码", }, "produce": { "产品编码": "产品编码", diff --git a/src/views/dashboard.vue b/src/views/dashboard.vue index a642989..c27c969 100644 --- a/src/views/dashboard.vue +++ b/src/views/dashboard.vue @@ -153,8 +153,9 @@ function getList() { }); homeDeviceRate().then(response => { pie_option.value.series[0].data = [ - { value: response.data.on, name: proxy.tLang('home', '使用中') }, - { value: response.data.off, name: proxy.tLang('home', '停机') } + { value: response.data.off, name: proxy.tLang('home', '停机') }, + + { value: response.data.on, name: proxy.tLang('home', '使用中') } ] deviceState.on = response.data.on; deviceState.off = response.data.off; diff --git a/src/views/index.vue b/src/views/index.vue index 5d2b40b..c25d4f3 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -63,19 +63,42 @@
- - 啊啊 1720*828 - 1680*788 + + + + + + + + + + + + + + + +
diff --git a/src/views/produce/add_edit.vue b/src/views/produce/add_edit.vue index 8e7095c..424b84a 100644 --- a/src/views/produce/add_edit.vue +++ b/src/views/produce/add_edit.vue @@ -67,6 +67,27 @@ const rules = { persionCode: [ { required: true, message: `${proxy.tLang('produce','员工编号')} ` + proxy.tLang('validate','不能为空'), trigger: "blur" } ], + starttime: [ + { required: true, message: `${proxy.tLang('produce','开始时间')} ` + proxy.tLang('validate','不能为空'), trigger: "blur" }, + //开始时间不能大于结束时间 + {validator: validateStarttime, trigger: 'blur'} + ], + endtime: [ + { required: true, message: `${proxy.tLang('produce','结束时间')} ` + proxy.tLang('validate','不能为空'), trigger: "blur" }, + //开始时间不能大于结束时间 + {validator: validateStarttime, trigger: 'blur'} + ], +} + + +function validateStarttime(rule, value, callback) { + let start = new Date(props.form.starttime).getTime(); + let end = new Date(props.form.endtime).getTime(); + if (start > end) { + callback(new Error('开始时间不能大于结束时间')); + } else { + callback(); + } } function close() { emit("update:modelValue", false); diff --git a/src/views/produce/index.vue b/src/views/produce/index.vue index 36a9ed8..eaedcc7 100644 --- a/src/views/produce/index.vue +++ b/src/views/produce/index.vue @@ -73,7 +73,7 @@ + prop="userCode" /> @@ -172,7 +172,7 @@ const columns = ref([ { key: 4, label: proxy.tLang('produce', '当前产量'), visible: true }, { key: 5, label: proxy.tLang('produce', '开始时间'), visible: true }, { key: 6, label: proxy.tLang('produce', '结束时间'), visible: true }, - { key: 7, label: proxy.tLang('produce', '批次'), visible: true }, + { key: 7, label: proxy.tLang('produce', '批次'), visible: false }, { key: 8, label: proxy.tLang('produce', '备注'), visible: false }, ]); diff --git a/src/views/product/product/index.vue b/src/views/product/product/index.vue index 44cbfd3..ed22218 100644 --- a/src/views/product/product/index.vue +++ b/src/views/product/product/index.vue @@ -45,7 +45,7 @@ @@ -235,7 +235,7 @@ function handleInfo(row) { /** 提交按钮 */ function submitForm(propform) { - if (propform.code != null) { + if (propform.disabled != false && propform.disabled) { updateProduction(propform).then(response => { proxy.$modal.msgSuccess(proxy.tLang('common', '修改成功')); open.value = false; diff --git a/src/views/product/working/add_edit.vue b/src/views/product/working/add_edit.vue index 05cf845..6da515e 100644 --- a/src/views/product/working/add_edit.vue +++ b/src/views/product/working/add_edit.vue @@ -41,7 +41,21 @@ const { proxy } = getCurrentInstance(); const formRef = ref() const rules = { code: [{ required: true, message: `${proxy.tLang('common', '请输入') + proxy.tLang('product', '产品编码')}`, trigger: "blur" }], + min:[ + {validator: validateMin, trigger: 'blur'} + ], + max:[ + {validator: validateMin, trigger: 'blur'} + ] }; + +function validateMin(rule, value, callback) { + if (props.form.min > props.form.max) { + callback(new Error('最小针数不能大于最大针数')); + } else { + callback(); + } +} const props = defineProps({ modelValue: [String, Object, Array], title: String, diff --git a/src/views/quality/index.vue b/src/views/quality/index.vue index 78da045..d43fcfc 100644 --- a/src/views/quality/index.vue +++ b/src/views/quality/index.vue @@ -51,15 +51,15 @@ + :formatter="(val) => { return totalQuality == 0 ? '0%' :((val / totalQuality) * 100).toFixed(1) + '%' }" /> + :formatter="(val) => { return totalQuality == 0 ? '0%' :((val / totalQuality) * 100).toFixed(1)||0 + '%' }" /> - +