listPage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <!--安全检查发布记录-->
  2. <template>
  3. <div class="releasePage-listPage">
  4. <div class="releasePage-listPage-min" v-if="pageType == 1">
  5. <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
  6. <!--<el-col :span="1.5">-->
  7. <!--<p class="add-button-one-150"-->
  8. <!--style="margin-right:20px;"-->
  9. <!--@click="handleExport"-->
  10. <!--v-hasPermi="['laboratory:checkOption:export']"-->
  11. <!--&gt;生成整改告知书</p>-->
  12. <!--</el-col>-->
  13. <el-form-item label="整改状态" prop="zgStatus" label-width="70px">
  14. <el-select v-model="queryParams.zgStatus" placeholder="请选择整改状态" clearable style="width:160px;">
  15. <el-option label="待整改" value="0" />
  16. <el-option label="整改待复核" value="1" />
  17. <el-option label="复核未通过" value="2" />
  18. <el-option label="整改中" value="3" />
  19. <el-option label="完成" value="4" />
  20. </el-select>
  21. </el-form-item>
  22. <el-form-item label="实验室" prop="laboratoryName" label-width="60px">
  23. <el-input
  24. style="width:130px;"
  25. v-model="queryParams.laboratoryName"
  26. placeholder="请输入实验室"
  27. clearable
  28. size="small"
  29. maxLength="15"
  30. />
  31. </el-form-item>
  32. <el-form-item label="实验室负责人" prop="fzrName" label-width="100px">
  33. <el-input
  34. style="width:130px;"
  35. v-model="queryParams.fzrName"
  36. placeholder="请输入负责人"
  37. clearable
  38. maxLength="10"
  39. size="small"
  40. />
  41. </el-form-item>
  42. <el-form-item label="整改类型" prop="zgType" label-width="70px">
  43. <el-select v-model="queryParams.zgType" placeholder="请选择整改类型" clearable style="width:160px;">
  44. <el-option label="一般整改" value="0" />
  45. <el-option label="重大整改" value="1" />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="检查时间" label-width="70px">
  49. <el-date-picker
  50. :clearable="false"
  51. v-model="dateRange"
  52. size="small"
  53. style="width: 220px"
  54. value-format="yyyy-MM-dd"
  55. type="daterange"
  56. range-separator="-"
  57. start-placeholder="开始日期"
  58. end-placeholder="结束日期"
  59. ></el-date-picker>
  60. </el-form-item>
  61. <el-form-item>
  62. <p class="inquire-button-one" @click="handleQuery">查询</p>
  63. <p class="reset-button-one" @click="resetQuery">重置</p>
  64. </el-form-item>
  65. <el-form-item style="float: right">
  66. <p class="reset-button-one" @click="backPage"><i class="el-icon-arrow-left"></i>返回</p>
  67. </el-form-item>
  68. </el-form>
  69. <el-table v-loading="loading" border :data="checkRecordList">
  70. <!-- <el-table-column type="selection" width="55" align="center"/>-->
  71. <!--<el-table-column type="selection" width="55" align="center" />-->
  72. <!--<el-table-column label="创建人id" align="center" prop="id" />-->
  73. <el-table-column label="整改状态" align="left" prop="zgStatus" width="120">
  74. <template slot-scope="scope">
  75. <p>{{scope.row.zgStatus==0?'待整改':(scope.row.zgStatus==1?'整改待复核':(scope.row.zgStatus==2?'复核未通过':(scope.row.zgStatus==3?'整改中':(scope.row.zgStatus==4?'整改完成':''))))}}</p>
  76. </template>
  77. </el-table-column>
  78. <el-table-column label="实验室名称" align="left" prop="laboratoryName" :show-overflow-tooltip="true" />
  79. <el-table-column label="实验楼" align="left" prop="buildingName" width="160"/>
  80. <el-table-column label="房间号" align="left" prop="fjNumber" width="100"/>
  81. <el-table-column label="实验室负责人" align="left" prop="fzrName" width="140"/>
  82. <el-table-column label="整改类型" align="left" prop="zgType" width="100">
  83. <template slot-scope="scope">{{scope.row.zgType==0?'一般整改':(scope.row.zgType==1?'重大整改':'')}}</template>
  84. </el-table-column>
  85. <el-table-column label="检查时间" align="left" prop="createTime" width="200"/>
  86. <el-table-column label="操作" align="left" class-name="small-padding fixed-width" width="120" v-if="tableButtonType">
  87. <template slot-scope="scope">
  88. <div class="button-box" style="display: flex;margin-left:20px;">
  89. <p class="table-min-button"
  90. @click="goPageInfo(2,scope.row)"
  91. v-hasPermi="['laboratory:checkRecord:query']"
  92. >查看</p>
  93. </div>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <pagination
  98. v-show="total>0"
  99. :total="total"
  100. :page.sync="queryParams.pageNum"
  101. :limit.sync="queryParams.pageSize"
  102. @pagination="getList"
  103. />
  104. </div>
  105. <check-record-info-page v-if="pageType == 2" :infoId="infoId"></check-record-info-page>
  106. </div>
  107. </template>
  108. <script>
  109. import { listJcjl } from "@/api/laboratory/release";
  110. import checkRecordInfoPage from "./checkRecordInfoPage.vue"
  111. export default {
  112. name: "Release",
  113. components: {
  114. checkRecordInfoPage
  115. },
  116. props:{
  117. checkId:{},
  118. },
  119. data() {
  120. return {
  121. tableButtonType:this.hasPermiDom(['laboratory:checkRecord:query']),
  122. pageType:1,
  123. // 遮罩层
  124. loading: true,
  125. // 选中数组
  126. ids: [],
  127. // 非单个禁用
  128. single: true,
  129. // 非多个禁用
  130. multiple: true,
  131. jcDwName:"",
  132. // 显示搜索条件
  133. showSearch: true,
  134. // 总条数
  135. total: 0,
  136. // 检查发布关系表格数据
  137. checkRecordList: [],
  138. // 弹出层标题
  139. title: "",
  140. // 是否显示弹出层
  141. open: false,
  142. // 查询参数
  143. queryParams: {
  144. pageNum: 1,
  145. pageSize:20,
  146. checkId: null,
  147. releaseDescribe: null,
  148. createByid: null,
  149. },
  150. // 表单参数
  151. form: {},
  152. // 表单校验
  153. rules: {
  154. },
  155. dateRange:[],
  156. infoId:"",
  157. };
  158. },
  159. created() {
  160. this.getList();
  161. },
  162. methods: {
  163. //页面状态切换
  164. goPageInfo(type,row){
  165. if(type == 2){
  166. this.pageType = 2;
  167. this.infoId = row.id;
  168. }else if(type == 1){
  169. this.pageType = 1;
  170. this.getList();
  171. }
  172. },
  173. backPage(){
  174. this.$parent.goPageInfo(1);
  175. },
  176. /** 查询检查发布关系列表 */
  177. getList() {
  178. this.loading = true;
  179. if(this.dateRange&&this.dateRange.length>0){
  180. this.queryParams.beginTime=this.dateRange[0]
  181. this.queryParams.endTime=this.dateRange[1]
  182. }else{
  183. this.queryParams.beginTime=null;
  184. this.queryParams.endTime=null
  185. }
  186. this.queryParams.ids = this.checkId;
  187. listJcjl(this.queryParams).then( response => {
  188. this.checkRecordList = response.rows;
  189. this.total = response.total;
  190. this.loading = false;
  191. });
  192. },
  193. // 取消按钮
  194. cancel() {
  195. this.open = false;
  196. this.reset();
  197. },
  198. // 表单重置
  199. reset() {
  200. this.form = {
  201. id: null,
  202. checkId: null,
  203. releaseDescribe: null,
  204. createByid: null,
  205. createBy: null,
  206. createTime: null,
  207. remark: null
  208. };
  209. this.resetForm("form");
  210. },
  211. /** 搜索按钮操作 */
  212. handleQuery() {
  213. this.queryParams.pageNum = 1;
  214. this.getList();
  215. },
  216. /** 重置按钮操作 */
  217. resetQuery() {
  218. this.dateRange = [];
  219. this.queryParams.beginTime = "";
  220. this.queryParams.endTime = "";
  221. // this.resetForm("queryForm");
  222. this.$set(this,'queryParams',{
  223. pageNum: 1,
  224. pageSize:20,
  225. zgStatus:"",
  226. laboratoryName: '',
  227. fzrName: '',
  228. zgType: '',
  229. });
  230. this.handleQuery();
  231. },
  232. // 多选框选中数据
  233. handleSelectionChange(selection) {
  234. let self = this;
  235. let list = selection.map(item => item.id);
  236. for(let i=0;i<self.checkRecordList.length;i++){
  237. if(list[0] == self.checkRecordList[i].id){
  238. if(self.checkRecordList[i].zgType == 1){
  239. this.$refs.selection.toggleRowSelection(self.checkRecordList[i],false);
  240. this.msgError("批量生成整改告知书只可勾选一般整改");
  241. return
  242. }
  243. }
  244. }
  245. if(selection[0]){
  246. if(!this.ids[0]){
  247. this.ids = selection.map(item => item.id);
  248. this.single = selection.length != 1;
  249. this.multiple = !selection.length;
  250. for(let i=0;i<self.checkRecordList.length;i++){
  251. if(list[0] == self.checkRecordList[i].id){
  252. self.jcDwName = self.checkRecordList[i].jcDwName;
  253. }
  254. }
  255. }else{
  256. let newId = list[list.length-1];
  257. let newName = "";
  258. let obj = {};
  259. for(let i=0;i<self.checkRecordList.length;i++){
  260. if(newId == self.checkRecordList[i].id){
  261. newName = self.checkRecordList[i].jcDwName;
  262. obj = self.checkRecordList[i];
  263. }
  264. }
  265. if(newName != this.jcDwName){
  266. this.$refs.selection.toggleRowSelection(obj,false);
  267. this.msgError("批量生成整改告知书只可勾选相同检查单位");
  268. }else{
  269. this.ids = selection.map(item => item.id);
  270. this.single = selection.length != 1;
  271. this.multiple = !selection.length;
  272. }
  273. }
  274. }else{
  275. this.ids = selection.map(item => item.id);
  276. this.single = selection.length != 1;
  277. this.multiple = !selection.length;
  278. self.jcDwName = "";
  279. }
  280. },
  281. /** 新增按钮操作 */
  282. handleAdd() {
  283. this.reset();
  284. this.open = true;
  285. this.title = "添加检查发布关系";
  286. },
  287. /** 修改按钮操作 */
  288. handleUpdate(row) {
  289. this.reset();
  290. const id = row.id || this.ids
  291. getRelease(id).then( response => {
  292. this.form = response.data;
  293. this.open = true;
  294. this.title = "修改检查发布关系";
  295. });
  296. },
  297. /** 提交按钮 */
  298. submitForm() {
  299. this.$refs["form"].validate(valid => {
  300. if (valid) {
  301. if (this.form.id != null) {
  302. updateRelease(this.form).then( response => {
  303. this.msgSuccess("修改成功");
  304. this.open = false;
  305. this.getList();
  306. });
  307. } else {
  308. addRelease(this.form).then( response => {
  309. this.msgSuccess("新增成功");
  310. this.open = false;
  311. this.getList();
  312. });
  313. }
  314. }
  315. });
  316. },
  317. /** 删除按钮操作 */
  318. handleDelete(row) {
  319. const ids = row.id || this.ids;
  320. this.$confirm('是否确认删除检查发布关系编号为"' + ids + '"的数据项?', "警告", {
  321. confirmButtonText: "确定",
  322. cancelButtonText: "取消",
  323. type: "warning"
  324. }).then(function() {
  325. return delRelease(ids);
  326. }).then(() => {
  327. this.getList();
  328. this.msgSuccess("删除成功");
  329. }).catch(() => {});
  330. },
  331. /** 导出按钮操作 */
  332. handleExport() {
  333. if(!this.ids[0]){
  334. this.msgError("请选择要生成的数据")
  335. return
  336. }
  337. this.download('/laboratory/checkOption/genNotify/'+this.ids, {
  338. }, `整改告知书.docx`)
  339. },
  340. }
  341. };
  342. </script>
  343. <style scoped lang="scss">
  344. .releasePage-listPage{
  345. flex: 1;
  346. display: flex;
  347. flex-direction: column;
  348. overflow: hidden !important;
  349. .releasePage-listPage-min{
  350. flex: 1;
  351. display: flex;
  352. flex-direction: column;
  353. overflow: hidden !important;
  354. padding: 20px 20px 20px;
  355. }
  356. }
  357. </style>