diff --git a/src/components/DialogForm/index.vue b/src/components/DialogForm/index.vue index 3248ce17..ac7e32ac 100644 --- a/src/components/DialogForm/index.vue +++ b/src/components/DialogForm/index.vue @@ -101,7 +101,9 @@ } " v-bind="col.bind"> - + @@ -410,8 +412,26 @@ export default { } if (!promiseList.length) this.formLoading = false; }, + // 上传成功的特殊处理 - beforeUpload() {}, + beforeUpload(file) { + const checkFileSize = () => { + const isLt2M = file.size / 1024 / 1024 < 2; + if (!isLt2M) { + this.$modal.msgError('上传文件大小不能超过 2MB!'); + } + return isLt2M; + }; + const checkFileType = () => { + const isJPG = + file.type === 'image/jpeg' || + file.type === 'image/png' || + file.type === 'image/jpg'; + return isJPG; + }; + return checkFileSize() && checkFileType(); + }, + // 上传前的验证规则可通过 bind 属性传入 handleUploadSuccess(response, file, prop) { console.log('[handleUploadSuccess]', response, file, prop); diff --git a/src/views/specialEquipment/basic/FireFighthing.vue b/src/views/specialEquipment/basic/FireFighthing.vue index 341d4883..9f925444 100644 --- a/src/views/specialEquipment/basic/FireFighthing.vue +++ b/src/views/specialEquipment/basic/FireFighthing.vue @@ -170,19 +170,19 @@ export default { { width: 256, prop: 'code', label: '设备编码' }, { prop: 'location', label: '位置' }, { prop: 'responsiblePeopleName', label: '负责人' }, - { prop: 'dueDate', label: '有效期至' }, + { prop: 'dueTime', label: '有效期至' }, { prop: 'remark', label: '备注' }, ], searchBarFormConfig: [ { type: 'input', - label: '名称', + label: '设备名称', placeholder: '请输入设备名称', param: 'name', }, { type: 'input', - label: '编码', + label: '设备编码', placeholder: '请输入设备编码', param: 'code', }, @@ -251,7 +251,7 @@ export default { { datetime: true, label: '有效期至', - prop: 'dueDate', + prop: 'dueTime', bind: { clearable: true }, }, {}, diff --git a/src/views/specialEquipment/basic/Safety.vue b/src/views/specialEquipment/basic/Safety.vue index 25cd5a61..b91767fb 100644 --- a/src/views/specialEquipment/basic/Safety.vue +++ b/src/views/specialEquipment/basic/Safety.vue @@ -175,13 +175,13 @@ export default { searchBarFormConfig: [ { type: 'input', - label: '名称', + label: '设备名称', placeholder: '请输入设备名称', param: 'name', }, { type: 'input', - label: '编码', + label: '设备编码', placeholder: '请输入设备编码', param: 'code', }, diff --git a/src/views/specialEquipment/check/Record-add.vue b/src/views/specialEquipment/check/Record-add.vue index c5935113..79e9c659 100644 --- a/src/views/specialEquipment/check/Record-add.vue +++ b/src/views/specialEquipment/check/Record-add.vue @@ -54,6 +54,7 @@ diff --git a/src/views/specialEquipment/maintain/PlanConfig.vue b/src/views/specialEquipment/maintain/PlanConfig.vue index 217e61fe..c4559687 100644 --- a/src/views/specialEquipment/maintain/PlanConfig.vue +++ b/src/views/specialEquipment/maintain/PlanConfig.vue @@ -353,7 +353,7 @@ export default { queryData.createTime = this.queryParams.createTime; } this.$router.push({ - path: '/equipment/base/maintain/record', + path: '/safety-environmental/special-equipment/equipment-maintain/maintain-record', query: queryData, }); // this.$router.push({ path: '/equipment/base/maintain/record', query: { orderNo: row.orderNo }}) diff --git a/src/views/specialEquipment/maintain/Record.vue b/src/views/specialEquipment/maintain/Record.vue index 3d18b73e..bf33d9a0 100644 --- a/src/views/specialEquipment/maintain/Record.vue +++ b/src/views/specialEquipment/maintain/Record.vue @@ -556,6 +556,19 @@ export default { this.form.relatePlan = tempRow.nextMaintainTime ? 1 : 2; this.form.startTime = tempRow.nextMaintainTime; this.form.maintainPlanId = tempRow.id; + // await (() => { + // return new Promise((acpt, rejt) => { + // this.form.relatePlan = + // this.$route.query.relatePlan || + // (tempRow.nextMaintainTime ? 1 : 2); + // this.form.startTime = tempRow.nextMaintainTime; + // acpt(); + // }); + // })(); + // this.$nextTick(() => { + // this.form.maintainPlanId = tempRow.id; + // this.form.equipmentId = tempRow.equipmentId; + // }); } if (this.$route.query.isAdd) { // 赋值