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 | 94 +++++++++++++++++++++++++++++++++++++---------- 1 files changed, 74 insertions(+), 20 deletions(-) diff --git a/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue b/web/src/views/modules/configItemWarehouse/ConfigItemWarehouse-AddOrUpdate.vue index 462cae9..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 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"> @@ -88,8 +88,13 @@ <el-table-column fixed="right" prop="files" label="涓婁紶闄勪欢" width="240" align="center"> <template v-slot="{ row }"> <!-- <zt-table-button @click="files(row.id)">涓婁紶闄勪欢</zt-table-button>--> - <table-uploader busi-type="config_item_warehouse" model-name="row" :dataForm="row" + <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> @@ -238,11 +243,17 @@ </div> <add-or-update-check ref="addOrUpdate" @recall="setCheckId"/> </el-form> + <template v-slot:footer> + <el-button v-if="dataForm.disabled" type="primary" @click="print()">鎵撳嵃</el-button> + </template> </zt-dialog> </template> <script> import AddOrUpdateCheck from '../testCheckOrder/TestCheckOrder-AddOrUpdate' + import qs from "qs"; + import Cookies from "js-cookie"; + import cloneDeep from "lodash/cloneDeep"; export default { data() { @@ -295,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; } }, @@ -320,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' @@ -332,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") @@ -370,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 = {} } @@ -389,11 +394,45 @@ 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({ + token: Cookies.get('token'), + id:this.dataForm.id + }) + let apiURL = `/configItemWarehouse/ConfigItemWarehouse/exportWarehouseOrder` + window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}` }, // 琛ㄥ崟鎻愪氦 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) { @@ -403,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