| | |
| | | <template> |
| | | <div v-if="Formlist.length>0"> |
| | | <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :table-loading="loading" |
| | | @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @row-click="handleRowClick"> |
| | | <template slot="menu" slot-scope="{type,size,row,index}"> |
| | | <el-button :size="size" :type="type" icon="el-icon-check" |
| | | @click="handleMaintenance(row, index)">维护 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | <div style="height: calc(100vh - 553px)"> |
| | | <avue-crud ref="crud" :data="data" :option="option" :page.sync="page" :table-loading="loading" |
| | | @on-load="getDataList" @size-change="handleSizePage" @current-change="handleCurrentPage" |
| | | @row-click="handleRowClick"> |
| | | <template slot="menu" slot-scope="{type,size,row,index}"> |
| | | <el-button :size="size" :type="type" icon="el-icon-check" |
| | | @click="handleMaintenance(row, index)">维护 |
| | | </el-button> |
| | | </template> |
| | | </avue-crud> |
| | | </div> |
| | | <el-dialog :visible.sync="dialogNode" append-to-body="true" title="模板阶段" width="50%"> |
| | | <avue-crud ref="crud" :data="stageData" :option="stageOption" :table-loading="loading" @on-load="getStagelist" |
| | | @row-click="handleRowStageClick"> |
| | |
| | | }, |
| | | data() { |
| | | const options = { |
| | | height: "auto", |
| | | height:'auto', |
| | | border: true, |
| | | addBtn: false, |
| | | align: 'center', |
| | |
| | | ], |
| | | option: { |
| | | ...options, |
| | | height: 383, |
| | | height: 330, |
| | | column: [ |
| | | {label: '模板编号', prop: 'modelKey'}, |
| | | {label: '模板名称', prop: 'modelName'}, |
| | |
| | | let param = {size: pageSize, current: currentPage} |
| | | const response = await getFlowpathList({...param, ...{templateId: this.code}}) |
| | | if (response.status === 200) { |
| | | console.log(response) |
| | | this.loading = false |
| | | const data = response.data.data |
| | | this.data = data.records |
| | |
| | | // 获取阶段列表 |
| | | async getStagelist() { |
| | | this.loading = false |
| | | console.log(this.modelKey) |
| | | const response = await stagelist({modelKey: this.modelKey}) |
| | | if (response.status === 200) { |
| | | this.loading = false |
| | | console.log(response.data) |
| | | this.stageData = response.data.data |
| | | } else this.loading = false |
| | | }, |
| | |
| | | } |
| | | return item |
| | | }) |
| | | console.log(datas) |
| | | let dataValue = datas.map(item => item.checked ? item.oid : undefined) |
| | | this.attributeValue = dataValue.filter(item => item) |
| | | this.attributeData = datas |
| | |
| | | }, |
| | | // 维护 |
| | | handleMaintenance(row) { |
| | | console.log(row) |
| | | this.dialogNode = true |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | |
| | | }) |
| | | }, |
| | | handleRowClick(row) { |
| | | console.log(row) |
| | | this.modelKey = row.modelKey |
| | | this.saveParam.modelKey = row.modelKey |
| | | this.dialogNode = true |
| | |
| | | }) |
| | | }, |
| | | async handleSave(event) { |
| | | console.log(event) |
| | | const data = event.map(item => { |
| | | const {id, name, attributeGroup} = item |
| | | return {attrId: id, attrName: name, attrGroup: attributeGroup} |
| | |
| | | processStageAttr: data, |
| | | ...this.saveParam |
| | | } |
| | | console.log(this.saveParam) |
| | | console.log(data) |
| | | const response = await attributeSave(param) |
| | | if (response.status === 200) { |
| | | // loading() |
| | | console.log(response) |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '新增数据成功!' |