“zhuo”
2023-08-10 312b055ee75a14d90201e9de9024927de49d7d8b
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
<template>
  <div class="content-main">
    <div class="top-bar">
      <el-form ref="form" :inline="true">
        <el-form-item>
          <el-date-picker
            v-model="input"
            type="date"
            placeholder="请选择查询日期"
          >
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="getData()">查询</el-button>
          <el-button type="primary" plain @click="resetData()">重置</el-button>
        </el-form-item>
      </el-form>
      <el-form>
        <!-- 上传附件 -->
        <el-button
          class="rightBtn"
          type="primary"
          icon="el-icon-upload2"
          @click="dialogFormVisible1 = true"
          >上传附件</el-button
        >
 
        <el-dialog title="新增计划" :visible.sync="dialogFormVisible1">
          <el-form :model="uploadingForm">
            <el-form-item label="审核日期:" :label-width="formLabelWidth">
              <el-date-picker
                v-model="uploadingForm.auditTime"
                type="date"
                placeholder="请选择日期"
                autocomplete="off"
              >
              </el-date-picker>
            </el-form-item>
            <el-form-item label="录入人:" :label-width="formLabelWidth">
              <el-input
                v-model="uploadingForm.keyboarder"
                autocomplete="off"
                placeholder="请输入录入人"
              ></el-input>
            </el-form-item>
            <el-form-item label="上传附件:" :label-width="formLabelWidth">
              <el-input
                v-model="uploadingForm.attachment"
                autocomplete="off"
              ></el-input>
            </el-form-item>
          </el-form>
          <div slot="footer" class="dialog-footer">
            <el-button @click="dialogFormVisible1 = false">取 消</el-button>
            <el-button type="primary" @click="dialogFormVisible1 = false"
              >确 定</el-button
            >
          </div>
        </el-dialog>
 
        <!-- 上传计划 -->
        <el-button
          class="rightBtn"
          type="primary"
          icon="el-icon-document-add"
          @click="addPlan"
          >新增计划</el-button
        >
        <el-button
          class="rightBtn"
          type="primary"
          icon="el-icon-document-checked"
          >导出年度计划</el-button
        >
        <el-button
          class="rightBtn"
          type="primary"
          icon="el-icon-document-checked"
          >导出内部实施计划</el-button
        >
      </el-form>
    </div>
    <div class="library-table">
      <div class="table-box">
        <el-table
          ref="auditTable"
          border
          :max-height="800"
          :cell-style="{ textAlign: 'center' }"
          :header-cell-style="{
            border: '0px',
            background: '#f5f7fa',
            color: '#606266',
            boxShadow: 'inset 0 1px 0 #ebeef5',
            textAlign: 'center',
          }"
          :data="auditTable"
          style="width: 100%"
        >
          <el-table-column type="index" label="序号" min-width="30px">
            <template>
              <el-checkbox type="checkbox" />
            </template>
          </el-table-column>
          <el-table-column prop="year" label="年度" min-width="60px" />
          <el-table-column prop="month" label="月度" min-width="60px" />
          <el-table-column prop="planTime" label="计划时间" min-width="100px" />
          <el-table-column prop="auditType" label="性质" min-width="80px">
            <template slot-scope="scope">
              <span>
                {{ scope.row.auditType == 0 ? "内审" : "管理评审" }}
              </span>
            </template>
          </el-table-column>
          <el-table-column prop="department" label="部门" min-width="80px" />
          <el-table-column
            prop="auditLeader"
            label="审核组长"
            min-width="80px"
          />
          <el-table-column prop="auditEmp" label="组员" min-width="80px" />
          <el-table-column
            prop="auditPurpose"
            label="审核目的"
            min-width="100px"
          />
          <el-table-column
            prop="auditScope"
            label="审核范围"
            min-width="100px"
          />
          <el-table-column
            prop="auditPursuant"
            label="审核依据"
            min-width="100px"
          />
          <el-table-column prop="writeUser" label="编制人" min-width="80px" />
          <el-table-column prop="createTime" label="编制日期" min-width="100px">
          </el-table-column>
          <el-table-column prop="keyboarder" label="录入人" min-width="80px" />
          <el-table-column prop="checker" label="检验人" min-width="80px" />
          <el-table-column
            prop="auditTime"
            label="审核日期"
            min-width="100px"
          />
          <el-table-column prop="count" label="不符合项目数" min-width="60px" />
          <el-table-column prop="auditState" label="状态" min-width="100px">
            <template slot-scope="scope">
              <div v-if="scope.row.auditState === 0">
                <el-tag class="tag-item" type="warning">即将开始</el-tag>
              </div>
              <div v-else-if="scope.row.auditState === 1">
                <el-tag class="tag-item" type="success">完成</el-tag>
              </div>
              <div v-else>
                <el-tag class="tag-item" type="danger">逾期</el-tag>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="操作" min-width="100" fixed="right">
            <template slot-scope="scope">
              <el-button
                type="text"
                size="small"
                @click="handleClick(scope.row)"
                >查看</el-button
              >
              <el-button type="text" size="small">删除</el-button>
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页器 -->
        <div>
          <el-pagination
            :current-page="page"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="total"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
import { selectAllList, addCnasAnnualPlan } from "@/api/CNAS/reviewAnnualPlan";
export default {
  data() {
    return {
      input: [],
      auditTable: [],
      page: 1,
      total: 0,
      pageSize: 10,
      dialogFormVisible1: false,
      uploadingForm: {
        auditTime: "",
        keyboarder: "",
        keyboarder: "",
      },
      formLabelWidth: "80px",
    };
  },
  created() {
    this.getData();
  },
  methods: {
    // 每页条数改变时触发 选择一页显示多少行
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.pageSize = val;
      this.getData();
    },
    // 当前页改变时触发 跳转其他页
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.page = val;
      this.getData();
    },
    // 重置按钮
    resetData() {
      this.input = undefined;
      this.page = 1;
      this.pageSize = 10;
      this.getData();
    },
    // 查询列表
    async getData() {
      const params = {
        page: this.page,
        pageSize: this.pageSize,
      };
      const { data } = await selectAllList(params);
      this.auditTable = data.row;
      this.total = data.total;
    },
  },
};
</script>
 
<style lang="scss" scoped>
.top-bar {
  margin: -25px -15px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  padding: 5px 24px 0px 24px;
}
.library-table {
  background-color: #fff;
  flex: 1;
  margin: 0px -15px;
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  .table-box {
    padding: 0px 20px;
    margin-top: 20px;
    flex: 1;
    background: #fff;
    display: flex;
    flex-direction: column;
    > div:nth-child(2) {
      display: flex;
      justify-content: end;
      margin: 10px 0;
    }
    .tag-item {
      width: 80px;
    }
  }
}
</style>