panzy
2022-05-21 c1df656dee7e75d109d2bee05f0c129e13e9367a
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
<template>
  <div class="app-container">
    <el-form
      ref="form"
      :inline="true"
      class="inquire"
      :model="listQuery.form"
      label-width="100px"
    >
      <el-form-item label="地点">
        <el-input v-model="listQuery.form.ADDRESS" style="width: 202px" placeholder="请输入内容"></el-input>
      </el-form-item>
      <el-form-item label="主持人">
        <el-input v-model="listQuery.form.HOST" style="width: 202px" placeholder="请输入内容"></el-input>
      </el-form-item>
      <el-form-item label="召开时间">
        <el-col :span="11">
          <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.Conference_TimeStart" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
        </el-col>
        <el-col style="text-align: center" :span="2">-</el-col>
        <el-col :span="11">
          <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.Conference_TimeEnd" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
        </el-col>
      </el-form-item>
      <el-form-item style="text-align: center; padding: 0 50px">
        <el-button type="primary" class="btns" size="small" icon="el-icon-search" @click="getPageList()">查询</el-button>
        <el-button type="primary" class="btns" size="small" icon="el-icon-refresh-right" @click="reset()">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row class="title-center">
      <el-col :span="10">
        <el-radio-group v-model="listQuery.type" @change="typeChange">
          <el-radio-button label="0">未上报</el-radio-button>
          <el-radio-button label="1">已上报</el-radio-button>
          <el-radio-button label="2">上级公司会议</el-radio-button>
        </el-radio-group>
      </el-col>
      <div v-if="listQuery.type==0">
        <el-col :span="10">
          <el-row>
            <el-col :span="7" :offset="7" style="text-align: right;">
                <span style="line-height: 36px; font-size: 14px; color: #606266;margin-right:10px;font-weight: bold;">请选择上报方式</span>
            </el-col>
            <el-col :span="10">
                <el-select v-model="listQuery.form.check_main_branch" placeholder="请选择" @change="changeUpType">
                    <el-option v-for="item in upTypeList" :key="item.value" :label="item.label" :value="item.value">
                    </el-option>
                </el-select>
            </el-col>
                <el-col :span="6">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.Conference_TimeStart" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col style="text-align: center" :span="2">至</el-col>
                <el-col :span="6">
                    <el-date-picker type="date" placeholder="选择日期" v-model="listQuery.form.Conference_TimeEnd" style="width: 100%" value-format="yyyy-MM-dd"></el-date-picker>
                </el-col>
                <el-col :span="10">
                <el-button type="primary" class="btns" size="small">上报</el-button>
            </el-col>
          </el-row>
        </el-col>
        <el-col :span="4" style="text-align: right">
          <el-button class="btns" type="primary" size="small" icon="el-icon-plus">添加</el-button>
          <el-button class="btns" type="primary" size="small" icon="el-icon-close" @click="sendBath()">批量删除</el-button>
        </el-col>
      </div>
       <div v-if="listQuery.type==1">
        <el-col :span="14" style="text-align: right">
          <el-button
            class="btns"
            type="primary"
            size="small"
            >撤销</el-button
          >
        </el-col>
      </div>
    </el-row>
    <el-row class="title-center">
      <el-col :span="10">
        <el-radio-group v-model="listQuery.form.CONFERENCE_PROFESSIONAL" @change="changeType2">
          <el-radio-button label="0">全部</el-radio-button>
          <el-radio-button label="综合">综合</el-radio-button>
          <el-radio-button label="生产">生产</el-radio-button>
          <el-radio-button label="设备">设备</el-radio-button>
          <el-radio-button label="电器">电器</el-radio-button>
          <el-radio-button label="仪表">仪表</el-radio-button>
          <el-radio-button label="消防">消防</el-radio-button>
          <el-radio-button label="安全管理">安全管理</el-radio-button>
          <el-radio-button label="其他">其他</el-radio-button>
        </el-radio-group>
      </el-col>
    </el-row>
    <el-table :data="tableData" style="width: 100%" @selection-change="handleSelectionChange">
        <el-table-column type="selection" width="55" align="center"></el-table-column>
        <el-table-column v-if="listQuery.type==2" prop="communityname" label="会议单位" align="center" width="120"></el-table-column>
        <el-table-column prop="CONFERENCE_TIME" label="召开时间" :formatter="formatColumnDate" align="center" width="120"></el-table-column>
        <el-table-column prop="ADDRESS" label="地点" align="center" width="120"></el-table-column>
        <el-table-column prop="HOST" label="主持人" align="center" width="120"></el-table-column>
        <el-table-column prop="CONFERENCE_PROFESSIONAL" label="会议专业" align="center" width="120"></el-table-column>
        <el-table-column prop="meeting_content" label="会议摘要" align="center"></el-table-column>
        <el-table-column prop="realFileName" label="会议纪要" align="center">
            <template slot-scope="scope" >
                <el-upload
                    class="upload-demo"
                    ref="upload"
                    v-if="listQuery.type==0"
                    :http-request="uploadSectionFile"
                    :on-preview="handlePreview"
                    :on-remove="handleRemove"
                    :file-list="fileList"
                    :before-upload="beforeUpload"
                    :auto-upload="true">
                    <el-button slot="trigger" size="small" type="primary" class="btns">上传附件</el-button>
                </el-upload>
                <div v-else
                v-for="item in scope.row.realFileName">
                    <el-link  type="primary" @click="downloadFile(subFile(item))">
                        {{subFile(item)}}
                    </el-link>
                </div>
            </template>
        </el-table-column>
        <el-table-column prop="date" v-if="listQuery.type==0" label="基本操作" align="center">
            <template slot-scope="scope">
                <el-button @click="updateClick(scope.row)" type="text" size="small">编辑</el-button>
                <el-button @click="updateClick(scope.row)" type="text" size="small">保存</el-button>
                <el-button @click="deleteClick(scope.row)" type="text" size="small">删除</el-button>
            </template>
        </el-table-column>
    </el-table>
    <div style="text-align: right">
      <el-pagination
        v-show="recordTotal > 0"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[10, 20, 30, 50]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="recordTotal"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import {getPageList, dowloand_do} from "@/api/sgyhpczl/troubleshooting";
