verifyCheck.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <!--整改审核-->
  2. <template>
  3. <div class="app-container verifyCheck">
  4. <div class="verifyCheckPage" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  6. <el-form-item label="关键字" prop="searchValue">
  7. <el-input
  8. v-model="queryParams.searchValue"
  9. placeholder="实验室名称/负责人/单号"
  10. clearable
  11. style="width:200px;"
  12. />
  13. </el-form-item>
  14. <el-form-item label="整改类型" prop="zgType">
  15. <el-select v-model="queryParams.zgType" placeholder="请选择整改类型" clearable style="width:150px;">
  16. <el-option label="一般整改" value="0" />
  17. <el-option label="重大整改" value="1" />
  18. </el-select>
  19. </el-form-item>
  20. <el-form-item label="审核状态" prop="spStatus">
  21. <el-select v-model="queryParams.spStatus" placeholder="请选择整改类型" clearable style="width:150px;">
  22. <el-option label="待复核" value="1" />
  23. <el-option label="已通过" value="4" />
  24. <el-option label="未通过" value="2" />
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="检查时间">
  28. <el-date-picker
  29. :clearable="false"
  30. v-model="dateRange"
  31. size="small"
  32. style="width: 240px"
  33. value-format="yyyy-MM-dd"
  34. type="daterange"
  35. range-separator="-"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期"
  38. ></el-date-picker>
  39. </el-form-item>
  40. <el-form-item label="整改时间">
  41. <el-date-picker
  42. :clearable="false"
  43. v-model="dateRangeTwo"
  44. size="small"
  45. style="width: 240px"
  46. value-format="yyyy-MM-dd"
  47. type="daterange"
  48. range-separator="-"
  49. start-placeholder="开始日期"
  50. end-placeholder="结束日期"
  51. ></el-date-picker>
  52. </el-form-item>
  53. <el-form-item>
  54. <p class="inquire-button-one" @click="handleQuery">查询</p>
  55. <p class="reset-button-one" @click="resetQuery">重置</p>
  56. </el-form-item>
  57. </el-form>
  58. <el-table v-loading="loading" border :data="checkRecordList" border>
  59. <el-table-column label="序号" type="index" align="center" width="50"/>
  60. <!--<el-table-column label="项目序号" align="left" prop="jcxNum" width="180"/>-->
  61. <el-table-column label="隐患描述" align="left" prop="yhMs" width="290" :show-overflow-tooltip="true"/>
  62. <el-table-column label="整改类型" align="left" prop="zgType" width="150">
  63. <template slot-scope="scope">{{scope.row.zgType==0?'一般整改':(scope.row.zgType==1?'重大整改':'')}}</template>
  64. </el-table-column>
  65. <el-table-column label="实验室名称" align="left" prop="laboratoryName" :show-overflow-tooltip="true"/>
  66. <el-table-column label="实验室负责人" align="left" prop="fzrName" width="150" />
  67. <el-table-column label="检查时间" align="left" prop="checkTime" width="180" />
  68. <el-table-column label="整改提交时间" align="left" prop="zgTime" width="180" />
  69. <el-table-column label="审核状态" align="left" prop="spStatus" width="120" >
  70. <template slot-scope="scope">
  71. <span :class="scope.row.spStatus == 1?'spStatus-1':(scope.row.spStatus == 2?'spStatus-2':(scope.row.spStatus == 4?'spStatus-3':''))">{{scope.row.spStatus == 1?'待复核':(scope.row.spStatus == 2?'未通过':(scope.row.spStatus == 4?'已通过':''))}}</span>
  72. </template>
  73. </el-table-column>
  74. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120" v-if="tableButtonType">
  75. <template slot-scope="scope">
  76. <div class="button-box" style="display: flex;margin-left:20px;">
  77. <p class="table-min-button"
  78. @click="goPageInfo(2,scope.row)"
  79. v-hasPermi="['laboratory:checkRecordDetails:query']"
  80. >{{scope.row.zgStatus == 1?'审核':'查看'}}</p>
  81. </div>
  82. </template>
  83. </el-table-column>
  84. </el-table>
  85. <pagination
  86. style="margin-bottom:20px;"
  87. v-show="total>0"
  88. :total="total"
  89. :page.sync="queryParams.pageNum"
  90. :limit.sync="queryParams.pageSize"
  91. @pagination="getList"
  92. />
  93. </div>
  94. <verify-check-info v-if="pageType == 2" :infoId="infoId"></verify-check-info>
  95. </div>
  96. </template>
  97. <script>
  98. import { listDzgCheckRecord, getCheckRecord, delCheckRecord, addCheckRecord, updateCheckRecord } from "@/api/laboratory/checkRecord";
  99. import verifyCheckInfo from "./verifyCheckInfo.vue"
  100. export default {
  101. name: "CheckRecord",
  102. components: {
  103. verifyCheckInfo
  104. },
  105. data() {
  106. return {
  107. tableButtonType:this.hasPermiDom(['laboratory:checkRecordDetails:query']),
  108. //页面状态
  109. pageType:1,
  110. // 遮罩层
  111. loading: true,
  112. // 选中数组
  113. ids: [],
  114. // 非单个禁用
  115. single: true,
  116. // 非多个禁用
  117. multiple: true,
  118. // 显示搜索条件
  119. showSearch: true,
  120. // 总条数
  121. total: 0,
  122. // 安全检查表格数据
  123. checkRecordList: [],
  124. // 弹出层标题
  125. title: "",
  126. // 是否显示弹出层
  127. open: false,
  128. // 查询参数
  129. queryParams: {
  130. pageNum: 1,
  131. pageSize:20,
  132. searchValue:"",
  133. zgType: '',
  134. spStatus: '',
  135. },
  136. //查询时间
  137. dateRange:[],
  138. //整改时间
  139. dateRangeTwo:[],
  140. // 表单参数
  141. form: {},
  142. // 表单校验
  143. rules: {
  144. laboratoryId: [
  145. { required: true, message: "实验室id不能为空", trigger: "blur" },
  146. { required: true, message: "实验室id不能为空", validator: this.spaceJudgment, trigger: "blur" }
  147. ],
  148. },
  149. //审核组件数据
  150. infoId:"",
  151. };
  152. },
  153. created() {
  154. this.getList();
  155. },
  156. methods: {
  157. //页面状态切换
  158. goPageInfo(type,row){
  159. if(type == 2){
  160. this.pageType = 2;
  161. this.infoId = row.id;
  162. }else if(type == 1){
  163. this.pageType = 1;
  164. this.getList();
  165. }
  166. },
  167. /** 查询安全检查列表 */
  168. getList() {
  169. this.loading = true;
  170. if(this.dateRange&&this.dateRange.length>0){
  171. this.queryParams.beginTime=this.dateRange[0]
  172. this.queryParams.endTime=this.dateRange[1]
  173. }else{
  174. this.queryParams.beginTime=null;
  175. this.queryParams.endTime=null
  176. }
  177. if(this.dateRangeTwo&&this.dateRangeTwo.length>0){
  178. this.queryParams.zgBeginTime=this.dateRangeTwo[0]
  179. this.queryParams.zgEndTime=this.dateRangeTwo[1]
  180. }else{
  181. this.queryParams.zgBeginTime=null;
  182. this.queryParams.zgEndTime=null
  183. }
  184. listDzgCheckRecord(this.queryParams).then( response => {
  185. this.checkRecordList = response.rows;
  186. this.total = response.total;
  187. this.loading = false;
  188. });
  189. },
  190. // 取消按钮
  191. cancel() {
  192. this.open = false;
  193. this.reset();
  194. },
  195. // 表单重置
  196. reset() {
  197. this.form = {
  198. id: null,
  199. laboratoryName: null,
  200. laboratoryId: null,
  201. buildingName: null,
  202. buildingId: null,
  203. jcDw: null,
  204. jcRyxm: null,
  205. fjNumber: null,
  206. fzrId: null,
  207. fzrName: null,
  208. fzrLxfs: null,
  209. zmClMs: null,
  210. zmClImg: null,
  211. zgMs: null,
  212. zgCs: null,
  213. zgJg: null,
  214. zgYyfx: null,
  215. zgStatus: 0,
  216. zgType: null,
  217. isCg: null,
  218. zgjzTime: null,
  219. zgbhTime: null,
  220. zgqrTime: null,
  221. createTime: null
  222. };
  223. this.resetForm("form");
  224. },
  225. /** 搜索按钮操作 */
  226. handleQuery() {
  227. this.queryParams.pageNum = 1;
  228. this.getList();
  229. },
  230. /** 重置按钮操作 */
  231. resetQuery() {
  232. // this.resetForm("queryForm");
  233. this.$set(this,'queryParams',{
  234. pageNum: 1,
  235. pageSize:20,
  236. searchValue:"",
  237. zgType: '',
  238. spStatus: '',
  239. });
  240. this.dateRange = [];
  241. this.queryParams.searchValue = "";
  242. this.queryParams.beginTime = "";
  243. this.queryParams.endTime = "";
  244. this.dateRangeTwo = [];
  245. this.queryParams.zgBeginTime = "";
  246. this.queryParams.zgEndTime = "";
  247. this.handleQuery();
  248. },
  249. // 多选框选中数据
  250. handleSelectionChange(selection) {
  251. this.ids = selection.map(item => item.id)
  252. this.single = selection.length!==1
  253. this.multiple = !selection.length
  254. },
  255. /** 新增按钮操作 */
  256. handleAdd() {
  257. this.reset();
  258. this.open = true;
  259. this.title = "添加安全检查";
  260. },
  261. /** 修改按钮操作 */
  262. handleUpdate(row) {
  263. this.reset();
  264. const id = row.id || this.ids
  265. getCheckRecord(id).then( response => {
  266. this.form = response.data;
  267. this.open = true;
  268. this.title = "修改安全检查";
  269. });
  270. },
  271. /** 提交按钮 */
  272. submitForm() {
  273. this.$refs["form"].validate(valid => {
  274. if (valid) {
  275. if (this.form.id != null) {
  276. updateCheckRecord(this.form).then( response => {
  277. this.msgSuccess("修改成功");
  278. this.open = false;
  279. this.getList();
  280. });
  281. } else {
  282. addCheckRecord(this.form).then( response => {
  283. this.msgSuccess("新增成功");
  284. this.open = false;
  285. this.getList();
  286. });
  287. }
  288. }
  289. });
  290. },
  291. /** 删除按钮操作 */
  292. handleDelete(row) {
  293. const ids = row.id || this.ids;
  294. this.$confirm('是否确认删除安全检查编号为"' + ids + '"的数据项?', "警告", {
  295. confirmButtonText: "确定",
  296. cancelButtonText: "取消",
  297. type: "warning"
  298. }).then(function() {
  299. return delCheckRecord(ids);
  300. }).then(() => {
  301. this.getList();
  302. this.msgSuccess("删除成功");
  303. }).catch(() => {});
  304. },
  305. /** 导出按钮操作 */
  306. handleExport() {
  307. this.download('laboratory/checkRecord/export', {
  308. ...this.queryParams
  309. }, `laboratory_checkRecord.xlsx`)
  310. }
  311. }
  312. };
  313. </script>
  314. <style scoped lang="scss">
  315. .verifyCheck{
  316. flex:1;
  317. display: flex;
  318. flex-direction: column;
  319. overflow: hidden !important;
  320. .verifyCheckPage{
  321. flex:1;
  322. display: flex;
  323. flex-direction: column;
  324. overflow: hidden;
  325. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  326. padding:20px!important;
  327. .spStatus-1{
  328. color:#FF9600;
  329. }
  330. .spStatus-2{
  331. color:#FF0000;
  332. }
  333. .spStatus-3{
  334. color:#21CC1D;
  335. }
  336. }
  337. }
  338. </style>