From e8aebd4dd2b398a2a90c37e18336fafbb2c314a4 Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期四, 14 八月 2025 17:01:49 +0800 Subject: [PATCH] 工厂建模功能调整 --- src/views/base/modules/factoryManager/FactoryModal.vue | 57 +++++++++++++++++++++++----- src/views/base/modules/group/SelectUserModal.vue | 2 src/views/system/modules/SelectUserModal.vue | 2 src/views/base/FactoryManager.vue | 37 +++++++++++++++--- src/views/base/modules/factoryManager/SelectUserModal.vue | 2 5 files changed, 79 insertions(+), 21 deletions(-) diff --git a/src/views/base/FactoryManager.vue b/src/views/base/FactoryManager.vue index 7808668..61c782a 100644 --- a/src/views/base/FactoryManager.vue +++ b/src/views/base/FactoryManager.vue @@ -5,8 +5,8 @@ <!-- 鎸夐挳鎿嶄綔鍖哄煙 --> <a-row style="margin-left: 14px"> - <a-button @click="handleAdd(1)" type="primary">娣诲姞杞﹂棿</a-button> - <a-button @click="handleAdd(2)" type="primary">娣诲姞涓嬬骇</a-button> + <a-button @click="handleAdd(1)" type="primary">娣诲姞宸ュ巶</a-button> + <a-button v-if="this.factoryCategory == '1' || this.factoryCategory == '2'" @click="handleAdd(2)" type="primary">娣诲姞涓嬬骇</a-button> <!-- <a-button type="primary" icon="download" @click="handleExportXls('杞﹂棿淇℃伅')">瀵煎嚭</a-button> <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> @@ -66,13 +66,16 @@ <a-tab-pane tab="鍩烘湰淇℃伅" key="1"> <a-card :bordered="false" v-if="selectedKeys.length>0"> <a-form-model ref="form" :model="model" :rules="validatorRules"> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryCode" label="杞﹂棿缂栧彿"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryCode" :label="codeLabel"> <a-input placeholder="璇疯緭鍏ヤ骇绾�/杞﹂棿缂栧彿" v-model="model.factoryCode"/> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryName" label="杞﹂棿鍚嶇О"> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="factoryName" :label="nameLabel"> <a-input placeholder="璇疯緭鍏ヤ骇绾�/杞﹂棿鍚嶇О" v-model="model.factoryName"/> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="涓婄骇杞﹂棿"> + <a-form-model-item v-if="this.factoryCategory == '3'" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="productionType" :label="nameLabel"> + <j-dict-select-tag type="list" placeholder="璇烽�夋嫨浜х嚎绫诲瀷" v-model="model.productionType" dictCode="production_type"/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="鐖惰妭鐐�"> <a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" @@ -180,7 +183,27 @@ computed: { importExcelUrl: function() { return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}` - } + }, + // 鏂板璁$畻灞炴�э細鍔ㄦ�佺紪鍙锋爣绛� + codeLabel() { + if (!this.currSelected.factoryCategory) return "杞﹂棿缂栧彿"; + const typeMap = { + '1': '宸ュ巶缂栧彿', + '2': '杞﹂棿缂栧彿', + '3': '浜х嚎缂栧彿' + }; + return typeMap[this.currSelected.factoryCategory] || "杞﹂棿缂栧彿"; + }, + // 鏂板璁$畻灞炴�э細鍔ㄦ�佸悕绉版爣绛� + nameLabel() { + if (!this.currSelected.factoryCategory) return "杞﹂棿鍚嶇О"; + const typeMap = { + '1': '宸ュ巶鍚嶇О', + '2': '杞﹂棿鍚嶇О', + '3': '浜х嚎鍚嶇О' + }; + return typeMap[this.currSelected.factoryCategory] || "杞﹂棿鍚嶇О"; + } }, methods: { loadData() { @@ -396,7 +419,7 @@ }) return false } - this.$refs.departModal.add(this.selectedKeys) + this.$refs.departModal.add(this.selectedKeys,this.factoryCategory) this.$refs.departModal.title = '鏂板' } else { this.$refs.departModal.add(this.currSelected) diff --git a/src/views/base/modules/factoryManager/FactoryModal.vue b/src/views/base/modules/factoryManager/FactoryModal.vue index dea6f54..4454250 100644 --- a/src/views/base/modules/factoryManager/FactoryModal.vue +++ b/src/views/base/modules/factoryManager/FactoryModal.vue @@ -16,28 +16,38 @@ <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" - label="杞﹂棿缂栫爜" + :label="codeLabel" prop="factoryCode" :hidden="false" hasFeedback > - <a-input id="factoryCode" placeholder="璇疯緭鍏ヤ骇绾�/杞﹂棿缂栧彿" v-model="model.factoryCode"/> + <a-input id="factoryCode" placeholder="璇疯緭鍏ュ伐鍘�/浜х嚎/杞﹂棿缂栧彿" v-model="model.factoryCode"/> </a-form-model-item> <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" - label="杞﹂棿鍚嶇О" + :label="nameLabel" prop="factoryName" :hidden="false" hasFeedback > - <a-input id="factoryName" placeholder="璇疯緭鍏ヤ骇绾�/杞﹂棿鍚嶇О" v-model="model.factoryName"/> + <a-input id="factoryName" placeholder="璇疯緭鍏ュ伐鍘�/浜х嚎/杞﹂棿鍚嶇О" v-model="model.factoryName"/> </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="涓婄骇杞﹂棿" hasFeedback> + <a-form-model-item + v-if="this.factoryCategory == '2'" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="浜х嚎绫诲瀷" + prop="productionType" + :hidden="false" + hasFeedback > + <j-dict-select-tag type="list" placeholder="璇烽�夋嫨浜х嚎绫诲瀷" v-model="model.productionType" dictCode="production_type"/> + </a-form-model-item> + <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" :hidden="seen" label="鐖惰妭鐐�" hasFeedback> <a-tree-select style="width:100%" :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" :treeData="factoryTree" v-model="model.parentId" - placeholder="璇烽�夋嫨涓婄骇杞﹂棿" + placeholder="璇烽�夋嫨鐖惰妭鐐�" :disabled="condition"> </a-tree-select> </a-form-model-item> @@ -63,12 +73,14 @@ import { httpAction } from '@/api/manage' import { queryById } from '@/api/api' import pick from 'lodash.pick' +import JDictSelectTag from '../../../../components/dict/JDictSelectTag.vue' export default { name: "FactoryModal", - components: { }, + components: {JDictSelectTag }, data () { return { factoryTree:[], + factoryCategory:'', title:"鎿嶄綔", seen:false, visible: false, @@ -86,7 +98,7 @@ confirmLoading: false, validatorRules:{ - factoryName:[{ required: true, message: '璇疯緭鍏ヤ骇绾�/杞﹂棿鍚嶇О!' }], + factoryName:[{ required: true, message: '璇疯緭鍏ュ伐鍘�/杞﹂棿/浜х嚎鍚嶇О!' }], }, url: { add: "/base/factory/add", @@ -95,6 +107,28 @@ } }, created () { + }, + computed: { + // 鏂板璁$畻灞炴�э細鍔ㄦ�佺紪鍙锋爣绛� + codeLabel() { + if (!this.factoryCategory) return "宸ュ巶缂栧彿"; + const typeMap = { + '1': '杞﹂棿缂栧彿', + '2': '浜х嚎缂栧彿', + '3': '浜х嚎缂栧彿' + }; + return typeMap[this.factoryCategory] || "宸ュ巶缂栧彿"; + }, + // 鏂板璁$畻灞炴�э細鍔ㄦ�佸悕绉版爣绛� + nameLabel() { + if (!this.factoryCategory) return "宸ュ巶鍚嶇О"; + const typeMap = { + '1': '杞﹂棿鍚嶇О', + '2': '浜х嚎鍚嶇О', + '3': '浜х嚎鍚嶇О' + }; + return typeMap[this.factoryCategory] || "宸ュ巶鍚嶇О"; + } }, methods: { loadTreeData(){ @@ -110,7 +144,7 @@ }) }, - add (factory) { + add (factory,factoryCategory) { if(factory){ this.seen = false; this.dictDisabled = false; @@ -118,13 +152,14 @@ this.seen = true; this.dictDisabled = true; } - this.edit(factory); + this.edit(factory,factoryCategory); }, - edit (record) { + edit (record,factoryCategory) { this.visible = true; this.model = Object.assign({}, this.defaultModel, record) this.loadTreeData(); this.model.parentId = record!=null?record.toString():null; + this.factoryCategory = factoryCategory }, close () { this.$emit('close'); diff --git a/src/views/base/modules/factoryManager/SelectUserModal.vue b/src/views/base/modules/factoryManager/SelectUserModal.vue index ee1d373..8af67ef 100644 --- a/src/views/base/modules/factoryManager/SelectUserModal.vue +++ b/src/views/base/modules/factoryManager/SelectUserModal.vue @@ -34,7 +34,7 @@ <!-- table鍖哄煙-begin --> <div> <a-table - size="small" + size="middle" bordered rowKey="id" :columns="columns1" diff --git a/src/views/base/modules/group/SelectUserModal.vue b/src/views/base/modules/group/SelectUserModal.vue index 36eeb3b..5da649b 100644 --- a/src/views/base/modules/group/SelectUserModal.vue +++ b/src/views/base/modules/group/SelectUserModal.vue @@ -34,7 +34,7 @@ <!-- table鍖哄煙-begin --> <div> <a-table - size="small" + size="middle" bordered rowKey="id" :columns="columns1" diff --git a/src/views/system/modules/SelectUserModal.vue b/src/views/system/modules/SelectUserModal.vue index 0dc51f9..a766641 100644 --- a/src/views/system/modules/SelectUserModal.vue +++ b/src/views/system/modules/SelectUserModal.vue @@ -33,7 +33,7 @@ <!-- table鍖哄煙-begin --> <div> <a-table - size="small" + size="middle" bordered rowKey="id" :columns="columns1" -- Gitblit v1.9.3