From bdca59f8f15e80e6dc98c1136748124844939472 Mon Sep 17 00:00:00 2001 From: “linengliang” <vanSuperEnergy@163.com> Date: 星期一, 06 十一月 2023 14:56:44 +0800 Subject: [PATCH] 部门修改加导入优化 --- src/views/eam/depart/modules/TeamModal.vue | 341 ++++++++++++ src/views/eam/depart/modules/PermissionTree.vue | 169 ++++++ src/views/dashboard/public/zghf.png | 0 src/views/eam/depart/modules/EquipmentList.vue | 161 +++++ src/views/eam/depart/modules/DepartForm.vue | 156 +++++ src/views/dashboard/Analysis.vue | 7 src/views/eam/depart/modules/DepartList.vue | 169 ++++++ src/views/eam/depart/DepartManage.vue | 416 ++++++++++++++ src/views/eam/depart/modules/DepartModel.vue | 60 ++ src/views/eam/depart/modules/TeamList.vue | 179 ++++++ 10 files changed, 1,655 insertions(+), 3 deletions(-) diff --git a/src/views/dashboard/Analysis.vue b/src/views/dashboard/Analysis.vue index a51d831..05278d8 100644 --- a/src/views/dashboard/Analysis.vue +++ b/src/views/dashboard/Analysis.vue @@ -1,6 +1,6 @@ <template> - <div> - <index-chart v-if="indexStyle==1"></index-chart> + <div style="text-align: center;vertical-align: middle;background-color:white;"> + <!-- <index-chart v-if="indexStyle==1"></index-chart> <index-bdc v-if="indexStyle==2"></index-bdc> <index-task v-if="indexStyle==3"></index-task> <div style="width: 100%;text-align: right;margin-top: 20px"> @@ -10,7 +10,8 @@ <a-radio :value="2">缁熻鍥捐〃2</a-radio> <a-radio :value="3">浠诲姟琛ㄦ牸</a-radio> </a-radio-group> - </div> + </div> --> + <img style="width:1000px; height:900px;" src="./public/zghf.png"> </div> </template> diff --git a/src/views/dashboard/public/zghf.png b/src/views/dashboard/public/zghf.png new file mode 100644 index 0000000..88ead01 --- /dev/null +++ b/src/views/dashboard/public/zghf.png Binary files differ diff --git a/src/views/eam/depart/DepartManage.vue b/src/views/eam/depart/DepartManage.vue new file mode 100644 index 0000000..b68ec77 --- /dev/null +++ b/src/views/eam/depart/DepartManage.vue @@ -0,0 +1,416 @@ +<template> + <a-row + type="flex" + :gutter="16" + > + <a-col + :md="5" + :sm="24" + > + <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" + > + <template + slot="title" + slot-scope="{key,entity,title,isLeaf,value}" + > + <span>{{ title }}</span> + <a-dropdown + :trigger="['click']" + placement="bottomCenter" + > + <a-menu slot="overlay"> + <a-menu-item v-if="key!='-1'"> + <a + href="javascript:;" + @click="handleEdit(entity)" + >缂栬緫</a> + </a-menu-item> + <a-menu-item> + <a + href="javascript:;" + @click="handleAdd({parentId:value,orgCategory:'2'})" + > + 娣诲姞瀛愮被鍒� + </a> + </a-menu-item> + <a-menu-item v-if="key!='-1'&&isLeaf"> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(entity.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + <span :style="{position: 'absolute',right: 0}"> + <a-icon type="down" /> + </span> + </a-dropdown> + </template> + </a-tree> + </a-spin> + </a-card> + </a-col> + <a-col + :md="24-5" + :sm="24" + > + <a-card + :bordered="false" + class="card-area" + title="鍏宠仈鍒楄〃" + style="height: 100%;" + > + <a-tabs defaultActiveKey="1"> + <a-tab-pane tab="閮ㄩ棬鍒楄〃" key="1" forceRender> + <depart-list :mainId="mainId"></depart-list> + </a-tab-pane> + <a-tab-pane tab="閮ㄩ棬鏉冮檺" key="2" forceRender v-if="false"> + <permission-tree :mainId="mainId"></permission-tree> + </a-tab-pane> + <a-tab-pane tab="璁惧鍒楄〃" key="3" forceRender> + <equipment-list :mainId="mainId"></equipment-list> + </a-tab-pane> + <a-tab-pane tab="鐝粍鍒楄〃" key="4" forceRender> + <team-list :mainId="mainId"></team-list> + </a-tab-pane> + </a-tabs> + </a-card> + </a-col> + <depart-model ref='modalForm' @ok='modalFormOk' @reloadTree="refreshTree"></depart-model> + </a-row> +</template> + +<script> +import { getAction } from '@/api/manage' +import Tooltip from 'ant-design-vue/es/tooltip' +import JEllipsis from "@/components/jeecg/JEllipsis" +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { deleteAction } from '../../../api/manage' +import DepartList from './modules/DepartList' +import PermissionTree from './modules/PermissionTree' +import EquipmentList from './modules/EquipmentList' +import TeamList from './modules/TeamList' +import DepartModel from './modules/DepartModel' +export default { + name: 'DepartManage', + mixins: [JeecgListMixin], + components: { + Tooltip, + JEllipsis, + DepartList, + PermissionTree, + EquipmentList, + TeamList, + DepartModel, + }, + data() { + return { + description: '璁惧閮ㄩ棬', + searchInput: '', + disableMixinCreated:true, + cardLoading: false, + loading: false, + treeDataSource: [], + selectedKeys: [], + expandedKeys: [], + mainId:'', + url: { + equipmentCategoryTreeList: '/sys/sysDepart/myTree', + delete: "/sys/sysDepart/delete", + list: "/eam/equipmentCategory/getAllChildren", + }, + 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]; + this.mainId = record.key; + }, + onExpand(expandedKeys) { + this.expandedKeys = expandedKeys; + this.autoExpandParent = false; + }, + queryTreeData() { + this.loading = true; + this.cardLoading = true; + getAction(this.url.equipmentCategoryTreeList).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; + }, + handleDelete(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.queryTreeData(); + that.$bus.$emit('loadData') + that.alterFlag = new Date(); + } else { + that.$message.warning(res.message); + } + }); + }, + 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(); + }, + handleAdd(record){ + this.$refs.modalForm.title = "鏂板" + this.$refs.modalForm.add(record); + } + }, +} +</script> + +<style scoped> +@import '~@assets/less/common.less'; +.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/depart/modules/DepartForm.vue b/src/views/eam/depart/modules/DepartForm.vue new file mode 100644 index 0000000..c5dedd0 --- /dev/null +++ b/src/views/eam/depart/modules/DepartForm.vue @@ -0,0 +1,156 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model + ref="form" + :model="model" + :rules="validatorRules" + slot="detail" + > + <a-row :gutter="24"> + <a-col :span="24"> + <a-form-item + :labelCol="labelCol" + :wrapperCol="wrapperCol" + label="鐖剁骇閮ㄩ棬" + prop="parentId" + > + <j-dict-select-tag + allow-clear + placeholder="璇烽�夋嫨鐖剁骇閮ㄩ棬" + :triggerChange="true" + dictCode="sys_depart,depart_name,id,del_flag = '0'" + v-model="model.parentId" + :disabled="true" + /> + </a-form-item> + </a-col> + </a-row> + <a-row> + <a-col :span="24"> + <a-form-model-item + label="缂栫爜" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="orgCode" + > + <a-input + v-model="model.orgCode" + placeholder="璇疯緭鍏ョ紪鐮�" + ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item + label="鍚嶇О" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="departName" + > + <a-input + v-model="model.departName" + placeholder="璇疯緭鍏ュ悕绉�" + ></a-input> + </a-form-model-item> + </a-col> + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + +import { httpAction, getAction } from '@/api/manage' +import { validateDuplicateValue } from '@/utils/util' + +export default { + name: 'RepairPlanTypeForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data() { + return { + model: { + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + orgCode: [ + { required: true, message: '璇疯緭鍏ョ紪鐮�!' }, + { validator: (rule, value, callback) => validateDuplicateValue('sys_depart', 'org_code', value, this.model.id, callback) }, + ], + departName: [ + { required: true, message: '璇疯緭鍏ュ悕绉�!' }, + { validator: (rule, value, callback) => validateDuplicateValue('sys_depart', 'depart_name', value, this.model.id, callback) }, + ], + }, + url: { + add: "/sys/sysDepart/add", + edit: "/sys/sysDepart/edit", + } + } + }, + computed: { + formDisabled() { + return this.disabled + }, + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add(record) { + this.edit(record); + }, + edit(record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + 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'; + } + 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; + }) + } + + }) + }, + } +} +</script> \ No newline at end of file diff --git a/src/views/eam/depart/modules/DepartList.vue b/src/views/eam/depart/modules/DepartList.vue new file mode 100644 index 0000000..c240209 --- /dev/null +++ b/src/views/eam/depart/modules/DepartList.vue @@ -0,0 +1,169 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + export default { + name: "DepartList", + mixins:[JeecgListMixin], + components: { }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['parentId'] = val + this.queryParam['delFlag'] = '0' + this.loadData(1); + } + } + } + }, + data () { + return { + description: '鏉愭枡鍑哄簱鍗曠鐞嗛〉闈�', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:40, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'閮ㄩ棬缂栫爜', + align:"center", + dataIndex: 'orgCode', + width:100, + }, + { + title:'閮ㄩ棬鍚嶇О', + align:"center", + dataIndex: 'departName', + ellipsis:true, + width:100, + }, + { + title:'鍒涘缓浜�', + align:"center", + dataIndex: 'createBy', + width:100, + }, + { + title:'鍒涘缓鏃ユ湡', + align:"center", + dataIndex: 'createTime', + width:100, + }, + { + title:'鏇存柊浜�', + align:"center", + dataIndex: 'updateBy', + width:100, + }, + { + title:'鏇存柊鏃ユ湡', + align:"center", + dataIndex: 'updateTime', + width:100, + }, + ], + url: { + list: "/sys/sysDepart/list", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + }, + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/eam/depart/modules/DepartModel.vue b/src/views/eam/depart/modules/DepartModel.vue new file mode 100644 index 0000000..a954cb4 --- /dev/null +++ b/src/views/eam/depart/modules/DepartModel.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + > + <depart-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></depart-form> + </j-modal> +</template> + +<script> + import DepartForm from './DepartForm' + export default { + name: "DepartModal", + components: { + DepartForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(record); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('reloadTree'); + this.visible = false; + }, + handleCancel () { + this.close() + }, + + } + } +</script> \ No newline at end of file diff --git a/src/views/eam/depart/modules/EquipmentList.vue b/src/views/eam/depart/modules/EquipmentList.vue new file mode 100644 index 0000000..3dd606f --- /dev/null +++ b/src/views/eam/depart/modules/EquipmentList.vue @@ -0,0 +1,161 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + export default { + name: "EquipmentList", + mixins:[JeecgListMixin], + components: { }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['useId'] = val + this.loadData(1); + } + } + } + }, + data () { + return { + description: '鏉愭枡鍑哄簱鍗曠鐞嗛〉闈�', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:40, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title: '璁惧绫诲瀷', + align: "center", + dataIndex: 'equipmentCategoryId_dictText', + width:100 + }, + { + title: '缁熶竴缂栫爜', + align: "center", + dataIndex: 'num', + width:100 + }, + { + title: '璁惧鍚嶇О', + align: "center", + dataIndex: 'name', + width:100 + }, + { + title: '鍨嬪彿', + align: "center", + dataIndex: 'model', + width:100 + }, + { + title: '瑙勬牸', + align: "center", + dataIndex: 'specification', + width:100 + }, + ], + url: { + list: "/eam/equipment/getEquipmentList", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + }, + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/eam/depart/modules/PermissionTree.vue b/src/views/eam/depart/modules/PermissionTree.vue new file mode 100644 index 0000000..c2713aa --- /dev/null +++ b/src/views/eam/depart/modules/PermissionTree.vue @@ -0,0 +1,169 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange"> + + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + + </a-table> + </div> + </a-card> +</template> + +<script> + + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + export default { + name: "UpdateABC", + mixins:[JeecgListMixin], + components: { }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['equipmentId'] = val + this.queryParam['updateType'] = 'ABC' + this.loadData(1); + + } + } + } + }, + data () { + return { + description: '鏉愭枡鍑哄簱鍗曠鐞嗛〉闈�', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'ABC鏍囪瘑锛堟棫锛�', + align:"center", + dataIndex: 'oldAbcTag_dictText', + width:300 + }, + { + title:'ABC鏍囪瘑锛堟柊锛�', + align:"center", + dataIndex: 'newAbcTag_dictText', + width:300 + }, + { + title:'鍙樻洿鏃ユ湡', + align:"center", + dataIndex: 'updateDate', + width:300 + }, + { + title:'鍙樻洿浜�', + align:"center", + dataIndex: 'updatePerson_dictText', + width:300 + }, + { + title:'澶囨敞', + align:"center", + dataIndex: 'remark', + width:300 + }, + ], + url: { + list: "/eam/equipmentUpdateInfo/list", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + } + + }, + mounted(){ + this.$bus.$on('loadData', (data) => { + this.loadData(); + }); + } + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/eam/depart/modules/TeamList.vue b/src/views/eam/depart/modules/TeamList.vue new file mode 100644 index 0000000..dfb94ff --- /dev/null +++ b/src/views/eam/depart/modules/TeamList.vue @@ -0,0 +1,179 @@ +<template> + <a-card :bordered="false" :class="'cust-erp-sub-tab'"> + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + </a-row> + </a-form> + </div> + <!-- <div class="table-operator"> + <a-button + @click="handleAdd" + type="primary" + icon="plus" + >鏂板鐝粍</a-button> + </div> --> + <div> + <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> + <i class="anticon anticon-info-circle ant-alert-icon"></i> 宸查�夋嫨 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>椤� + <a style="margin-left: 24px" @click="onClearSelected">娓呯┖</a> + </div> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :scroll="{x:true}" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + @change="handleTableChange"> + <template slot="htmlSlot" slot-scope="text"> + <div v-html="text"></div> + </template> + <template slot="imgSlot" slot-scope="text,record"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犲浘鐗�</span> + <img v-else :src="getImgView(text)" :preview="record.id" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> + </template> + <template slot="fileSlot" slot-scope="text"> + <span v-if="!text" style="font-size: 12px;font-style: italic;">鏃犳枃浠�</span> + <a-button + v-else + :ghost="true" + type="primary" + icon="download" + size="small" + @click="downloadFile(text)"> + 涓嬭浇 + </a-button> + </template> + + <span slot="action" slot-scope="text, record"> + <a @click="handleEdit(record)">缂栬緫</a> + <a-divider type="vertical" /> + <a-popconfirm title="纭畾鍒犻櫎鍚�?" @confirm="() => handleDelete(record.id)"> + <a>鍒犻櫎</a> + </a-popconfirm> + </span> + </a-table> + </div> + <team-modal ref='modalForm' @ok='modalFormOk' :mainId="mainId"></team-modal> + </a-card> +</template> +<script> +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import TeamModal from './TeamModal.vue' + export default { + name: "TeamList", + mixins:[JeecgListMixin], + components: {TeamModal }, + props:{ + mainId:{ + type:String, + default:'', + required:false + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else if(val!=='-1'){ + this.queryParam['departId'] = val + this.queryParam['delFlag'] = '0' + this.loadData(1); + }else{ + this.queryParam['delFlag'] = '0' + this.loadData(1); + } + } + } + }, + data () { + return { + description: '鏉愭枡鍑哄簱鍗曠鐞嗛〉闈�', + disableMixinCreated:true, + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key:'rowIndex', + width:60, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title:'鐝粍缂栫爜', + align:"center", + dataIndex: 'num', + width:100 + }, + { + title:'鐝粍鍚嶇О', + align:"center", + dataIndex: 'name', + width:100 + }, + { + title:'鍒涘缓浜�', + align:"center", + dataIndex: 'createBy', + width:100, + }, + { + title:'鍒涘缓鏃ユ湡', + align:"center", + dataIndex: 'createTime', + width:100, + }, + { + title:'鏇存柊浜�', + align:"center", + dataIndex: 'updateBy', + width:100, + }, + { + title:'鏇存柊鏃ユ湡', + align:"center", + dataIndex: 'updateTime', + width:100, + }, + ], + url: { + list: "/base/team/list", + }, + dictOptions:{ + } + } + }, + created() { + }, + computed: { + importExcelUrl(){ + return `${window._CONFIG['domianURL']}/${this.url.importUrl}/${this.mainId}`; + } + }, + methods: { + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + }, + handleAdd(){ + this.$refs.modalForm.title = "鏂板" + this.$refs.modalForm.visible = true; + } + }, + + } +</script> +<style scoped> + @import '~@assets/less/common.less' +</style> diff --git a/src/views/eam/depart/modules/TeamModal.vue b/src/views/eam/depart/modules/TeamModal.vue new file mode 100644 index 0000000..fb4616e --- /dev/null +++ b/src/views/eam/depart/modules/TeamModal.vue @@ -0,0 +1,341 @@ +<template> + <a-modal + :title="title" + :width="1600" + :visible="visible" + :confirmLoading="confirmLoading" + :okButtonProps="{ props: {disabled: disableSubmit} }" + @ok="handleOk" + @cancel="handleCancel" + cancelText="鍏抽棴" + > + <a-spin :spinning="confirmLoading"> + <a-form :form="form"> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + <a-col + :md="6" + :sm="8" + > + <a-form-item label="鍗曟嵁鍙�"> + <j-input + placeholder="璇疯緭鍏ュ崟鎹彿妫�绱�" + v-model="queryParam.num" + ></j-input> + </a-form-item> + </a-col> + + <a-col + :md="6" + :sm="8" + > + <a-form-item label="璁惧鍚嶇О"> + <j-input + placeholder="璇疯緭鍏ヨ澶囧悕绉版绱�" + v-model="queryParam.equipmentName" + ></j-input> + </a-form-item> + </a-col> + <a-col + :md="6" + :sm="8" + > + <a-button + type="primary" + @click="searchQuery" + icon="search" + >鏌ヨ</a-button> + <a-button + @click="searchReset" + icon="reload" + style="margin-left:8px;" + >閲嶇疆</a-button> + </a-col> + </a-row> + <a-row :gutter="24"> + <a-col :span="24"> + + </a-col> + </a-row> + </a-form> + </div> + <div style="margin-top:8px;"> + <a-table + ref="table" + size="middle" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="confirmLoading" + @change="handleTableChange" + :customRow="clickThenCheck" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + > + <span slot="faultDescription" slot-scope="text"> + <j-ellipsis :value="text" :length="10" /> + </span> + </a-table> + </div> + </a-form> + </a-spin> + + </a-modal> +</template> + +<script> + +import { postAction, getAction } from '@/api/manage' +import JDate from '@/components/jeecg/JDate' +import Tooltip from 'ant-design-vue/es/tooltip' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JEllipsis from '@/components/jeecg/JEllipsis'//寮曞叆杩囬暱瑁佸壀 +import store from '@/store' + +export default { + name: "FaultReportRepair", + mixins: [JeecgListMixin], + components: { + JDate, + Tooltip, + JEllipsis, + store + }, + props:{ + mainId:{ + type:String, + required:false, + default:"", + } + }, + watch:{ + mainId:{ + immediate: true, + handler(val) { + if(!this.mainId){ + this.clearList() + }else{ + this.queryParam['noEqId'] = val + this.loadData(1); + } + } + } + }, + data() { + return { + title: "閫夋嫨鏁呴殰鎶ヤ慨淇℃伅", + visible: false, + model: {}, + dataSource: [], + disableSubmit: false, + type: "radio", + /* 鍒嗛〉鍙傛暟 */ + ipagination: { + current: 1, + pageSize: 10, + pageSizeOptions: ['10', '20', '30'], + showTotal: (total, range) => { + return range[0] + "-" + range[1] + " 鍏�" + total + "鏉�" + }, + showQuickJumper: true, + showSizeChanger: true, + total: 0 + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 6 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 18 }, + }, + confirmLoading: false, + form: this.$form.createForm(this), + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title:'鐝粍缂栫爜', + align:"center", + dataIndex: 'num', + width:100 + }, + { + title:'鐝粍鍚嶇О', + align:"center", + dataIndex: 'name', + width:100 + }, + { + title:'鍒涘缓浜�', + align:"center", + dataIndex: 'createBy', + width:100, + }, + { + title:'鍒涘缓鏃ユ湡', + align:"center", + dataIndex: 'createTime', + width:100, + }, + { + title:'鏇存柊浜�', + align:"center", + dataIndex: 'updateBy', + width:100, + }, + { + title:'鏇存柊鏃ユ湡', + align:"center", + dataIndex: 'updateTime', + width:100, + }, + ], + url: { + list: "/base/team/list", + add: "/eam/repairOrder/addBySelectReport" + }, + } + }, + methods: { + searchQuery() { + this.loadData(1); + }, + searchReset() { + this.queryParam = {}; + this.loadData(1) + }, + clickThenCheck(record) { + return { + on: { + click: (e) => { + this.selectedRowRecord = record; + this.onSelectChange(record.id.split(","), [record]); + } + } + }; + }, + onSelectChange(selectedRowKeys, selectionRows) { + this.selectedRowKeys = selectedRowKeys; + this.selectionRows = selectionRows; + }, + close() { + this.queryParam = {}; + this.$emit('close'); + this.visible = false; + }, + handleOk() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.confirmLoading=true; + if (that.selectedRowKeys.length === 0) { + that.$message.error("璇烽�夋嫨鏁呴殰鎶ヤ慨鍗曞悗鎻愪氦锛�") + return false; + } + postAction(this.url.add,this.selectionRows).then(res=>{ + if(res.success){ + that.$message.success("棰嗗彇鎴愬姛锛�") + that.$emit('ok'); + }else{ + that.$message.error("棰嗗彇鍑虹幇寮傚父锛�") + } + }).finally(res=>{ + that.confirmLoading = false; + that.close(); + }); + }, + handleCancel() { + this.close(); + }, + clearList(){ + this.dataSource=[] + this.selectedRowKeys=[] + this.ipagination.current = 1 + }, + }, +} +</script> +<style scoped> +.ant-btn { + padding: 0 10px; + margin-left: 3px; +} + +.ant-form-item-control { + line-height: 0px; +} + +.fontweight { + font-weight: bold; +} + +/** 涓昏〃鍗曡闂磋窛 */ +.ant-form .ant-form-item { + margin-bottom: 10px; +} + +/** Tab椤甸潰琛岄棿璺� */ +.ant-tabs-content .ant-form-item { + margin-bottom: 0px; +} +.ant-table-tbody .ant-table-row td { + padding-top: 10px; + padding-bottom: 10px; +} + +.anty-row-operator button { + margin: 0 5px; +} + +.ant-btn-danger { + background-color: #ffffff; +} + +.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; +} + .notshow { + display: none; +} + +.frozenRowClass { + color: #c9c9c9; +} +.hight { + color: #f5222d; +} +.middle { + color: #fa8c16; +} +.low { + color: #52c41a; +} +.dataUnKnow { + color: #1890ff; +} .frozenRowClass { + color: #c9c9c9; +} +</style> \ No newline at end of file -- Gitblit v1.9.3