From 6c86748e1a987865cbf5bafa9b122c76bd24a695 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期二, 22 七月 2025 11:51:49 +0800 Subject: [PATCH] 技术状态变更及流程 --- src/views/eam/technical/modules/EamTechnicalStatusChangeModal.vue | 342 ++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 241 insertions(+), 101 deletions(-) diff --git a/src/views/eam/technical/modules/EamTechnicalStatusChangeModal.vue b/src/views/eam/technical/modules/EamTechnicalStatusChangeModal.vue index c674e64..7a4b5b1 100644 --- a/src/views/eam/technical/modules/EamTechnicalStatusChangeModal.vue +++ b/src/views/eam/technical/modules/EamTechnicalStatusChangeModal.vue @@ -1,138 +1,276 @@ <template> - <j-modal - :title="title" - :width="800" - :visible="visible" - :confirmLoading="confirmLoading" - switchFullscreen - @ok="handleOk" - @cancel="handleCancel" - cancelText="鍏抽棴"> - - <a-spin :spinning="confirmLoading"> - <a-form-model ref="form" :model="model" :rules="validatorRules"> - - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="delFlag" label="鍒犻櫎鏍囪"> - <a-input-number v-model="model.delFlag"/> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeOrderNum" label="鍙樻洿鍗曞彿"> - <a-input placeholder="璇疯緭鍏ュ彉鏇村崟鍙�" v-model="model.changeOrderNum" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="changeStatus" label="鍙樻洿鍗曠姸鎬�"> - <a-input placeholder="璇疯緭鍏ュ彉鏇村崟鐘舵��" v-model="model.changeStatus" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="designer" label="缂栧埗浜�"> - <a-input placeholder="璇疯緭鍏ョ紪鍒朵汉" v-model="model.designer" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="designerTime" label="缂栧埗鏃堕棿"> - <a-input placeholder="璇疯緭鍏ョ紪鍒舵椂闂�" v-model="model.designerTime" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departHeaderSignature" label="浣跨敤鍗曚綅瀹や富绠$瀛�"> - <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶅涓荤绛惧瓧" v-model="model.departHeaderSignature" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departHeaderSignatureTime" label="浣跨敤鍗曚綅瀹や富绠$瀛楁椂闂�"> - <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶅涓荤绛惧瓧鏃堕棿" v-model="model.departHeaderSignatureTime" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departHeaderSignatureComment" label="浣跨敤鍗曚綅瀹や富绠℃剰瑙�"> - <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶅涓荤鎰忚" v-model="model.departHeaderSignatureComment" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departLeaderSignature" label="浣跨敤鍗曚綅閮ㄤ富绠$瀛�"> - <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶉儴涓荤绛惧瓧" v-model="model.departLeaderSignature" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departLeaderSignatureTime" label="浣跨敤鍗曚綅閮ㄤ富绠$瀛楁椂闂�"> - <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶉儴涓荤绛惧瓧鏃堕棿" v-model="model.departLeaderSignatureTime" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departLeaderSignatureComment" label="浣跨敤鍗曚綅閮ㄤ富绠$瀛�"> - <a-input placeholder="璇疯緭鍏ヤ娇鐢ㄥ崟浣嶉儴涓荤绛惧瓧" v-model="model.departLeaderSignatureComment" /> - </a-form-model-item> - <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="hfCode" label="HF缂栫爜"> - <a-input placeholder="璇疯緭鍏F缂栫爜" v-model="model.hfCode" /> - </a-form-model-item> - - </a-form-model> + <j-modal :title="title" :width="1200" :visible="visible" :confirmLoading="confirmLoading" switchFullscreen + @ok="handleOk" @cancel="handleCancel" cancelText="鍏抽棴"> + <a-spin :spinning="spinning"> + <div class="table-page-search-wrapper"> + <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-row> + <a-col :span="8"> + <a-form-model-item label="鍙樻洿鍗曞彿"> + <a-input placeholder="绯荤粺鑷姩鐢熸垚" v-model="model.changeOrderNum" disabled/> + </a-form-model-item> + </a-col> + <a-col :span="8"> + <a-form-model-item label="鐢宠鍗曚綅" prop="factoryOrgCode"> + <a-tree-select v-model="model.factoryOrgCode" :tree-data="productionTreeData" + @change="detail.dataSource=[]" + show-search :replaceFields="{key:'orgCode',value:'orgCode'}" + treeNodeFilterProp="title" searchPlaceholder="璇疯緭鍏ュ叧閿瓧鎼滅储" + :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" placeholder="璇烽�夋嫨鐢宠鍗曚綅" + allow-clear tree-default-expand-all :allow-clear="false"/> + </a-form-model-item> + </a-col> + </a-row> + + <a-row> + <a-col :span="24"> + <a-form-model-item label="澶囨敞" :labelCol="{span:2}" :wrapperCol="{span:20}"> + <a-textarea placeholder="璇疯緭鍏ュ娉�" v-model="model.remark"/> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </div> + + <j-vxe-table ref="editableDetailTable" rowNumber rowSelection bordered alwaysEdit toolbar + v-if="model.factoryOrgCode" + :toolbarConfig="detail.toolbarConfig" keep-source :height="300" + :dataSource="detail.dataSource" :columns="detail.columns"> + <!--缁熶竴缂栫爜--> + <template v-slot:equipmentId="props"> + <lx-search-equipment-select v-model="props.row.equipmentId" placeholder="璇疯緭鍏ョ粺涓�缂栫爜鎴栧悕绉版悳绱�" + :factoryOrgCode="model.factoryOrgCode" + @autocompleteForm="autocompleteForm($event,props.row)" :allowClear="false"/> + </template> + + <!-- 淇濆吇鏃ユ湡--> + <template v-slot:changeDate="props"> + <a-date-picker v-model="props.row.changeDate" value-format="YYYY-MM-DD" :allow-clear="false"/> + </template> + + <!-- 鎿嶄綔--> + <template v-slot:action="props"> + <a :disabled="!props.row.equipmentId" @click="handlePreviewDetail(props.row.standardId)">棰勮鏄庣粏</a> + </template> + </j-vxe-table> </a-spin> </j-modal> </template> <script> - import { httpAction } from '@/api/manage' - import moment from "moment" + import { httpAction, getAction } from '@/api/manage' + import { JVXETypes } from '@comp/jeecg/JVxeTable' + import LxSearchEquipmentSelect from '../../equipment/modules/LxSearchEquipmentSelect' export default { - name: "EamTechnicalStatusChangeModal", - data () { + name: 'EamTechnicalStatusChangeModal', + components: { LxSearchEquipmentSelect }, + props: { + productionTreeData: { + type: Array + } + }, + data() { return { - title:"鎿嶄綔", + title: '鎿嶄綔', visible: false, model: {}, labelCol: { xs: { span: 24 }, - sm: { span: 5 }, + sm: { span: 6 } }, wrapperCol: { xs: { span: 24 }, - sm: { span: 16 }, + sm: { span: 18 } }, - confirmLoading: false, - validatorRules:{ + spinning: false, + validatorRules: { + factoryOrgCode: [{ required: true, message: '璇烽�夋嫨鐢宠鍗曚綅', trigger: 'change' }] + }, + detail: { + dataSource: [], + columns: [ + { + title: 'ID', + key: 'id', + type: JVXETypes.hidden + }, + { + title: '缁熶竴缂栫爜', + key: 'equipmentId', + align: 'center', + type: JVXETypes.slot, + slotName: 'equipmentId', + width: 250, + validateRules: [ + { required: true, message: '璇疯緭鍏�${title}鎴栧悕绉版悳绱�' }, + { unique: true, message: '${title}涓嶈兘閲嶅' } + ] + }, + { + title: '璁惧鍚嶇О', + key: 'equipmentName', + align: 'center', + type: JVXETypes.normal, + width: 200 + }, + { + title: '璁惧鍨嬪彿', + key: 'equipmentModel', + align: 'center', + type: JVXETypes.normal, + width: 200 + }, + { + title: '浣跨敤鍗曚綅', + key: 'factoryName', + align: 'center', + type: JVXETypes.normal, + width: 200 + }, + { + title: '鍙樻洿鍘熷洜', + key: 'changeCategory', + align: 'center', + dictCode: 'technical_status_change_reason', + type: JVXETypes.select, + width: 200, + placeholder: '璇烽�夋嫨${title}', + validateRules: [{ required: true, message: '璇烽�夋嫨${title}' }] + }, + { + title: '鍙樻洿鏃ユ湡', + key: 'changeDate', + align: 'center', + type: JVXETypes.slot, + width: 200, + slotName: 'changeDate', + validateRules: [{ required: true, message: '璇烽�夋嫨${title}' }] + }, + { + title: '鍙樻洿鍚庢妧鏈姸鎬�', + key: 'changeTechnicalStatus', + align: 'center', + dictCode: 'equipment_technology_status', + type: JVXETypes.select, + width: 220, + placeholder: '璇烽�夋嫨${title}', + validateRules: [{ required: true, message: '璇烽�夋嫨${title}' }] + } + ], + toolbarConfig: { + // prefix 鍓嶇紑锛泂uffix 鍚庣紑 + slot: ['prefix', 'suffix'], + // add 鏂板鎸夐挳锛況emove 鍒犻櫎鎸夐挳锛沜learSelection 娓呯┖閫夋嫨鎸夐挳 + btn: ['add', 'remove', 'clearSelection'] + } }, url: { - add: "/eam/eamTechnicalStatusChange/add", - edit: "/eam/eamTechnicalStatusChange/edit", - }, + add: '/eam/eamTechnicalStatusChange/add', + edit: '/eam/eamTechnicalStatusChange/edit', + detail: '/eam/eamTechnicalStatusChangeDetail/queryList' + } } }, - created () { - }, methods: { - add () { + add() { //鍒濆鍖栭粯璁ゅ�� - this.edit({}); + this.edit({}) }, - edit (record) { - this.model = Object.assign({}, record); - this.visible = true; + + edit(record) { + this.model = Object.assign({}, record) + this.visible = true + if (record.id) this.loadDetail(record.id) }, - close () { - this.$emit('close'); - this.visible = false; - this.$refs.form.clearValidate(); + + /** + * 鑾峰彇璁惧鏄庣粏 + * @param orderId + */ + loadDetail(orderId) { + this.spinning = true + this.detail.dataSource = [] + getAction(this.url.detail, { orderId }) + .then(res => { + console.log('res', res) + if (res.success) this.detail.dataSource = res.result + }) + .finally(() => { + this.spinning = false + }) }, - handleOk () { - const that = this; + + autocompleteForm(selectObj, record) { + record.factoryName = selectObj.factoryOrgCode_dictText + record.equipmentName = selectObj.equipmentName + record.equipmentModel = selectObj.equipmentModel + record.changeTechnicalStatus = 'PROHIBITED' + }, + + async handleOk() { + const tableData = this.$refs.editableDetailTable.getTableData() + if (tableData.length == 0) { + this.$notification.warning({ + message: '娑堟伅', + description: '璇疯嚦灏戞柊澧炰竴鏉¤褰�' + }) + return + } + + const errMap = await this.$refs.editableDetailTable.validateTable() + if (errMap) return + + const that = this // 瑙﹀彂琛ㄥ崟楠岃瘉 - this.$refs.form.validate(valid => { + this.$refs.form.validate(valid => { if (valid) { - that.confirmLoading = true; - let httpurl = ''; - let method = ''; - if(!this.model.id){ - httpurl+=this.url.add; - method = 'post'; - }else{ - httpurl+=this.url.edit; - method = 'put'; + that.confirmLoading = that.spinning = true + let httpUrl = '' + let method = '' + if (!this.model.id) { + httpUrl += this.url.add + method = 'post' + } else { + httpUrl += this.url.edit + method = 'put' } - httpAction(httpurl,this.model,method).then((res)=>{ - if(res.success){ - that.$message.success(res.message); - that.$emit('ok'); - }else{ - that.$message.warning(res.message); - } - }).finally(() => { - that.confirmLoading = false; - that.close(); - }) - }else{ - return false; + that.model.tableDetailList = this.$refs.editableDetailTable.getTableData() + httpAction(httpUrl, this.model, method) + .then((res) => { + if (res.success) { + that.$notification.success({ + message: '娑堟伅', + description: res.message + }) + that.$emit('ok') + that.close() + } else { + that.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + that.confirmLoading = that.spinning = false + }) + } else { + return false } }) }, - handleCancel () { + + handleCancel() { this.close() }, + + close() { + this.$emit('close') + this.visible = false + this.$refs.form.clearValidate() + } } @@ -140,5 +278,7 @@ </script> <style lang="less" scoped> - + /deep/ .ant-select-dropdown-menu { + text-align: left; + } </style> \ No newline at end of file -- Gitblit v1.9.3