From 232febf29b40995d7cdef2a6e5a7a4c1e8668008 Mon Sep 17 00:00:00 2001
From: zhangherong <571457620@qq.com>
Date: 星期一, 03 三月 2025 14:51:42 +0800
Subject: [PATCH] art: 【设备台账-新增】页面,点击“设备所属分类”下拉选项,已经删除的“设备分类”仍显示,有误!
---
src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue | 227 +++++++++++++++++++++++++++-----------------------------
1 files changed, 108 insertions(+), 119 deletions(-)
diff --git a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
index 07c1959..6750518 100644
--- a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
+++ b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue
@@ -35,12 +35,12 @@
>
<!-- <a-input-search
:disabled="disableSubmit"
- placeholder="璇烽�夋嫨瀵硅薄閮ㄩ棬"
+ placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬"
enter-button
@search="onDepartList()"
:read-only="true"
v-decorator="['useDepartName', validatorRules.useDepartName]"
- /> -->
+ />
<a-tree-select
style="width: 100%"
:dropdown-style="{ maxHeight: '400px', overflow: 'auto' }"
@@ -48,6 +48,15 @@
placeholder="璇烽�夋嫨閮ㄩ棬"
tree-default-expand-all
v-decorator="['departId', validatorRules.useId ]"
+ />-->
+
+ <j-dict-select-tag
+ allow-clear
+ :disabled="disableSubmit"
+ :placeholder="disableSubmit?'':'璇烽�夋嫨浣跨敤閮ㄩ棬'"
+ :triggerChange="true"
+ dictCode="sys_depart,depart_name,id,del_flag!='1'"
+ v-decorator="['departId', {}]"
/>
</a-form-item>
</a-col>
@@ -114,21 +123,21 @@
<a-input
allow-clear
:disabled="true"
- :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囩紪鐮�/鍚嶇О/鍨嬪彿'"
+ :placeholder="disableSubmit?'':'璇疯緭鍏ョ粺涓�缂栫爜/鍚嶇О/鍨嬪彿'"
v-decorator="['equipmentId', validatorRules.equipmentId ]"
/>
</a-form-item>
</a-col>
<!-- <a-col :span="12">
<a-form-item
- label="瀵硅薄閮ㄩ棬Id"
+ label="浣跨敤閮ㄩ棬Id"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<a-input
allow-clear
:disabled="true"
- :placeholder="disableSubmit?'':'璇疯緭鍏ュ璞¢儴闂╥d'"
+ :placeholder="disableSubmit?'':'璇疯緭鍏ヤ娇鐢ㄩ儴闂╥d'"
v-decorator="['departId', validatorRules.useId ]"
/>
</a-form-item>
@@ -149,7 +158,23 @@
</a-col>
</a-row>
<a-row :gutter="24">
- <a-col :span="12">
+ <!-- <a-col :span="12">
+ <a-form-item
+ label="淇濆吇绫诲瀷"
+ :labelCol="labelCol"
+ :wrapperCol="wrapperCol"
+ >
+ <j-dict-select-tag
+ allow-clear
+ :disabled="disableSubmit"
+ :placeholder="disableSubmit?'':'璇烽�夋嫨淇濆吇绫诲瀷'"
+ :triggerChange="true"
+ dictCode="maintenance_type"
+ v-decorator="['maintenanceType', validatorRules.maintenanceType]"
+ />
+ </a-form-item>
+ </a-col> -->
+ <!-- <a-col :span="12">
<a-form-item
label="娲惧伐鏂瑰紡"
:labelCol="labelCol"
@@ -164,7 +189,7 @@
v-decorator="['assignMode', validatorRules.assignMode]"
/>
</a-form-item>
- </a-col>
+ </a-col> -->
<a-col :span="12">
<a-form-item
label="鐗堟湰"
@@ -179,8 +204,6 @@
/>
</a-form-item>
</a-col>
- </a-row>
- <a-row :gutter="24">
<a-col
v-if="this.isRevise == true"
:span="12"
@@ -218,14 +241,14 @@
<!-- <a-row :gutter="24">
<a-col :span="12">
<a-form-item
- label="瀵硅薄閮ㄩ棬"
+ label="浣跨敤閮ㄩ棬"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
>
<j-dict-select-tag
allow-clear
:disabled="disableSubmit"
- :placeholder="disableSubmit?'':'璇峰璞¢儴闂�'"
+ :placeholder="disableSubmit?'':'璇蜂娇鐢ㄩ儴闂�'"
:triggerChange="true"
dictCode="sys_depart,depart_name,id,version = '7' and del_flag!='1'"
v-decorator="['departId', validatorRules.departId]"
@@ -263,6 +286,7 @@
rowKey='id'
:columns="columns"
:dataSource="dataSource"
+ :pagination="false"
>
<template
v-for="col in columns"
@@ -271,15 +295,15 @@
>
<div :key="col.dataIndex">
- <a-select
+ <!-- <a-select
v-if="col.dataIndex == 'maintenanceCycleId'"
:value="text"
:options="record.maintenanceCycles"
@change="(e) => handleChange(e, record.key, col, index)"
style="width: 100%"
:disabled="false"
- />
- <a-textarea
+ /> -->
+ <!--<a-textarea
:value="text"
v-if="col.dataIndex == 'maintenanceRequire'"
:maxLength="500"
@@ -287,7 +311,7 @@
placeholder="璇疯緭鍏ュ畨鍏ㄨ姹�"
@change="(e)=>handleChange(e, record.key, col, index)"
/>
- <a-textarea
+ <a-textarea
:value="text"
v-if="col.dataIndex == 'location'"
:maxLength="500"
@@ -295,7 +319,7 @@
placeholder="璇疯緭鍏ヤ繚鍏讳綅缃�"
@change="(e)=>handleChange(e, record.key, col, index)"
:disabled="true"
- />
+ />
<j-image-upload
:value="text"
v-if="col.dataIndex == 'photo'"
@@ -304,7 +328,7 @@
placeholder="璇蜂笂浼犲浘鐗�"
@change="(e)=>handleChange(e, record.key, col, index)"
>
- </j-image-upload>
+ </j-image-upload>-->
<j-dict-select-tag
v-if="col.dataIndex == 'maintenanceRole'"
:value="text"
@@ -312,8 +336,8 @@
:triggerChange="true"
dictCode="maintenance_role"
placeholder="璇烽�夋嫨淇濆吇瑙掕壊"
- style="width: 100%"
@change="(e)=>handleChange(e, record.key, col, index)"
+ style="width: 100%"
/>
</div>
</template>
@@ -329,43 +353,6 @@
<a>鍒犻櫎</a>
</a-popconfirm>
</span>
-
- <!-- <span
- slot="photo"
- slot-scope="text,record"
- >
- <Tooltip
- placement="top"
- title="棰勮鍥剧墖"
- >
- <img
- v-if=" record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif')"
- width="30"
- height="14"
- border="1"
- draggable="false"
- preview="1"
- :preview-text="''"
- :src="record.upload.src"
- />
- </Tooltip>
- <a
- v-if="record.upload.path && record.upload.format.toLowerCase()=='pdf'"
- href="javascript:;"
- @click="view(record.upload)"
- >
- 棰勮
- </a>
-
- <a-divider
- v-if="record.upload.path && (record.upload.format.toLowerCase()=='jpg'||record.upload.format.toLowerCase()=='bmp'||record.upload.format.toLowerCase()=='png'||record.upload.format.toLowerCase()=='jpeg'||record.upload.format.toLowerCase()=='gif'||record.upload.format.toLowerCase()=='pdf')"
- type="vertical"
- />
- <a
- href="javascript:;"
- @click="handleUpload(record)"
- >涓婁紶</a>
- </span> -->
</a-table>
<template slot="footer">
<a-button
@@ -450,17 +437,30 @@
// align: 'center',
// dataIndex: 'id'
// },
+ // {
+ // title: '淇濆吇閮ㄤ綅',
+ // align: 'center',
+ // dataIndex: 'location',
+ // // scopedSlots: { customRender: 'location' },
+ // // width: 150,
+ // },
{
- title: '淇濆吇椤圭洰',
+ title: '淇濆吇瑙掕壊',
+ align: 'center',
+ dataIndex: 'maintenanceRole',
+ scopedSlots: { customRender: 'maintenanceRole' },
+ },
+ {
+ title: '淇濆吇鍐呭',
align: 'center',
dataIndex: 'name'
},
- {
- title: '淇濆吇鏍囧噯',
- align: 'center',
- dataIndex: 'standard'
- },
+ // {
+ // title: '楠屾敹鏍囧噯',
+ // align: 'center',
+ // dataIndex: 'standard'
+ // },
// {
// title: '鏂规硶',
// align: 'center',
@@ -476,46 +476,34 @@
// align: 'center',
// dataIndex: 'maintenanceSpecialtyName'
// },
- {
- title: '瀹夊叏瑕佹眰',
- align: 'center',
- dataIndex: 'maintenanceRequire',
- scopedSlots: { customRender: 'maintenanceRequire' },
- width: 150,
- },
- {
- title: '宸ユ椂瀹氶',
- align: 'center',
- dataIndex: 'workingHourQuota'
- },
- {
- title: '绀烘剰鍥�',
- align: 'center',
- dataIndex: 'photo',
- scopedSlots: { customRender: 'photo' },
- width: 150,
- },
- {
- title: '淇濆吇閮ㄤ綅',
- align: 'center',
- dataIndex: 'location',
- scopedSlots: { customRender: 'location' },
- width: 150,
- },
- {
- title: '鍛ㄦ湡',
- align: 'center',
- dataIndex: 'maintenanceCycleId',
- scopedSlots: { customRender: 'maintenanceCycleId' },
- width: 150,
- },
- {
- title: '淇濆吇瑙掕壊',
- align: 'center',
- dataIndex: 'maintenanceRole',
- scopedSlots: { customRender: 'maintenanceRole' },
- width: 150,
- },
+ // {
+ // title: '瀹夊叏瑕佹眰',
+ // align: 'center',
+ // dataIndex: 'maintenanceRequire',
+ // scopedSlots: { customRender: 'maintenanceRequire' },
+ // width: 150,
+ // },
+ // {
+ // title: '宸ユ椂瀹氶',
+ // align: 'center',
+ // dataIndex: 'workingHourQuota'
+ // },
+ // {
+ // title: '绀烘剰鍥�',
+ // align: 'center',
+ // dataIndex: 'photo',
+ // scopedSlots: { customRender: 'photo' },
+ // width: 150,
+ // },
+
+ // {
+ // title: '鍛ㄦ湡',
+ // align: 'center',
+ // dataIndex: 'maintenanceCycleId',
+ // scopedSlots: { customRender: 'maintenanceCycleId' },
+ // width: 150,
+ // },
+
{
title: '鎿嶄綔',
align: 'center',
@@ -558,7 +546,7 @@
},
useDepartName: {
rules: [
- { required: true, message: '璇烽�夋嫨瀵硅薄閮ㄩ棬!' },
+ { required: true, message: '璇烽�夋嫨浣跨敤閮ㄩ棬!' },
]
},
equipmentName: {
@@ -566,9 +554,9 @@
{ required: true, message: '璇烽�夋嫨璁惧!' },
]
},
- assignMode: {
+ maintenanceType: {
rules: [
- { required: true, message: '璇烽�夋嫨娲惧伐鏂瑰紡!' },
+ { required: true, message: '璇烽�夋嫨淇濆吇绫诲瀷!' },
]
},
version: {
@@ -586,7 +574,7 @@
list: "/eam/maintenanceStandardDetail/getMaintenanceStandardDetailListByIds",
add: "/eam/maintenanceStandard/add",
edit: "/eam/maintenanceStandard/edit",
- addDetail: "/eam/maintenanceStandardDetail/add",
+ // addDetail: "/eam/maintenanceStandardDetail/add",
getMaintenanceCycle: "/eam/maintenanceStandardDetail/getPeriodicMaintenanceCycle",
realDelete: "/eam/maintenanceStandardDetail/realDelete",
revise: '/eam/maintenanceStandard/revise',
@@ -606,7 +594,7 @@
for (let i = 0; i < data.length; i++) {
let id = this.getUuiD(15);
this.dataSource.push({
- id: id,
+ id: data[i].id,
maintenanceProjectId: data[i].id,
name: data[i].name,
standard: data[i].standard,
@@ -617,7 +605,7 @@
maintenanceRequire: data[i].maintenanceRequire,
workingHourQuota: data[i].workingHourQuota,
// upload: this.upload,
- maintenanceCycles: this.maintenanceCycles,
+ // maintenanceCycles: this.maintenanceCycles,
})
// let formData = {};
@@ -666,7 +654,7 @@
edit(record) {
let that = this;
- this.initOptions();
+ // this.initOptions();
// this.getMaintenanceCycle()
this.dataSource = [];
this.form.resetFields();
@@ -677,11 +665,11 @@
that.dataSource = temp;
}
that.$nextTick(() => {
- that.form.setFieldsValue(pick(that.model, 'num', 'departId', 'teamId', 'equipmentId', 'equipmentName', 'useDepartName', 'useId', 'teamName', 'assignMode', 'version', 'remark'));
+ that.form.setFieldsValue(pick(that.model, 'num', 'departId', 'teamId', 'equipmentId', 'equipmentName', 'useDepartName', 'useId', 'maintenanceType', 'teamName', 'version', 'remark'));
});
if (record.id) {
- this.maintenanceCycles = []
- this.getMaintenanceCycle(this.model.equipmentId)
+ // this.maintenanceCycles = []
+ // this.getMaintenanceCycle(this.model.equipmentId)
this.codeDisable = true;
that.$nextTick(() => {
if (that.isRevise) {
@@ -720,24 +708,24 @@
onEquipmentList() {
let data = this.form.getFieldsValue(['departId']);
- if (data.departId == null || data.departId == "") {
- this.$message.warning("璇峰厛閫夋嫨瀵硅薄閮ㄩ棬锛�");
- return
- }
+ // if (data.departId == null || data.departId == "") {
+ // this.$message.warning("璇峰厛閫夋嫨浣跨敤閮ㄩ棬锛�");
+ // return
+ // }
this.$refs.EquipmentList.list(data.departId);
this.$refs.EquipmentList.title = "閫夋嫨璁惧淇℃伅";
},
sendEquipmentRecord(data) {
this.dataSource = [];
let record = data.record;
- this.getMaintenanceCycle(record.id)
+ // this.getMaintenanceCycle(record.id)
this.form.setFieldsValue({ equipmentId: record.id, equipmentName: record.num + "/" + record.name + "/" + record.model, teamId: record.teamId, teamName: record.teamId_dictText });
},
onDepartList() {
this.$refs.DepartList.list();
- this.$refs.DepartList.title = "閫夋嫨瀵硅薄閮ㄩ棬";
+ this.$refs.DepartList.title = "閫夋嫨浣跨敤閮ㄩ棬";
},
sendDepartRecord(data) {
this.dataSource = [];
@@ -756,7 +744,6 @@
},
handleOk() {
- console.log("123")
const that = this;
this.form.validateFields((err, values) => {
if (!err) {
@@ -769,13 +756,16 @@
}
formData.maintenanceStandardDetaillist = that.dataSource;
formData.type = 'daily';
+ formData.maintenanceType = '2';
let obj;
if (!this.model.id) {
formData.versionStatus = '1'
+ formData.approvalStatus = '1'
obj = postAction(this.url.add, formData);
} else {
if (this.isRevise) {
formData.versionStatus = '1'
+ formData.approvalStatus = '1'
obj = postAction(this.url.revise, formData);
} else {
obj = requestPut(this.url.edit, formData, { id: this.model.id });
@@ -815,7 +805,6 @@
},
getMaintenanceCycle(equipmentId) {
- debugger
getAction(this.url.getMaintenanceCycle, { equipmentId: equipmentId }).then((res) => {
if (res.success) {
this.maintenanceCycles = res.result
--
Gitblit v1.9.3