| | |
| | | <el-aside width="200px" v-loading="showGrouploading"> |
| | | <el-container> |
| | | <el-main class="nopadding"> |
| | | <el-tree ref="group" class="menu" node-key="id" :data="group" :current-node-key="''" |
| | | :highlight-current="true" :expand-on-click-node="false" |
| | | :default-expanded-keys="[1]" :filter-node-method="groupFilterNode" |
| | | @node-click="groupClick"></el-tree> |
| | | <el-tree ref="group" class="menu" node-key="id" :data="group" |
| | | :current-node-key="treeCheckKey" :highlight-current="true" |
| | | :expand-on-click-node="false" :check-on-click-node="true" |
| | | :default-expanded-keys="[1]" :render-content="renderContent" |
| | | :filter-node-method="groupFilterNode" @node-click="groupClick1"></el-tree> |
| | | </el-main> |
| | | </el-container> |
| | | </el-aside> |
| | |
| | | </div> |
| | | </el-header> |
| | | <el-main class="nopadding"> |
| | | <scTable ref="table" :apiObj="apiObj" @selection-change="selectionChange" stripe |
| | | remoteSort remoteFilter> |
| | | <scTable ref="table" :params="params" :apiObj="apiObj" |
| | | @selection-change="selectionChange" stripe> |
| | | <el-table-column type="selection" width="50"></el-table-column> |
| | | <el-table-column label="å·¥ä½ç¼å·" prop="id" width="120" |
| | | sortable='custom'></el-table-column> |
| | |
| | | <el-container> |
| | | <el-main class="nopadding"> |
| | | <el-tree ref="group" class="menu" node-key="id" :data="group" |
| | | :current-node-key="treeCheckKey" |
| | | :highlight-current="true" |
| | | :expand-on-click-node="false" |
| | | :check-on-click-node="true" |
| | | :default-expanded-keys="[1]" |
| | | :render-content="renderContent" |
| | | :filter-node-method="groupFilterNode" |
| | | @node-click="groupClick"></el-tree> |
| | | :current-node-key="treeCheckKey" :highlight-current="true" |
| | | :expand-on-click-node="false" :check-on-click-node="true" |
| | | :default-expanded-keys="[1]" :render-content="renderContent" |
| | | :filter-node-method="groupFilterNode" @node-click="groupClick"></el-tree> |
| | | </el-main> |
| | | </el-container> |
| | | </el-aside> |
| | | <el-container> |
| | | <el-main class="" v-show="addGroupShow"> |
| | | <el-form |
| | | v-show="treeCheckedNode.id == 1" |
| | | :model="form" :rules="rules" ref="dialogForm" label-width="200px" |
| | | label-position="left"> |
| | | <el-form v-show="treeCheckedNode.id == 1" :model="form" :rules="rules" ref="dialogForm" |
| | | label-width="200px" label-position="left"> |
| | | <el-form-item label="产线æ ç¾" prop="groupTag"> |
| | | <el-select v-model="form.groupTag" clearable placeholder="产线æ ç¾" |
| | | style="width: 240px"> |
| | |
| | | placeholder="夿³¨"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-form v-show="group_tag.map(item => item.dictKey).includes(treeCheckedNode.groupTag) || beltline_type.map(item => item.dictKey).includes(treeCheckedNode.groupTag) || treeCheckedNode.id == 101" |
| | | <el-form |
| | | v-show="group_tag.map(item => item.dictKey).includes(treeCheckedNode.groupTag) || beltline_type.map(item => item.dictKey).includes(treeCheckedNode.groupTag) || treeCheckedNode.id == 101" |
| | | :model="form" :rules="rules" ref="dialogForm" label-width="200px" |
| | | label-position="left"> |
| | | <el-form-item label="å·¥ä½ç»æ ç¾" prop="groupTag"> |
| | |
| | | <el-header v-show="!addGroupShow"> |
| | | <div class="left-panel"> |
| | | <el-button @click="addChild" type="primary" plain>æ°å¢ä¸çº§</el-button> |
| | | <el-button @click="deleteWorkGroup" v-show="!['1', '101'].includes(treeCheckedNode.id)" type="danger" |
| | | <el-button @click="deleteWorkGroup" |
| | | v-show="!['1', '101'].includes(treeCheckedNode.id)" type="danger" |
| | | plain>å é¤</el-button> |
| | | </div> |
| | | </el-header> |
| | |
| | | return { |
| | | showGrouploading: false, |
| | | options: [], |
| | | activeName: '2', |
| | | activeName: '1', |
| | | group: [], |
| | | groupFilterText: '', |
| | | apiObj: '', |
| | | params: {}, |
| | | // -------- |
| | | form: { |
| | | groupTag: '', |
| | |
| | | } |
| | | }, |
| | | watch: { |
| | | activeName() { |
| | | this.queryList() |
| | | activeName: { |
| | | handler(val) { |
| | | this.queryList().then(() => { |
| | | if (val == 1) { |
| | | console.log('>>>>>>>>>>>>>>', this.treeCheckedNode) |
| | | this.apiObj = this.$API.workstation.getList |
| | | this.params = { |
| | | groupId: this.treeCheckedNode.id, |
| | | keyWord: '', |
| | | status: 1, |
| | | type: '' |
| | | } |
| | | this.groupClick1(this.treeCheckedNode) |
| | | } |
| | | }) |
| | | }, |
| | | immediate: true |
| | | }, |
| | | treeCheckedNode: { |
| | | handler(val) { |
| | |
| | | this.queryList() |
| | | }, |
| | | methods: { |
| | | renderContent (h, {node,data}) { |
| | | console.log(node,data) |
| | | renderContent(h, { data }) { |
| | | let img = data.groupTag == 'fms_beltline' |
| | | return h('span',{ |
| | | return h('span', { |
| | | |
| | | }, |
| | | img ? h('img', { |
| | | src: pmsPng |
| | | }, '') : '', |
| | | data.name) |
| | | img ? h('img', { |
| | | src: pmsPng |
| | | }, '') : '', |
| | | data.name) |
| | | }, |
| | | init() { |
| | | this.$API.system.dic.getDic.get({ code: 'beltline_type' }).then(res => { |
| | |
| | | }) |
| | | |
| | | }, |
| | | queryList(flag) { |
| | | async queryList(flag) { |
| | | this.showGrouploading = true |
| | | this.$API.basicdata.getWorkstationGroup.get().then(res => { |
| | | this.treeCheckedNode = {} |
| | | this.treeCheckKey = '' |
| | | return this.$API.workstation.getWorkstationGroup.get().then(res => { |
| | | if (res.code == 200) { |
| | | let data = this.formatData(res.data) |
| | | this.group = data |
| | | this.showGrouploading = false |
| | | // this.$nextTick(() => { |
| | | if (!flag) { |
| | | let parent = res.data.filter(item => item.parentId == 0)[0] |
| | | this.treeCheckedNode = parent |
| | |
| | | this.treeCheckedNode = parent |
| | | this.treeCheckKey = parent.id |
| | | } |
| | | |
| | | let data = this.formatData(res.data) |
| | | this.group = data |
| | | this.showGrouploading = false |
| | | // }) |
| | | |
| | | } |
| | | }) |
| | | }, |
| | |
| | | return newData |
| | | }, |
| | | async saveWorkstationGroup() { |
| | | const validate = await this.$refs.dialogForm.validate().catch(()=>{}) |
| | | if(!validate){ return false } |
| | | const validate = await this.$refs.dialogForm.validate().catch(() => { }) |
| | | if (!validate) { return false } |
| | | if (this.addGroupShow) { |
| | | let data = Object.assign({ |
| | | code: "", |
| | |
| | | status: 1, |
| | | groupType: this.treeCheckedNode.groupType, |
| | | groupCategory: this.treeCheckedNode.groupCategory |
| | | },this.form) |
| | | return this.$API.basicdata.saveWorkstationGroup.post(data).then(res => { |
| | | }, this.form) |
| | | return this.$API.workstation.saveWorkstationGroup.post(data).then(res => { |
| | | console.log(res) |
| | | this.queryList(true) |
| | | }) |
| | | } |
| | | let data = Object.assign({},this.treeCheckedNode,this.form) |
| | | this.$API.basicdata.saveWorkstationGroup.put(data).then(res => { |
| | | let data = Object.assign({}, this.treeCheckedNode, this.form) |
| | | this.$API.workstation.saveWorkstationGroup.put(data).then(res => { |
| | | console.log(res) |
| | | this.queryList(true) |
| | | }) |
| | | }, |
| | | deleteWorkGroup () { |
| | | this.$API.basicdata.deleteWorkGroup.delete({ |
| | | deleteWorkGroup() { |
| | | this.$API.workstation.deleteWorkGroup.delete({ |
| | | groupId: this.treeCheckedNode.id |
| | | }).then(() => { |
| | | this.queryList() |
| | | }) |
| | | }, |
| | | addChild () { |
| | | addChild() { |
| | | this.addGroupShow = true |
| | | this.$refs.dialogForm.resetFields() |
| | | }, |
| | |
| | | |
| | | }, |
| | | groupClick(node) { |
| | | console.log(node) |
| | | this.treeCheckedNode = node |
| | | }, |
| | | groupClick1(data) { |
| | | console.log('-------', data) |
| | | var params = { |
| | | groupId: data.id, |
| | | keyWord: '', |
| | | status: 1, |
| | | type: '' |
| | | } |
| | | this.$refs.table.reload(params) |
| | | }, |
| | | table_add() { |
| | | var newRow = { |
| | | key: "", |