jinlin
2024-02-01 2df883fcbed176f83d8d144fd007e7f72fcb54d6
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<template>
  <zt-dialog ref="dialog" column="2" :title="title" :stepMarker="stepMarker" @confirm="formSubmit">
    <el-form ref="dataForm" style="padding-top: 0" :inline="true" :disabled="dataForm.disabled" :model="dataForm"
             label-width="120px" class="contractFormAuto">
      <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="QaAuditContentWidth">
          <el-form-item class="marginTopAndMarginBottom" label="项目名称" style="width: 49%">
            <el-input v-model="dataForm.project.softwareName" placeholder="请输入项目名称"></el-input>
          </el-form-item>
          <el-form-item class="marginTopAndMarginBottom" label="项目标识" style="width: 49%">
            <el-input v-model="dataForm.project.softwareIdentity" placeholder="请输入项目标识"></el-input>
          </el-form-item>
        </div>
        <div class="el-flexQaAuditDialog el-border-bottom">
          <div class="QaFormWidth DAlign DHold">
            项目成员
          </div>
          <div class="el-border-left" style="width: calc(100% - 120px);min-height: 40px">
            <el-form-item style="width: 50%;padding: 0 5px">
              <span>项目负责人:{{dataForm.project.projectLeader || '项目负责人'}} </span>
            </el-form-item>
            <el-form-item style="width: 40%;padding: 0 5px">
              <span>测试人员:{{dataForm.project.projectTesters || '测试人员'}} </span>
            </el-form-item>
            <el-form-item style="width: 40%;padding: 0 5px">
              <span>配置人员:{{dataForm.project.projectConfiger || '配置人员'}} </span>
            </el-form-item>
          </div>
        </div>
        <div class="el-flexQaAuditDialog el-border-bottom">
          <div class="QaFormWidth DAlign DHold">
            已完成的检查
          </div>
          <div class="el-border-left" style="width: calc(100% - 120px);min-height: 40px">
            <el-form-item class="el-QaTextarea" label-width="20px" style="width: 100%;padding: 5px">
              <el-input type="textarea" :rows="2" placeholder="请输入内容"
                        v-model="dataForm.auditReport.completedCheck"></el-input>
            </el-form-item>
          </div>
        </div>
        <div class=" el-border-bottom">
          <div style="height: 40px;line-height: 40px;text-align:center;font-weight: 600">
            不符合项列表
          </div>
          <div>
            <div class="table-container">
              <el-table ref="tableConfigItemList" class="el-software el-margin-top-bot"
                        style="width: 99%;margin-left: 5px" border :data="dataForm.incongruentList"
                        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="oddNum" min-width="350" label="不符合项单号">
                  <template v-slot="{ row }">
                    <el-input v-model="row.oddNum" placeholder="不符合项单号"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="notTrueDescribe" width="220" align="center" label="不符合项描述">
                  <template v-slot="{ row }">
                    <el-input v-model="row.notTrueDescribe" placeholder="不符合项描述"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="workProcess" width="100" align="center" label="所属工作产品/过程">
                  <template v-slot="{ row }">
                    <el-input v-model="row.workProcess" placeholder="所属工作产品/过程"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="discoveryPhase" width="80" align="center" label="发现阶段">
                  <template v-slot="{ row }">
                    <el-input v-model="row.discoveryPhase" placeholder="发现阶段"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="chargePerson" width="80" align="center" label="责任人">
                  <template v-slot="{ row }">
                    <el-input v-model="row.chargePerson" placeholder="责任人"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="status" width="80" align="center" label="状态">
                  <template v-slot="{ row }">
                    <el-input v-model="row.status" placeholder="状态"></el-input>
                  </template>
                </el-table-column>
                <el-table-column prop="remark" width="100" align="center" label="备注">
                  <template v-slot="{ row }">
                    <el-input v-model="row.remark" placeholder="备注"></el-input>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
        </div>
        <div class="el-border-bottom">
          <div style="height: 40px;line-height: 40px;text-align:center;font-weight: 600">
            QA总结
          </div>
          <div class="el-border-bottom">
            <el-form-item class="el-QaTextarea" label-width="20px" style="width: 100%;padding: 5px">
              <el-input v-if="stepMarker=='qashbg_first'" type="textarea" :rows="2" placeholder="请输入内容"
                        v-model="dataForm.auditReport.qaSummary"></el-input>
              <span v-else>{{ dataForm.auditReport.qaSummary}}</span>
            </el-form-item>
            <el-form-item label="检查人(签字):" label-width="160px" style="width: 48%;padding: 5px;">
              {{ dataForm.auditReport.checker }}
            </el-form-item>
            <el-form-item style="width: 48%;padding: 5px;">
              {{ dataForm.auditReport.checkDate | filterTime('YYYY年MM月DD日') }}
            </el-form-item>
          </div>
          <div>
            <el-form-item label="质量监督员意见:" class="el-QaTextarea1" label-width="160px" style="width: 100%;padding: 5px">
              <el-input v-if="stepMarker=='qashbg_zljd'" type="textarea" :rows="2" placeholder="请输入内容"
                        v-model="dataForm.auditReport.supervisorOpinion"></el-input>
              <span v-else>{{ dataForm.auditReport.supervisorOpinion}}</span>
            </el-form-item>
            <el-form-item label="质量监督员(签字):" label-width="160px" style="width: 48%;padding: 5px;">
              {{ dataForm.auditReport.supervisorSign }}
            </el-form-item>
            <el-form-item style="width: 48%;padding: 5px;">
              {{ dataForm.auditReport.superviseDate | filterTime('YYYY年MM月DD日') }}
            </el-form-item>
          </div>
        </div>
      </div>
      <div class="el-flex qa-sc" style="height: 60px">
        <el-form-item class="marginTopAndMarginBottom" style="width: 100%">
          <config-uploader :lineHeight="true" busi-type="qa_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 {
        stepMarker: '',
        dataForm: {
          auditReport: {
            code: '',
            completedCheck: '',
            qaSummary: '',
            checker: '',
            checkDate: '',
            supervisorOpinion: '',
            supervisorSign: '',
            superviseDate: '',
          },
          id: '',
          project: {
            softwareIdentity: '',
            softwareName: '',
            projectLeader: '',
            projectTesters: '',
            projectConfiger: ''
          },
          incongruentList: []
        }
      }
    },
    methods: {
      init(id, row) {
        if (id) {
          this.dataForm.id = id
        } else {
          this.dataForm.id = row.id
        }
        if (row.projectId) {
          this.dataForm.projectId = row.projectId
        }
        // this.dataForm.disabled
        this.getInfo()
        if (!this.dataForm.disabled) {
          if (!row.stepMarker) {
            this.stepMarker = 'qashbg_first'
            this.title = 'QA审核报告'
          } else {
            this.title = row.stepName
            this.stepMarker = row.stepMarker
          }
        }
        console.log(this.dataForm.id, this.dataForm.projectId, this.stepMarker, 'this.dataForm.id, this.dataForm.projectId,this.stepMarker')
      },
      indexFormat(index) {
        return index += 1
      },
      async getNameById() {
        let params = {
          projectLeaderId: this.dataForm.project.projectLeader,
          projectTestersId: this.dataForm.project.projectTesters,
          projectConfigerId: this.dataForm.project.projectConfiger
        }
        let res = await this.$http.get(`/qaAuditReport/QaAuditReport/getNameById`, {params: params})
        if (res.success) {
          this.dataForm.project.projectLeader = res.data.projectLeaderName
          this.dataForm.project.projectTesters = res.data.projectTestersName
          this.dataForm.project.projectConfiger = res.data.projectConfigerName
        }
      },
      addCirculatRow() {
        this.dataForm.technicalList.push({})
        this.$nextTick(() => {
          const tableBody = this.$refs.tableCirculatOrderList.$el.querySelector('.el-table__body-wrapper')
          tableBody.scrollTop = tableBody.scrollHeight;
        })
      },
      // 获取信息
      async getInfo() {
        let params = {
          reportId: this.dataForm.id,
          projectId: this.dataForm.projectId
        }
        let res = await this.$http.get(`/qaAuditReport/QaAuditReport/getDto`, {params: params})
        this.dataForm = {
          ...this.dataForm,
          ...res.data
        }
        this.getNameById()
        if (this.dataForm.project === null) {
          this.dataForm.project = {}
        }
        if (this.dataForm.flowInfoDto === null) {
          this.dataForm.flowInfoDto = {}
        }
        console.log(this.dataForm, "getInfo this.dataForm")
      },
      async print() {
        var params = qs.stringify({
          token: Cookies.get('token'),
          id: this.dataForm.id
        })
        let apiURL = `/qaAuditReport/QaAuditReport/exportQaReport`
        window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
      },
      // 表单提交
      async formSubmit(submitType) {
        console.log(this.dataForm, "this.dataForm11111")
        if (submitType == 'tj' || submitType == 'bl') {
          let flowInfo = {
            flowCode: 'qashbg',
            stepIdMark: this.stepMarker,
            submitType: submitType
          }
          this.dataForm.flowInfoDto = flowInfo;
        }
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/qaAuditReport/QaAuditReport/', this.dataForm)
        if (res.success) {
          await this.$tip.success()
          this.$refs.dialog.close()
          this.$emit('refreshDataList')
        }
      }
    }
  }
</script>
<style>
  .el-flexQaAuditDialog {
    display: flex;
    align-items: center;
  }
 
  .QaFormWidth {
    width: 120px;
  }
 
  .QaAuditContentWidth > .el-form-item > .el-form-item__content {
    width: calc(100% - 120px);
  }
 
  .el-form-item.el-QaTextarea > .el-form-item__content {
    width: 100%;
  }
 
  .el-form-item.el-QaTextarea1 > .el-form-item__content {
    width: calc(100% - 160px);
  }
</style>
<style>
  .qa-sc > .el-form-item > .el-form-item__content {
    width: 100%;
  }
</style>