import {uploadFile} from "@/api/sgyhpczl/hiddenDangerRectification";
 
import {
  initYHLX,
} from "@/api/sgyhpczl/initSelect";
 
export default {
    data() {
        return {
            listQuery: {
            page: 1,
            limit: 10,
            type: 0,//type=0 待上报 type=1 已上报 type=2 上级公司会议
            form: {
                CONFERENCE_PROFESSIONAL: '0'
            },
            },
            table1: true,
            table2: false,
 
            currentPage: 1,
            pageSize: 10,
            recordTotal: 0,
            YHLXList:[],
            tableData: [],
            selectedList: [],
            listLoading: false,
            fileList:[],
            upTypeList:[{label:"按勾选上报",value:0},{label:"按时间上报",value:1}],
            upTimeShow: false,
        };
  },
    mounted() {
        this.getPageList();
        this.initYHLX();
    },
  methods: {
    sendBath() {
      this.$router.push({
        path: "/existN",
      });
    },
    handleClick(data, val) {
      if (val == "存在") {
        this.$router.push({
          path: "/exist",
        });
      }
    },
    handoff(index) {
      if (index == 1) {
        this.table1 = false;
        this.table2 = true;
        this.listQuery.type = 2;
        console.log(this.listQuery.type);
        this.getPageList();
      } else {
        this.table1 = true;
        this.table2 = false;
      }
    },
      initYHLX(){
          initYHLX().then(res=>{
              if (res.data.ok==1){
                  this.YHLXList=res.data.data
              } else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      changeUpType(val){
          if (val == 1){
              this.upTimeShow = true
          }
      },
    checkTime() {
      if (
        this.listQuery.form.check_dateStart != null &&
        this.listQuery.form.check_dateStart != ""
      ) {
        if (
          this.listQuery.form.check_dateEnd != null &&
          this.listQuery.form.check_dateEnd != ""
        ) {
        } else {
          this.$message({
            type: "error",
            message: "请选择检查结束时间",
            duration: 3000,
          });
          return;
        }
      }
      if (
        this.listQuery.form.check_dateEnd != null &&
        this.listQuery.form.check_dateEnd != ""
      ) {
        if (
          this.listQuery.form.check_dateStart != null &&
          this.listQuery.form.check_dateStart != ""
        ) {
        } else {
          this.$message({
            type: "error",
            message: "请选择检查开始时间",
            duration: 3000,
          });
          return;
        }
      }
    },
    //搜索
    getPageList() {
      this.listQuery.page = 1;
      this.checkTime();
      getPageList(this.listQuery).then((res) => {
        if (res.data.ok == 1) {
          this.tableData = res.data.data.items;
          this.recordTotal = res.data.data.total;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    //重置
    reset() {
      this.listQuery.form = {};
      this.getPageList();
    },
    handleSizeChange(val) {
      this.listQuery.limit = val;
      this.getPageListForPagination();
    },
    handleCurrentChange(val) {
      this.listQuery.page = val;
      this.getPageListForPagination();
    },
    getPageListForPagination() {
      this.checkTime();
      getPageList(this.listQuery).then((res) => {
        if (res.data.ok == 1) {
          this.tableData = res.data.data.items;
          this.recordTotal = res.data.data.total;
        } else {
          this.$message({
            type: "error",
            message: res.data.msg,
            duration: 3000,
          });
        }
      });
    },
    typeChange(val) {
      this.listQuery.type = val;
      this.getPageList();
    },
      changeType2(val){
          this.listQuery.form.CONFERENCE_PROFESSIONAL = val;
          this.getPageList();
      },
    handleSelectionChange(val) {
      this.selectedList = [];
      val.forEach((item) => {
        this.selectedList.push(item);
      });
    },
      uploadSectionFile(param) {
          let form = new FormData();
          var that = this;
          form.append('file', param.file);
          //隐患延期申请附件
          form.append('type', "0");
          uploadFile(form).then(res => {
              var data = res.data;
              if (data.ok) {
                  var fileName = data.data.fileName[0];
                  if (!fileName.endsWith("a62b")) {
                      fileName = fileName + param.file.realFileName;
                  }
                  that.ruleForm.realFileName = that.ruleForm.realFileName + "," + fileName;
              }
          }).error(res => {
              this.$message({
                  type: 'error',
                  message: '附件上传失败,请重试!'
              });
          })
      },
      downloadFile(path){
          let params = {
              type: 1,
              fileName: path,
          };
          dowloand_do(params).then((res) => {
              if (res.data.ok == 1) {
                  this.$notify({
                      title: "成功",
                      message: res.data,
                      type: "success",
                      duration: 2000,
                  });
              } else {
                  this.$message({
                      type: "error",
                      message: res.data.msg,
                      duration: 3000,
                  });
              }
          });
      },
      subFile(fileName){
        return  fileName.substring(fileName.indexOf("fileName=")+9)
      },
      handleRemove(file, fileList) {
          console.log(file, fileList)
      },
      handlePreview(file) {
          console.log(file)
      },
      beforeUpload(file) {
          var FileExt = file.name.replace(/.+\./, "");
          if (['jpg', 'png', 'bmp', 'gif', 'jpeg'].indexOf(FileExt.toLowerCase()) === -1) {
              this.$message({
                  type: 'warning',
                  message: '请上传后缀名为jpg、png、bmp、gif、jpeg的图片!'
              });
              return false;
          }
      },
    //日期格式转换
    formatColumnDate(row, column) {
      // 获取单元格数据
      let data = row[column.property];
      if (data == null) {
        return null;
      }
      let dt = new Date(data);
      return (
        dt.getFullYear() + "-" + (dt.getMonth() + 1) + "-" + dt.getDate() + " "
      );
    },
  },
};
</script>
<style scoped>
.inquire {
  display: flex;
  justify-content: left;
  flex-wrap: wrap;
}
.inquire .el-form-item {
  padding: 0 20px;
}
.title-center {
  padding: 20px 0;
}
 
.btns {
  background-color: #034ea2;
  border: 1px solid #034ea2;
}
 
.title-center /deep/ .el-radio-button:first-child .el-radio-button__inner {
  border: none;
}
 
.title-center /deep/ .el-radio-button__inner {
  border: none;
  border-radius: 0px;
}
 
.title-center
  /deep/
  .el-radio-button__orig-radio:checked
  + .el-radio-button__inner {
  background-color: #034ea2;
  background-color: #034ea2;
}
</style>