From 6e1bf994c2f0bd0e3698f5bdfd94b916fa17d6c7 Mon Sep 17 00:00:00 2001 From: juzi <819872918@qq.com> Date: Tue, 7 Nov 2023 15:49:07 +0800 Subject: [PATCH 1/3] bug --- .env.dev | 4 +- .env.prod | 4 +- .../components/deliveryLogDetail.vue | 2 + .../deliveryLog/components/loadedPage.vue | 14 ++++++- src/views/delivery/deliveryLog/index.vue | 39 +++++++++++++++---- .../components/deliveryLogDetDetail.vue | 4 ++ src/views/delivery/deliveryLogDet/index.vue | 4 +- src/views/energy/base/energyType/index.vue | 2 +- .../energyLimit/components/energyLimitAdd.vue | 21 ++++++++-- .../energy/monitoring/energyLimit/index.vue | 10 +++++ .../monitoring/energyOverlimitLog/index.vue | 9 +++++ .../monitoring/energyReportSearch/index.vue | 10 +++-- .../energy/monitoring/orderEnergy/index.vue | 4 +- .../group/base/groupTeamScheduling/index.vue | 19 ++++----- .../group/monitoring/groupTeamView/index.vue | 15 +++---- .../group/monitoring/teamProduction/index.vue | 27 +++++++------ src/views/order/base/orderManage/index.vue | 16 ++++---- .../base/orderManage/orderDetailData.vue | 4 +- .../orderCompletionMonitoring/index.vue | 33 ++++++++++------ 19 files changed, 165 insertions(+), 76 deletions(-) diff --git a/.env.dev b/.env.dev index 6a1675e8..44287cda 100644 --- a/.env.dev +++ b/.env.dev @@ -13,8 +13,8 @@ VUE_APP_TITLE = MES系统 # 芋道管理系统/开发环境 # VUE_APP_BASE_API = 'http://100.64.0.26:48082' -# VUE_APP_BASE_API = 'http://192.168.0.33:48082' -VUE_APP_BASE_API = 'http://192.168.4.173:48080' +VUE_APP_BASE_API = 'http://192.168.0.33:48082' +# VUE_APP_BASE_API = 'http://192.168.4.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.1.49:48080' # VUE_APP_BASE_API = 'http://192.168.1.8:48080' diff --git a/.env.prod b/.env.prod index 7ac2b7f1..43504e8f 100644 --- a/.env.prod +++ b/.env.prod @@ -2,14 +2,14 @@ ENV = 'production' # 页面标题 -VUE_APP_TITLE = 产线监控系统 +VUE_APP_TITLE = MES系统 # 芋道管理系统/生产环境 VUE_APP_BASE_API = '/prod-api' # 根据服务器或域名修改 # PUBLIC_PATH = 'http://my-pi.com:8888/yudao-admin/' -PUBLIC_PATH = 'http://192.168.0.33:8888/' +PUBLIC_PATH = 'http://192.168.0.33:8889/' # 二级部署路径 VUE_APP_APP_NAME ='yudao-admin' diff --git a/src/views/delivery/deliveryLog/components/deliveryLogDetail.vue b/src/views/delivery/deliveryLog/components/deliveryLogDetail.vue index e5fb7be5..caa9aef9 100644 --- a/src/views/delivery/deliveryLog/components/deliveryLogDetail.vue +++ b/src/views/delivery/deliveryLog/components/deliveryLogDetail.vue @@ -154,11 +154,13 @@ export default { padding: 8px 8px 8px 40px; .title { height: 16px; + font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.85); } .text { height: 16px; + font-size: 14px; font-weight: 400; color: rgba(102,102,102,0.75); } diff --git a/src/views/delivery/deliveryLog/components/loadedPage.vue b/src/views/delivery/deliveryLog/components/loadedPage.vue index 40d48f61..3d1c6d2f 100644 --- a/src/views/delivery/deliveryLog/components/loadedPage.vue +++ b/src/views/delivery/deliveryLog/components/loadedPage.vue @@ -39,7 +39,7 @@ - + import { getProductAll } from '@/api/base/product' import { deliveryLogDetCreate } from '@/api/base/delivery' +import { orderDetail } from '@/api/base/orderManage' export default { name: 'LoadedPage', data() { @@ -107,16 +108,25 @@ export default { } }, methods: { - init(id, code) { + init(id, code, orderId) { this.getSelectList() this.form.logId = id this.code = code + this.getProductId(orderId) }, getSelectList() { getProductAll().then(res => { this.productList = res.data || [] }) }, + // 获得装车产品 + getProductId(orderId) { + orderDetail({ + id: orderId + }).then(res => { + this.form.productId = res.data.planProductId || '' + }) + }, submitForm() { this.$refs['addOrUpdate'].validate((valid) => { if (valid) { diff --git a/src/views/delivery/deliveryLog/index.vue b/src/views/delivery/deliveryLog/index.vue index 0f324fcf..844f5030 100644 --- a/src/views/delivery/deliveryLog/index.vue +++ b/src/views/delivery/deliveryLog/index.vue @@ -119,7 +119,8 @@ export default { { type: 'input', label: '订单名', - param: 'orderName' + param: 'orderName', + defaultSelect: '' }, { type: 'input', @@ -138,10 +139,10 @@ export default { color: 'primary' }, { - type: 'separate' + type: this.$auth.hasPermi('extend:delivery-log:create') ? 'separate' : '', }, { - type: 'button', + type: this.$auth.hasPermi('extend:delivery-log:create') ? 'button' : '', btnName: '新增', name: 'add', color: 'success', @@ -161,25 +162,25 @@ export default { tableH: this.tableHeight(260), total: 0, tableBtn: [ - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('extend:delivery-log:loaded') ? { type: 'loaded', btnName: '装车' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('extend:delivery-log:detail') ? { type: 'detail', btnName: '详情' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('extend:delivery-log:update') ? { type: 'edit', btnName: '编辑' } : undefined, - this.$auth.hasPermi('base:group-team:delete') + this.$auth.hasPermi('extend:delivery-log:delete') ? { type: 'delete', btnName: '删除' @@ -196,10 +197,32 @@ export default { window.addEventListener('resize', () => { this.tableH = this.tableHeight(260) }) + if (location.href.indexOf('?') > 0) { + let arr = location.href.split('?')[1] + this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]) + } else { + this.formConfig[0].defaultSelect = '' + } + this.queryParams.orderName = this.formConfig[0].defaultSelect this.getList(); }, components: { AddOrUpdate, LoadedPage, DeliveryLogDetail }, + watch: { + $route: 'initData' + }, methods: { + initData(to) { + if (to.name === 'DeliveryLog') { + if (location.href.indexOf('?') > 0) { + let arr = location.href.split('?')[1] + this.formConfig[0].defaultSelect = decodeURI(arr.split('=')[1]) + } else { + this.formConfig[0].defaultSelect = '' + } + this.queryParams.orderName = this.formConfig[0].defaultSelect + this.getList() + } + }, getList() { deliveryLogPage({...this.queryParams}).then(res => { this.list = res.data.list || [] @@ -236,7 +259,7 @@ export default { case 'loaded': this.centervisible2 = true this.$nextTick(() => { - this.$refs.loadedPage.init(val.data.id, val.data.code) + this.$refs.loadedPage.init(val.data.id, val.data.code, val.data.orderId) }) break default: diff --git a/src/views/delivery/deliveryLogDet/components/deliveryLogDetDetail.vue b/src/views/delivery/deliveryLogDet/components/deliveryLogDetDetail.vue index 1fd04ed2..f26889a9 100644 --- a/src/views/delivery/deliveryLogDet/components/deliveryLogDetDetail.vue +++ b/src/views/delivery/deliveryLogDet/components/deliveryLogDetDetail.vue @@ -379,12 +379,14 @@ export default { padding: 8px 8px 8px 40px; .blodTip { height: 16px; + font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.85); margin-bottom: 8px; } .lightTip { height: 16px; + font-size: 14px; font-weight: 400; color: rgba(102,102,102,0.75); } @@ -415,11 +417,13 @@ export default { padding: 8px 8px 8px 40px; .title { height: 16px; + font-size: 14px; font-weight: 600; color: rgba(0,0,0,0.85); } .text { height: 16px; + font-size: 14px; font-weight: 400; color: rgba(102,102,102,0.75); } diff --git a/src/views/delivery/deliveryLogDet/index.vue b/src/views/delivery/deliveryLogDet/index.vue index 7502d885..7a21fa78 100644 --- a/src/views/delivery/deliveryLogDet/index.vue +++ b/src/views/delivery/deliveryLogDet/index.vue @@ -61,7 +61,7 @@ const tableProps = [ }, { prop: 'rate', - label: '累积发货比例(%)' + label: '累积发货比例(%)' } ] export default { @@ -92,7 +92,7 @@ export default { tableH: this.tableHeight(260), total: 0, tableBtn: [ - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('extend:delivery-log-det:detail') ? { type: 'detail', btnName: '详情' diff --git a/src/views/energy/base/energyType/index.vue b/src/views/energy/base/energyType/index.vue index 428fb11d..57fa05f1 100644 --- a/src/views/energy/base/energyType/index.vue +++ b/src/views/energy/base/energyType/index.vue @@ -92,7 +92,7 @@ export default { color: 'primary' }, { - type: 'separate' + type: this.$auth.hasPermi('base:energy-type:create') ? 'separate' : '', }, { type: this.$auth.hasPermi('base:energy-type:create') ? 'button' : '', diff --git a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue index d3bf793a..53068272 100644 --- a/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue +++ b/src/views/energy/monitoring/energyLimit/components/energyLimitAdd.vue @@ -62,8 +62,9 @@ - - + + + @@ -96,14 +97,16 @@ export default { type: '', plcParamId: '', limitType: '', - limitValue: '' + minValue: null, + maxValue: null }, objIds: [],// 回显数组 isEdit: false, //是否是编辑 rules: { objectId: [{ required: true, message: '对象不能为空', trigger: 'change' }], energyTypeId: [{ required: true, message: '能源类型不能为空', trigger: 'change' }], - type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }] + type: [{ required: true, message: '监控模式不能为空', trigger: 'change' }], + limitType: [{ required: true, message: '指标类型不能为空', trigger: 'change' }] }, detailList: [] } @@ -199,6 +202,12 @@ export default { this.$modal.msgError("监控模式为详细时,详细参数为必填"); return false } + if (this.form.minValue && this.form.maxValue) { + if (this.form.minValue > this.form.maxValue) { + this.$modal.msgError("消耗量阈值,最小值不能大于最大值"); + return false + } + } // this.form.limitType = Number(this.form.limitType) if (this.isEdit) { // 编辑 @@ -223,6 +232,10 @@ export default { }, formClear() { this.$refs.form.resetFields() + this.form.type = '' + this.form.plcParamId = '' + this.form.minValue = null + this.form.maxValue = null this.objIds = '' this.detailList = [] this.isEdit = false diff --git a/src/views/energy/monitoring/energyLimit/index.vue b/src/views/energy/monitoring/energyLimit/index.vue index a740d820..ce058a31 100644 --- a/src/views/energy/monitoring/energyLimit/index.vue +++ b/src/views/energy/monitoring/energyLimit/index.vue @@ -37,6 +37,7 @@ @cancel="handleCancel" @confirm="handleConfirm" :before-close="handleCancel" + width='60%' > @@ -199,6 +200,15 @@ export default { item.type = i.label } }) + if (item.minValue && item.maxValue) { + item.limitValue = item.minValue + '-' + item.maxValue + } else if(item.minValue){ + item.limitValue = '最小值' + item.minValue + }else if(item.maxValue){ + item.limitValue = '最大值' + item.maxValue + } else { + item.limitValue = '' + } }) this.list = arr this.total = response.data.total; diff --git a/src/views/energy/monitoring/energyOverlimitLog/index.vue b/src/views/energy/monitoring/energyOverlimitLog/index.vue index 8075e2a1..f748592c 100644 --- a/src/views/energy/monitoring/energyOverlimitLog/index.vue +++ b/src/views/energy/monitoring/energyOverlimitLog/index.vue @@ -136,6 +136,15 @@ export default { item.type = i.name } }) + if (item.minValue && item.maxValue) { + item.limitValue = item.minValue + '-' + item.maxValue + } else if(item.minValue){ + item.limitValue = '最小值' + item.minValue + }else if(item.maxValue){ + item.limitValue = '最大值' + item.maxValue + } else { + item.limitValue = '' + } }) this.list = arr this.total = response.data.total; diff --git a/src/views/energy/monitoring/energyReportSearch/index.vue b/src/views/energy/monitoring/energyReportSearch/index.vue index 86498ff6..117b6d12 100644 --- a/src/views/energy/monitoring/energyReportSearch/index.vue +++ b/src/views/energy/monitoring/energyReportSearch/index.vue @@ -121,8 +121,9 @@ export default { this.tableH = this.tableHeight(260) this.isFold = this.searchBarWidth('energyReportSearchBox', 1180) }) - if (this.$route.params.startTime && this.$route.params.endTime) { - this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime] + if (location.href.indexOf('?') > 0) { + let arr = location.href.split('?')[1].split('&') + this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]] } else { this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()] } @@ -138,8 +139,9 @@ export default { methods: { initData(to) { if (to.name === 'EnergyReportSearch') { - if (this.$route.params.startTime && this.$route.params.endTime) { - this.formConfig[2].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime] + if (location.href.indexOf('?') > 0) { + let arr = location.href.split('?')[1].split('&') + this.formConfig[2].defaultSelect = [arr[0].split('=')[1], arr[1].split('=')[1]] } else { this.formConfig[2].defaultSelect = [Date.now() - 7*24*3600000, Date.now()] } diff --git a/src/views/energy/monitoring/orderEnergy/index.vue b/src/views/energy/monitoring/orderEnergy/index.vue index 847d7003..b66497bf 100644 --- a/src/views/energy/monitoring/orderEnergy/index.vue +++ b/src/views/energy/monitoring/orderEnergy/index.vue @@ -115,7 +115,7 @@ export default { type: 'select', label: '能源类型', selectOptions: [], - param: 'objType', + param: 'energyTypeId', filterable: true, width: 120, clearable: false @@ -126,7 +126,7 @@ export default { selectOptions: this.getDictDatas(this.DICT_TYPE.OBJECT_TYPE), labelField: 'label', valueField: 'value', - param: 'energyTypeId', + param: 'objType', width: 100, clearable: false }, diff --git a/src/views/group/base/groupTeamScheduling/index.vue b/src/views/group/base/groupTeamScheduling/index.vue index 49cd5ccd..37924793 100644 --- a/src/views/group/base/groupTeamScheduling/index.vue +++ b/src/views/group/base/groupTeamScheduling/index.vue @@ -16,10 +16,10 @@ - + - 设置 + 设置 自动排班 @@ -285,21 +285,22 @@ export default { switch (val) { case '1': this.$router.push({ - // path: '/core/monitoring/production-line-data', - name: 'ProductionLineData', - params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } + path: '/core/enhance/product-line-24h?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime, + // name: 'ProductionLineData', + // params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } }) break; case '2': // 能源 this.$router.push({ - name: 'EnergyReportSearch', - params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } + path: '/energy/monitoring/energy-report-search?startTime='+this.chooseObj.startTime+'&endTime='+this.chooseObj.endTime + // name: 'EnergyReportSearch', + // params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } }) break; default: this.$router.push({ - // path: '/quality/monitoring/quality-statistics', - name: 'QualityStatistics', + path: '/quality/monitoring/quality-statistics', + // name: 'QualityStatistics', params: { startTime: this.chooseObj.startTime, endTime: this.chooseObj.endTime } }) } diff --git a/src/views/group/monitoring/groupTeamView/index.vue b/src/views/group/monitoring/groupTeamView/index.vue index 7a5a6e1f..821a60b3 100644 --- a/src/views/group/monitoring/groupTeamView/index.vue +++ b/src/views/group/monitoring/groupTeamView/index.vue @@ -49,12 +49,6 @@ const tableProps = [ label: '上班次数' } ] -const tableBtn = [ - { - type: 'detail', - btnName: '详情' - } -] export default { name: 'GroupTeamView', data() { @@ -82,7 +76,14 @@ export default { }, workOrderList: [], workOrderName: '', - tableBtn, + tableBtn: [ + this.$auth.hasPermi('base:group-team-view:detail') + ? { + type: 'detail', + btnName: '详情' + } + : undefined + ].filter((v) => v), tableProps, tableH: this.tableHeight(220), list: [], diff --git a/src/views/group/monitoring/teamProduction/index.vue b/src/views/group/monitoring/teamProduction/index.vue index bcd93a29..611dd390 100644 --- a/src/views/group/monitoring/teamProduction/index.vue +++ b/src/views/group/monitoring/teamProduction/index.vue @@ -72,12 +72,6 @@ const tableProps = [ showOverflowtooltip: true } ] -const tableBtn = [ - { - type: 'viewDetail', - btnName: '查看生产情况' - } -] export default { name: 'GroupTeamScheduling', data() { @@ -98,13 +92,14 @@ export default { { type: 'datePicker', label: '上班日期', - dateType: 'date', + dateType: 'daterange', format: 'yyyy-MM-dd', valueFormat: 'yyyy-MM-dd', + rangeSeparator: '-', // valueFormat: "timestamp", - param: 'startDay', + param: 'tiemStr', defaultSelect: '', - width: 200 + width: 250 }, { type: 'button', @@ -119,10 +114,17 @@ export default { pageSize: 20, classesId: '', teamName: '', - startDay: '' + startDay: [] }, tableProps, - tableBtn, + tableBtn: [ + this.$auth.hasPermi('base:team-production:detail') + ? { + type: 'viewDetail', + btnName: '查看生产情况' + } + : undefined + ].filter((v) => v), list: [], tableH: this.tableHeight(260), total: 0, @@ -142,7 +144,8 @@ export default { this.queryParams.pageNo = 1; this.queryParams.classesId = val.classesId this.queryParams.teamName = val.teamName - this.queryParams.startDay = val.startDay + this.queryParams.startDay[0] = val.tiemStr ? val.tiemStr[0] + ' 00:00:00' : '' + this.queryParams.startDay[1] = val.tiemStr ? val.tiemStr[1] + ' 23:59:59' : '' this.getList() }, getList() { diff --git a/src/views/order/base/orderManage/index.vue b/src/views/order/base/orderManage/index.vue index 9a4d2afd..d8181ad5 100644 --- a/src/views/order/base/orderManage/index.vue +++ b/src/views/order/base/orderManage/index.vue @@ -165,10 +165,10 @@ export default { color: 'primary' }, { - type: 'separate' + type: this.$auth.hasPermi('base:order-manage:create') ? 'separate' : '', }, { - type: 'button', + type: this.$auth.hasPermi('base:order-manage:create') ? 'button' : '', btnName: '新增', name: 'add', color: 'success', @@ -188,31 +188,31 @@ export default { list: [], tableH: this.tableHeight(260), tableBtn: [ - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-manage:addWorkOrder') ? { type: 'add', btnName: '新增工单' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-manage:bindWorkOrder') ? { type: 'bind', btnName: '绑定工单' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-manage:detail') ? { type: 'detail', btnName: '详情' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-manage:edit') ? { type: 'edit', btnName: '编辑' } : undefined, - this.$auth.hasPermi('base:group-team:delete') + this.$auth.hasPermi('base:order-manage:delete') ? { type: 'delete', btnName: '删除' @@ -292,7 +292,7 @@ export default { this.handleDelete(val.data) break case 'detail': - this.$router.push({ name: 'OrderDetailData', params: { orderId: val.data.id }}) + this.$router.push({path: '/order/base/order-manage/order-detail-data?orderId='+ val.data.id}) break case 'add': this.workIssueTitle = '新增工单' diff --git a/src/views/order/base/orderManage/orderDetailData.vue b/src/views/order/base/orderManage/orderDetailData.vue index 298e9954..4286c770 100644 --- a/src/views/order/base/orderManage/orderDetailData.vue +++ b/src/views/order/base/orderManage/orderDetailData.vue @@ -222,7 +222,7 @@ export default { window.addEventListener('resize', () => { this.tableH = this.tableHeight(510) / 2 }) - this.orderId = this.$route.params.orderId + this.orderId = location.href.split('?')[1].split('=')[1] this.getMsg() }, watch: { @@ -231,7 +231,7 @@ export default { methods: { initData(to) { if (to.name === 'OrderDetailData') { - this.orderId = this.$route.params.orderId + this.orderId = location.href.split('?')[1].split('=')[1] this.getMsg() } }, diff --git a/src/views/order/monitoring/orderCompletionMonitoring/index.vue b/src/views/order/monitoring/orderCompletionMonitoring/index.vue index 4cb31be5..d20b887a 100644 --- a/src/views/order/monitoring/orderCompletionMonitoring/index.vue +++ b/src/views/order/monitoring/orderCompletionMonitoring/index.vue @@ -144,7 +144,7 @@ export default { color: 'primary' } ], - activeName: 'barChart', + activeName: 'dataList', // 查询参数 queryParams: { pageNo: 1, @@ -157,19 +157,19 @@ export default { tableH: this.tableHeight(270), total: 0, tableBtn: [ - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-completion-monitoring:orderDet') ? { type: 'orderDetail', btnName: '工单详情' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-completion-monitoring:qualityDet') ? { type: 'qualityDetail', btnName: '质量详情' } : undefined, - this.$auth.hasPermi('base:group-team:update') + this.$auth.hasPermi('base:order-completion-monitoring:sendOut') ? { type: 'sendOutDetail', btnName: '发货详情' @@ -194,16 +194,14 @@ export default { getPage() { orderMonitor({...this.queryParams}).then(res => { this.list = res.data || [] - this.getPieChart() + // this.getPieChart() }) }, // 饼图 getPieChart() { var chartDom = document.getElementById('orderPieBar'); var myChart = echarts.init(chartDom); - var option; - - option = { + var option = { color:['#288AFF','#7164FF','#fff','#63BDFF','#8EF0AB','#FFCE6A'], series: [ { @@ -311,13 +309,12 @@ export default { show: false }, data: [ - { value: 1000, name: '5' }, + { value: 800, name: '5' }, { value: 1048, name: 'xxx' } ] } ] } - option && myChart.setOption(option) }, // 查询 @@ -331,9 +328,23 @@ export default { } this.getPage() }, - handleClick() {} + handleClick(val) { + console.log(val) + switch (val.type) { + case 'orderDetail': + + break + case 'qualityDetail': + + break + default: + this.$router.push({ + path: '/delivery/delivery-log?orderId='+encodeURI(val.data.name) + }) + } } } +} diff --git a/src/views/quality/monitoring/currentData/index.vue b/src/views/quality/monitoring/currentData/index.vue new file mode 100644 index 00000000..81e49adc --- /dev/null +++ b/src/views/quality/monitoring/currentData/index.vue @@ -0,0 +1,436 @@ + + + diff --git a/src/views/quality/monitoring/deviceParameters/components/pieChart.vue b/src/views/quality/monitoring/deviceParameters/components/pieChart.vue new file mode 100644 index 00000000..249e5b3b --- /dev/null +++ b/src/views/quality/monitoring/deviceParameters/components/pieChart.vue @@ -0,0 +1,279 @@ + + + + + + + diff --git a/src/views/quality/monitoring/deviceParameters/index.vue b/src/views/quality/monitoring/deviceParameters/index.vue new file mode 100644 index 00000000..0c30de48 --- /dev/null +++ b/src/views/quality/monitoring/deviceParameters/index.vue @@ -0,0 +1,714 @@ + + + + + + + + + diff --git a/src/views/quality/monitoring/deviceParameters/utils/local-data-manager.js b/src/views/quality/monitoring/deviceParameters/utils/local-data-manager.js new file mode 100644 index 00000000..5d8c76fd --- /dev/null +++ b/src/views/quality/monitoring/deviceParameters/utils/local-data-manager.js @@ -0,0 +1,36 @@ +export default class LocalDataManager { + constructor(dataList, pageNo, pageSize) { + this._dataListStore = dataList; + this._pageNo = pageNo; + this._pageSize = pageSize; + } + + set pageNo(pageNo) { + console.log('set pageNo', pageNo); + this._pageNo = pageNo; + } + + set pageSize(pageSize) { + console.log('set pageSize', pageSize); + this._pageSize = pageSize; + } + + get dataList() { + const firstLine = this._dataListStore[0]; + const realDataList = this._dataListStore.slice(1); + return [ + firstLine, + ...realDataList.slice((this._pageNo - 1) * this._pageSize, this._pageNo * this._pageSize) + ] + } + + get total() { + return this._dataListStore.length; + } + + deleteData(id) { + const idx = this._dataListStore.findIndex(item => item.id == id); + this._dataListStore.splice(idx, 1); + // send http request + } +} \ No newline at end of file diff --git a/src/views/quality/monitoring/equipmentTraceability/components/pieChart.vue b/src/views/quality/monitoring/equipmentTraceability/components/pieChart.vue new file mode 100644 index 00000000..249e5b3b --- /dev/null +++ b/src/views/quality/monitoring/equipmentTraceability/components/pieChart.vue @@ -0,0 +1,279 @@ + + + + + + + diff --git a/src/views/quality/monitoring/equipmentTraceability/index.vue b/src/views/quality/monitoring/equipmentTraceability/index.vue new file mode 100644 index 00000000..c88a7f60 --- /dev/null +++ b/src/views/quality/monitoring/equipmentTraceability/index.vue @@ -0,0 +1,576 @@ + + + + + + + diff --git a/src/views/quality/monitoring/materielDateFrom/index.vue b/src/views/quality/monitoring/materielDateFrom/index.vue new file mode 100644 index 00000000..95791604 --- /dev/null +++ b/src/views/quality/monitoring/materielDateFrom/index.vue @@ -0,0 +1,247 @@ + + + + diff --git a/src/views/quality/monitoring/mixins/basic-add.js b/src/views/quality/monitoring/mixins/basic-add.js new file mode 100644 index 00000000..0b9acd23 --- /dev/null +++ b/src/views/quality/monitoring/mixins/basic-add.js @@ -0,0 +1,100 @@ +/* + * @Author: zwq + * @Date: 2022-08-24 11:19:43 + * @LastEditors: zwq + * @LastEditTime: 2023-08-03 14:21:04 + * @Description: + */ +export default { + data() { + /* eslint-disable */ + return { + urlOptions: { + createURL: '', + updateURL: '', + infoURL: '', + codeURL: '', + getOption: false, + isGetCode: false, + optionArrUrl: [], + optionArr: {} + }, + visible: false, + setData: false + } + }, + created() { + }, + activated() { + }, + methods: { + init(id) { + this.dataForm.id = id || ""; + this.visible = true; + if (this.urlOptions.getOption) { + this.getArr() + } + this.$nextTick(() => { + this.$refs["dataForm"].resetFields(); + if (this.dataForm.id) { + this.urlOptions.infoURL(id).then(response => { + this.dataForm = response.data; + if (this.setData) { + this.setDataForm() + } + }); + } else { + if (this.urlOptions.isGetCode) { + this.getCode() + } + } + }); + }, + getCode() { + this.urlOptions.codeURL() + .then(({ data: res }) => { + this.dataForm.code = res; + }) + .catch(() => {}); + }, + getArr() { + const params = { + pageSize: 100, + pageNo: 1, + } + this.urlOptions.optionArrUrl.forEach((item, index) => { + item(params).then(({ data: res }) => { + this.$set(this.urlOptions.optionArr, `arr${index}`, res.list) + }) + .catch(() => { + }); + }); + }, + // 表单提交 + dataFormSubmit() { + this.$refs["dataForm"].validate((valid) => { + if (!valid) { + return false; + } + // 修改的提交 + if (this.dataForm.id) { + this.urlOptions.updateURL(this.dataForm).then(response => { + this.$modal.msgSuccess("修改成功"); + this.visible = false; + this.$emit("refreshDataList"); + }); + return; + } + // 添加的提交 + this.urlOptions.createURL(this.dataForm).then(response => { + this.$modal.msgSuccess("新增成功"); + this.visible = false; + this.$emit("refreshDataList"); + }); + }); + }, + formClear() { + this.$refs.dataForm.resetFields() + } + } +} diff --git a/src/views/quality/monitoring/mixins/basic-page.js b/src/views/quality/monitoring/mixins/basic-page.js new file mode 100644 index 00000000..8723be82 --- /dev/null +++ b/src/views/quality/monitoring/mixins/basic-page.js @@ -0,0 +1,168 @@ +/* + * @Author: zwq + * @Date: 2022-08-24 11:19:43 + * @LastEditors: DY + * @LastEditTime: 2023-09-21 16:02:07 + * @Description: + */ +export default { + data() { + /* eslint-disable */ + return { + urlOptions: { + getDataListURL: '', + deleteURL: '', + statusUrl: '', + exportURL: '' + }, + tableData: [], + listQuery: { + pageSize: 10, + pageNo: 1, + total: 1, + }, + exportLoading: false, + dataListLoading: false, + addOrEditTitle: '', + addOrUpdateVisible: false, + } + }, + created() { + }, + mounted() { + this.getDataList() + }, + methods: { + // 获取数据列表 + getDataList() { + this.dataListLoading = true; + this.urlOptions.getDataListURL(this.listQuery).then(response => { + this.tableData = response.data.list; + this.listQuery.total = response.data.total; + this.dataListLoading = false; + }); + }, + // 每页数 + sizeChangeHandle(val) { + this.listQuery.pageSize = val; + this.listQuery.pageNo = 1; + this.getDataList(); + }, + // 当前页 + currentChangeHandle(val) { + this.listQuery.pageNo = val; + this.getDataList(); + }, + // 新增 / 修改 + addOrUpdateHandle(id) { + this.addOrUpdateVisible = true; + this.$nextTick(() => { + this.$refs.addOrUpdate.init(id); + }); + }, + cancel(id) { + this.$refs["popover-" + id].showPopper = false; + }, + //改变状态 + changeStatus(id) { + this.$http + .post(this.urlOptions.statusUrl, { id }) + .then(({ data: res }) => { + if (res.code !== 0) { + return this.$message.error(res.msg); + } + this.$refs["popover-" + id].showPopper = false; + this.$message({ + message: this.$t("prompt.success"), + type: "success", + duration: 500, + onClose: () => { + this.getDataList(); + }, + }); + }) + .catch(() => { }); + }, + //tableBtn点击 + handleClick(val) { + if (val.type === "edit") { + this.addOrUpdateVisible = true; + this.addOrEditTitle = "编辑"; + this.$nextTick(() => { + this.$refs.addOrUpdate.init(val.data.id); + }); + } else if (val.type === "delete") { + this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex) + } else if (val.type === "change") { + this.changeStatus(val.data.id) + } else { + this.otherMethods(val) + } + }, + // 删除 + deleteHandle(id, name, index) { + this.$confirm(`确定对${name ? '[名称=' + name + ']' : '[序号=' + index + ']'}进行删除操作?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.urlOptions.deleteURL(id).then(({ data }) => { + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.getDataList(); + }, + }); + }); + }) + .catch(() => { }); + }, + //search-bar点击 + buttonClick(val) { + switch (val.btnName) { + case "search": + this.listQuery.xm1 = val.xm1; + this.listQuery.xm2 = val.xm2; + this.listQuery.pageNo = 1; + this.getDataList(); + break; + case "add": + this.addOrEditTitle = '新增' + this.addOrUpdateVisible = true; + this.addOrUpdateHandle() + break; + default: + console.log(val) + } + }, + handleCancel() { + this.$refs.addOrUpdate.formClear() + this.addOrUpdateVisible = false + this.addOrEditTitle = '' + }, + handleConfirm() { + this.$refs.addOrUpdate.dataFormSubmit() + }, + successSubmit() { + this.handleCancel() + this.getDataList() + }, + /** 导出按钮操作 */ + handleExport() { + // 处理查询参数 + let params = { ...this.queryParams }; + params.pageNo = undefined; + params.pageSize = undefined; + this.$modal.confirm('是否确认导出所有数据项?').then(() => { + this.exportLoading = true; + return this.urlOptions.exportURL(params); + }).then(response => { + this.$download.excel(response, '工厂.xls'); + this.exportLoading = false; + }).catch(() => { }); + } + } +} diff --git a/src/views/quality/monitoring/mixins/code-filter.js b/src/views/quality/monitoring/mixins/code-filter.js new file mode 100644 index 00000000..30c5f12e --- /dev/null +++ b/src/views/quality/monitoring/mixins/code-filter.js @@ -0,0 +1,69 @@ + +/* + * @Date: 2020-12-29 16:49:28 + * @LastEditors: DY + * @LastEditTime: 2023-09-12 11:13:34 + * @FilePath: \basic-admin\src\filters\basicData\index.js + * @Description: + */ + +const table = { + lineStatus: { + 1: '生产中', + 2: '停止', + 3: '未知', + }, + reportType: { + 1: '日', + 2: '周', + 3: '月' + } +} + +// 日期格式化 +export function parseTime(time, pattern) { + if (arguments.length === 0 || !time) { + return null + } + const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}' + let date + if (typeof time === 'object') { + date = time + } else { + if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) { + time = parseInt(time) + } else if (typeof time === 'string') { + time = time.replace(new RegExp(/-/gm), '/').replace('T', ' ').replace(new RegExp(/\.\d{3}/gm),''); + } + if ((typeof time === 'number') && (time.toString().length === 10)) { + time = time * 1000 + } + date = new Date(time) + } + const formatObj = { + y: date.getFullYear(), + m: date.getMonth() + 1, + d: date.getDate(), + h: date.getHours(), + i: date.getMinutes(), + s: date.getSeconds(), + a: date.getDay() + } + const time_str = format.replace(/{([ymdhisa])+}/g, (result, key) => { + let value = formatObj[key] + // Note: getDay() returns 0 on Sunday + if (key === 'a') { + return ['日', '一', '二', '三', '四', '五', '六'][value] + } + if (result.length > 0 && value < 10) { + value = '0' + value + } + return value || 0 + }) + return time_str +} +export default function (dictTable) { + return function (val) { + return table?.[dictTable]?.[val] + } +} diff --git a/src/views/quality/monitoring/processTraceability/index.vue b/src/views/quality/monitoring/processTraceability/index.vue new file mode 100644 index 00000000..23bcc1e9 --- /dev/null +++ b/src/views/quality/monitoring/processTraceability/index.vue @@ -0,0 +1,267 @@ + + + + diff --git a/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessBomList.vue b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessBomList.vue new file mode 100644 index 00000000..133c1816 --- /dev/null +++ b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessBomList.vue @@ -0,0 +1,180 @@ + + + + + + + diff --git a/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessDetail.vue b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessDetail.vue new file mode 100644 index 00000000..00ef7f0c --- /dev/null +++ b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessDetail.vue @@ -0,0 +1,486 @@ + + + + + + + + + diff --git a/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessInfo.vue b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessInfo.vue new file mode 100644 index 00000000..e2c7240c --- /dev/null +++ b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessInfo.vue @@ -0,0 +1,126 @@ + + + + + + + diff --git a/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessNode.js b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessNode.js new file mode 100644 index 00000000..948aaf24 --- /dev/null +++ b/src/views/quality/monitoring/processTraceabilityDetail/components/ProcessNode.js @@ -0,0 +1,170 @@ +import { Node, ObjectExt, Shape } from '@antv/x6'; +import { IdToName } from '@/utils' +import cache from '@/utils/cache' +import axios from '@/utils/request' +import { v4 } from 'uuid' + +Shape.Edge.config({ + attrs: { + line: { + stroke: '#ccc', + strokeWidth: 1, + targetMarker: { + name: 'block', + width: 1, + height: 1 + }, + }, + } +}) + + +export default class ProcessNode extends Node { } +ProcessNode.config({ + width: 200, + height: 100, + markup: [ + { + tagName: 'rect', + selector: 'container', + attrs: { + x: 0, + y: 0, + width: 200, + height: 100, + fill: 'transparent', + stroke: '#ccc' + }, + }, + { + tagName: 'rect', + attrs: { + x: 0, + y: 0, + width: 200, + height: 50, + fill: '#ffffff', + }, + }, + { + tagName: 'rect', + attrs: { + x: 0, + y: 50, + width: 200, + height: 50, + fill: '#f8f8f8', + }, + }, + { + tagName: 'text', + selector: 'detName', + attrs: { + x: 20, + y: 30, + }, + }, + { + tagName: 'text', + selector: 'sectionName', + attrs: { + x: 115, + y: 30, + }, + }, + { + tagName: 'text', + selector: 'detDesc', + attrs: { + x: 26, + y: 80, + fill: '#777', + fontSize: 14, + fill: '#1a90fc', + }, + }, + ], + attrs: { + line: { + fill: 'red' + } + }, + ports: { + groups: { + in: { + position: 'left', + attrs: { + circle: { + r: 2, + magnet: true, + stroke: '#0b58ff', + strokeWidth: 1, + fill: '#0b58ff' + } + } + }, + out: { + position: 'right', + attrs: { + circle: { + r: 2, + magnet: true, + stroke: '#0b58ff', + strokeWidth: 1, + fill: '#0b58ff' + } + } + } + } + }, + propHooks(metadata) { + const { detId, detName, detDesc, sectionName, processId, sectionId, ...others } = metadata; + // debugger; + if (detName) ObjectExt.setByPath(others, 'attrs/detName/text', detName); + if (detDesc) ObjectExt.setByPath(others, 'attrs/detDesc/text', detDesc); + if (sectionName) ObjectExt.setByPath(others, 'attrs/sectionName/text', sectionName); + if (detId) ObjectExt.setByPath(others, 'attrs/detId/text', detId); + if (processId) ObjectExt.setByPath(others, 'attrs/processId/text', processId); + if (sectionId) ObjectExt.setByPath(others, 'attrs/sectionId/text', sectionId); + return others; + } +}); + +export const CACHE_NAME = 'ProcessDetail::section'; + +export async function getSectionFrom(sectionId) { + const sectionList = await cache.getList( + CACHE_NAME, + async () => { + const { code, data } = await axios( + '/base/core-production-line/listAll' + ); + if (code == 0) { + return data; + } + } + ); + return IdToName(sectionId, sectionList); +} + +export async function createProcessNode({ flowId, id, name, sectionId, remark }) { + const sectionName = await getSectionFrom(sectionId); + return { + shape: 'process-node', + x: 0, + y: 0, + detName: name, // 工序名称 + sectionName, // 工段 + sectionId, + detDesc: remark, // 工序说明 + processId: flowId, // 工艺ID + detId: id, // 工序ID + tools: [], + ports: [ + { id: v4(), group: 'in' }, + { id: v4(), group: 'out' }, + ] + }; +} + +export async function createEdge(src, dest) { } \ No newline at end of file diff --git a/src/views/quality/monitoring/processTraceabilityDetail/index.vue b/src/views/quality/monitoring/processTraceabilityDetail/index.vue new file mode 100644 index 00000000..34fb96a4 --- /dev/null +++ b/src/views/quality/monitoring/processTraceabilityDetail/index.vue @@ -0,0 +1,63 @@ + + + + + + + diff --git a/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue b/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue index 1d660f8a..9ef8b17c 100644 --- a/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue +++ b/src/views/quality/monitoring/qualityInspectionRecord/dialogForm.vue @@ -1,4 +1,4 @@ -