zhuo
2025-05-20 7eb190f13437b2e67788e9f4bdea725fdb165f01
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
<template>
  <div class="capacity-scope">
    <div style="display: flex;justify-content: space-between">
      <div style="display: flex;">
        <div style="margin-bottom: 18px;margin-right: 10px;display: flex;align-items: center;line-height: 32px;">
          <span style="width: 88px;font-size: 14px;font-weight: 700;color: #606266;">文件名称</span>
          <el-input v-model="queryParams.fileName" clearable placeholder="请输入" size="small"
                    @keyup.enter.native="refreshTable()"></el-input>
        </div>
        <div style="line-height: 30px;">
          <el-button type="primary" size="mini" @click="refreshTable">查询</el-button>
          <el-button size="mini" @click="refresh">重置</el-button>
        </div>
      </div>
      <div style="line-height: 30px;">
        <el-button :loading="outLoading" size="small" type="primary" style="margin-right: 10px" @click="openForm('add')">新增</el-button>
      </div>
    </div>
    <div class="table">
      <lims-table :tableData="tableData" :column="column" :tableLoading="tableLoading" :height="'calc(100vh - 270px)'"
                  :page="page" @pagination="pagination"></lims-table>
    </div>
    <el-dialog :visible.sync="addDialogVisible" title="评价" width="900px" @close="closeDia">
      <el-form ref="form" :model="form" label-position="right" label-width="120px" :rules="formRules">
        <el-row>
          <el-col :span="12">
            <el-form-item label="文件名称:" prop="fileName">
              <el-input v-model="form.fileName" placeholder="请输入" size="small"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="计划内容:" prop="implementationContent">
              <el-input v-model="form.implementationContent" placeholder="请输入"
                        size="small"
                        :rows="6"
                        type="textarea"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="动态内容:" prop="dynamicContent">
              <el-input v-model="form.dynamicContent" placeholder="请输入"
                        size="small"
                        :rows="6"
                        type="textarea"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="监督人:" prop="supervisor">
              <el-select v-model="form.supervisor"
                         clearable filterable
                         placeholder="请选择" size="small" style="width: 100%;">
                <el-option v-for="item in responsibleOptions" :key="item.name" :label="item.name" :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="质量评审日期:" prop="superviseDate">
              <el-date-picker v-model="form.superviseDate" format="yyyy-MM-dd"
                              placeholder="选择日期" size="small" value-format="yyyy-MM-dd"
                              type="date" style="width: 100%"></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="closeDia">取 消</el-button>
        <el-button :loading="addLoading" type="primary" @click="handleAdd">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
 
<script>
import limsTable from "@/components/Table/lims-table.vue";
import filePreview from "@/components/Preview/filePreview.vue";
import {
  exportProcessEvaluate,
  doProcessEvaluate,
  delProcessEvaluate,
  pageProcessEvaluate,
} from '@/api/cnas/process/uncertainty.js'
import { mapGetters } from "vuex";
import {
  deleteManagementReview,
  exportManagementReview,
  pageManagementReview, saveOrUpdateManagementReview
} from "@/api/cnas/process/ensureResults/managementReview";
import {selectUserCondition} from "@/api/cnas/resourceDemand/facilitiesEnvironment/facilitiesAndEnvironment";
export default {
  name: 'Uncertainty',
  components: {
    limsTable,
    filePreview
  },
  data() {
    return {
      addPower: false,
      outPower: false,
      outLoading: false,
      addDialogVisible: false,
      operationType: '',
      addInfo: {},
      addLoading: false,
      queryParams: {},
      tableData: [],
      column: [
        { label: "文件名称", prop: "fileName" },
        { label: "监督人", prop: "supervisor" },
        { label: "质量评审日期", prop: "superviseDate" },
        {
          dataType: "action",
          label: "操作",
          operation: [
            {
              name: "编辑",
              type: "text",
              clickFun: (row) => {
                this.openForm('edit', row);
              },
            },
            {
              name: "删除",
              type: "text",
              clickFun: (row) => {
                this.handleDelete(row);
              },
            },
            {
              name: "导出",
              type: "text",
              clickFun: (row) => {
                this.handleDown0(row);
              },
            },
          ],
        },
      ],
      page: {
        total: 0,
        size: 10,
        current: 0,
      },
      tableLoading: false,
      form: {
        fileName: '',
        implementationContent: '',
        dynamicContent: '',
        supervisor: '',
        superviseDate: '',
      },
      formRules: {
        fileName: [{required: true, message: '请填写文件名称',trigger: 'blur'}],
        implementationContent: [{required: true, message: '请填写计划内容',trigger: 'blur'}],
        dynamicContent: [{required: true, message: '请填动态内容',trigger: 'blur'}],
        supervisor: [{required: true, message: '请选择监督人',trigger: 'change'}],
        superviseDate: [{required: true, message: '请选择日期',trigger: 'change'}],
      },
      responsibleOptions: [],
    }
  },
  // 用于上传文件的信息
  computed: {
    ...mapGetters(["userId"]),
  },
  mounted() {
    this.getList()
  },
  methods: {
    getList() {
      this.tableLoading = true;
      let param = { ...this.queryParams, ...this.page };
      delete param.total;
      pageManagementReview({ ...param })
        .then((res) => {
          this.tableLoading = false;
          if (res.code === 200) {
            this.tableData = res.data.records;
            this.page.total = res.data.total;
          }
        })
        .catch((err) => {
          this.tableLoading = false;
        });
    },
    pagination({ page, limit }) {
      this.page.current = page;
      this.page.size = limit;
      this.getList();
    },
    refresh() {
      this.queryParams = {};
      this.page.current = 1;
      this.getList();
    },
    refreshTable() {
      this.page.current = 1;
      this.getList();
    },
    handleDown0(row) {
      exportManagementReview({managementReviewId: row.managementReviewId}).then(res => {
        const blob = new Blob([res], { type: 'application/msword' });
        this.$download.saveAs(blob, row.fileName + '.docx');
      })
    },
    // 打开新增编辑弹框
    openForm (type, row) {
      this.addDialogVisible = true;
      this.$nextTick(() => {
        this.form = {}
        this.$refs['form'].resetFields();
        if (type === 'edit') {
          this.form = {...row}
        }
        this.operationType = type;
        this.getUserList()
      })
    },
    // 提交表单
    handleAdd() {
      this.addLoading = true;
      saveOrUpdateManagementReview(this.form).then((res) => {
        this.addLoading = false;
        this.$message.success('评价成功');
        this.closeDia();
        this.refreshTable()
      })
    },
    closeDia() {
      this.$refs['form'].resetFields();
      this.addDialogVisible = false;
    },
    handleDelete(row) {
      this.$confirm("是否删除该条数据?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      }).then(() => {
        deleteManagementReview({ managementReviewId: row.managementReviewId }).then((res) => {
          this.$message.success("删除成功");
          this.refresh();
        });
      }).catch(() => { });
    },
    getUserList(){
      selectUserCondition({type: 2}).then(res => {
        if (res.code == 200) {
          this.responsibleOptions = res.data
        }
      })
    },
  }
}
</script>
 
<style scoped>
.search {
  height: 46px;
  display: flex;
  justify-content: space-between;
}
 
.search_thing {
  width: 350px;
  display: flex;
  align-items: center;
}
 
.search_label {
  width: 80px;
  font-size: 14px;
  text-align: right;
}
 
.search_input {
  width: calc(100% - 80px);
}
</style>