From e59527c22e7598e0c099b01893885cbd7f9eb020 Mon Sep 17 00:00:00 2001 From: zhangherong <571457620@qq.com> Date: 星期二, 25 三月 2025 10:53:23 +0800 Subject: [PATCH] art: 设备台账-列表、详情 修改 --- src/views/eam/equipment/modules/EamEquipmentModal.vue | 73 ++++++++++++++---------- src/mixins/JeecgListMixin.js | 5 + src/views/eam/equipment/EamEquipmentList.vue | 89 +++++++++++++++++------------ 3 files changed, 99 insertions(+), 68 deletions(-) diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index 161c3a6..2fa306f 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -301,7 +301,10 @@ // 鎵撳紑璇︽儏鎶藉眽鏃剁鐢ㄨ澶囩紪鐮併�佽澶囧悕绉拌緭鍏ユ this.$refs.modalForm.disSeach = true; // 璋冪敤鎶藉眽琛ㄥ崟缁勪欢涓殑娓呴櫎琛ㄥ崟楠岃瘉鏂规硶 - this.$refs.modalForm.removeValidate() + if(this.$refs.modalForm.removeValidate) { + this.$refs.modalForm.removeValidate() + } + }, /* 瀵煎嚭 */ handleExportXls2(){ diff --git a/src/views/eam/equipment/EamEquipmentList.vue b/src/views/eam/equipment/EamEquipmentList.vue index ed6bece..c6527c7 100644 --- a/src/views/eam/equipment/EamEquipmentList.vue +++ b/src/views/eam/equipment/EamEquipmentList.vue @@ -84,11 +84,21 @@ :scroll="{ x: 'max-content' }" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange"> - <span slot="equipmentImportance" slot-scope="text"> - <lx-switch v-model="text" disabled checked-children='鏄�' un-checked-children='鍚�' /> + <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�" /> </span> - + <span slot="mdcFlag" slot-scope="text"> + <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�" /> + </span> + <span slot="processParametersFlag" slot-scope="text"> + <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�" /> + </span> + <span slot="precisionParametersFlag" slot-scope="text"> + <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�" /> + </span> + <span slot="specialEquipment" slot-scope="text"> + <lx-switch v-model="text" disabled checked-children="鏄�" un-checked-children="鍚�" /> + </span> <span slot="action" slot-scope="text, record"> <a @click="handleEdit(record)">缂栬緫</a> @@ -96,6 +106,9 @@ <a-dropdown> <a class="ant-dropdown-link">鏇村 <a-icon type="down" /></a> <a-menu slot="overlay"> + <a-menu-item> + <a href="javascript:;" @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> <a-menu-item> <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> <a>鍒犻櫎</a> @@ -139,7 +152,7 @@ customRender: function(t, r, index) { return parseInt(index) + 1 }, - fixed: 'left', + fixed: 'left' }, { title: '璁惧缂栧彿', @@ -160,147 +173,151 @@ { title: '鍏抽敭璁惧鏍囪瘑', align: 'center', - width : 100, + width: 100, dataIndex: 'equipmentImportance', scopedSlots: { customRender: 'equipmentImportance' } }, { title: '鎶�鏈姸鎬�', align: 'center', - width : 100, + width: 100, dataIndex: 'technologyStatus_dictText' }, { title: '鎿嶄綔绯荤粺', align: 'center', - width : 100, + width: 100, dataIndex: 'operationSystem' }, { title: '浣跨敤杞﹂棿', align: 'center', - width : 100, - dataIndex: 'orgId' + width: 100, + dataIndex: 'orgId_dictText' }, { title: '璁惧绠$悊鍛�', align: 'center', - width : 100, - dataIndex: 'equipmentManager' + width: 100, + dataIndex: 'equipmentManager_dictText' }, { title: '璁惧鍒嗙被', align: 'center', - width : 100, + width: 100, dataIndex: 'equipmentCategory_dictText' }, { title: '璁惧鍨嬪彿', align: 'center', - width : 100, + width: 100, dataIndex: 'equipmentModel' }, { title: '璁惧瑙勬牸', align: 'center', - width : 100, + width: 100, dataIndex: 'equipmentSpecification' }, { title: '涓昏酱杩炴帴灏哄', align: 'center', - width : 100, + width: 100, dataIndex: 'spindleConnectDimension' }, { title: '鎬诲姛鐜�', align: 'center', - width : 100, + width: 100, dataIndex: 'equipmentPower' }, { title: '瀹夎浣嶇疆', align: 'center', - width : 100, + width: 100, dataIndex: 'installationPosition' }, { title: '璧勪骇鐘舵��', align: 'center', - width : 100, + width: 100, dataIndex: 'assetStatus_dictText' }, { title: '绔嬮」鍗″彿', align: 'center', - width : 100, + width: 100, dataIndex: 'cardNumber' }, { title: '鍑哄巶缂栧彿', align: 'center', - width : 100, + width: 100, dataIndex: 'factoryNumber' }, { title: '鏈哄簥鍘傚', align: 'center', - width : 100, + width: 100, dataIndex: 'manufacturingEnterprise' }, { title: '鏉ユ簮鍥藉', align: 'center', - width : 100, + width: 100, dataIndex: 'originCountry' }, { title: '鍑哄巶鏃ユ湡', align: 'center', - width : 100, + width: 100, dataIndex: 'leaveFactoryDate' }, { title: '楠屾敹鏃ユ湡', align: 'center', - width : 100, + width: 100, dataIndex: 'acceptanceCheckDate' }, { title: '璐ㄤ繚寮�濮嬫棩鏈�', align: 'center', - width : 100, + width: 100, dataIndex: 'warrantyStartDate' }, { title: '璐ㄤ繚缁撴潫鏃ユ湡', align: 'center', - width : 100, + width: 100, dataIndex: 'warrantyEndDate' }, { title: '鏄惁瀹炴柦MDC', align: 'center', - width : 100, - dataIndex: 'mdcFlag' + width: 100, + dataIndex: 'mdcFlag', + scopedSlots: { customRender: 'mdcFlag' } }, { - title: '鏄惁鏈夊伐鑹哄弬鏁�', + title: '鏈夋棤宸ヨ壓鍙傛暟', align: 'center', - width : 100, - dataIndex: 'processParametersFlag' + width: 100, + dataIndex: 'processParametersFlag', + scopedSlots: { customRender: 'processParametersFlag' } }, { - title: '鏄惁鏈夌簿搴﹀弬鏁�', + title: '鏈夋棤绮惧害鍙傛暟', align: 'center', - width : 100, - dataIndex: 'precisionParametersFlag' + width: 100, + dataIndex: 'precisionParametersFlag', + scopedSlots: { customRender: 'precisionParametersFlag' } }, { title: '鏄惁涓虹壒绉嶈澶�', align: 'center', - width : 100, - dataIndex: 'specialEquipment' + width: 100, + dataIndex: 'specialEquipment', + scopedSlots: { customRender: 'specialEquipment' } }, { title: '閲嶉噺', diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue index d3e72bc..83ae66a 100644 --- a/src/views/eam/equipment/modules/EamEquipmentModal.vue +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -5,6 +5,7 @@ :visible="visible" centered :confirmLoading="confirmLoading" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" switchFullscreen @ok="handleOk" @cancel="handleCancel" @@ -19,17 +20,17 @@ <a-row> <a-col :span="8"> <a-form-model-item prop="equipmentCode" label="璁惧缂栧彿"> - <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode"/> + <a-input placeholder="璇疯緭鍏ヨ澶囩紪鍙�" v-model="model.equipmentCode" :disabled="editable || disableSubmit" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item prop="equipmentName" label="璁惧鍚嶇О"> - <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName"/> + <a-input placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName" :disabled="disableSubmit" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item prop="equipmentModel" label="璁惧鍨嬪彿"> - <a-input placeholder="璇疯緭鍏ヨ澶囧瀷鍙�" v-model="model.equipmentModel"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囧瀷鍙�'" v-model="model.equipmentModel" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> @@ -38,20 +39,20 @@ <a-col :span="8"> <a-form-model-item prop="equipmentSpecification" label="璁惧瑙勬牸"> - <a-input placeholder="璇疯緭鍏ヨ澶囪鏍�" v-model="model.equipmentSpecification"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囪鏍�'" v-model="model.equipmentSpecification" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item prop="equipmentCategory" label="璁惧鍒嗙被"> <j-dict-select-tag dict-code="equipment_category" placeholder="璇烽�夋嫨璁惧鍒嗙被" - v-model="model.equipmentCategory"/> + v-model="model.equipmentCategory" :disabled="disableSubmit" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item prop="operationSystem" label="鎿嶄綔绯荤粺"> - <a-input placeholder="璇疯緭鍏ユ搷浣滅郴缁�" v-model="model.operationSystem"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ搷浣滅郴缁�'" v-model="model.operationSystem" :disabled="disableSubmit" /> </a-form-model-item> </a-col> </a-row> @@ -63,45 +64,46 @@ checked-children='鏄�' un-checked-children='鍚�' v-model="model.equipmentImportance" + :disabled="disableSubmit" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item prop="equipmentPower" label="鎬诲姛鐜�"> - <a-input placeholder="璇疯緭鍏ユ�诲姛鐜�" v-model="model.equipmentPower"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ�诲姛鐜�'" v-model="model.equipmentPower" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item prop="cardNumber" label="绔嬮」鍗″彿"> - <a-input placeholder="璇疯緭鍏ョ珛椤瑰崱鍙�" v-model="model.cardNumber"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ョ珛椤瑰崱鍙�'" v-model="model.cardNumber" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> </a-col> <a-col :span="6"> - <j-image-upload></j-image-upload> + <j-image-upload text="璁惧鍥剧墖" biz="eam_equipment_image" v-model="model.equipmentImage"></j-image-upload> </a-col> </a-row> <a-row :gutter="24"> <a-col :span="6"> <a-form-model-item prop="equipmentWeight" label="閲嶉噺"> - <a-input placeholder="璇疯緭鍏ラ噸閲�" v-model="model.equipmentWeight"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ラ噸閲�'" v-model="model.equipmentWeight" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="equipmentPort" label="璁惧绔彛"> - <a-input placeholder="璇疯緭鍏ヨ澶囩鍙�" v-model="model.equipmentPort"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヨ澶囩鍙�'" v-model="model.equipmentPort" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="coordinateNum" label="鍧愭爣鏁伴噺"> - <a-input-number v-model="model.coordinateNum" style="width: 100%"/> + <a-input-number :placeholder="disableSubmit?'':'璇疯緭鍏ュ潗鏍囨暟閲�'" v-model="model.coordinateNum" style="width: 100%" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="assetStatus" label="璧勪骇鐘舵��"> - <j-dict-select-tag dict-code="asset_status" placeholder="璇烽�夋嫨璧勪骇鐘舵��" v-model="model.assetStatus" + <j-dict-select-tag dict-code="asset_status" v-model="model.assetStatus" disabled/> </a-form-model-item> </a-col> @@ -113,22 +115,22 @@ <a-row :gutter="24"> <a-col :span="6"> <a-form-model-item prop="factoryNumber" label="鍑哄巶缂栧彿"> - <a-input placeholder="璇疯緭鍏ュ嚭鍘傜紪鍙�" v-model="model.factoryNumber"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ嚭鍘傜紪鍙�'" v-model="model.factoryNumber" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="leaveFactoryDate" label="鍑哄巶鏃ユ湡"> - <a-date-picker placeholder="璇烽�夋嫨鍑哄巶鏃ユ湡" v-model="model.leaveFactoryDate"/> + <a-date-picker placeholder="璇烽�夋嫨鍑哄巶鏃ユ湡" v-model="model.leaveFactoryDate" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="acceptanceCheckDate" label="楠屾敹鏃ユ湡"> - <a-date-picker placeholder="璇烽�夋嫨楠屾敹鏃ユ湡" v-model="model.acceptanceCheckDate"/> + <a-date-picker placeholder="璇烽�夋嫨楠屾敹鏃ユ湡" v-model="model.acceptanceCheckDate" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="installationPosition" label="瀹夎浣嶇疆"> - <a-input placeholder="璇疯緭鍏ュ畨瑁呬綅缃�" v-model="model.installationPosition"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ畨瑁呬綅缃�'" v-model="model.installationPosition" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> @@ -136,22 +138,22 @@ <a-row :gutter="24"> <a-col :span="6"> <a-form-model-item prop="spindleConnectDimension" label="涓昏酱杩炴帴灏哄"> - <a-input placeholder="璇疯緭鍏ヤ富杞磋繛鎺ュ昂瀵�" v-model="model.spindleConnectDimension"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ヤ富杞磋繛鎺ュ昂瀵�'" v-model="model.spindleConnectDimension" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="specialEquipment" label="鏄惁鐗圭璁惧"> - <lx-switch checked-children='鏄�' un-checked-children='鍚�' v-model="model.specialEquipment"/> + <lx-switch checked-children='鏄�' un-checked-children='鍚�' v-model="model.specialEquipment" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="manufacturingEnterprise" label="鍒堕�犲巶瀹�"> - <a-input placeholder="璇疯緭鍏ュ埗閫犲巶瀹�" v-model="model.manufacturingEnterprise"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ埗閫犲巶瀹�'" v-model="model.manufacturingEnterprise" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="originCountry" label="鏉ユ簮鍥藉"> - <a-input placeholder="璇疯緭鍏ユ潵婧愬浗瀹�" v-model="model.originCountry"/> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ潵婧愬浗瀹�'" v-model="model.originCountry" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> @@ -169,29 +171,30 @@ placeholder="璇烽�夋嫨浣跨敤杞﹂棿" allow-clear tree-default-expand-all + :disabled="editable || disableSubmit" > </a-tree-select> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="equipmentManager" label="璁惧绠$悊鍛�"> - <j-search-select-tag placeholder="璇烽�夋嫨璁惧绠$悊鍛�" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0"/> + <j-search-select-tag placeholder="璇烽�夋嫨璁惧绠$悊鍛�" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="technologyStatus" label="鎶�鏈姸鎬�"> <j-dict-select-tag dict-code="technology_status" placeholder="璇烽�夋嫨鎶�鏈姸鎬�" - v-model="model.technologyStatus"/> + v-model="model.technologyStatus" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="mdcFlag" label="鏄惁瀹炴柦MDC"> - <lx-switch checked-children='鏄�' un-checked-children='鍚�' @change="handleMdcFlagChange" v-model="model.mdcFlag"/> + <lx-switch checked-children='鏄�' un-checked-children='鍚�' @change="handleMdcFlagChange" v-model="model.mdcFlag" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6" v-if="model.mdcFlag === '1'"> <a-form-model-item prop="deviceType" label="MDC璁惧绫诲瀷"> - <j-search-select-tag placeholder="璇烽�夋嫨璁惧绫诲瀷" v-model="model.deviceType" dict="mdc_equipment_type,equipment_type_name, equipment_type_name, equipment_type_states='Y'" /> + <j-search-select-tag placeholder="璇烽�夋嫨璁惧绫诲瀷" v-model="model.deviceType" dict="mdc_equipment_type,equipment_type_name, equipment_type_name, equipment_type_states='Y'" :disabled="disableSubmit" /> </a-form-model-item> </a-col> </a-row> @@ -199,22 +202,22 @@ <a-row :gutter="24"> <a-col :span="6"> <a-form-model-item prop="warrantyStartDate" label="璐ㄤ繚寮�濮嬫棩鏈�"> - <a-date-picker placeholder="璇烽�夋嫨寮�濮嬫棩鏈�" v-model="model.warrantyStartDate"/> + <a-date-picker :placeholder="disableSubmit?'':'璇烽�夋嫨寮�濮嬫棩鏈�'" v-model="model.warrantyStartDate" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="warrantyEndDate" label="璐ㄤ繚缁撴潫鏃ユ湡"> - <a-date-picker placeholder="璇烽�夋嫨缁撴潫鏃ユ湡" v-model="model.warrantyEndDate"/> + <a-date-picker :placeholder="disableSubmit?'':'璇烽�夋嫨缁撴潫鏃ユ湡'" v-model="model.warrantyEndDate" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="processParametersFlag" label="鏈夋棤宸ヨ壓鍙傛暟"> - <lx-switch checked-children='鏈�' un-checked-children='鏃�' v-model="model.processParametersFlag"/> + <lx-switch checked-children='鏈�' un-checked-children='鏃�' v-model="model.processParametersFlag" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> <a-form-model-item prop="precisionParametersFlag" label="鏈夋棤绮惧害鍙傛暟"> - <lx-switch checked-children='鏈�' un-checked-children='鏃�' v-model="model.precisionParametersFlag"/> + <lx-switch checked-children='鏈�' un-checked-children='鏃�' v-model="model.precisionParametersFlag" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> @@ -222,7 +225,7 @@ <a-row :gutter="24"> <a-col :span="24"> <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" prop="remark" label="澶囨敞"> - <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/> + <a-textarea :placeholder="disableSubmit?'':'璇疯緭鍏ュ娉�'" v-model="model.remark" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> @@ -243,6 +246,10 @@ return { title: '鎿嶄綔', visible: false, + //鎺у埗缂栬緫 + editable: false, + //璇︽儏鎺у埗 + disableSubmit: false, model: {}, labelCol: { xs: { span: 24 }, @@ -304,10 +311,13 @@ }, methods: { add() { + this.editable = false; //鍒濆鍖栭粯璁ゅ�� - this.edit({}) + this.model = {}; + this.visible = true }, edit(record) { + this.editable = true; this.model = Object.assign({}, record) this.visible = true }, @@ -361,6 +371,7 @@ }) }, handleMdcFlagChange(checked){ + this.model.deviceType = ''; if (checked) { this.validatorRules.deviceType[0].required = true } else { -- Gitblit v1.9.3