diff --git a/src/api/equipment/base/maintain/record.js b/src/api/equipment/base/maintain/record.js index 89f74906..8ca6f36f 100644 --- a/src/api/equipment/base/maintain/record.js +++ b/src/api/equipment/base/maintain/record.js @@ -1,7 +1,7 @@ /* * @Author: Do not edit * @Date: 2023-11-08 15:56:52 - * @LastEditTime: 2023-11-21 10:50:55 + * @LastEditTime: 2023-11-23 19:10:07 * @LastEditors: DY * @Description: */ @@ -32,3 +32,13 @@ export function exportMaintainMonitorExcel(query) { responseType: 'blob' }) } + +// 导出设备保养记录 +export function exportMaintainLogExcel(query) { + return request({ + url: '/base/equipment-maintain-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/api/equipment/base/repair.js b/src/api/equipment/base/repair.js index c8b115e2..79fb191b 100644 --- a/src/api/equipment/base/repair.js +++ b/src/api/equipment/base/repair.js @@ -1,7 +1,7 @@ /* * @Author: Do not edit * @Date: 2023-11-10 16:09:33 - * @LastEditTime: 2023-11-16 18:57:08 + * @LastEditTime: 2023-11-23 20:29:28 * @LastEditors: DY * @Description: */ @@ -31,3 +31,13 @@ export function deleteRepair(id) { method: 'delete' }) } + +// 导出设备维修 +export function exportRepairLogExcel(query) { + return request({ + url: '/base/equipment-repair-log/export-excel', + method: 'get', + params: query, + responseType: 'blob' + }) +} diff --git a/src/views/base/coreEquipment/index.vue b/src/views/base/coreEquipment/index.vue index 4e0ad8cf..0bd17c95 100644 --- a/src/views/base/coreEquipment/index.vue +++ b/src/views/base/coreEquipment/index.vue @@ -288,10 +288,10 @@ export default { [ { input: true, - label: '产品加工时间(s)', + label: '单件产品加工时间(s)', prop: 'processingTime', rules: [ - { required: true, message: '产品加工时间不能为空', trigger: 'blur' }, + { required: true, message: '单件产品加工时间不能为空', trigger: 'blur' }, { type: 'number', message: '请输入正确的数字值', @@ -319,9 +319,16 @@ export default { prop: 'description', }, ], + [ + { + upload: true, + label: '上传资料', + prop: 'files', + }, + ], [ { input: true, label: '备注', prop: 'remark' } - ] + ], // [ // { // assetUpload: true, diff --git a/src/views/base/coreEquipmentLineBind/index.vue b/src/views/base/coreEquipmentLineBind/index.vue index 1e08ce2d..c0874798 100644 --- a/src/views/base/coreEquipmentLineBind/index.vue +++ b/src/views/base/coreEquipmentLineBind/index.vue @@ -189,6 +189,10 @@ export default { ], label: '产线统计类型', prop: 'lineDataType', + bind: { + clearable: true, filterable: true + }, + rules: [{ required: true, message: '产线统计类型不能为空', trigger: 'change' }], }, { select: true, @@ -199,6 +203,10 @@ export default { ], label: '工段统计类型', prop: 'sectionDataType', + bind: { + clearable: true, filterable: true + }, + rules: [{ required: true, message: '工段统计类型不能为空', trigger: 'change' }], }, ], ], diff --git a/src/views/base/coreWorkOrder/detail.vue b/src/views/base/coreWorkOrder/detail.vue index 10b7a75f..d3859ebf 100644 --- a/src/views/base/coreWorkOrder/detail.vue +++ b/src/views/base/coreWorkOrder/detail.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-22 09:47:53 + * @LastEditTime: 2023-11-23 18:45:15 * @Description: --> @@ -49,7 +49,9 @@ 负责人:{{ dataForm.workers }} - 关联产线:{{ dataForm.productLineNames }} + 关联产线: + {{ item }} + 物料计算方式:{{ dataForm.materialMethod === 1 ? '产品基础' : dataForm.materialMethod === 2 ? '工艺扩展' : '' }} diff --git a/src/views/base/material/index.vue b/src/views/base/material/index.vue index ad584127..3ed043ea 100644 --- a/src/views/base/material/index.vue +++ b/src/views/base/material/index.vue @@ -39,6 +39,7 @@ import { deleteMaterial } from '@/api/base/material'; import { listData } from "@/api/system/dict/data"; +import { publicFormatter } from '@/utils/dict'; const tableProps = [ { @@ -59,8 +60,9 @@ const tableProps = [ label: '英文名称' }, { - prop: 'materialType', - label: '物料类型' + prop: 'type', + label: '物料类型', + filter: publicFormatter('material_type') }, { prop: 'supplierName', diff --git a/src/views/base/materialProductBom/add-or-updata.vue b/src/views/base/materialProductBom/add-or-updata.vue index ec766d8d..727cf356 100644 --- a/src/views/base/materialProductBom/add-or-updata.vue +++ b/src/views/base/materialProductBom/add-or-updata.vue @@ -2,7 +2,7 @@ * @Author: zwq * @Date: 2021-11-18 14:16:25 * @LastEditors: DY - * @LastEditTime: 2023-11-22 11:09:44 + * @LastEditTime: 2023-11-23 15:00:00 * @Description: --> @@ -311,6 +311,9 @@ export default { row.mUnit = u.label } }) + } else { + row.unit = null + row.mUnit = '' } // row.materialCode = tempList[0].code // row.unit = tempList[0].unit diff --git a/src/views/base/materialUseLog/index.vue b/src/views/base/materialUseLog/index.vue index 7ad48efa..9f46be93 100644 --- a/src/views/base/materialUseLog/index.vue +++ b/src/views/base/materialUseLog/index.vue @@ -215,12 +215,33 @@ export default { this.$refs.addOrUpdate.init(val.data.id); }); } else if (val.type === "delete") { - this.deleteHandle(val.data.id, val.data.materialName, val.data._pageIndex) + this.deleteHandle(val.data.id, val.data.materialName) } else if (val.type === "change") { this.changeStatus(val.data.id) } else { this.otherMethods(val) } + }, + // 删除 + deleteHandle(id, name) { + this.$confirm(`是否确认删除物料名称为${name}的数据项?`, "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.urlOptions.deleteURL(id).then(({ data }) => { + this.$message({ + message: "操作成功", + type: "success", + duration: 1500, + onClose: () => { + this.getDataList(); + }, + }); + }); + }) + .catch(() => { }); } }, }; diff --git a/src/views/equipment/base/maintain/Monitor/index.vue b/src/views/equipment/base/maintain/Monitor/index.vue index 01c4a091..e5b5038c 100644 --- a/src/views/equipment/base/maintain/Monitor/index.vue +++ b/src/views/equipment/base/maintain/Monitor/index.vue @@ -52,6 +52,7 @@ import { publicFormatter } from '@/utils/dict'; import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; import { exportMaintainMonitorExcel } from '@/api/equipment/base/maintain/record' +import { parseTime } from '@/utils/ruoyi' const remainBox = { name: 'RemainBox', @@ -99,7 +100,7 @@ const btn = { render: function (h) { return ( - {this.injectData.label} + {this.injectData.name} ); }, @@ -113,16 +114,16 @@ export default { return { searchBarKeys: ['planId', 'equipmentId'], tableProps: [ - { - prop: 'createTime', - label: '添加时间', - fixed: true, - width: 180, - filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), - }, + // { + // prop: 'createTime', + // label: '添加时间', + // fixed: true, + // width: 180, + // filter: parseTime(createTime), + // }, { prop: 'name', label: '保养计划' }, - { prop: 'lineName', label: '产线' }, - { prop: 'sectionName', label: '工段' }, + { prop: 'lineName', label: '产线名' }, + { prop: 'sectionName', label: '工段名' }, { prop: 'equipmentName', label: '设备名称' }, { prop: 'equipmentCode', label: '设备编码' }, { prop: 'maintenancePeriod', label: '保养频率' }, @@ -134,16 +135,16 @@ export default { { prop: 'lastMaintainTime', label: '上次保养时间', - filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'), + filter: parseTime, }, - { prop: 'nextMaintainTime', label: '计划下次保养时间' }, + { prop: 'nextMaintainTime', label: '计划下次保养时间', filter: parseTime }, { prop: 'remainDays', label: '距离保养时间(天)', subcomponent: remainBox, }, - { prop: 'opt1', label: '设备保养', subcomponent: btn }, - { prop: 'opt2', label: '保养记录', subcomponent: btn }, + { prop: 'opt1', label: '设备保养', name: '操作', subcomponent: btn }, + { prop: 'opt2', label: '保养记录', name: '查看详情', subcomponent: btn }, ], searchBarFormConfig: [ { @@ -243,15 +244,16 @@ export default { switch (action) { // 查看详情 case '设备保养': - this.$router.push({ path: '/equipment/base/maintain/plan-config',query: { - equipmentId: value.equipmentId, - equipmentName: value.equipmentName + this.$router.push({ path: '/equipment/base/maintain/record',query: { + addRecord: 1, + row: value } }) break; case '保养记录': const queryData = { equipmentId: value.equipmentId, - maintainPlanId: value.id + maintainPlanId: value.id, + relatePlan: value.lastMaintainTime ? 1 : 2 } this.$router.push({ path: '/equipment/base/maintain/record',query: queryData }) break; diff --git a/src/views/equipment/base/maintain/PlanConfig/index.vue b/src/views/equipment/base/maintain/PlanConfig/index.vue index cd319d53..76f399a7 100644 --- a/src/views/equipment/base/maintain/PlanConfig/index.vue +++ b/src/views/equipment/base/maintain/PlanConfig/index.vue @@ -51,6 +51,7 @@ import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; import { deleteEqMaintainPlan } from '@/api/equipment/base/maintain/record' +import { publicFormatter } from '@/utils/dict'; export default { name: 'PlanConfig', @@ -95,7 +96,7 @@ export default { { prop: 'equipmentName', label: '设备名称' }, { prop: 'maintainDuration', label: '计划保养用时(h)' }, { prop: 'maintenancePeriod', label: '保养频率(天/次)' }, - { prop: 'maintainType', label: '保养类型' }, + { prop: 'maintainType', label: '保养类型', filter: publicFormatter('maintain_type') }, { prop: 'remark', label: '备注' }, ], searchBarFormConfig: [ @@ -224,6 +225,17 @@ export default { rules: [{ required: true, message: '保养频率不能为空', trigger: 'blur' }], }, ], + [ + { + switch: true, + label: '启用状态', + prop: 'enabled', + bind: { + 'active-value': 1, + 'inactive-value': 0, + }, + } + ], [{ input: true, label: '备注', prop: 'remark' }], ], // 是否显示弹出层 @@ -300,7 +312,8 @@ export default { const queryData = { equipmentId: row.equipmentId, maintainPlanId: row.id, - relatePlan: row.enabled + isAdd: 1 + // relatePlan: row.enabled } if (this.queryParams.createTime) { queryData.createTime = this.queryParams.createTime diff --git a/src/views/equipment/base/maintain/Record/index.vue b/src/views/equipment/base/maintain/Record/index.vue index 09e84ef4..104bb241 100644 --- a/src/views/equipment/base/maintain/Record/index.vue +++ b/src/views/equipment/base/maintain/Record/index.vue @@ -53,7 +53,7 @@ import moment from 'moment'; import basicPageMixin from '@/mixins/lb/basicPageMixin'; import Editor from '@/components/Editor'; -import { deleteEqMaintainLog } from '@/api/equipment/base/maintain/record'; +import { deleteEqMaintainLog, exportMaintainLogExcel } from '@/api/equipment/base/maintain/record'; const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); @@ -311,13 +311,16 @@ export default { this.searchBarFormConfig[0].defaultSelect = this.$route.query.equipmentId ?? undefined; this.searchBarFormConfig[1].defaultSelect = - Number(this.$route.query.maintainPlanId) ?? undefined; + this.$route.query.maintainPlanId ?? undefined; this.searchBarFormConfig[2].defaultSelect = this.$route.query?.createTime ?? undefined; this.searchBarFormConfig[3].defaultSelect = Number(this.$route.query.relatePlan) ?? undefined; } this.getList(); + if (this.$route.query.addRecord) { + this.handleAdd() + } }, methods: { initSearchBar() { @@ -398,6 +401,19 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + if (this.$route.query.addRecord) { + // 赋值 + const tempRow = this.$route.query.row + this.form.equipmentId = tempRow.equipmentId + this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2 + this.form.startTime = tempRow.nextMaintainTime + this.form.maintainPlanId = tempRow.id + } + if (this.$route.query.isAdd) { + // 赋值 + this.form.equipmentId = this.$route.query.equipmentId + this.form.maintainPlanId = this.$route.query.maintainPlanId + } this.open = true; this.title = '添加保养记录'; }, @@ -440,7 +456,7 @@ export default { handleDelete(row) { const id = row.id; this.$modal - .confirm('是否删除设备名称为"' + row.equipmentName + '"的数据项?') + .confirm('是否确认删除设备名称为"' + row.equipmentName + '"的数据项?') .then(function () { return deleteEqMaintainLog(id); }) @@ -456,7 +472,7 @@ export default { this.info({ id }).then((response) => { this.form = response.data; this.open = true; - this.title = '修改保养记录'; + this.title = '查看保养记录详情'; }); }, /** 导出按钮操作 */ @@ -469,10 +485,10 @@ export default { .confirm('是否确认导出所有保养记录?') .then(() => { this.exportLoading = true; - return exportEquipmentTypeExcel(params); + return exportMaintainLogExcel(params); }) .then((response) => { - this.$download.excel(response, '保养记录.xls'); + this.$download.excel(response, '设备保养记录.xls'); this.exportLoading = false; }) .catch(() => {}); diff --git a/src/views/equipment/base/repair/CustomDialogForm.vue b/src/views/equipment/base/repair/CustomDialogForm.vue index 1b2dd8a8..8e09da62 100644 --- a/src/views/equipment/base/repair/CustomDialogForm.vue +++ b/src/views/equipment/base/repair/CustomDialogForm.vue @@ -41,12 +41,12 @@ - {{ dataForm.faultTime }} + {{ parseTime(dataForm.faultTime) }} - {{ dataForm.faultLevel }} + {{ getDictDataLabel('fault-level', dataForm.faultLevel) }} @@ -164,11 +164,11 @@ @@ -179,6 +179,8 @@ import { getEqRepair, updateEqRepair } from '@/api/equipment/base/repair' import Editor from "@/components/Editor"; import FileUpload from "@/components/FileUpload"; import { getDictDatas } from "@/utils/dict"; +import { parseTime } from '@/utils/ruoyi' +import { getDictDataLabel } from '@/utils/dict'; export default { name: 'DialogForm', diff --git a/src/views/equipment/base/repair/index.vue b/src/views/equipment/base/repair/index.vue index ce352ed6..dc94ed7c 100644 --- a/src/views/equipment/base/repair/index.vue +++ b/src/views/equipment/base/repair/index.vue @@ -53,12 +53,12 @@ diff --git a/src/views/equipment/base/spareParts/Config/index.vue b/src/views/equipment/base/spareParts/Config/index.vue index 71b323b2..d76d9616 100644 --- a/src/views/equipment/base/spareParts/Config/index.vue +++ b/src/views/equipment/base/spareParts/Config/index.vue @@ -60,8 +60,9 @@ import { publicFormatter } from '@/utils/dict'; import Editor from '@/components/Editor'; import addSparts from './addSparts.vue'; import { deleteConfig } from '@/api/equipment/base/spare-parts/config' +import htmls from './htmls.vue' -const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); +// const timeFilter = (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'); export default { name: 'EquipmentSparePartsConfig', @@ -111,7 +112,7 @@ export default { { prop: 'equipmentCode', label: '设备编码' }, { prop: 'responsible', label: '负责人' }, // { prop: 'unit', label: '单位', filter: publicFormatter('unit_dict') }, - { prop: 'description', label: '描述' }, + { prop: 'description', label: '描述', subcomponent: htmls }, { prop: 'sparePartNumber', label: '备品备件数量' }, // { prop: 'remark', label: '备注' }, ],