From 80989ae609bb5dc01191a583a30f8d08ca4f31f3 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期六, 11 十一月 2023 18:43:17 +0800 Subject: [PATCH] 中心 工区 工段修改 --- src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue | 11 src/views/eam/modules/siteAreaLine/SiteAreaLineLeft.vue | 310 ++++++++++++++ src/views/eam/SiteAreaLineManagerNew.vue | 41 + src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue | 11 src/views/eam/modules/site/AreaModel.vue | 8 src/views/eam/modules/site/ProductionLineModel.vue | 8 src/views/eam/modules/site/SiteModel.vue | 11 src/views/eam/modules/siteAreaLine/SiteAreaLineModel.vue | 279 +++++++++++++ src/views/eam/modules/siteAreaLine/SiteAreaLineRight.vue | 36 + src/views/eam/modules/equipmentNew/EquipmentModal.vue | 103 ++-- src/views/eam/modules/siteAreaLine/SiteAreaLine2List.vue | 391 ++++++++++++++++++ 11 files changed, 1,158 insertions(+), 51 deletions(-) diff --git a/src/views/eam/SiteAreaLineManagerNew.vue b/src/views/eam/SiteAreaLineManagerNew.vue new file mode 100644 index 0000000..f6ef065 --- /dev/null +++ b/src/views/eam/SiteAreaLineManagerNew.vue @@ -0,0 +1,41 @@ +<template> + <a-row + type="flex" + :gutter="16" + > + <a-col + :md="6" + :sm="24" + > + <site-area-line-left /> + </a-col> + <a-col + :md="24-6" + :sm="24" + > + <site-area-line-right /> + </a-col> + </a-row> +</template> + +<script> +import SiteAreaLineLeft from './modules/siteAreaLine/SiteAreaLineLeft' +import SiteAreaLineRight from './modules/siteAreaLine/SiteAreaLineRight' +export default { + name: 'SiteAreaLineManagerNew', + components: { + SiteAreaLineLeft, + SiteAreaLineRight + }, + data() { + return { + description: '鏁呴殰鍘熷洜' + } + }, + methods: {} +} +</script> + +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue b/src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue index 2100db5..991fb92 100644 --- a/src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue +++ b/src/views/eam/modules/dailyInspectionStandard/DailylnspectionStandardModal.vue @@ -42,7 +42,7 @@ @search="onDepartList()" :read-only="true" v-decorator="['useDepartName', validatorRules.useDepartName]" - /> --> + /> <a-tree-select style="width: 100%" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" @@ -50,6 +50,15 @@ placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" tree-default-expand-all v-decorator="['useId', 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="['useId', {}]" /> </a-form-item> </a-col> diff --git a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue index f8a4047..9107a54 100644 --- a/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue +++ b/src/views/eam/modules/dailyMaintenanceStandard/DailyMaintenanceStandardModal.vue @@ -40,7 +40,7 @@ @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> diff --git a/src/views/eam/modules/equipmentNew/EquipmentModal.vue b/src/views/eam/modules/equipmentNew/EquipmentModal.vue index 47d46a5..5db4bea 100644 --- a/src/views/eam/modules/equipmentNew/EquipmentModal.vue +++ b/src/views/eam/modules/equipmentNew/EquipmentModal.vue @@ -117,13 +117,21 @@ :wrapperCol="wrapperCol" prop="useId" > - <a-tree-select + <!-- <a-tree-select style="width: 100%" :disabled="formDisabled" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData" placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" tree-default-expand-all + v-model="model.useId" + /> --> + <j-dict-select-tag + allow-clear + :disabled="formDisabled" + placeholder="璇烽�夋嫨浣跨敤閮ㄩ棬" + :triggerChange="true" + dictCode="sys_depart,depart_name,id,del_flag!='1'" v-model="model.useId" /> </a-form-model-item> @@ -173,13 +181,21 @@ :wrapperCol="wrapperCol" prop="manageId" > - <a-tree-select + <!-- <a-tree-select :disabled="formDisabled" style="width: 100%" :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" :tree-data="treeData" placeholder="璇烽�夋嫨缁存姢閮ㄩ棬" tree-default-expand-all + v-model="model.manageId" + /> --> + <j-dict-select-tag + allow-clear + :disabled="formDisabled" + placeholder="璇烽�夋嫨缁存姢閮ㄩ棬" + :triggerChange="true" + dictCode="sys_depart,depart_name,id,del_flag!='1'" v-model="model.manageId" /> </a-form-model-item> @@ -319,7 +335,10 @@ /> </a-form-model-item> </a-col> - <a-col :span="6" v-if="model.operatingSystem=='yes'"> + <a-col + :span="6" + v-if="model.operatingSystem=='yes'" + > <a-form-model-item label="绯荤粺" :labelCol="labelCol" @@ -348,12 +367,12 @@ </a-form-model-item> </a-col> <a-col :span="6"> - <a-form-model-item - label="鍧愭爣鏁伴噺" - :labelCol="labelCol" - :wrapperCol="wrapperCol" - prop="coordinateNum" - > + <a-form-model-item + label="鍧愭爣鏁伴噺" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="coordinateNum" + > <a-input-number v-model="model.coordinateNum" :disabled="formDisabled" @@ -691,8 +710,8 @@ ></a-input> </a-form-model-item> </a-col> - </a-row> - <a-row hidden> + </a-row> + <a-row hidden> <a-col :span="6"> <a-form-model-item label="骞冲潎浣跨敤鐜�" @@ -902,8 +921,8 @@ default: false, required: false }, - caytegoryParam:{ - type:String, + caytegoryParam: { + type: String, default: '', required: false } @@ -990,7 +1009,7 @@ propertyStatus: [ { required: true, message: '璇烽�夋嫨璧勪骇鐘舵��!' }, ], - system:[ + system: [ { required: true, message: '璇疯緭鍏ョ郴缁�!' }, ] }, @@ -998,7 +1017,7 @@ add: "/eam/equipment/add", edit: "/eam/equipment/edit", loadOptions: '/sys/sysDepart/loadDepartTreeOptions', - getCategoryFlag:"/eam/equipmentCategory/queryById" + getCategoryFlag: "/eam/equipmentCategory/queryById" }, treeData: [], needSpecific: false, @@ -1018,8 +1037,8 @@ edit(record) { console.log(this.disabled) this.model = Object.assign({}, record); - if(!this.model.id){ - this.model.equipmentStatus = '1' + if (!this.model.id) { + this.model.equipmentStatus = '1' } this.visible = true; }, @@ -1167,9 +1186,9 @@ }, onSearchPrecisionParametersTemplate() { - if(this.model.num ==''||this.model.num==undefined||this.model.num==null){ - this.$message.warn("璇峰厛濉啓缁熶竴缂栫爜") - return false; + if (this.model.num == '' || this.model.num == undefined || this.model.num == null) { + this.$message.warn("璇峰厛濉啓缁熶竴缂栫爜") + return false; } this.$refs.PrecisionParametersTemplateList.list(); this.$refs.PrecisionParametersTemplateList.title = "閫夋嫨璁惧绮惧害妯℃澘"; @@ -1220,32 +1239,32 @@ }) } //鏀瑰彉鎶�鏈姸鎬侀壌瀹氬懆鏈� - if(this.model.equipmentCategoryId!==null&&this.model.equipmentCategoryId!=''){ + if (this.model.equipmentCategoryId !== null && this.model.equipmentCategoryId != '') { var value = this.model.equipmentCategoryId; - getAction(this.url.getCategoryFlag,{id:value}).then(res=>{ - if(res.result.equipmentCategoryUda1!=='weldingMachine'&&res.result.equipmentCategoryUda11!=='filesCarousel'&&res.result.equipmentCategoryUda1!=='tester'){ - if(val==='A'){ - this.model.checkPeriod=365*3+''; - } - if(val==='B'||val==='C'||val==='D'){ - this.model.checkPeriod=365*4+''; - } - } - this.model = Object.assign({},this.model); + getAction(this.url.getCategoryFlag, { id: value }).then(res => { + if (res.result.equipmentCategoryUda1 !== 'weldingMachine' && res.result.equipmentCategoryUda11 !== 'filesCarousel' && res.result.equipmentCategoryUda1 !== 'tester') { + if (val === 'A') { + this.model.checkPeriod = 365 * 3 + ''; + } + if (val === 'B' || val === 'C' || val === 'D') { + this.model.checkPeriod = 365 * 4 + ''; + } + } + this.model = Object.assign({}, this.model); }) } }, - categoryChange(value){ - getAction(this.url.getCategoryFlag,{id:value}).then(res=>{ - if(res.result.equipmentCategoryUda1==='weldingMachine'){ - this.model.checkPeriod=365*3+''; - }else if(res.result.equipmentCategoryUda1==='filesCarousel'){ - this.model.checkPeriod=365*4+''; - }else if(res.result.equipmentCategoryUda1==='tester'){ - this.model.checkPeriod=365*1+''; - } - this.model = Object.assign({},this.model); - }) + categoryChange(value) { + getAction(this.url.getCategoryFlag, { id: value }).then(res => { + if (res.result.equipmentCategoryUda1 === 'weldingMachine') { + this.model.checkPeriod = 365 * 3 + ''; + } else if (res.result.equipmentCategoryUda1 === 'filesCarousel') { + this.model.checkPeriod = 365 * 4 + ''; + } else if (res.result.equipmentCategoryUda1 === 'tester') { + this.model.checkPeriod = 365 * 1 + ''; + } + this.model = Object.assign({}, this.model); + }) } }, computed: { diff --git a/src/views/eam/modules/site/AreaModel.vue b/src/views/eam/modules/site/AreaModel.vue index 8f563eb..b7038b7 100644 --- a/src/views/eam/modules/site/AreaModel.vue +++ b/src/views/eam/modules/site/AreaModel.vue @@ -21,7 +21,7 @@ :wrapperCol="{span:18}" > <a-input - :readOnly="true" + :readOnly="codeDisable" allow-clear placeholder="灏嗙敱绯荤粺鑷姩鐢熸垚" v-decorator="['num', validatorRules.num ]" @@ -105,7 +105,7 @@ <script> import pick from 'lodash.pick' -import { getAction,postAction, requestPut } from '@/api/manage' +import { getAction, postAction, requestPut } from '@/api/manage' import { duplicateCheck } from '@/api/api' export default { @@ -163,6 +163,7 @@ getNum: '/eam/sysIdentity/getNumNew', }, disableSubmit: false, + codeDisable: false, //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� alterFlag: "" } @@ -189,6 +190,9 @@ } }) }); + this.codeDisable = false; + } else { + this.codeDisable = true; } }, close() { diff --git a/src/views/eam/modules/site/ProductionLineModel.vue b/src/views/eam/modules/site/ProductionLineModel.vue index 29db281..7ac1c10 100644 --- a/src/views/eam/modules/site/ProductionLineModel.vue +++ b/src/views/eam/modules/site/ProductionLineModel.vue @@ -21,7 +21,7 @@ :wrapperCol="{span:18}" > <a-input - :readOnly="true" + :readOnly="codeDisable" allow-clear placeholder="灏嗙敱绯荤粺鑷姩鐢熸垚" v-decorator="['num', validatorRules.num ]" @@ -89,7 +89,7 @@ <script> import pick from 'lodash.pick' -import { getAction,postAction, requestPut } from '@/api/manage' +import { getAction, postAction, requestPut } from '@/api/manage' import { duplicateCheck } from '@/api/api' export default { @@ -142,6 +142,7 @@ getNum: '/eam/sysIdentity/getNumNew', }, disableSubmit: false, + codeDisable: false, //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� alterFlag: "" } @@ -168,6 +169,9 @@ } }) }); + this.codeDisable = false; + } else { + this.codeDisable = true; } }, close() { diff --git a/src/views/eam/modules/site/SiteModel.vue b/src/views/eam/modules/site/SiteModel.vue index 2c4eb1f..22eb73c 100644 --- a/src/views/eam/modules/site/SiteModel.vue +++ b/src/views/eam/modules/site/SiteModel.vue @@ -21,7 +21,7 @@ :wrapperCol="{span:18}" > <a-input - :readOnly="true" + :readOnly="codeDisable" allow-clear placeholder="灏嗙敱绯荤粺鑷姩鐢熸垚" v-decorator="['num', validatorRules.num ]" @@ -71,7 +71,7 @@ <script> import pick from 'lodash.pick' -import { getAction,postAction, requestPut } from '@/api/manage' +import { getAction, postAction, requestPut } from '@/api/manage' import { duplicateCheck } from '@/api/api' export default { @@ -118,6 +118,7 @@ getNum: '/eam/sysIdentity/getNumNew', }, disableSubmit: false, + codeDisable: false, //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� alterFlag: "" } @@ -133,6 +134,7 @@ this.model = Object.assign({}, record); this.visible = true; this.disableSubmit = false; + this.$nextTick(() => { this.form.setFieldsValue(pick(this.model, 'num', 'name', 'remark')) }); @@ -144,7 +146,10 @@ } }) }); - } + this.codeDisable = false; + } else { + this.codeDisable = true; + } 4 }, close() { this.$emit('close'); diff --git a/src/views/eam/modules/siteAreaLine/SiteAreaLine2List.vue b/src/views/eam/modules/siteAreaLine/SiteAreaLine2List.vue new file mode 100644 index 0000000..a0f1491 --- /dev/null +++ b/src/views/eam/modules/siteAreaLine/SiteAreaLine2List.vue @@ -0,0 +1,391 @@ +<template> + <a-card + :bordered="false" + class="card-area" + > + <template slot="title"> + <i + class="action-jeecg actionsite2" + style="font-size: 18px;" + /> + 涓績/宸ュ尯/宸ユ鏄庣粏 + </template> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <!-- 鎼滅储鍖哄煙 --> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :md="8" + :sm="8" + > + <a-form-item label="缂栧彿"> + <a-input + placeholder="璇疯緭鍏ョ紪鍙锋煡璇�" + v-model="queryParam.num" + ></a-input> + </a-form-item> + </a-col> + <a-col + :md="8" + :sm="8" + > + <a-form-item label="鍚嶇О"> + <a-input + placeholder="璇疯緭鍏ュ悕绉版煡璇�" + v-model="queryParam.name" + ></a-input> + </a-form-item> + </a-col> + </a-row> + </a-form> + </div> + + <!-- 鎿嶄綔鎸夐挳鍖哄煙 --> + <div + class="table-operator" + style="margin-top: 5px" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + @click="searchReset" + icon="reload" + >閲嶇疆</a-button> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板</a-button> + <!-- <a-button + type="primary" + icon="download" + @click="handleExportXls('鍘熷洜')" + >瀵煎嚭</a-button> --> + <a-dropdown v-if="selectedRowKeys.length > 0"> + <a-button style="margin-left: 8px"> + 鎵归噺鎿嶄綔 + <a-icon type="down" /> + </a-button> + <a-menu slot="overlay"> + <a-menu-item @click="batchDel"> + <a-icon type="delete" />鍒犻櫎 + </a-menu-item> + </a-menu> + </a-dropdown> + </div> + + <a-table + ref="table" + bordered + size="middle" + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps:getCheckboxProps}" + @change="handleTableChange" + :scroll="{ x: true}" + > + <template + slot="num" + slot-scope="text" + > + <a-tooltip + placement="top" + :title="text" + trigger="hover" + > + <div> + <template slot="title"> </template> + <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> + </div> + </a-tooltip> + </template> + <template + slot="name" + slot-scope="text" + > + <a-tooltip + placement="top" + :title="text" + trigger="hover" + > + <div> + <template slot="title"> </template> + <p style="cusor:pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: 130px;">{{ text }}</p> + </div> + </a-tooltip> + </template> + <span + slot="action" + slot-scope="text, record" + > + <a + href="javascript:;" + @click="handleDetail(record)" + >璇︽儏</a> + <a-divider type="vertical" /> + <a-dropdown> + <a class="ant-dropdown-link"> + 鏇村 + <a-icon type="down" /> + </a> + <a-menu slot="overlay"> + <a-menu-item> + <a @click="handleEdit(record)">缂栬緫</a> + </a-menu-item> + + <a-menu-item v-if="record.nextAreas.length==0"> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + <a-menu-item v-else> + <a-popconfirm title="褰撳墠淇℃伅宸茶寮曠敤锛岃鍏堝垹闄ゅ叧鑱斾俊鎭悗鍐嶆墽琛屽垹闄ゆ搷浣�"> + <a class="frozenRowClass">鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + <site-area-line-model + ref="modalForm" + @ok="modalFormOk" + ></site-area-line-model> + </a-card> +</template> + +<script> +import { requestPut, deleteAction, getAction } from '@/api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import SiteAreaLineModel from './SiteAreaLineModel' +import JInput from '@/components/jeecg/JInput' +import JEllipsis from '@/components/jeecg/JEllipsis' + +export default { + name: 'SiteAreaLine2List', + mixins: [JeecgListMixin], + components: { + SiteAreaLineModel, + JInput, + JEllipsis, + }, + props: { + nodeSelected: { + type: Object, + default: {} + } + }, + data() { + return { + dataSource: [], + //榛樿鎺掑簭 + isorter: { + column: 'num', + order: 'asc', + }, + + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + align: 'center', + customRender: function (t, r, index) { + return parseInt(index) + 1 + }, + width: 50, + }, + { + title: '缂栫爜', + align: "center", + dataIndex: 'num', + }, + { + title: '鍚嶇О', + align: "center", + dataIndex: 'name', + }, + { + title: '鍒涘缓浜�', + align: "center", + dataIndex: 'createBy', + }, + { + title: '鍒涘缓鏃堕棿', + align: "center", + dataIndex: 'createTime', + }, + { + title: '鎿嶄綔', + align: "center", + dataIndex: 'action', + scopedSlots: { + customRender: 'action', + }, + width: 150, + fixed: 'right', + }, + ], + url: { + list: "/base/area/getAlllist", + delete: "/base/area/delete", + deleteBatch: "/base/area/deleteBatch", + exportXlsUrl: '/eam/faultCause/exportXls', + // importExcelUrl: 'base/site/importExcel', + }, + //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� + alterFlag: "", + parentNum: "-1", + parentName: "涓績/宸ュ尯/宸ユ", + }; + }, + methods: { + + getCheckboxProps(record) { + return ({ + props: { + disabled: !(record.nextAreas.length == 0), + } + }) + }, + + //绂佺敤鐘舵�佹牱寮� + tableRowClass(record, index) { + if (record.status != "1") { + return "frozenRowClass"; + } + return ""; + }, + + handleActive(id) { + let that = this; + requestPut(that.url.active, {}, { id: id }).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.loadData(); + } else { + that.$message.warning(res.message); + } + }); + }, + handleAdd: function () { + this.$refs.modalForm.add({ parentNum: this.parentNum, parentName: this.parentName }); + this.$refs.modalForm.title = "鏂板"; + this.$refs.modalForm.disableSubmit = false; + // this.$refs.modalForm.parentId = this.nodeSelected.key; + this.$refs.modalForm.parentId = !this.nodeSelected.key ? '-1' : this.nodeSelected.key; + }, + handleDelete: function (id) { + if (!this.url.delete) { + this.$message.error("璇疯缃畊rl.delete灞炴��!") + return + } + var that = this; + deleteAction(that.url.delete, { id: id }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(1) + that.$message.success(res.message); + that.loadData(); + that.alterFlag = new Date(); + } else { + that.$message.warning(res.message); + } + }); + }, + + batchDel: function () { + if (!this.url.deleteBatch) { + this.$message.error("璇疯缃畊rl.deleteBatch灞炴��!") + return + } + if (this.selectedRowKeys.length <= 0) { + this.$message.warning('璇烽�夋嫨涓�鏉¤褰曪紒'); + return; + } else { + var ids = ""; + for (var a = 0; a < this.selectedRowKeys.length; a++) { + ids += this.selectedRowKeys[a] + ","; + } + var that = this; + this.$confirm({ + title: "纭鍒犻櫎", + content: "鏄惁鍒犻櫎閫変腑鏁版嵁?", + onOk: function () { + that.loading = true; + deleteAction(that.url.deleteBatch, { ids: ids }).then((res) => { + if (res.success) { + //閲嶆柊璁$畻鍒嗛〉闂 + that.reCalculatePage(that.selectedRowKeys.length) + that.$message.success(res.message); + that.loadData(); + that.onClearSelected(); + that.alterFlag = new Date(); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.loading = false; + }); + } + }); + } + }, + + searchReset() { + this.queryParam = {}; + this.queryParam.parentId = this.nodeSelected.key; + this.loadData(1); + }, + }, + watch: { + alterFlag() { + this.$bus.$emit('queryTreeData'); + }, + nodeSelected() { + this.queryParam = {}; + this.queryParam.parentId = this.nodeSelected.key; + this.parentNum = !this.nodeSelected.rfield1 ? '-1' : this.nodeSelected.rfield1; + this.parentName = !this.nodeSelected.rfield2 ? '涓浗鑸彂' : this.nodeSelected.rfield2; + this.loadData(1); + }, + }, + created() { + this.queryParam = {}; + this.queryParam.parentId = this.nodeSelected.key; + this.loadData(1); + } + + +} +</script> +<style> +@import '~@assets/less/common.less'; + +.frozenRowClass { + color: #c9c9c9; +} +.success { + color: green; +} +.error { + color: red; +} +.fontweight { + font-weight: bold; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/siteAreaLine/SiteAreaLineLeft.vue b/src/views/eam/modules/siteAreaLine/SiteAreaLineLeft.vue new file mode 100644 index 0000000..b41e5ab --- /dev/null +++ b/src/views/eam/modules/siteAreaLine/SiteAreaLineLeft.vue @@ -0,0 +1,310 @@ +<template> + <a-card + :loading="cardLoading" + :bordered="false" + title="涓績/宸ュ尯/宸ユ" + style="height: 100%;" + > + <a-spin :spinning="loading"> + <a-alert + type="info" + :showIcon="true" + style="margin-right: 54px;" + > + <div slot="message"> + 褰撳墠锛�<span v-if="this.currSelected.title">{{ getCurrSelectedTitle() }}</span> + <a + v-if="this.currSelected.title" + style="margin-left: 10px" + @click="onClearSelected" + >鍙栨秷</a> + </div> + </a-alert> + <div class="drawer-bootom-button"> + <a-dropdown + :trigger="['click']" + placement="bottomCenter" + > + <a-menu slot="overlay"> + <a-menu-item + key="1" + @click="expandAll" + >灞曞紑鎵�鏈�</a-menu-item> + <a-menu-item + key="2" + @click="closeAll" + >鍚堝苟鎵�鏈�</a-menu-item> + <a-menu-item + key="3" + @click="refreshTree" + >鍒锋柊</a-menu-item> + </a-menu> + <a-button> + <a-icon type="bars" /> + </a-button> + </a-dropdown> + </div> + + <a-input-search + @search="handleSearch" + style="width:100%;margin-top: 10px" + placeholder="涓績/宸ュ尯/宸ユ" + allowClear + v-model="searchInput" + @change="handleChange" + /> + + <a-tree + showLine + ref="tree" + :checkStrictly="checkStrictly" + :expandedKeys.sync="expandedKeys" + :selectedKeys="selectedKeys" + :dropdownStyle="{maxHeight:'200px',overflow:'auto'}" + :treeData="treeDataSource" + :autoExpandParent="autoExpandParent" + @select="onSelect" + @expand="onExpand" + > + </a-tree> + </a-spin> + </a-card> +</template> + +<script> +import { getAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import JEllipsis from "@/components/jeecg/JEllipsis" + +export default { + name: 'SiteAreaLineLeft', + components: { + Tooltip, + JEllipsis + }, + props: ['value'], + data() { + return { + searchInput: '', + cardLoading: false, + loading: false, + treeDataSource: [], + selectedKeys: [], + expandedKeys: [], + url: { + treeList: '/base/area/loadTree' + }, + searchValue: '', + dataList: [], + autoExpandParent: true, + checkStrictly: true, + allTreeKeys: [], + currSelected: {}, + hiding: false, + } + }, + created() { + this.queryTreeData(); + this.closeAll(); + }, + methods: { + getCurrSelectedTitle() { + return !this.currSelected.title ? '' : this.currSelected.title; + }, + onClearSelected() { + this.hiding = true; + this.currSelected = {}; + this.selectedKeys = []; + }, + onSelect(selectedKeys, e) { + this.hiding = false; + let record = e.node.dataRef; + this.currSelected = Object.assign({}, record); + this.selectedKeys = [record.key]; + }, + onExpand(expandedKeys) { + this.expandedKeys = expandedKeys; + this.autoExpandParent = false; + }, + queryTreeData() { + this.loading = true; + this.cardLoading = true; + getAction(this.url.treeList).then((res) => { + if (res.success) { + this.dataList = []; + this.allTreeKeys = []; + this.treeDataSource = res.result; + this.generateList(res.result); + } else { + this.$message.warn(res.message); + } + }).finally(() => { + this.loading = false; + this.cardLoading = false; + }) + }, + handleChange() { + let search = this.searchInput; + let expandedKeys = this.dataList + .map(item => { + if (item.title.indexOf(search) > -1) { + return this.getParentKey(item.key, this.treeDataSource); + } + return null; + }) + .filter((item, i, self) => item && self.indexOf(item) === i); + Object.assign(this, { + expandedKeys, + searchValue: search, + autoExpandParent: true, + }); + }, + handleSearch(value) { + let search = value; + let expandedKeys = this.dataList + .map(item => { + if (item.title.indexOf(search) > -1) { + return this.getParentKey(item.key, this.treeDataSource); + } + return null; + }) + .filter((item, i, self) => item && self.indexOf(item) === i); + Object.assign(this, { + expandedKeys, + searchValue: search, + autoExpandParent: true, + }); + }, + getParentKey(key, tree) { + let parentKey; + for (let i = 0; i < tree.length; i++) { + const node = tree[i]; + if (node.children) { + if (node.children.some(item => item.key === key)) { + parentKey = node.key; + } else if ( + this.getParentKey(key, node.children)) { + parentKey = this.getParentKey(key, node.children); + } + } + } + return parentKey; + }, + + generateList(data) { + for (let i = 0; i < data.length; i++) { + const node = data[i]; + const key = node.key; + const title = node.title; + // const type = node.type; + + this.dataList.push({ key, title: title }); + this.allTreeKeys.push(key); + if (node.children) { + this.generateList(node.children); + } + } + }, + expandAll() { + this.expandedKeys = this.allTreeKeys; + }, + closeAll() { + this.expandedKeys = ['-1']; + }, + refreshTree() { + this.queryTreeData(); + } + }, + mounted() { + this.$bus.$on('queryTreeData', this.queryTreeData); + }, + //鐩戝惉 + watch: { + currSelected(val) {//鐩戝惉currSelected 鍙樺寲锛屽皢鍙樺寲鍚庣殑鏁板�间紶閫掔粰 getCurrSelected 浜嬩欢 + this.$bus.$emit('getCurrSelected', val); + }, + } +} +</script> + +<style> +.replaceSearch { + color: #00090f; + font-weight: bold; + background-color: rgb(204, 204, 204); +} +/* .ant-select-disabled { + color: rgba(241, 16, 16, 0.25); +} +.ant-select-disabled .ant-select-selection { + background: #a76b6b; +} */ +/*闅愯棌鏍戠殑榛樿icon*/ +.ant-tree-switcher-noop { + display: none !important; +} +/*闅愯棌鏍戠殑榛樿绔栫嚎*/ +.ant-tree.ant-tree-show-line li:not(:last-child):before { + border-left: 0px; +} + +.ant-card-body .table-operator { + margin: 15px; +} + +.anty-form-btn { + width: 100%; + text-align: center; +} + +.anty-form-btn button { + margin: 0 5px; +} + +.anty-node-layout .ant-layout-header { + padding-right: 0; +} + +.header { + padding: 0 8px; +} + +.header button { + margin: 0 3px; +} + +.ant-modal-cust-warp { + height: 100%; +} + +.ant-modal-cust-warp .ant-modal-body { + height: calc(100% - 110px) !important; + overflow-y: auto; +} + +.ant-modal-cust-warp .ant-modal-content { + height: 90% !important; + overflow-y: hidden; +} + +#app .desktop { + height: auto !important; +} + +/** Button鎸夐挳闂磋窛 */ +.ant-btn { + margin-left: 3px; +} +.ant-alert { + padding: 5px 15px 5px 37px; +} +.drawer-bootom-button { + position: absolute; + top: 1px; + /* padding: 10px 16px; */ + text-align: left; + right: 0; + background: #fff; + border-radius: 0 0 2px 2px; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/siteAreaLine/SiteAreaLineModel.vue b/src/views/eam/modules/siteAreaLine/SiteAreaLineModel.vue new file mode 100644 index 0000000..d54abed --- /dev/null +++ b/src/views/eam/modules/siteAreaLine/SiteAreaLineModel.vue @@ -0,0 +1,279 @@ +<template> + <a-modal + :title="title" + :width="650" + :visible="visible" + :maskClosable="false" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + + <a-row + hidden + :gutter="24" + > + <a-col :span="24"> + <a-form-item + label="涓婄骇鏁呴殰鍘熷洜缂栧彿锛�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヤ笂绾ф晠闅滃師鍥犵紪鍙�'" + v-decorator="['parentNum', validatorRules.parentNum ]" + /> + </a-form-item> + </a-col> + </a-row> + <a-row + hidden + :gutter="24" + > + <a-col :span="24"> + <a-form-item + label="涓婄骇鏁呴殰鍘熷洜鍚嶇О锛�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="true" + :placeholder="disableSubmit?'':'璇疯緭鍏ヤ笂绾ф晠闅滃師鍥犲悕绉�'" + v-decorator="['parentName', validatorRules.parentName ]" + /> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + label="缂栧彿锛�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + :disabled="disableSubmit" + allow-clear + :placeholder="disableSubmit?'':'璇疯緭鍏ョ紪鐮�'" + v-decorator="['num', validatorRules.num ]" + /> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + label="鍚嶇О锛�" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + > + <a-input + allow-clear + :disabled="disableSubmit" + :placeholder="disableSubmit?'':'璇疯緭鍏ュ悕绉�'" + v-decorator="['name', validatorRules.name ]" + /> + </a-form-item> + </a-col> + </a-row> + + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="澶囨敞" + > + <a-textarea + allow-clear + :disabled="disableSubmit" + :placeholder="disableSubmit?'':'璇疯緭鍏ュ娉�'" + v-decorator="['remark', validatorRules.remark]" + /> + </a-form-item> + </a-col> + </a-row> + + </a-form> + </a-spin> + + <template slot="footer"> + <a-button + :style="{marginRight: '8px'}" + @click="handleCancel" + > + 鍏抽棴 + </a-button> + <!-- <a-button + v-if="!this.model.id" + :disabled="disableSubmit || confirmLoading" + :loading="confirmLoading" + @click="handleOk" + type="primary" + >淇濆瓨骞剁户缁柊澧�</a-button> --> + <a-button + :disabled="disableSubmit || confirmLoading" + :loading="confirmLoading" + @click="handleOk" + type="primary" + >淇濆瓨</a-button> + <!-- icon="save" --> + </template> + + </a-modal> +</template> + +<script> +import pick from 'lodash.pick' +import { getAction, postAction, requestPut } from '@/api/manage' +import { duplicateCheck } from '@/api/api' + +export default { + name: 'SiteAreaLineModel', + data() { + return { + title: "鎿嶄綔", + visible: false, + codeDisable: true, + disableSubmit: false, + parentId: '', + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + form: this.$form.createForm(this), + validatorRules: { + num: { + rules: [ + { required: true, message: '璇疯緭鍏ョ紪鍙�!' }, + // { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, + // { validator: this.validateNum }, + ] + }, + name: { + rules: [ + { required: true, message: '璇疯緭鍏ュ悕绉�!' }, + // { min: 2, max: 30, message: '闀垮害鍦� 2 鍒� 30 涓瓧绗�', trigger: 'blur' }, + // { validator: this.validateName }, + ] + }, + remark: { + rules: [ + { min: 0, max: 100, message: '闀垮害涓嶈秴杩� 100 涓瓧绗�', trigger: 'blur' }, + ] + } + }, + url: { + add: "/base/area/add", + edit: "/base/area/edit", + }, + //鏂板銆佺紪杈戙�佸垹闄ゃ�佹壒閲忓垹闄ゆ搷浣滄敼鍙樻暟鎹悗鍒锋柊鍏宠仈鐨勭粍浠剁殑鐩戝惉灞炴�� + alterFlag: "" + } + }, + created() { + }, + methods: { + + add(record) { + this.edit(record); + }, + + edit(record) { + this.form.resetFields(); + this.model = Object.assign({}, record); + this.visible = true; + this.disableSubmit = false; + this.$nextTick(() => { + this.form.setFieldsValue(pick(this.model, 'parentNum', 'parentName', 'num', 'name', 'remark')) + }); + if (record.id) { + this.codeDisable = true; + } else { + this.codeDisable = false; + } + }, + + close() { + this.$emit('close'); + this.visible = false; + }, + + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.form.validateFields((err, values) => { + if (!err) { + that.confirmLoading = true; + let formData = Object.assign(this.model, values); + let obj; + if (!this.model.id) { + formData.parentId = this.parentId + obj = postAction(this.url.add, formData); + } else { + obj = requestPut(this.url.edit, formData, { id: this.model.id }); + } + obj.then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + that.alterFlag = new Date(); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + that.close(); + }) + } + }) + }, + + handleCancel() { + this.close() + }, + }, + watch: { + alterFlag() { + this.$bus.$emit('queryTreeData'); + }, + } +} +</script> + +<style scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +</style> \ No newline at end of file diff --git a/src/views/eam/modules/siteAreaLine/SiteAreaLineRight.vue b/src/views/eam/modules/siteAreaLine/SiteAreaLineRight.vue new file mode 100644 index 0000000..8fdbd34 --- /dev/null +++ b/src/views/eam/modules/siteAreaLine/SiteAreaLineRight.vue @@ -0,0 +1,36 @@ +<template> + <keep-alive> + <site-area-line-2-list + v-if="nodeType === 0" + :nodeSelected="nodeSelected" + ></site-area-line-2-list> + </keep-alive> +</template> + +<script> +import SiteAreaLine2List from "./SiteAreaLine2List"; +export default { + name: 'FaultCauseRight', + components: { + SiteAreaLine2List, + }, + data() { + return { + description: '涓績/宸ュ尯/宸ユ', + currentOrgCode: '', + nodeType: 0, + nodeSelected: {} + } + }, + methods: {}, + mounted() { + this.$bus.$on('getCurrSelected', (data) => { //getCurrSelected 浜嬩欢 鎺ユ敹缁勪欢浼犻�掔殑鍙傛暟 + this.nodeType = (data.type == undefined ? 0 : data.type); + this.nodeSelected = data; + }) + }, +} +</script> + +<style scoped> +</style> \ No newline at end of file -- Gitblit v1.9.3