jinlin
2024-01-23 52a302b11c08cbc564ff3931038ae57a305a95d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<template>
  <zt-dialog ref="dialog"  @confirm="formSubmit">
    <el-form :model="dataForm" :inline="true" ref="dataForm" style="padding-top: 0" :disabled="dataForm.disabled"
             label-width="120px" class="configAuditFormAuto">
      <div>
        <el-form-item label-width="60px" label="编号:" style="width:100%;margin-bottom: -5px">
          <span>{{dataForm.auditReport.code || '编号自动生成'}}</span>
        </el-form-item>
      </div>
      <div style="border: 1px solid rgba(0,0,0,.2);width: 99%">
        <div style="border-bottom: 1px solid rgba(0,0,0,.2);" class="configAuditContentWidth">
          <el-form-item class="marginTopAndMarginBottom" label="项目名称" style="width: 48%">
            <el-input v-model="dataForm.project.softwareName" placeholder="项目名称"></el-input>
          </el-form-item>
          <el-form-item class="marginTopAndMarginBottom" label="项目标识" style="width: 48%">
            <el-input v-model="dataForm.project.softwareIdentity" placeholder="项目标识"></el-input>
          </el-form-item>
        </div>
        <div style="border-bottom: 1px solid rgba(0,0,0,.2);">
          <div>
            <div style="text-align: center;font-weight: 600;border-bottom:1px solid rgba(0,0,0,.2);height: 40px;line-height: 40px;font-size: 18px">审核内容</div>
            <el-form-item label="状态标记" label-width="150px" style="width:100%;padding-left:20px;margin-bottom:0">
              √合格         ×不合格       NA不适用
            </el-form-item>
            <div class="table-container">
              <el-table ref="tableConfigAuditList" class="el-software el-margin-top-bot" border
                        :data="dataForm.contentList"
                        stripe>
                <el-table-column prop="no" align="center" width="60" label="序号">
                  <template slot-scope="scope">
                    <span v-html="indexFormat(scope.$index)"></span>
                  </template>
                </el-table-column>
                <el-table-column prop="auditContent" min-width="180" label="审核内容">
                  <template v-slot="{ row }">
                    <el-input v-model="row.auditContent" placeholder="审核内容"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="auditResult" align="center" width="150" label="审核结果">
                  <template v-slot="{ row }">
                    <zt-dict v-model="row.auditResult" placeholder="审核结果" dict="status_tag"
                             clearable></zt-dict>
                  </template>
                </el-table-column>
                <el-table-column prop="remark" label="备注" width="100" align="center">
                  <template v-slot="{ row }">
                    <el-input v-model="row.remark" placeholder="备注"></el-input>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <div>
            <div style="text-align: center;font-weight: 600;height: 40px;line-height: 40px;font-size: 18px">发现的问题</div>
            <div class="table-container">
              <el-table ref="tableConfigAuditList" class="el-software el-margin-top-bot" border
                        :data="dataForm.problemList"
                        stripe>
                <el-table-column prop="no" align="center" width="60" label="序号">
                  <template slot-scope="scope">
                    <span v-html="indexFormat(scope.$index)"></span>
                  </template>
                </el-table-column>
                <el-table-column prop="problemDescription" min-width="180" label="问题描述">
                  <template v-slot="{ row }">
                    <el-input v-model="row.problemDescription" placeholder="问题描述"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="isNotTrue" align="center" width="150" label="是否为不符合项">
                  <template v-slot="{ row }">
                    <zt-dict v-model="row.isNotTrue" placeholder="是否为不符合项" dict="is_or_not" :radio="true"
                             clearable></zt-dict>
                  </template>
                </el-table-column>
                <el-table-column prop="problemRectification" label="问题整改情况" width="100" align="center">
                  <template v-slot="{ row }">
                    <el-input v-model="row.problemRectification" placeholder="问题整改情况"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="discoveryPhase" label="发现阶段" width="100" align="center">
                  <template v-slot="{ row }">
                    <el-input v-model="row.discoveryPhase" placeholder="发现阶段"></el-input>
                  </template>
                </el-table-column>
              </el-table>
              <div class="icon-container" @click="addConfigAuditRow()">
                <!-- 放置固定的图标 -->
                <i class="el-icon-plus"></i>
              </div>
            </div>
          </div>
        </div>
        <div class="el-flexConfigAuditDialog">
          <div style="width: 112px;text-align: center;font-weight: 600">
            审核人员:
          </div>
          <div class="el-border-left-right" style="width: 20%;height: 40px;">
            <el-form-item style="width: 100%;padding-left:20px;margin:0;">
              <el-input type="textarea" :rows="1" placeholder="请输入审核人员"
                        v-model="dataForm.auditReport.auditor"></el-input>
              <!--{{dataForm.configAuditReport.auditor}}-->
            </el-form-item>
          </div>
          <div style="width: 52px;text-align: center;font-weight: 600">
            日 期
          </div>
          <div class="el-border-left" style="width: 20%;height: 40px;">
            <el-form-item style="width: 100%;padding-left:20px;margin:0;">
              <el-date-picker
                v-model="dataForm.auditReport.auditorDate"
                type="date"
                placeholder="请选择日期">
              </el-date-picker>
              <!--{{ dataForm.configAuditReport.auditorDate | filterTime('YYYY年MM月DD日') }}-->
            </el-form-item>
          </div>
        </div>
      </div>
      <div class="el-flex report-sc" style="height: 60px">
        <el-form-item class="marginTopAndMarginBottom" style="width: 100%">
          <config-uploader :lineHeight="true" busi-type="config_audit_report" model-name="dataForm" :dataForm="dataForm"
                           v-model="dataForm.files"/>
        </el-form-item>
      </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 {
        dataForm: {
          id: '',
          auditReport:{
            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")
      },
      addConfigAuditRow() {
        this.dataForm.problemList.push({})
        this.$nextTick(() => {
          const tableBody = this.$refs.tableConfigAuditList.$el.querySelector('.el-table__body-wrapper')
          tableBody.scrollTop = tableBody.scrollHeight;
        })
      },
      async print(){
        var params = qs.stringify({
          token: Cookies.get('token'),
          id:this.dataForm.id
        })
        let apiURL = `/configAuditReport/ConfigAuditReport/exportConfigAudit`
        window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
      },
      // 表单提交
      async formSubmit() {
        console.log(this.dataForm,"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>
<style>
.el-flexConfigAuditDialog{
  display: flex;
  align-items: center
}
.configAuditContentWidth > .el-form-item > .el-form-item__content {
  width: calc(100% - 120px);
}
.configAuditFormAuto .marginTopAndMarginBottom {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}
 
.configAuditFormAuto .marginTopAndMarginBottom2 {
  margin-top: -10px !important;
  margin-bottom: 10px !important;
}
 
.configAuditFormAuto .marginTopAndMarginBottom3 {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
}
 
.acceptDate > .el-form-item > .el-form-item__content {
  line-height: 80px;
}
 
.configAuditFormAuto .el-radio {
  margin-right: 10px;
}
.report-sc > .el-form-item > .el-form-item__content {
  width:100%;
}
</style>