From ebdee541df438f35ae291bf136c91afc2c1fffae Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期三, 10 九月 2025 20:45:58 +0800 Subject: [PATCH] 设备归还功能调整 --- src/views/eam/equipment/modules/EamEquipmentModal.vue | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 52 insertions(+), 7 deletions(-) diff --git a/src/views/eam/equipment/modules/EamEquipmentModal.vue b/src/views/eam/equipment/modules/EamEquipmentModal.vue index d46c38b..94365ba 100644 --- a/src/views/eam/equipment/modules/EamEquipmentModal.vue +++ b/src/views/eam/equipment/modules/EamEquipmentModal.vue @@ -52,7 +52,7 @@ <a-col :span="8"> <a-form-model-item prop="equipmentType" label="璁惧绉嶇被"> - <j-tree-dict placeholder="璇烽�夋嫨璁惧绉嶇被" v-model="model.equipmentType" parent-code="equipment_category" field="code" :async="false" :disabled="disableSubmit"></j-tree-dict> + <j-tree-dict placeholder="璇烽�夋嫨璁惧绉嶇被" v-model="model.equipmentType" parent-code="equipment_category" field="code" :async="true" :disabled="disableSubmit"></j-tree-dict> </a-form-model-item> </a-col> </a-row> @@ -106,8 +106,9 @@ <a-row :gutter="24"> <a-col :span="6"> - <a-form-model-item prop="areaCode" label="鍖哄彿"> - <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ュ尯鍙�'" v-model="model.areaCode" :disabled="disableSubmit"/> + <a-form-model-item prop="technologyStatus" label="鎶�鏈姸鎬�"> + <j-dict-select-tag dict-code="technology_status" placeholder="璇烽�夋嫨鎶�鏈姸鎬�" + v-model="model.technologyStatus" :disabled="disableSubmit" /> </a-form-model-item> </a-col> <a-col :span="6"> @@ -124,6 +125,17 @@ <a-form-model-item prop="assetStatus" label="璧勪骇鐘舵��"> <j-dict-select-tag dict-code="asset_status" v-model="model.assetStatus" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="equipmentUse" label="璁惧鐢ㄩ��"> + <j-dict-select-tag dict-code="equipment_use" v-model="model.equipmentUse" + placeholder="璇烽�夋嫨璁惧鐢ㄩ��" :disabled="disableSubmit"/> + </a-form-model-item> + </a-col> + <a-col :span="6"> + <a-form-model-item prop="operator" label="鎿嶄綔宸�"> + <a-input :placeholder="disableSubmit?'':'璇疯緭鍏ユ搷浣滃伐'" v-model="model.operator" :disabled="disableSubmit"/> </a-form-model-item> </a-col> </a-row> @@ -185,7 +197,7 @@ <a-form-model-item prop="orgId" label="浣跨敤杞﹂棿"> <a-tree-select v-model="model.orgId" style="width: 100%" - :tree-data="treeData" + :tree-data="treeDataAlias" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨浣跨敤杞﹂棿" allow-clear @@ -196,8 +208,8 @@ </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 and post='PCR0004' and status=1" :disabled="disableSubmit"/> + <a-form-model-item prop="equipmentManager" label="璁惧璐d换浜�"> + <j-search-select-tag placeholder="璇烽�夋嫨璁惧璐d换浜�" v-model="model.equipmentManager" dict="sys_user,realname, username, del_flag=0 and post='PCR0004' and status=1" :disabled="disableSubmit"/> </a-form-model-item> </a-col> <a-col :span="6"> @@ -279,7 +291,7 @@ { required: true, message: '璇烽�夋嫨浣跨敤杞﹂棿' } ], equipmentManager: [ - { required: true, message: '璇烽�夋嫨璁惧绠$悊鍛�' } + { required: true, message: '璇烽�夋嫨璁惧璐d换浜�' } ], deviceType: [ { required: false, message: '璇烽�夋嫨璁惧绫诲瀷' } @@ -291,6 +303,7 @@ loadProductionOptions:'/mdc/mdcProduction/loadProductionTreeOptions' }, treeData: [], + treeDataAlias: [] } }, created() { @@ -352,11 +365,43 @@ getAction(this.url.loadProductionOptions).then(res => { if (res.success) { this.treeData = [...res.result] + this.treeDataAlias = this.deepCopyAndModify(res.result) }else { that.$message.warning(res.message) } }) }, + deepCopyAndModify(arr) { + // 濡傛灉褰撳墠鍏冪礌涓嶆槸鏁扮粍鎴栧璞★紝鐩存帴杩斿洖 + if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) { + return arr; + } + + // 濡傛灉鏄暟缁勶紝鍒涘缓涓�涓柊鏁扮粍骞堕�掑綊澶勭悊姣忎釜鍏冪礌 + if (Array.isArray(arr)) { + const newArray = []; + for (let i = 0; i < arr.length; i++) { + newArray.push(this.deepCopyAndModify(arr[i])); + } + return newArray; + } + + // 濡傛灉鏄璞★紝鍒涘缓涓�涓柊瀵硅薄骞堕�掑綊澶勭悊姣忎釜灞炴�� + const newObj = {}; + for (const key in arr) { + if (arr.hasOwnProperty(key)) { + if(key === 'selectable') { + newObj[key] = true; + } else if(key === 'children') { + newObj[key] = this.deepCopyAndModify(arr[key]); + }else { + newObj[key] = arr[key]; + } + + } + } + return newObj; + } } } </script> -- Gitblit v1.9.3