From ca420bd9c09b51a404ade3e0106257725df727be Mon Sep 17 00:00:00 2001 From: 田源 <lastanimals@163.com> Date: 星期三, 01 十一月 2023 11:32:28 +0800 Subject: [PATCH] 整合代码 --- Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue | 296 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 262 insertions(+), 34 deletions(-) diff --git a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue index 50a2502..8f23f75 100644 --- a/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue +++ b/Source/UBCS-WEB/src/views/modeling/BusinessAdd.vue @@ -5,6 +5,7 @@ append-to-body @close="closeSubmitDialog" width="70%" + top="6vh" style="height: 115vh;" > <el-form ref="form" :model="btmType" show-message="true" inline size="medium" label-suffix=":" class="btmTypeForm" @@ -15,25 +16,36 @@ <el-form-item label="涓枃鍚嶇О" label-width="100px"> <el-input v-model="btmType.name" :prefix-icon="icons.name"></el-input> </el-form-item> - <el-form-item label="鏁版嵁搴撹〃鍚�" label-width="100px"> + <!-- <el-form-item label="鏁版嵁搴撹〃鍚�" label-width="100px"> <el-input v-model="btmType.tableName" :prefix-icon="icons.tableName"></el-input> - </el-form-item> + </el-form-item> --> <el-form-item label="鎵�灞為鍩�" label-width="100px" prop="domain" class="domainSelect"> - <el-select v-model="btmType.bizDomain" :prefix-icon="icons.domain"> + <el-select placeholder="璇烽�夋嫨棰嗗煙" v-model="btmType.bizDomain" :prefix-icon="icons.domain"> <el-option v-for="item in domainOption" :label="item.label" :value="item.value" :key="item.value"> </el-option> </el-select> </el-form-item> <el-form-item label="鐗堟湰瑙勫垯" label-width="100px"> - <el-input v-model="btmType.revisionRuleName" :prefix-icon="icons.revisionRule" class="revisionRule" - @focus="openRevision" clearable @clear="clearRevision"> - <i slot="suffix" class="el-input__icon el-icon-search"></i> + <el-input v-model="btmType.revisionRuleName" + :prefix-icon="icons.revisionRule" + class="revisionRule" + @focus="openRevision" + clearable + @clear="clearRevision" + :suffix-icon="icons.referType" + placeholder="璇烽�夋嫨锛岀暀绌哄垯涓嶈繘琛岀鐞�"> </el-input> </el-form-item> <el-form-item label="鐢熷懡鍛ㄦ湡" label-width="100px"> - <el-input v-model="btmType.lifeCycleId" :prefix-icon="icons.lifeCycle"> - <i slot="suffix" class="el-input__icon el-icon-search"></i> + <el-input v-model="btmType.lifeCycleName" + :prefix-icon="icons.lifeCycle" + class="lifeCycle" + @focus="openLifeCycle" + clearable + @clear="clearLifeCycle" + :suffix-icon="icons.referType" + placeholder="璇烽�夋嫨锛岀暀绌哄垯涓嶈繘琛岀鐞�"> </el-input> </el-form-item> <div> @@ -67,7 +79,7 @@ <el-tag>{{ row.attrDataTypeText }}</el-tag> </template> <template slot="menu" slot-scope="{row,index}"> - <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row)">缂栬緫 + <el-button icon="el-icon-edit" size="small" type="text" v-if="!row.$cellEdit" @click="cellEditClick(row,index)">缂栬緫 </el-button> <el-button icon="el-icon-delete" size="small" type="text" v-if="!row.$cellEdit" @click="removeFormAttrTable(row,index)">绉婚櫎 @@ -118,7 +130,10 @@ :data="revisionRef.data" :page.sync="revisionRef.page" ref="revisionRef" - @row-click="revisionClick"> + @row-click="revisionClick" + v-loading="revisionRef.loading" + @search-change="searchRevisionRule" + @search-reset="clearSearchRevisionRule"> <template slot="radio" slot-scope="{row}"> <el-radio v-model="revisionRef.selectRow" @@ -131,7 +146,37 @@ <el-button @click="cancelRevision">鍙栨秷</el-button> </div> </el-dialog> + + <!-- 鐢熷懡鍛ㄦ湡鐨勫弬鐓� --> + <el-dialog title="璇烽�夋嫨鐢熷懡鍛ㄦ湡" + :visible.sync="lifeCycleRef.visible" + append-to-body + width="80%"> + + <avue-crud class="lifeCycleRef" + :option="lifeCycleRef.option" + :data="lifeCycleRef.data" + :page.sync="lifeCycleRef.page" + ref="lifeCycleRef" + @row-click="lifeCycleClick" + v-loading="lifeCycleRef.loading" + @search-change="searchLifeCycle" + @search-reset="clearSearchLifeCycle"> + <template slot="radio" + slot-scope="{row}"> + <el-radio v-model="lifeCycleRef.selectRow" + :label="row.$index"> + </el-radio> + </template> + </avue-crud> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="confirmLifeCycle">纭畾</el-button> + <el-button @click="cancelLifeCycle">鍙栨秷</el-button> + </div> + </el-dialog> </el-dialog> + + </template> @@ -140,6 +185,7 @@ import {add, update} from '@/api/omd/btmType'; import {queryPage} from '@/api/omd/OmdAttribute'; import {getPage} from '@/api/omd/revisionRule'; +import {getList} from '@/api/modeling/cycle'; export default { name: 'BusinessAdd', @@ -287,6 +333,71 @@ currentPage: 1, pageSize: 10 }, + loading: false, + selectRow: '', + searchKey: null, + option: { + height: 360, + addBtn: false, + refreshBtn: false, + columnBtn: false, + menu: false, + border: true, + reserveSelection: true, + searchMenuSpan: 8, + searchShowBtn: false, + highlightCurrentRow: true, + column: [{ + label: '閫夋嫨', + prop: 'radio', + width: 60, + hide: false + }, + { + label: '鑻辨枃鍚嶇О', + prop: 'id', + search: true + }, + { + label: "涓枃鍚嶇О", + prop: "name", + search: true, + }, + { + label: "璺宠穬瀛楃", + prop: "skipCode" + }, + { + label: "鍒濆鍊�", + prop: "startCode" + }, + { + label: "姝ラ暱", + prop: "serialStep" + }, + { + label: "鍓嶇紑", + prop: "prefixCode" + }, + { + label: "鍚庣紑", + prop: "suffixCode" + }, + { + label: "鎻忚堪", + prop: "description", + type: "textarea" + } + ] + }, + }, + lifeCycleRef: { + visible: false, + page: { + currentPage: 1, + pageSize: 10 + }, + loading: false, selectRow: '', searchKey: null, option: { @@ -426,7 +537,7 @@ if (!this.btmType.attributes) { this.btmType.attributes = []; } - console.log(this.attrRef.selectData); + // console.log(this.attrRef.selectData); this.attrRef.selectData.forEach(item => { this.btmType.attributes.push({ id: item.id, @@ -495,33 +606,62 @@ }, // 鍒楄〃缂栬緫 cellEditClick(cell) { - console.log(cell); + // console.log(cell); cell.$cellEdit = true; }, // 鍒楄〃缂栬緫淇濆瓨 - cellEditSave(row) { - this.btmType.attributes[row.$index].name = row.name - this.btmType.attributes[row.$index].defaultValue = row.defaultValue; - this.btmType.attributes[row.$index].description = row.description; + cellEditSave(row,index) { + // console.log("1111111111111111111111") + this.btmType.attributes[index].name = row.name + this.btmType.attributes[index].defaultValue = row.defaultValue; + this.btmType.attributes[index].description = row.description; row.$cellEdit = false; + // console.log(this.btmType.attributes); + this.$refs.attrTable.refreshTable(); }, // 鎵撳紑鐗堟湰瑙勫垯鍙傜収 - async openRevision() { - await getPage().then(res => { + openRevision() { + this.revisionRef.visible = true; + this.revisionRuleOnLoad(); + }, + // 鐗堟湰鍙傜収鍒楄〃鐨勯粯璁ゆ煡璇㈡柟娉� + revisionRuleOnLoad(){ + this.revisionRef.loading = true; + getPage().then(res => { this.revisionRef.data = res.data.data.records; }); - this.revisionRef.visible = true; + setTimeout(() => { + this.revisionRef.loading = false; + }, 600) + this.$nextTick(() => { + this.$refs.revisionRef.refreshTable(); + }); + }, + // 鎵撳紑鐗堟湰瑙勫垯鍙傜収 + openLifeCycle() { + this.lifeCycleRef.visible = true; + this.lifeCycleOnLoad(); + }, + // 鐢熷懡鍛ㄦ湡鍒楄〃鐨勯粯璁ゆ煡璇㈡柟娉� + lifeCycleOnLoad(){ + this.lifeCycleRef.loading = true; + getList().then(res => { + this.lifeCycleRef.data = res.data.data.records; + }); + setTimeout(() => { + this.lifeCycleRef.loading = false; + }, 600) + this.$nextTick(() => { + this.$refs.lifeCycleRef.refreshTable(); + }); }, // 鍏抽棴鐗堟湰瑙勫垯鍙傜収寮圭獥 closeRevisionDialog() { this.revisionRef.visible = false; }, - // 鐗堟湰瑙勫垯鍙傜収鍒楄〃妫�绱� - revisionRefSearch() { - - }, - // 鐗堟湰瑙勫垯閫変腑浜嬩欢 - revisionChange() { + // 鍏抽棴鐢熷懡鍛ㄦ湡鍙傜収寮圭獥 + closeLifeCycleDialog() { + this.lifeCycleRef.visible = false; }, // 纭閫変腑鐗堟湰瑙勫垯 confirmRevision() { @@ -531,11 +671,24 @@ this.btmType.inputRevisionFlag = false; this.cancelRevision(); }, + // 纭閫変腑鐢熷懡鍛ㄦ湡 + confirmLifeCycle() { + this.btmType.lifeCycleFlag = true; + this.btmType.lifeCycleId = this.lifeCycleRef.selectData.id; + this.btmType.lifeCycleName = this.lifeCycleRef.selectData.name; + this.cancelLifeCycle(); + }, // 鍙栨秷閫変腑鐗堟湰瑙勫垯 cancelRevision() { this.revisionRef.selectRow = ''; this.revisionRef.selectData = {}; this.closeRevisionDialog(); + }, + // 鍙栨秷閫変腑鐢熷懡鍛ㄦ湡 + cancelLifeCycle() { + this.lifeCycleRef.selectRow = ''; + this.lifeCycleRef.selectData = {}; + this.closeLifeCycleDialog(); }, // 鐗堟湰瑙勫垯鍗曢�� revisionClick(row) { @@ -545,15 +698,90 @@ name: row.name, }; }, + // 鐢熷懡鍛ㄦ湡鍗曢�� + lifeCycleClick(row) { + this.lifeCycleRef.selectRow = row.$index; + this.lifeCycleRef.selectData = { + id: row.id, + name: row.name, + }; + }, + // 鍙栨秷鐗堟湰瑙勫垯 clearRevision() { this.$delete(this.btmType, 'revisionFlag'); this.$delete(this.btmType, 'revisionRuleId'); this.$delete(this.btmType, 'revisionRuleName'); this.$delete(this.btmType, 'inputRevisionFlag'); }, + // 鍙栨秷鐢熷懡鍛ㄦ湡 + clearLifeCycle() { + this.$delete(this.btmType, 'lifeCycleFlag'); + this.$delete(this.btmType, 'lifeCycleId'); + this.$delete(this.btmType, 'lifeCycleName'); + }, + // 琛ㄥ崟閲嶇疆 resetForm() { this.btmType = {}; this.$refs.form.resetFields(); + }, + /** + * 鎼滅储鐗堟湰瑙勫垯 + * @param params 鎼滅储妗嗚緭鍏ュ�� {id: '',name: ''} 鐩存帴鑾峰彇灏辫 + * @param done 鎵ц瀹屾垚鍚庣殑鍥炶皟 + */ + searchRevisionRule(params,done){ + let condition = {}; + if (params.id){ + condition['id_like'] = params.id; + } + if (params.name){ + condition['name_like'] = params.name; + } + this.revisionRef.loading = true; + getPage(this.revisionRef.page.currentPage,this.revisionRef.page.pageSize,condition).then(res => { + this.revisionRef.data = res.data.data.records; + }); + setTimeout(() => { + done(); + this.revisionRef.loading = false; + }, 600); + this.$nextTick(() => { + this.$refs.revisionRef.refreshTable(); + }); + }, + /** + * 鎼滅储鐢熷懡鍛ㄦ湡 + * @param params 鎼滅储妗嗚緭鍏ュ�� + * @param done 鎵ц瀹屾垚鍚庣殑鍥炶皟 + */ + searchLifeCycle(params,done){ + let condition = {}; + if (params.id){ + condition['id_like'] = params.id; + } + if (params.name){ + condition['name_like'] = params.name; + } + this.lifeCycleRef.loading = true; + getList(this.lifeCycleRef.page.currentPage,this.lifeCycleRef.page.pageSize,condition).then(res => { + this.lifeCycleRef.data = res.data.data.records; + }); + setTimeout(() => { + done(); + this.lifeCycleRef.loading = false; + }, 600); + this.$nextTick(() => { + this.$refs.lifeCycleRef.refreshTable(); + }); + }, + // 鍙栨秷鐗堟湰瑙勫垯鎼滅储 + clearSearchRevisionRule(item){ + this.revisionRuleOnLoad(); + }, + // 鍙栨秷鐢熷懡鍛ㄦ湡鎼滅储 + clearSearchLifeCycle(item){ + this.lifeCycleOnLoad(); + console.log(item); } } } @@ -569,27 +797,27 @@ display: none !important; } +.lifeCycleRef > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu { + display: none !important; +} + .btmTypeForm > .el-form-item > .el-form-item__content > .el-input > .el-input__inner { - width: 200px; + width: 260px; } .domainSelect > .el-form-item__content > .el-select > .el-input > .el-input__inner { - width: 200px; + width: 260px; } .viewFlag { - width: 305px; + width: 360px; } .viewInput > .el-form-item__content > .el-input > .el-input__inner { - width: 200px; + width: 630px; } .descClass > .el-input__inner { - width: 57vw -} - -#descId { - width: 57vw; + width: 1000px; } </style> -- Gitblit v1.9.3