From 07e58d77abaf0e82ca7673e0e84c43fc5ea664a3 Mon Sep 17 00:00:00 2001
From: wente <329538422@qq.com>
Date: 星期一, 18 十二月 2023 09:14:27 +0800
Subject: [PATCH] 合同评审及登录页
---
web/src/views/modules/project/Environ-AddOrUpdate.vue | 79 ++++++++++++++++++++++++---------------
1 files changed, 48 insertions(+), 31 deletions(-)
diff --git a/web/src/views/modules/project/Environ-AddOrUpdate.vue b/web/src/views/modules/project/Environ-AddOrUpdate.vue
index 995fdb5..a589117 100644
--- a/web/src/views/modules/project/Environ-AddOrUpdate.vue
+++ b/web/src/views/modules/project/Environ-AddOrUpdate.vue
@@ -56,7 +56,7 @@
</template>
</el-table-column>
</el-table>
- <div class="icon-container" @click="addSoftwareRow()">
+ <div v-if="!dataForm.disabled" class="icon-container" @click="addSoftwareRow()">
<!-- 鏀剧疆鍥哄畾鐨勫浘鏍� -->
<i class="el-icon-plus"></i>
</div>
@@ -97,7 +97,7 @@
</template>
</el-table-column>
</el-table>
- <div class="icon-container" @click="addHardwareRow()">
+ <div v-if="!dataForm.disabled" class="icon-container" @click="addHardwareRow()">
<!-- 鏀剧疆鍥哄畾鐨勫浘鏍� -->
<i class="el-icon-plus"></i>
</div>
@@ -111,7 +111,7 @@
<div style="width: calc(100% - 120px);">
<div class="el-wt-border-left">
<span>{{dataForm.environ.testEnvirontDiagram}}</span>
- <config-uploader busi-type="test_environt_diagram" model-name="dataForm" :dataForm="dataForm"
+ <config-uploader :lineHeight="true" busi-type="test_environt_diagram" model-name="dataForm" :dataForm="dataForm"
@getImageUrl="getImageUrl"
v-model="dataForm.files"/>
<div v-if="dataForm.url">
@@ -160,7 +160,7 @@
</template>
</el-table-column>
</el-table>
- <div class="icon-container" @click="addDiscrepancyRow()">
+ <div v-if="!dataForm.disabled" class="icon-container" @click="addDiscrepancyRow()">
<!-- 鏀剧疆鍥哄畾鐨勫浘鏍� -->
<i class="el-icon-plus"></i>
</div>
@@ -211,10 +211,16 @@
</div>
</div>
</el-form>
+ <template v-slot:footer>
+ <el-button v-if="dataForm.disabled" type="primary" @click="print()">鎵撳嵃</el-button>
+ </template>
</zt-dialog>
</template>
<script>
+ import qs from "qs";
+ import Cookies from "js-cookie";
+
export default {
data() {
return {
@@ -251,11 +257,11 @@
},
methods: {
init(id, row) {
+ console.log(row, 'row')
this.dataForm.id = row.id
this.dataForm.projectId = row.projectId
- // this.dataForm.disabled
+ this.dataForm.disabled
this.getInfo()
- this.getImageUrl()
console.log(this.dataForm.id, this.dataForm.projectId, 'params params')
},
// 鑾峰彇淇℃伅
@@ -265,11 +271,13 @@
projectId: this.dataForm.projectId
}
let res = await this.$http.get(`/project/Environ/getDto`, {params: params})
- this.dataForm = {
- ...this.dataForm,
- ...res.data
+ if (res.data) {
+ this.dataForm = {
+ ...this.dataForm,
+ ...res.data
+ }
+ this.getImageUrl()
}
- console.log(this.dataForm, 'this.dataForm')
},
indexFormat(index) {
return index += 1
@@ -295,27 +303,36 @@
tableBody.scrollTop = tableBody.scrollHeight;
})
},
- getImageUrl() {
- let pictureId = this.getFirstImageId(this.dataForm.files, 'test_environt_diagram')
- this.dataForm.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${pictureId}`
- console.log(this.dataForm.url, ' this.dataForm.url')
- },
- getFirstImageId(oss) {
- console.log(oss, ' getFirstImageId(oss)')
- let fileId = 0
- if (oss != null) {
- if (oss.groups.length > 0) {
- let group = oss.groups[0]
- if (group.fields.length > 0) {
- let field = group.fields[0]
- if (field.files.length > 0) {
- let file = field.files[0]
- fileId = file.id
- }
- }
- }
- }
- return fileId
+ getImageUrl() {
+ let pictureId = this.getFirstImageId(this.dataForm.files)
+ this.dataForm.url = `${window.SITE_CONFIG['apiURL']}/sys/oss/content2?fileId=${pictureId}`
+ console.log(this.dataForm.url, ' this.dataForm.url')
+ },
+ getFirstImageId(oss) {
+ console.log(oss, ' getFirstImageId(oss)')
+ let fileId = 0
+ if (oss != null) {
+ if (oss.groups.length > 0) {
+ let group = oss.groups[0]
+ if (group.fields.length > 0) {
+ let field = group.fields[0]
+ if (field.files.length > 0) {
+ let file = field.files[0]
+ fileId = file.id
+ }
+ }
+ }
+ }
+ return fileId
+ },
+ async print() {
+ console.log(this.dataForm)
+ let params = qs.stringify({
+ token: Cookies.get('token'),
+ id: this.dataForm.id
+ })
+ let apiURL = `/project/Environ/exportEnviron/`
+ window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
},
// 琛ㄥ崟鎻愪氦
async formSubmit() {
--
Gitblit v1.9.1