reformCheck.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. <!--问题整改列表-->
  2. <template>
  3. <div class="app-container reformCheck">
  4. <div class="reformCheckPage" v-if="pageType == 1">
  5. <div class="top-big-box">
  6. <div>
  7. <p :class="spStatus==0?'color_one':'color_99'" @click="tableClick(0)">待整改({{num0}})</p>
  8. <p :class="{'back_one':spStatus==0}"></p>
  9. </div>
  10. <div>
  11. <p :class="spStatus==1?'color_one':'color_99'" @click="tableClick(1)">待复核({{num1}})</p>
  12. <p :class="{'back_one':spStatus==1}"></p>
  13. </div>
  14. <div>
  15. <p :class="spStatus==2?'color_one':'color_99'" @click="tableClick(2)">复核未通过({{num2}})</p>
  16. <p :class="{'back_one':spStatus==2}"></p>
  17. </div>
  18. <div>
  19. <p :class="spStatus==3?'color_one':'color_99'" @click="tableClick(3)">暂时无法整改({{num3}})</p>
  20. <p :class="{'back_one':spStatus==3}"></p>
  21. </div>
  22. <div>
  23. <p :class="spStatus==4?'color_one':'color_99'" @click="tableClick(4)">整改完成({{num4}})</p>
  24. <p :class="{'back_one':spStatus==4}"></p>
  25. </div>
  26. </div>
  27. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
  28. <el-form-item label="实验室名称" prop="laboratoryName" label-width="90px">
  29. <el-input
  30. v-model="queryParams.laboratoryName"
  31. placeholder="请输入实验室名称"
  32. clearable
  33. size="small"
  34. />
  35. </el-form-item>
  36. <el-form-item label="整改类型" prop="zgType" label-width="80px">
  37. <el-select v-model="queryParams.zgType" placeholder="请选择整改类型" clearable size="small">
  38. <el-option label="一般整改" value="0" />
  39. <el-option label="重大整改" value="1" />
  40. </el-select>
  41. </el-form-item>
  42. <el-form-item label="检查时间" label-width="80px">
  43. <el-date-picker
  44. :clearable="false"
  45. v-model="dateRange"
  46. size="small"
  47. style="width: 240px"
  48. value-format="yyyy-MM-dd"
  49. type="daterange"
  50. range-separator="-"
  51. start-placeholder="开始日期"
  52. end-placeholder="结束日期"
  53. ></el-date-picker>
  54. </el-form-item>
  55. <el-form-item>
  56. <p class="inquire-button-one" @click="handleQuery">查询</p>
  57. <p class="reset-button-one" @click="resetQuery">重置</p>
  58. </el-form-item>
  59. </el-form>
  60. <el-table v-loading="loading" border :data="checkRecordList" border>
  61. <el-table-column label="序号" type="index" align="center" width="50"/>
  62. <!--<el-table-column label="项目序号" align="left" prop="jcxSstkNum" width="100" show-overflow-tooltip/>-->
  63. <el-table-column label="隐患描述" align="left" prop="yhMs" show-overflow-tooltip/>
  64. <el-table-column label="整改类型" align="left" prop="zgType" width="110" show-overflow-tooltip>
  65. <template slot-scope="scope">{{scope.row.zgType==0?'一般整改':(scope.row.zgType==1?'重大整改':'')}}</template>
  66. </el-table-column>
  67. <el-table-column label="实验室名称" align="left" prop="laboratoryName" width="180" show-overflow-tooltip/>
  68. <el-table-column label="房间号" align="left" prop="fjNumber" width="90"/>
  69. <el-table-column label="实验楼" align="left" prop="buildingName" width="150" show-overflow-tooltip/>
  70. <el-table-column label="检查单位" align="left" prop="jcDwName" width="150" show-overflow-tooltip/>
  71. <el-table-column label="检查时间" align="left" prop="checkTime" width="200"/>
  72. <el-table-column label="整改截止时间" align="left" prop="zgjzTime" width="150" v-if="queryParams.spStatus == 0"/>
  73. <el-table-column label="整改完成时间" align="left" prop="zgTime" width="150" v-if="queryParams.spStatus == 1"/>
  74. <el-table-column label="整改驳回时间" align="left" prop="spTime" width="150" v-if="queryParams.spStatus == 2"/>
  75. <el-table-column label="复核时间" align="left" prop="spTime" width="150" v-if="queryParams.spStatus == 4"/>
  76. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120" v-if="tableButtonType">
  77. <template slot-scope="scope">
  78. <div class="button-box" style="display: flex;margin-left:20px;">
  79. <p class="table-min-button"
  80. @click="goPageType(2,scope.row)"
  81. v-hasPermi="['laboratory:checkRecordDetails:query']"
  82. >查看</p>
  83. </div>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. <pagination
  88. style="margin-bottom:20px;"
  89. v-show="total>0"
  90. :total="total"
  91. :page.sync="queryParams.pageNum"
  92. :limit.sync="queryParams.pageSize"
  93. @pagination="getList"/>
  94. </div>
  95. <check-record-info v-if="pageType == 2" :infoId="infoId"></check-record-info>
  96. <!-- 添加或修改安全检查对话框 -->
  97. <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  98. <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  99. <el-form-item label="实验室名称" prop="laboratoryName" :show-overflow-tooltip="true">
  100. <el-input v-model="form.laboratoryName" placeholder="请输入实验室名称" />
  101. </el-form-item>
  102. <el-form-item label="实验室id" prop="laboratoryId">
  103. <el-input v-model="form.laboratoryId" placeholder="请输入实验室id" />
  104. </el-form-item>
  105. <el-form-item label="实验楼名称" prop="buildingName">
  106. <el-input v-model="form.buildingName" placeholder="请输入实验楼名称" />
  107. </el-form-item>
  108. <el-form-item label="实验楼id" prop="buildingId">
  109. <el-input v-model="form.buildingId" placeholder="请输入实验楼id" />
  110. </el-form-item>
  111. <el-form-item label="检查单位" prop="jcDw" :show-overflow-tooltip="true">
  112. <el-input v-model="form.jcDw" placeholder="请输入检查单位" />
  113. </el-form-item>
  114. <el-form-item label="检查人" prop="jcRyxm">
  115. <el-input v-model="form.jcRyxm" placeholder="请输入检查人" />
  116. </el-form-item>
  117. <el-form-item label="房间号" prop="fjNumber">
  118. <el-input v-model="form.fjNumber" placeholder="请输入房间号" />
  119. </el-form-item>
  120. <el-form-item label="负责人id" prop="fzrId">
  121. <el-input v-model="form.fzrId" placeholder="请输入负责人id" />
  122. </el-form-item>
  123. <el-form-item label="负责人姓名" prop="fzrName">
  124. <el-input v-model="form.fzrName" placeholder="请输入负责人姓名" />
  125. </el-form-item>
  126. <el-form-item label="负责人联系方式" prop="fzrLxfs">
  127. <el-input v-model="form.fzrLxfs" placeholder="请输入负责人联系方式" />
  128. </el-form-item>
  129. <el-form-item label="证明材料描述" prop="zmClMs">
  130. <el-input v-model="form.zmClMs" placeholder="请输入证明材料描述" />
  131. </el-form-item>
  132. <el-form-item label="证明材料图片" prop="zmClImg">
  133. <el-input v-model="form.zmClImg" placeholder="请输入证明材料图片" />
  134. </el-form-item>
  135. <el-form-item label="整改描述" prop="zgMs">
  136. <el-input v-model="form.zgMs" placeholder="请输入整改描述" />
  137. </el-form-item>
  138. <el-form-item label="整改措施" prop="zgCs">
  139. <el-input v-model="form.zgCs" placeholder="请输入整改措施" />
  140. </el-form-item>
  141. <el-form-item label="整改结果" prop="zgJg">
  142. <el-input v-model="form.zgJg" placeholder="请输入整改结果" />
  143. </el-form-item>
  144. <el-form-item label="原因分析" prop="zgYyfx">
  145. <el-input v-model="form.zgYyfx" placeholder="请输入原因分析" />
  146. </el-form-item>
  147. <el-form-item label=" 0待整改 1整改待确认 2复核未通过 3整改中 4完成">
  148. <el-radio-group v-model="form.spStatus">
  149. <el-radio label="1">请选择字典生成</el-radio>
  150. </el-radio-group>
  151. </el-form-item>
  152. <el-form-item label="0一般整改 1重大整改" prop="zgType">
  153. <el-select v-model="form.zgType" placeholder="请选择0一般整改 1重大整改">
  154. <el-option label="请选择字典生成" value="" />
  155. </el-select>
  156. </el-form-item>
  157. <el-form-item label="0否 1是" prop="isCg">
  158. <el-input v-model="form.isCg" placeholder="请输入0否 1是" />
  159. </el-form-item>
  160. <el-form-item label="整改截止时间" prop="zgjzTime">
  161. <el-date-picker clearable size="small"
  162. v-model="form.zgjzTime"
  163. type="date"
  164. value-format="yyyy-MM-dd"
  165. placeholder="选择整改截止时间">
  166. </el-date-picker>
  167. </el-form-item>
  168. <el-form-item label="整改驳回时间" prop="zgbhTime">
  169. <el-date-picker clearable size="small"
  170. v-model="form.zgbhTime"
  171. type="date"
  172. value-format="yyyy-MM-dd"
  173. placeholder="选择整改驳回时间">
  174. </el-date-picker>
  175. </el-form-item>
  176. <el-form-item label="整改确认时间" prop="zgqrTime">
  177. <el-date-picker clearable size="small"
  178. v-model="form.zgqrTime"
  179. type="date"
  180. value-format="yyyy-MM-dd"
  181. placeholder="选择整改确认时间">
  182. </el-date-picker>
  183. </el-form-item>
  184. </el-form>
  185. <div slot="footer" class="dialog-footer">
  186. <el-button type="primary" @click="submitForm">确 定</el-button>
  187. <el-button @click="cancel">取 消</el-button>
  188. </div>
  189. </el-dialog>
  190. </div>
  191. </template>
  192. <script>
  193. import { checkRecordList, selectStatusList,listWtzg } from "@/api/laboratory/checkRecord";
  194. import checkRecordInfo from "./CheckRecordInfo.vue"
  195. export default {
  196. name: "CheckRecord",
  197. components: {
  198. checkRecordInfo
  199. },
  200. data() {
  201. return {
  202. tableButtonType:this.hasPermiDom(['laboratory:checkRecordDetails:query']),
  203. //传参数据
  204. infoId:"",
  205. //各状态数量
  206. num0:"",
  207. num1:"",
  208. num2:"",
  209. num3:"",
  210. num4:"",
  211. //页面状态
  212. pageType:1,
  213. // 遮罩层
  214. loading: true,
  215. // 选中数组
  216. ids: [],
  217. // 非单个禁用
  218. single: true,
  219. // 非多个禁用
  220. multiple: true,
  221. // 显示搜索条件
  222. showSearch: true,
  223. // 总条数
  224. total: 0,
  225. // 安全检查表格数据
  226. checkRecordList: [{}],
  227. // 弹出层标题
  228. title: "",
  229. // 是否显示弹出层
  230. open: false,
  231. // 查询参数
  232. queryParams: {
  233. //整改状态
  234. spStatus:0,
  235. pageNum: 1,
  236. pageSize:20,
  237. laboratoryName: null,
  238. zgType: null,
  239. isZgStatus:"",
  240. },
  241. spStatus:0,
  242. //查询时间
  243. dateRange:[],
  244. // 表单参数
  245. form: {},
  246. // 表单校验
  247. rules: {
  248. laboratoryId: [
  249. { required: true, message: "实验室id不能为空", trigger: "blur" },
  250. { required: true, message: "实验室id不能为空", validator: this.spaceJudgment, trigger: "blur" }
  251. ],
  252. }
  253. };
  254. },
  255. created() {
  256. this.getNum();
  257. this.getList();
  258. },
  259. methods: {
  260. goPageType(type,row){
  261. if(type == 2){
  262. this.infoId = row.id;
  263. this.pageType = 2;
  264. }else if(type == 1){
  265. this.pageType = 1;
  266. this.getNum();
  267. this.getList();
  268. }
  269. },
  270. //整改状态切换
  271. tableClick(type){
  272. console.log('type',type);
  273. if(this.spStatus != type){
  274. if(type == 3){
  275. this.queryParams.isZgStatus = 1;
  276. this.queryParams.spStatus = "4";
  277. }else if(type == 4){
  278. this.queryParams.isZgStatus = 0;
  279. this.queryParams.spStatus = type;
  280. }else{
  281. this.queryParams.isZgStatus = "";
  282. this.queryParams.spStatus = type;
  283. }
  284. this.queryParams.pageNum = 1;
  285. this.queryParams.pageSize = 20;
  286. this.spStatus = type;
  287. // this.resetQuery();
  288. this.getNum();
  289. this.getList();
  290. }
  291. },
  292. getNum(){
  293. this.queryParams.isCg = 0;
  294. selectStatusList(this.queryParams).then( response => {
  295. let self = this;
  296. for(let i=0;i<response.data.length;i++){
  297. if(response.data[i].lx == '0'){
  298. self.num0 = response.data[i].sl
  299. }else if(response.data[i].lx == '1'){
  300. self.num1 = response.data[i].sl
  301. }else if(response.data[i].lx == '2'){
  302. self.num2 = response.data[i].sl
  303. }else if(response.data[i].lx == '3'){
  304. self.num3 = response.data[i].sl
  305. }else if(response.data[i].lx == '4'){
  306. self.num4 = response.data[i].sl
  307. }
  308. }
  309. // this.checkRecordList = response.rows;
  310. });
  311. },
  312. /** 查询安全检查列表 */
  313. getList() {
  314. this.loading = true;
  315. if(this.dateRange&&this.dateRange.length>0){
  316. this.queryParams.beginTime=this.dateRange[0]
  317. this.queryParams.endTime=this.dateRange[1]
  318. }else{
  319. this.queryParams.beginTime=null;
  320. this.queryParams.endTime=null
  321. }
  322. this.queryParams.isCg = 0;
  323. let obj = JSON.parse(JSON.stringify(this.queryParams))
  324. if(obj.spStatus == 3){
  325. obj.spStatus = 1;
  326. }
  327. // checkRecordList(this.queryParams).then( response => {
  328. listWtzg(obj).then( response => {
  329. this.checkRecordList = response.rows;
  330. this.total = response.total;
  331. this.loading = false;
  332. });
  333. },
  334. // 取消按钮
  335. cancel() {
  336. this.open = false;
  337. this.reset();
  338. },
  339. // 表单重置
  340. reset() {
  341. this.form = {
  342. id: null,
  343. laboratoryName: null,
  344. laboratoryId: null,
  345. buildingName: null,
  346. buildingId: null,
  347. jcDw: null,
  348. jcRyxm: null,
  349. fjNumber: null,
  350. fzrId: null,
  351. fzrName: null,
  352. fzrLxfs: null,
  353. zmClMs: null,
  354. zmClImg: null,
  355. zgMs: null,
  356. zgCs: null,
  357. zgJg: null,
  358. zgYyfx: null,
  359. spStatus: 0,
  360. zgType: null,
  361. isCg: null,
  362. zgjzTime: null,
  363. zgbhTime: null,
  364. zgqrTime: null,
  365. createTime: null
  366. };
  367. this.resetForm("form");
  368. },
  369. /** 搜索按钮操作 */
  370. handleQuery() {
  371. this.queryParams.pageNum = 1;
  372. this.getList();
  373. },
  374. /** 重置按钮操作 */
  375. resetQuery() {
  376. // this.resetForm("queryForm");
  377. this.queryParams.pageNum = 1;
  378. this.queryParams.pageSize = 20;
  379. this.queryParams.laboratoryName = '';
  380. this.queryParams.zgType = '';
  381. this.dateRange = [];
  382. this.queryParams.beginTime = "";
  383. this.queryParams.endTime = "";
  384. this.handleQuery();
  385. this.getNum();
  386. },
  387. // 多选框选中数据
  388. handleSelectionChange(selection) {
  389. this.ids = selection.map(item => item.id)
  390. this.single = selection.length!==1
  391. this.multiple = !selection.length
  392. },
  393. /** 新增按钮操作 */
  394. handleAdd() {
  395. this.reset();
  396. this.open = true;
  397. this.title = "添加安全检查";
  398. },
  399. /** 修改按钮操作 */
  400. handleUpdate(row) {
  401. this.reset();
  402. const id = row.id || this.ids
  403. getCheckRecord(id).then( response => {
  404. this.form = response.data;
  405. this.open = true;
  406. this.title = "修改安全检查";
  407. });
  408. },
  409. /** 提交按钮 */
  410. submitForm() {
  411. this.$refs["form"].validate(valid => {
  412. if (valid) {
  413. if (this.form.id != null) {
  414. updateCheckRecord(this.form).then( response => {
  415. this.msgSuccess("修改成功");
  416. this.open = false;
  417. this.getList();
  418. });
  419. } else {
  420. addCheckRecord(this.form).then( response => {
  421. this.msgSuccess("新增成功");
  422. this.open = false;
  423. this.getList();
  424. });
  425. }
  426. }
  427. });
  428. },
  429. /** 删除按钮操作 */
  430. handleDelete(row) {
  431. const ids = row.id || this.ids;
  432. this.$confirm('是否确认删除安全检查编号为"' + ids + '"的数据项?', "警告", {
  433. confirmButtonText: "确定",
  434. cancelButtonText: "取消",
  435. type: "warning"
  436. }).then(function() {
  437. return delCheckRecord(ids);
  438. }).then(() => {
  439. this.getList();
  440. this.msgSuccess("删除成功");
  441. }).catch(() => {});
  442. },
  443. /** 导出按钮操作 */
  444. handleExport() {
  445. this.download('laboratory/checkRecord/export', {
  446. ...this.queryParams
  447. }, `laboratory_checkRecord.xlsx`)
  448. }
  449. }
  450. };
  451. </script>
  452. <style scoped lang="scss">
  453. .reformCheck{
  454. flex:1;
  455. display: flex;
  456. flex-direction: column;
  457. overflow: hidden !important;
  458. .reformCheckPage{
  459. flex:1;
  460. display: flex;
  461. flex-direction: column;
  462. overflow: hidden;
  463. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  464. padding:20px!important;
  465. .top-big-box{
  466. display: flex;
  467. border-bottom:2px solid #E0E0E0;
  468. margin-top:-9px;
  469. margin-bottom:20px;
  470. div{
  471. cursor:pointer;
  472. padding:0 30px;
  473. p:nth-child(1){
  474. line-height:58px;
  475. font-size:18px;
  476. text-align: center;
  477. margin:0;
  478. }
  479. p:nth-child(2){
  480. height:4px;
  481. margin:0 auto;
  482. border-radius:1px;
  483. }
  484. }
  485. }
  486. }
  487. }
  488. </style>