| | |
| | | </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 { |
| | |
| | | }, |
| | | 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') |
| | | }, |
| | | // 获取信息 |
| | |
| | | projectId: this.dataForm.projectId |
| | | } |
| | | let res = await this.$http.get(`/project/Environ/getDto`, {params: params}) |
| | | if (res.data) { |
| | | this.dataForm = { |
| | | ...this.dataForm, |
| | | ...res.data |
| | | } |
| | | console.log(this.dataForm, 'this.dataForm') |
| | | this.getImageUrl() |
| | | } |
| | | }, |
| | | indexFormat(index) { |
| | | return index += 1 |
| | |
| | | }) |
| | | }, |
| | | getImageUrl() { |
| | | let pictureId = this.getFirstImageId(this.dataForm.files, 'test_environt_diagram') |
| | | 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') |
| | | }, |
| | |
| | | } |
| | | 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() { |
| | | let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/project/Environ/', this.dataForm) |