jinlin
2024-01-31 9025b9cf7ec8610003d445a31d93e35e7bd73c2e
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
<template>
  <zt-dialog ref="dialog"  @confirm="formSubmit">
    <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px">
      <zt-form-item label="软件名称" prop="reviewDate" >
        <el-input v-model="dataForm.project.softwareName"></el-input>
      </zt-form-item>
      <zt-form-item label="软件编号" prop="reviewDate" >
        <el-input v-model="dataForm.project.code"></el-input>
      </zt-form-item>
      <zt-form-item label="软件标识" prop="reviewDate" >
        <el-input v-model="dataForm.project.softwareIdentity"></el-input>
      </zt-form-item>
      <zt-form-item label="评审日期" prop="reviewDate" >
        <el-date-picker
          v-model="dataForm.reviewComment.reviewDate"
          type="date"
          placeholder="请选择评审日期">
        </el-date-picker>
      </zt-form-item>
      <zt-form-item label="评审人数" prop="reviewerNum" >
        <el-input v-model="dataForm.reviewComment.reviewerNum"></el-input>
      </zt-form-item>
      <div style="height: 60px;width: 75%">
        <el-form-item >
          <config-uploader :lineHeight="true" :busi-type="type" 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 {
        type:'test_review_comment_',
        pageCode: '',
        dataForm: {
          id: '',
          project: {
            softwareName: '',
            softwareIdentity:'',
            code:''
          },
          reviewComment: {
            reviewDate: '',
            reviewerNum: ''
          },
          projectId: '',
        }
      }
    },
    methods: {
      init(id, row) {
        if (id) {
          this.dataForm.id = id
        } else {
          this.dataForm.id = row.id
        }
        this.pageCode = row.pageCode
        if (row.projectId) {
          this.dataForm.projectId = row.projectId
        }
        this.getInfo()
        //console.log(this.dataForm.id, this.dataForm.projectId, this.stepMarker, 'this.dataForm.id, this.dataForm.projectId,this.stepMarker')
      },
      // 获取信息
      async getInfo() {
        let params = {
          commentId: this.dataForm.id,
          projectId: this.dataForm.projectId,
          pageCode: this.pageCode
        }
        console.log(this.pageCode, "getInfo pageCode")
        let res = await this.$http.get(`/testReviewComment/TestReviewComment/getDto`, {params: params})
        this.dataForm = {
          ...this.dataForm,
          ...res.data
        }
        this.type=this.type+this.pageCode
        console.log(this.dataForm, 'this.dataForm this.dataForm')
      },
      async print() {
        var params = qs.stringify({
          token: Cookies.get('token'),
          id: this.dataForm.id,
          pageCode: this.pageCode
        })
        let apiURL = `/testReviewComment/TestReviewComment/exportReviewComment`
        window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${params}`
      },
      // 表单提交
      async formSubmit() {
        let res = await this.$http[!this.dataForm.id ? 'post' : 'put']('/testReviewComment/TestReviewComment/', this.dataForm)
        if (res.success) {
          await this.$tip.success()
          this.$refs.dialog.close()
          this.$emit('refreshDataList')
        }
      }
    }
  }
</script>
<style>
  .marginTopAndMarginBottom {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
</style>