index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. <!--检查记录-->
  2. <template>
  3. <div class="app-container checkRecord">
  4. <div class="checkRecordPage" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" style="margin-top:20px;" :inline="true" v-show="showSearch">
  6. <el-form-item label="关键字" prop="searchValue" label-width="70px">
  7. <el-input
  8. style="width:230px;"
  9. v-model="queryParams.searchValue"
  10. placeholder="请输入实验室/负责人/检查单号"
  11. clearable
  12. size="small"
  13. maxLength="20"
  14. />
  15. </el-form-item>
  16. <el-form-item label="整改类型" prop="zgType" label-width="80px">
  17. <el-select v-model="queryParams.zgType" placeholder="请选择整改类型" clearable size="small">
  18. <el-option label="一般整改" value="0" />
  19. <el-option label="重大整改" value="1" />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="检查时间" label-width="80px">
  23. <el-date-picker
  24. :clearable="false"
  25. v-model="dateRange"
  26. size="small"
  27. style="width: 240px"
  28. value-format="yyyy-MM-dd"
  29. type="daterange"
  30. range-separator="-"
  31. start-placeholder="开始日期"
  32. end-placeholder="结束日期"
  33. ></el-date-picker>
  34. </el-form-item>
  35. <el-form-item>
  36. <p class="inquire-button-one" @click="handleQuery">查询</p>
  37. <p class="reset-button-one" @click="resetQuery">重置</p>
  38. </el-form-item>
  39. </el-form>
  40. <div class="checkRecordPage-top-box" v-hasPermi="['laboratory:checkRecord:list']">
  41. <p class="el-icon-question img-p" @mouseenter="showText" @mouseout="hideText"></p>
  42. <p class="checkRecordPage-title">草稿箱检查数:{{listCount}}</p>
  43. <p class="checkRecordPage-button" @click="goPageInfo(3)">立即处理>></p>
  44. <p class="checkRecordPage-null"></p>
  45. <div class="position-box" v-if="textType">
  46. <p>温馨提示</p>
  47. <p>PC端和手机端录入检查时选择保存到草稿箱的数据</p>
  48. </div>
  49. </div>
  50. <el-table v-loading="loading" border :data="checkRecordList" ref="selection" @selection-change="handleSelectionChange">
  51. <!--<el-table-column type="selection" width="55" align="center"/>-->
  52. <el-table-column label="检查单号" align="left" prop="checkNum" width="180"/>
  53. <el-table-column label="状态" align="center" prop="zgStatus" width="120">
  54. <template slot-scope="scope">
  55. <p style="margin:0;" v-if="scope.row.isZgStatus == 1">暂时无法整改</p>
  56. <p style="margin:0;" v-if="scope.row.isZgStatus == 0">{{scope.row.zgStatus==0?'待整改':(scope.row.zgStatus==1?'整改待复核':(scope.row.zgStatus==2?'复核未通过':(scope.row.zgStatus==4?'整改完成':(scope.row.zgStatus==5?'逾期':''))))}}</p>
  57. </template>
  58. </el-table-column>
  59. <el-table-column label="整改类型" align="left" prop="zgType" width="120">
  60. <template slot-scope="scope">{{scope.row.zgType==0?'一般整改':(scope.row.zgType==1?'重大整改':'')}}</template>
  61. </el-table-column>
  62. <el-table-column label="实验室名称" align="left" prop="laboratoryName" :show-overflow-tooltip="true"/>
  63. <el-table-column label="实验楼" align="left" prop="buildingName" width="160"/>
  64. <el-table-column label="房间号" align="left" prop="fjNumber" width="100"/>
  65. <el-table-column label="隐患/已改/未改" align="left" prop="fjNumber" width="120">
  66. <template slot-scope="scope">
  67. <span style="color:#FFAE00;">{{scope.row.countYh}}</span>
  68. <span>/</span>
  69. <span style="color:#14BA3B;">{{scope.row.countYzg}}</span>
  70. <span>/</span>
  71. <span style="color:#FF5E5E;font-size: 18px;font-weight: bold;">{{scope.row.countWzg}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="检查单位" align="left" prop="jcDwName" width="160" :show-overflow-tooltip="true"/>
  75. <el-table-column label="检查时间" align="left" prop="createTime" width="200"/>
  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. v-hasPermi="['laboratory:checkRecordDetails:query']"
  81. @click="goPageInfo(2,scope.row)"
  82. >查看</p>
  83. </div>
  84. </template>
  85. </el-table-column>
  86. </el-table>
  87. <pagination
  88. v-show="total>0"
  89. :total="total"
  90. :page.sync="queryParams.pageNum"
  91. :limit.sync="queryParams.pageSize"
  92. @pagination="getList"
  93. />
  94. </div>
  95. <check-record-info-page v-if="pageType == 2" :infoId="infoId"></check-record-info-page>
  96. <unsubmitted-page-list v-if="pageType == 3"></unsubmitted-page-list>
  97. <check-list v-if="pageType == 4"></check-list>
  98. </div>
  99. </template>
  100. <script>
  101. import { listCheckRecord, listCountCheckRecord, getCheckRecord, delCheckRecord, addCheckRecord, updateCheckRecord,listJcjl } from "@/api/laboratory/checkRecord";
  102. import checkRecordInfoPage from "./checkRecordInfoPage.vue"
  103. import unsubmittedPageList from "./unsubmittedPageList.vue"
  104. import checkList from "./checkList.vue"
  105. export default {
  106. name: "CheckRecord",
  107. components: {
  108. checkRecordInfoPage,
  109. unsubmittedPageList,
  110. checkList
  111. },
  112. data() {
  113. return {
  114. tableButtonType:this.hasPermiDom(['laboratory:checkRecordDetails:query']),
  115. //传参参数
  116. infoId:"",
  117. //页面状态
  118. pageType:1,
  119. // 遮罩层
  120. loading: true,
  121. // 选中数组
  122. ids: [],
  123. // 非单个禁用
  124. single: true,
  125. // 非多个禁用
  126. multiple: true,
  127. // 显示搜索条件
  128. showSearch: true,
  129. // 总条数
  130. total: 0,
  131. // 安全检查表格数据
  132. checkRecordList: [],
  133. // 弹出层标题
  134. title: "",
  135. // 是否显示弹出层
  136. open: false,
  137. // 查询参数
  138. queryParams: {
  139. pageNum: 1,
  140. pageSize:20,
  141. searchValue: null,
  142. laboratoryName: null,
  143. fzrName: null,
  144. zgType: null,
  145. },
  146. //查询时间
  147. dateRange:[],
  148. // 表单参数
  149. form: {},
  150. // 表单校验
  151. rules: {
  152. laboratoryId: [
  153. { required: true, message: "实验室id不能为空", trigger: "blur" }
  154. ],
  155. },
  156. // 未提交数量
  157. listCount:"",
  158. //检查单位名称
  159. jcDwName:"",
  160. //展示开关
  161. textType:false,
  162. };
  163. },
  164. created() {
  165. },
  166. mounted(){
  167. this.getList();
  168. this.getListCount();
  169. },
  170. methods: {
  171. //悬浮展示
  172. showText(){
  173. console.log("1")
  174. this.textType = true;
  175. },
  176. hideText(){
  177. console.log("2")
  178. this.textType = false;
  179. },
  180. //页面状态切换
  181. goPageInfo(type,row){
  182. if(type == 2){
  183. this.pageType = 2;
  184. this.infoId = row.id;
  185. }else if(type == 3){
  186. this.pageType = 3;
  187. }else if(type == 1){
  188. this.pageType = 1;
  189. this.getList();
  190. this.getListCount();
  191. }else if(type == 4){
  192. this.pageType = 4;
  193. }
  194. },
  195. /** 导出按钮操作 */
  196. handleExport() {
  197. if(!this.ids[0]){
  198. this.msgError("请选择要生成的数据")
  199. return
  200. }
  201. this.download('/laboratory/checkOption/genNotify/'+this.ids, {
  202. }, `整改告知书.docx`)
  203. },
  204. /** 查询安全检查列表 */
  205. getList() {
  206. this.loading = true;
  207. if(this.dateRange&&this.dateRange.length>0){
  208. this.queryParams.beginTime=this.dateRange[0]
  209. this.queryParams.endTime=this.dateRange[1]
  210. }else{
  211. this.queryParams.beginTime=null;
  212. this.queryParams.endTime=null
  213. }
  214. this.queryParams.isCg = 0;
  215. // listCheckRecord(this.queryParams).then( response => {
  216. listJcjl(this.queryParams).then( response => {
  217. this.checkRecordList = response.rows;
  218. this.total = response.total;
  219. this.loading = false;
  220. });
  221. },
  222. getListCount() {
  223. listCountCheckRecord().then( response => {
  224. this.listCount = response.data;
  225. });
  226. },
  227. // 取消按钮
  228. cancel() {
  229. this.open = false;
  230. this.reset();
  231. },
  232. // 表单重置
  233. reset() {
  234. this.form = {
  235. id: null,
  236. laboratoryName: null,
  237. laboratoryId: null,
  238. buildingName: null,
  239. buildingId: null,
  240. jcDw: null,
  241. jcRyxm: null,
  242. fjNumber: null,
  243. fzrId: null,
  244. fzrName: null,
  245. fzrLxfs: null,
  246. zmClMs: null,
  247. zmClImg: null,
  248. zgMs: null,
  249. zgCs: null,
  250. zgJg: null,
  251. zgYyfx: null,
  252. zgStatus: 0,
  253. zgType: null,
  254. isCg: null,
  255. zgjzTime: null,
  256. zgbhTime: null,
  257. zgqrTime: null,
  258. createTime: null
  259. };
  260. this.resetForm("form");
  261. },
  262. /** 搜索按钮操作 */
  263. handleQuery() {
  264. this.queryParams.pageNum = 1;
  265. this.getList();
  266. },
  267. /** 重置按钮操作 */
  268. resetQuery() {
  269. // this.resetForm("queryForm");
  270. this.$set(this,'queryParams',{
  271. pageNum: 1,
  272. pageSize:20,
  273. searchValue:"",
  274. zgType: '',
  275. });
  276. this.dateRange = [];
  277. this.queryParams.searchValue = "";
  278. this.queryParams.beginTime = "";
  279. this.queryParams.endTime = "";
  280. this.handleQuery();
  281. },
  282. // 多选框选中数据
  283. handleSelectionChange(selection) {
  284. let self = this;
  285. let list = selection.map(item => item.id);
  286. for(let i=0;i<self.checkRecordList.length;i++){
  287. if(list[0] == self.checkRecordList[i].id){
  288. if(self.checkRecordList[i].zgType == 1){
  289. this.$refs.selection.toggleRowSelection(self.checkRecordList[i],false);
  290. this.msgError("批量生成整改告知书只可勾选一般整改");
  291. return
  292. }
  293. }
  294. }
  295. if(selection[0]){
  296. if(!this.ids[0]){
  297. this.ids = selection.map(item => item.id);
  298. this.single = selection.length != 1;
  299. this.multiple = !selection.length;
  300. for(let i=0;i<self.checkRecordList.length;i++){
  301. if(list[0] == self.checkRecordList[i].id){
  302. self.jcDwName = self.checkRecordList[i].jcDwName;
  303. }
  304. }
  305. }else{
  306. let newId = list[list.length-1];
  307. let newName = "";
  308. let obj = {};
  309. for(let i=0;i<self.checkRecordList.length;i++){
  310. if(newId == self.checkRecordList[i].id){
  311. newName = self.checkRecordList[i].jcDwName;
  312. obj = self.checkRecordList[i];
  313. }
  314. }
  315. if(newName != this.jcDwName){
  316. this.$refs.selection.toggleRowSelection(obj,false);
  317. this.msgError("批量生成整改告知书只可勾选相同检查单位");
  318. }else{
  319. this.ids = selection.map(item => item.id);
  320. this.single = selection.length != 1;
  321. this.multiple = !selection.length;
  322. }
  323. }
  324. }else{
  325. this.ids = selection.map(item => item.id);
  326. this.single = selection.length != 1;
  327. this.multiple = !selection.length;
  328. self.jcDwName = "";
  329. }
  330. },
  331. // 多选框选中数据
  332. handleSelectionChangeTwo(selection) {
  333. console.log("123",selection);
  334. this.idsTwo = selection.map(item => item.id)
  335. this.singleTwo = selection.length!==1
  336. this.multipleTwo = !selection.length
  337. },
  338. /** 新增按钮操作 */
  339. handleAdd() {
  340. this.reset();
  341. this.open = true;
  342. this.title = "添加安全检查";
  343. },
  344. /** 修改按钮操作 */
  345. handleUpdate(row) {
  346. this.reset();
  347. const id = row.id || this.ids
  348. getCheckRecord(id).then( response => {
  349. this.form = response.data;
  350. this.open = true;
  351. this.title = "修改安全检查";
  352. });
  353. },
  354. /** 提交按钮 */
  355. submitForm() {
  356. this.$refs["form"].validate(valid => {
  357. if (valid) {
  358. if (this.form.id != null) {
  359. updateCheckRecord(this.form).then( response => {
  360. this.msgSuccess("修改成功");
  361. this.open = false;
  362. this.getList();
  363. });
  364. } else {
  365. addCheckRecord(this.form).then( response => {
  366. this.msgSuccess("新增成功");
  367. this.open = false;
  368. this.getList();
  369. });
  370. }
  371. }
  372. });
  373. },
  374. /** 删除按钮操作 */
  375. handleDelete(row) {
  376. const ids = row.id || this.ids;
  377. this.$confirm('是否确认删除安全检查编号为"' + ids + '"的数据项?', "警告", {
  378. confirmButtonText: "确定",
  379. cancelButtonText: "取消",
  380. type: "warning"
  381. }).then(function() {
  382. return delCheckRecord(ids);
  383. }).then(() => {
  384. this.getList();
  385. this.msgSuccess("删除成功");
  386. }).catch(() => {});
  387. },
  388. }
  389. };
  390. </script>
  391. <style scoped lang="scss">
  392. .checkRecord{
  393. flex:1;
  394. display: flex;
  395. flex-direction: column;
  396. overflow: hidden !important;
  397. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  398. .checkRecordPage{
  399. flex:1;
  400. display: flex;
  401. flex-direction: column;
  402. overflow: hidden !important;
  403. padding:0 20px 20px;
  404. .checkRecordPage-top-box{
  405. display: flex;
  406. background: #CCE6FE;
  407. border-radius:6px;
  408. margin:0 0 20px 0;
  409. position: relative;
  410. .img-p{
  411. font-size:18px;
  412. margin:0 10px;
  413. line-height:40px;
  414. color:#FFC000;
  415. margin-left:20px;
  416. }
  417. .checkRecordPage-title{
  418. color:#333;
  419. margin:0;
  420. line-height:40px;
  421. font-size:14px;
  422. }
  423. .checkRecordPage-button{
  424. margin:0;
  425. line-height:40px;
  426. font-size:14px;
  427. color:#0183FA;
  428. margin-left:40px;
  429. cursor: pointer;
  430. }
  431. .checkRecordPage-null{
  432. flex:1;
  433. }
  434. .position-box{
  435. padding:10px 20px;
  436. background: rgba(0,0,0,0.8);
  437. position: absolute;
  438. top:10px;
  439. left:48px;
  440. z-index:999;
  441. border-radius:4px;
  442. p{
  443. margin:0;
  444. font-size:12px;
  445. line-height:20px;
  446. color:#fff;
  447. font-weight:500;
  448. }
  449. }
  450. }
  451. }
  452. }
  453. </style>