reformCheck.vue 17 KB

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