From 1772fc5e211f9e9e0ab4cdc6c29b436aac178c2a Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期五, 23 二月 2024 12:19:55 +0800 Subject: [PATCH] 修改 --- web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue | 79 ++++++++++++++++++++++++++++++--------- 1 files changed, 60 insertions(+), 19 deletions(-) diff --git a/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue b/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue index f6bc816..13128b3 100644 --- a/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue +++ b/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue @@ -28,7 +28,7 @@ </el-date-picker> </el-form-item> <el-form-item class="marginTopAndMarginBottom2" label="搴撶被鍨�" style="width: 99%"> - <zt-dict :disabled="stepMarker!=='pzxrk_first'" v-model="dataForm.configItemWarehouse.libraryType" :radio="true" dict="library_type"></zt-dict> + <zt-dict disabled="disabled" v-model="dataForm.configItemWarehouse.libraryType" :radio="true" dict="library_type"></zt-dict> </el-form-item> </div> <div class="el-flexManageDialog el-border-bottom"> @@ -90,6 +90,11 @@ <!-- <zt-table-button @click="files(row.id)">涓婁紶闄勪欢</zt-table-button>--> <table-uploader :disabled="!showAddAndEdit" busi-type="config_item_warehouse" model-name="row" :dataForm="row" v-model="row.files"/> + </template> + </el-table-column> + <el-table-column v-if="stepMarker=='pzxrk_first'" fixed="right" label="鎿嶄綔" align="center"> + <template slot-scope="scope"> + <zt-table-button @click="deleteRow(scope.$index,scope.row.id)">鍒犻櫎</zt-table-button> </template> </el-table-column> </el-table> @@ -248,6 +253,7 @@ import AddOrUpdateCheck from '../testCheckOrder/TestCheckOrder-AddOrUpdate' import qs from "qs"; import Cookies from "js-cookie"; + import cloneDeep from "lodash/cloneDeep"; export default { data() { @@ -300,10 +306,10 @@ }, created() { const roleName = localStorage.getItem('roleName') - if (roleName && roleName.includes('QA')) { + if (roleName && roleName.includes('瀹℃牳浜哄憳')) { this.showColumn = true; } - if (roleName && roleName.includes('娴嬭瘯鍛�')) { + if (roleName && roleName.includes('妫�娴嬩汉鍛�')) { this.showAddAndEdit = true; } }, @@ -325,7 +331,11 @@ if (row.projectId) { this.dataForm.projectId = row.projectId } - this.getInfo() + if (row.libraryType) { + console.log(row.libraryType,"row.libraryType") + this.dataForm.configItemWarehouse.libraryType = row.libraryType + } + this.getInfo2() if (!this.dataForm.disabled) { if (!row.stepMarker) { this.stepMarker = 'pzxrk_first' @@ -337,13 +347,6 @@ } console.log(this.dataForm.id, this.dataForm.projectId, 'params params') }, - // addConfigItemWarehouseRow(){ - // this.dataForm.configItemList.push({}) - // this.$nextTick(()=>{ - // const tableBody=this.$refs.tableConfigItemList.$el.querySelector('.el-table__body-wrapper') - // tableBody.scrollTop = tableBody.scrollHeight; - // }) - // }, handleCommand(pageCode) { const selectedItem = this.menuOptions.find(item => item.pageCode === pageCode); console.log(selectedItem, "handleCommand(pageCode) selectedItem") @@ -375,16 +378,13 @@ this.$set(row, 'checkId', checkId) }, // 鑾峰彇淇℃伅 - async getInfo() { + async getInfo2() { let params = { warehouseId: this.dataForm.id, - projectId: this.dataForm.projectId + projectId: this.dataForm.projectId, + libraryType:this.dataForm.configItemWarehouse.libraryType } let res = await this.$http.get(`/configItemWarehouse/ConfigItemWarehouse/getDto`, {params: params}) - this.dataForm = { - ...this.dataForm, - ...res.data - } if (this.dataForm.project === null) { this.dataForm.project = {} } @@ -394,7 +394,21 @@ if (this.dataForm.flowInfoDto === null) { this.dataForm.flowInfoDto = {} } + setTimeout(()=>{ + this.dataForm = { + ...this.dataForm, + ...res.data + } + },100) console.log(this.dataForm, "getInfo this.dataForm") + }, + async deleteRow(index, id){ + if (await this.$tip.confirm(this.$t('prompt.info', {'handle': this.$t('delete')}))) { + if (id != null) { + let res = await this.$http.delete('/configItemWarehouse/WarehouseConfigItem/', {data: [id]}) + } + this.dataForm.configItemList.splice(index, 1) + } }, async print(){ var params = qs.stringify({ @@ -406,7 +420,19 @@ }, // 琛ㄥ崟鎻愪氦 async formSubmit(submitType) { - if (this.showColumn && submitType == 'bl') { + let isFiles = true; + let flag = true; + console.log(this.dataForm, "this.dataForm11111") + this.dataForm.configItemList.forEach(item => { + if (parseInt(item.secretClass) > localStorage.getItem('userSecretClass')) { + this.$alert("褰撳墠椤圭洰璁剧疆鐨勫瘑绾ч珮浜庡綋鍓嶇敤鎴风殑瀵嗙骇锛岃閲嶆柊璁剧疆") + flag =false + } + }) + if (!flag){ + return + } + if (this.showColumn && submitType === 'bl') { for (let item of this.dataForm.configItemList) { if (item) { if (this.pageNameCode[item.itemName] && !item.checkId) { @@ -416,7 +442,22 @@ } } } - if (submitType == 'tj' || submitType == 'bl') { + if (submitType === 'tj' || submitType === 'bl') { + this.dataForm.configItemList.forEach(item => { + console.log(item, "his.dataForm.technicalList.forEach") + item.files.groups.forEach(groups => { + groups.fields.forEach(files => { + if (files.files.length === 0) { + this.$alert("褰撳墠瀛樺湪鏈笂浼犻檮浠剁殑閰嶇疆椤癸紝璇烽噸鏂颁笂浼�") + isFiles = false + return isFiles + } + }) + }) + }) + if (!isFiles){ + return + } let flowInfo = { flowCode: 'pzxrk', stepIdMark: this.stepMarker, -- Gitblit v1.9.1