<template>
|
<zt-dialog ref="dialog" @confirm="formSubmit">
|
<el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px">
|
<zt-form-item label="编号" prop="code" rules="required">
|
<el-input v-model="dataForm.code"></el-input>
|
</zt-form-item>
|
<zt-form-item label="审核人" prop="auditor" rules="required">
|
<el-input v-model="dataForm.auditor"></el-input>
|
</zt-form-item>
|
<zt-form-item label="审核时间" prop="auditorDate" rules="required">
|
<el-input v-model="dataForm.auditorDate"></el-input>
|
</zt-form-item>
|
</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 {
|
dataForm: {
|
id: '',
|
configAuditReport:{
|
code: '',
|
auditor: '',
|
auditorDate: '',
|
},
|
project: {
|
softwareIdentity: '',
|
softwareName: ''
|
},
|
problemList:[],
|
contentList:[]
|
}
|
}
|
},
|
methods: {
|
indexFormat(index) {
|
return index += 1
|
},
|
init(id, row) {
|
if (id) {
|
this.dataForm.id = id
|
} else {
|
this.dataForm.id = row.id
|
}
|
if (row.projectId) {
|
this.dataForm.projectId = row.projectId
|
}
|
this.getInfo()
|
console.log(this.dataForm.id, this.dataForm.projectId, 'params params')
|
},
|
// 获取信息
|
async getInfo() {
|
let params = {
|
reportId: this.dataForm.id,
|
projectId: this.dataForm.projectId
|
}
|
let res = await this.$http.get(`/configAuditReport/ConfigAuditReport/getDto`, {params: params})
|
this.dataForm = {
|
...this.dataForm,
|
...res.data
|
}
|
if(this.dataForm.configAuditReport === null){
|
this.dataForm.contractReview={}
|
}
|
console.log(this.dataForm, "getInfo this.dataForm")
|
},
|
async print(){
|
var params = qs.stringify({
|
token: Cookies.get('token'),
|
id:this.dataForm.id
|
})
|
let apiURL = `/configAuditReport/ConfigAuditReport/exportReport`
|
window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
|
},
|
// 表单提交
|
async formSubmit() {
|
let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/configAuditReport/ConfigAuditReport/', this.dataForm)
|
if (res.success) {
|
await this.$tip.success()
|
this.$refs.dialog.close()
|
this.$emit('refreshDataList')
|
}
|
}
|
}
|
}
|
</script>
|