index.vue 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065
  1. <template>
  2. <div class="app-container">
  3. <el-form
  4. :model="queryParams"
  5. ref="queryForm"
  6. :inline="true"
  7. v-show="showSearch"
  8. label-width="68px"
  9. >
  10. <!-- <el-form-item label="受检单位_id" prop="inspectedUnitId">
  11. <el-input
  12. v-model="queryParams.inspectedUnitId"
  13. placeholder="请输入受检单位_id"
  14. clearable
  15. size="small"
  16. @keyup.enter.native="handleQuery"
  17. />
  18. </el-form-item>
  19. <el-form-item label="受检单位" prop="inspectedUnit">
  20. <el-input
  21. v-model="queryParams.inspectedUnit"
  22. placeholder="请输入受检单位"
  23. clearable
  24. size="small"
  25. @keyup.enter.native="handleQuery"
  26. />
  27. </el-form-item>
  28. <el-form-item label="检查时间" prop="inspectionTime">
  29. <el-input
  30. v-model="queryParams.inspectionTime"
  31. placeholder="请输入检查时间"
  32. clearable
  33. size="small"
  34. @keyup.enter.native="handleQuery"
  35. />
  36. </el-form-item>
  37. <el-form-item label="积分" prop="score">
  38. <el-input
  39. v-model="queryParams.score"
  40. placeholder="请输入积分"
  41. clearable
  42. size="small"
  43. @keyup.enter.native="handleQuery"
  44. />
  45. </el-form-item>
  46. <el-form-item label="整改时间" prop="rectificationTime">
  47. <el-input
  48. v-model="queryParams.rectificationTime"
  49. placeholder="请输入整改时间"
  50. clearable
  51. size="small"
  52. @keyup.enter.native="handleQuery"
  53. />
  54. </el-form-item>
  55. <el-form-item label="当前状态" prop="currentState">
  56. <el-input
  57. v-model="queryParams.currentState"
  58. placeholder="请输入当前状态"
  59. clearable
  60. size="small"
  61. @keyup.enter.native="handleQuery"
  62. />
  63. </el-form-item>
  64. <el-form-item label="整改负责人ID" prop="chargePeopleId">
  65. <el-input
  66. v-model="queryParams.chargePeopleId"
  67. placeholder="请输入整改负责人ID"
  68. clearable
  69. size="small"
  70. @keyup.enter.native="handleQuery"
  71. />
  72. </el-form-item>
  73. <el-form-item label="整改负责人" prop="chargePeople">
  74. <el-input
  75. v-model="queryParams.chargePeople"
  76. placeholder="请输入整改负责人"
  77. clearable
  78. size="small"
  79. @keyup.enter.native="handleQuery"
  80. />
  81. </el-form-item>
  82. <el-form-item label="图片举证" prop="pictureProof">
  83. <el-input
  84. v-model="queryParams.pictureProof"
  85. placeholder="请输入图片举证"
  86. clearable
  87. size="small"
  88. @keyup.enter.native="handleQuery"
  89. />
  90. </el-form-item>
  91. <el-form-item label="文件举证" prop="documentProof">
  92. <el-input
  93. v-model="queryParams.documentProof"
  94. placeholder="请输入文件举证"
  95. clearable
  96. size="small"
  97. @keyup.enter.native="handleQuery"
  98. />
  99. </el-form-item>
  100. <el-form-item label="创建人ID" prop="createUserId">
  101. <el-input
  102. v-model="queryParams.createUserId"
  103. placeholder="请输入创建人ID"
  104. clearable
  105. size="small"
  106. @keyup.enter.native="handleQuery"
  107. />
  108. </el-form-item>
  109. <el-form-item label="创建人" prop="createUser">
  110. <el-input
  111. v-model="queryParams.createUser"
  112. placeholder="请输入创建人"
  113. clearable
  114. size="small"
  115. @keyup.enter.native="handleQuery"
  116. />
  117. </el-form-item>-->
  118. <!-- <el-form-item>
  119. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  120. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  121. </el-form-item> -->
  122. </el-form>
  123. <el-row :gutter="10" class="mb8">
  124. <el-col :span="1.5" class="isSubmit">
  125. <el-radio-group v-model="queryParams.caoZuoType" @change="caoZuoTypefun"
  126. ><el-radio-button label="1">加分</el-radio-button>
  127. <el-radio-button label="0">减分</el-radio-button>
  128. </el-radio-group>
  129. </el-col>
  130. </el-row>
  131. <hr />
  132. <el-row :gutter="10" class="mb8">
  133. <el-col :span="1.5">
  134. <el-button
  135. type="success"
  136. v-if="queryParams.caoZuoType == 0"
  137. @click="handleAdd"
  138. style="background: #1d96ff"
  139. >减分录入</el-button
  140. >
  141. </el-col>
  142. <el-col :span="1.5">
  143. <el-button
  144. type="success"
  145. v-if="queryParams.caoZuoType == 1"
  146. @click="handleAdd"
  147. style="background: #1d96ff"
  148. >加分录入</el-button
  149. >
  150. </el-col>
  151. <!-- <el-col :span="1.5">
  152. <el-button
  153. type="primary"
  154. plain
  155. icon="el-icon-plus"
  156. size="mini"
  157. @click="handleAdd"
  158. v-hasPermi="['bdglregular:specialinfo:add']"
  159. >新增</el-button>
  160. </el-col>
  161. <el-col :span="1.5">
  162. <el-button
  163. type="success"
  164. plain
  165. icon="el-icon-edit"
  166. size="mini"
  167. :disabled="single"
  168. @click="handleUpdate"
  169. v-hasPermi="['bdglregular:specialinfo:edit']"
  170. >修改</el-button>
  171. </el-col>
  172. <el-col :span="1.5">
  173. <el-button
  174. type="danger"
  175. plain
  176. icon="el-icon-delete"
  177. size="mini"
  178. :disabled="multiple"
  179. @click="handleDelete"
  180. v-hasPermi="['bdglregular:specialinfo:remove']"
  181. >删除</el-button>
  182. </el-col>
  183. <el-col :span="1.5">
  184. <el-button
  185. type="warning"
  186. plain
  187. icon="el-icon-download"
  188. size="mini"
  189. :loading="exportLoading"
  190. @click="handleExport"
  191. v-hasPermi="['bdglregular:specialinfo:export']"
  192. >导出</el-button>
  193. </el-col>-->
  194. <!-- <right-toolbar
  195. :showSearch.sync="showSearch"
  196. @queryTable="getList"
  197. ></right-toolbar> -->
  198. </el-row>
  199. <el-table
  200. v-loading="loading"
  201. :data="specialinfoList"
  202. :header-cell-style="{ background: '#003C69', color: 'white' }"
  203. @selection-change="handleSelectionChange"
  204. >
  205. <el-table-column type="selection" width="55" align="center" />
  206. <!-- <el-table-column label="主键ID" align="center" prop="id" /> -->
  207. <el-table-column label="序号" align="center" type="index" />
  208. <!-- <el-table-column label="受检单位_id" align="center" prop="inspectedUnitId" /> -->
  209. <el-table-column label="受检单位" align="center" prop="inspectedUnit" />
  210. <el-table-column
  211. label="负责人"
  212. align="center"
  213. prop="chargePeople"
  214. :key="Math.random()"
  215. v-if="queryParams.caoZuoType == 0"
  216. />
  217. <el-table-column
  218. label="分值"
  219. align="center"
  220. :key="Math.random()"
  221. prop="score"
  222. >
  223. <template slot-scope="scope">
  224. <div style="color: rgb(255 106 0)" v-if="queryParams.caoZuoType == 0">
  225. {{ scope.row.score }}
  226. </div>
  227. <div style="color: rgb(2 255 2)" v-if="queryParams.caoZuoType == 1">
  228. {{ scope.row.score }}
  229. </div>
  230. </template>
  231. </el-table-column>
  232. <el-table-column label="检查时间" align="center" prop="inspectionTime" />
  233. <el-table-column
  234. label="事由"
  235. align="center"
  236. show-overflow-tooltip
  237. prop="question"
  238. />
  239. <!-- <el-table-column
  240. label="当前状态"
  241. align="center"
  242. prop="currentState"
  243. :key="Math.random()"
  244. v-if="queryParams.caoZuoType==0"
  245. >
  246. <template slot-scope="scope">
  247. <div
  248. style="color:#ff0000;"
  249. v-if="scope.row.currentState=='未通过'"
  250. >{{scope.row.currentState}}</div>
  251. <div
  252. style="color:#ffa500;"
  253. v-if="scope.row.currentState=='待处理'"
  254. >{{scope.row.currentState}}</div>
  255. <div
  256. style="color:#3498db;"
  257. v-if="scope.row.currentState=='待验收'"
  258. >{{scope.row.currentState}}</div>
  259. <div
  260. style="color:#38d764;"
  261. v-if="scope.row.currentState=='已通过'"
  262. >{{scope.row.currentState}}</div>
  263. </template>
  264. </el-table-column> -->
  265. <el-table-column
  266. label="当前状态"
  267. align="center"
  268. prop="currentState"
  269. :key="Math.random()"
  270. v-if="queryParams.caoZuoType == 0"
  271. >
  272. <template slot-scope="scope">
  273. <div
  274. style="color: rgb(255 106 0)"
  275. v-if="scope.row.currentState == '未通过'"
  276. >
  277. {{ scope.row.currentState }}
  278. </div>
  279. <div style="color: #ffa500" v-if="scope.row.currentState == '待处理'">
  280. {{ scope.row.currentState }}
  281. </div>
  282. <div style="color: #3498db" v-if="scope.row.currentState == '待验收'">
  283. {{ scope.row.currentState }}
  284. </div>
  285. <div
  286. style="color: rgb(2 255 2)"
  287. v-if="scope.row.currentState == '已通过'"
  288. >
  289. {{ scope.row.currentState }}
  290. </div>
  291. <div style="color: #909399" v-if="scope.row.currentState == '已逾期'">
  292. {{ scope.row.currentState }}
  293. </div>
  294. </template>
  295. </el-table-column>
  296. <el-table-column
  297. label="整改时间"
  298. align="center"
  299. prop="rectificationTime"
  300. :key="Math.random()"
  301. v-if="queryParams.caoZuoType == 0"
  302. />
  303. <!-- <el-table-column label="整改负责人ID" align="center" prop="chargePeopleId" />
  304. <el-table-column label="整改措施" align="center" prop="correctiveAction" />
  305. <el-table-column label="图片举证" align="center" prop="pictureProof" />
  306. <el-table-column label="文件举证" align="center" prop="documentProof" />
  307. <el-table-column label="创建人ID" align="center" prop="createUserId" />
  308. <el-table-column label="创建人" align="center" prop="createUser" />-->
  309. <el-table-column
  310. label="操作"
  311. align="center"
  312. class-name="small-padding fixed-width"
  313. >
  314. <template slot-scope="scope">
  315. <el-button
  316. size="btk"
  317. type="text"
  318. v-if="
  319. queryParams.caoZuoType == 0 &&
  320. scope.row.isCaoZuoDept == 0 &&
  321. (scope.row.currentState == '未通过' ||
  322. scope.row.currentState == '待处理')
  323. "
  324. @click="handleUpdate(scope.row)"
  325. >整改</el-button
  326. >
  327. <el-button
  328. size="btu"
  329. type="text"
  330. @click="shenpifun(scope.row)"
  331. v-if="
  332. queryParams.caoZuoType == 0 &&
  333. scope.row.isShenPi == 0 &&
  334. scope.row.currentState == '待验收'
  335. "
  336. >审批</el-button
  337. >
  338. <!-- <el-button size="btd" @click="handleDelete(scope.row)"
  339. >删除</el-button
  340. > -->
  341. </template>
  342. </el-table-column>
  343. </el-table>
  344. <pagination
  345. v-show="total > 0"
  346. :total="total"
  347. :page.sync="queryParams.pageNum"
  348. :limit.sync="queryParams.pageSize"
  349. @pagination="getList"
  350. />
  351. <!-- 添加或修改专项检查对话框 -->
  352. <el-dialog
  353. :title="title"
  354. :visible.sync="open"
  355. width="500px"
  356. append-to-body
  357. :close-on-click-modal="false"
  358. >
  359. <el-form
  360. ref="form"
  361. :model="form"
  362. :rules="rules"
  363. :inline="true"
  364. label-width="120px"
  365. >
  366. <div class="jiben">基本信息</div>
  367. <el-form-item label="受检单位" prop="inspectedUnit">
  368. <el-select
  369. v-model="form.inspectedUnit"
  370. @change="inspectedUnitfun"
  371. clearable
  372. placeholder="请选择受检单位"
  373. :disabled="disabled"
  374. >
  375. <el-option
  376. v-for="dict in unitId"
  377. :key="dict.deptId"
  378. :label="dict.deptName"
  379. :value="dict"
  380. ></el-option>
  381. </el-select>
  382. </el-form-item>
  383. <!-- <el-form-item label="受检单位" prop="inspectedUnit">
  384. <el-select v-model="form.unitCheck" clearable placeholder="请选择检查单位">
  385. <el-option
  386. v-for="dict in unitId"
  387. :key="dict.deptId"
  388. :label="dict.deptName"
  389. :value="dict.deptId"
  390. ></el-option>
  391. </el-select>
  392. </el-form-item>-->
  393. <el-form-item label="检查时间" prop="inspectionTime">
  394. <el-date-picker
  395. clearable
  396. size="small"
  397. v-model="form.inspectionTime"
  398. type="datetime"
  399. value-format="yyyy-MM-dd HH:mm:ss"
  400. placeholder="选择检查时间"
  401. :disabled="disabled"
  402. ></el-date-picker>
  403. </el-form-item>
  404. <el-form-item label="分值" prop="score" v-if="jiannum == 0">
  405. <!-- <el-input v-model="form.score" @blur="scoreblur" :disabled="disabled" type="number" placeholder="请输入分值" /> -->
  406. <el-input-number
  407. v-model="form.score"
  408. controls-position="right"
  409. :min="0"
  410. :disabled="disabled"
  411. ></el-input-number>
  412. </el-form-item>
  413. <!-- <el-form-item label="积分" prop="score">
  414. <el-input v-model="form.score" placeholder="请输入积分" />
  415. </el-form-item>-->
  416. <el-form-item label="整改时间" prop="rectificationTime">
  417. <el-date-picker
  418. clearable
  419. size="small"
  420. v-model="form.rectificationTime"
  421. type="datetime"
  422. default-time="00:00:00"
  423. value-format="yyyy-MM-dd HH:mm:ss"
  424. placeholder="选择整改时间"
  425. :disabled="disabled"
  426. ></el-date-picker>
  427. </el-form-item>
  428. <!-- <el-form-item label="当前状态" prop="currentState">
  429. <el-input v-model="form.currentState" placeholder="请输入当前状态" />
  430. </el-form-item>-->
  431. <el-form-item
  432. label="受检负责人"
  433. prop="chargePeople"
  434. v-if="jiannum != 0"
  435. >
  436. <el-select
  437. v-model="form.chargePeople"
  438. clearable
  439. @change="chargePeoplefun"
  440. placeholder="请选择受检负责人"
  441. :disabled="disabled"
  442. >
  443. <el-option
  444. v-for="dict in peopleIds"
  445. :key="dict.id"
  446. :label="dict.name"
  447. :value="dict"
  448. ></el-option>
  449. </el-select>
  450. </el-form-item>
  451. <!-- <el-form-item label="整改负责人" prop="chargePeopleId">
  452. <el-select
  453. v-model="form.chargePeopleId"
  454. clearable
  455. ref="chargePeopleId"
  456. placeholder="请选择负责人"
  457. >
  458. <el-option v-for="dict in peopleIds" :key="dict.id" :label="dict.name" :value="dict.id"></el-option>
  459. </el-select>
  460. </el-form-item>
  461. <el-form-item label="整改负责人" prop="chargePeople">
  462. <el-input v-model="form.chargePeople" placeholder="请输入整改负责人" />
  463. </el-form-item>-->
  464. <div class="jiben" v-if="queryParams.caoZuoType == 0">存在问题</div>
  465. <div class="jiben" v-if="queryParams.caoZuoType == 1">加分事由</div>
  466. <el-form-item label prop="question">
  467. <el-input
  468. v-model="form.question"
  469. :disabled="disabled"
  470. type="textarea"
  471. placeholder="请输入内容"
  472. />
  473. </el-form-item>
  474. <div class="jiben" v-if="jiannum != 0">整改措施</div>
  475. <el-form-item label prop="correctiveAction" v-if="jiannum != 0">
  476. <el-input
  477. v-model="form.correctiveAction"
  478. :disabled="disabled"
  479. type="textarea"
  480. placeholder="请输入内容"
  481. />
  482. </el-form-item>
  483. <div class="jiben" v-if="jiannum != 0">图片举证</div>
  484. <el-form-item label prop="pictureProof" v-if="jiannum != 0">
  485. <imageUpload v-model="form.pictureProof" :limit="1" />
  486. <!-- <el-input v-model="form.pictureProof" placeholder="请输入图片举证" /> -->
  487. </el-form-item>
  488. <div class="jiben" v-if="jiannum != 0">文件举证</div>
  489. <el-form-item label prop="documentProof" v-if="jiannum != 0">
  490. <!-- <fileUpload v-model="form.documentProof" /> -->
  491. <fileUpload v-model="form.documentProof" />
  492. <!-- <el-input v-model="form.documentProof" placeholder="请输入文件举证" /> -->
  493. </el-form-item>
  494. <div class="jiben" v-if="currentState == 1">未通过原因</div>
  495. <el-form-item label prop="score" v-if="currentState == 1">
  496. <el-input
  497. v-model="form.reasonReturn"
  498. :disabled="disabled || curr"
  499. type="textarea"
  500. placeholder="请输入未通过原因"
  501. />
  502. </el-form-item>
  503. <!-- <el-form-item label="创建人ID" prop="createUserId">
  504. <el-input v-model="form.createUserId" placeholder="请输入创建人ID" />
  505. </el-form-item>
  506. <el-form-item label="创建人" prop="createUser">
  507. <el-input v-model="form.createUser" placeholder="请输入创建人" />
  508. </el-form-item>-->
  509. </el-form>
  510. <div slot="footer" class="dialog-footer">
  511. <el-button
  512. type="primary"
  513. @click="submitForm"
  514. v-if="btnnum != 0 && btnnum != 1"
  515. >确 定</el-button
  516. >
  517. <el-button type="primary" @click="tongguofun" v-if="btnnum == 0"
  518. >通 过</el-button
  519. >
  520. <el-button type="primary" @click="zhenggaifun" v-if="btnnum == 0"
  521. >重新整改</el-button
  522. >
  523. <el-button type="primary" @click="weitongguofun" v-if="btnnum == 1"
  524. >确 定</el-button
  525. >
  526. <el-button @click="cancel" size="btn">取 消</el-button>
  527. </div>
  528. </el-dialog>
  529. </div>
  530. </template>
  531. <script>
  532. import {
  533. listSpecialinfo,
  534. getSpecialinfo,
  535. delSpecialinfo,
  536. addSpecialinfo,
  537. updateSpecialinfo,
  538. exportSpecialinfo,
  539. getDept,
  540. listPeople,
  541. editquestion,
  542. editissuccess,
  543. editisfalse,
  544. bumenlist,
  545. listSpecialinfos,
  546. } from "@/api/bdglregular/specialinfo";
  547. export default {
  548. name: "Specialinfo",
  549. data() {
  550. return {
  551. // 遮罩层
  552. loading: true,
  553. // 导出遮罩层
  554. exportLoading: false,
  555. // 选中数组
  556. ids: [],
  557. // 非单个禁用
  558. single: true,
  559. // 非多个禁用
  560. multiple: true,
  561. // 显示搜索条件
  562. showSearch: true,
  563. // 总条数
  564. total: 0,
  565. // 专项检查表格数据
  566. specialinfoList: [],
  567. // 弹出层标题
  568. title: "",
  569. // 是否显示弹出层
  570. open: false,
  571. // 查询参数
  572. queryParams: {
  573. pageNum: 1,
  574. pageSize: 10,
  575. inspectedUnitId: null,
  576. inspectedUnit: null,
  577. inspectionTime: null,
  578. score: null,
  579. rectificationTime: null,
  580. currentState: null,
  581. question: null,
  582. chargePeopleId: null,
  583. chargePeople: null,
  584. correctiveAction: null,
  585. pictureProof: null,
  586. documentProof: null,
  587. createUserId: null,
  588. createUser: null,
  589. caoZuoType: 0,
  590. },
  591. // 表单参数
  592. form: {},
  593. // 表单校验
  594. rules: {
  595. inspectedUnit: [
  596. { required: true, message: "受检单位不能为空", trigger: "change" },
  597. ],
  598. inspectionTime: [
  599. { required: true, message: "检查时间不能为空", trigger: "change" },
  600. ],
  601. rectificationTime: [
  602. { required: true, message: "整改时间为空", trigger: "change" },
  603. ],
  604. chargePeople: [
  605. { required: true, message: "整改负责人不能为空", trigger: "change" },
  606. ],
  607. },
  608. //单位
  609. unitId: [],
  610. //调动人员对象
  611. peopleIds: [],
  612. //区分减分、增改
  613. jiannum: null,
  614. btnnum: null,
  615. disabled: false,
  616. currentState: null,
  617. curr: null,
  618. };
  619. },
  620. created() {
  621. this.queryParams = {
  622. pageNum: 1,
  623. pageSize: 10,
  624. inspectedUnitId: null,
  625. inspectedUnit: null,
  626. inspectionTime: null,
  627. score: null,
  628. rectificationTime: null,
  629. currentState: null,
  630. question: null,
  631. chargePeopleId: null,
  632. chargePeople: null,
  633. correctiveAction: null,
  634. pictureProof: null,
  635. documentProof: null,
  636. createUserId: null,
  637. createUser: null,
  638. caoZuoType: 0,
  639. };
  640. //部门数据
  641. getDept().then((res) => {
  642. if (res.code == 200) {
  643. this.unitId = res.data;
  644. }
  645. });
  646. //调动人员对象
  647. listPeople().then((res) => {
  648. if (res.code == 200) {
  649. this.peopleIds = res.rows;
  650. }
  651. });
  652. if (this.$route.query.id) {
  653. bumenlist(this.$route.query.id).then((res) => {
  654. this.specialinfoList = res.rows;
  655. this.total = res.total;
  656. this.loading = false;
  657. });
  658. } else if (this.$route.query.obj) {
  659. this.queryParams.inspectedUnitId = this.$route.query.obj.id;
  660. this.queryParams.currentState = this.$route.query.obj.name + "";
  661. listSpecialinfos(this.queryParams).then((res) => {
  662. this.specialinfoList = res.rows;
  663. this.total = res.total;
  664. this.loading = false;
  665. });
  666. } else {
  667. this.getList();
  668. }
  669. },
  670. watch: {
  671. $route(to, from) {
  672. this.queryParams = {
  673. pageNum: 1,
  674. pageSize: 10,
  675. inspectedUnitId: null,
  676. inspectedUnit: null,
  677. inspectionTime: null,
  678. score: null,
  679. rectificationTime: null,
  680. currentState: null,
  681. question: null,
  682. chargePeopleId: null,
  683. chargePeople: null,
  684. correctiveAction: null,
  685. pictureProof: null,
  686. documentProof: null,
  687. createUserId: null,
  688. createUser: null,
  689. caoZuoType: 0,
  690. };
  691. if (to.query.id) {
  692. console.log(1);
  693. bumenlist(to.query.id).then((res) => {
  694. this.specialinfoList = res.rows;
  695. this.total = res.total;
  696. this.loading = false;
  697. });
  698. } else if (to.query.obj) {
  699. console.log(2);
  700. this.queryParams.inspectedUnitId = to.query.obj.id;
  701. this.queryParams.currentState = to.query.obj.name + "";
  702. listSpecialinfos(this.queryParams).then((res) => {
  703. console.log(res);
  704. this.specialinfoList = res.rows;
  705. this.total = res.total;
  706. this.loading = false;
  707. });
  708. } else {
  709. console.log(3);
  710. this.getList();
  711. }
  712. },
  713. },
  714. methods: {
  715. /** 查询专项检查列表 */
  716. getList() {
  717. this.loading = true;
  718. listSpecialinfo(this.queryParams).then((response) => {
  719. this.specialinfoList = response.rows;
  720. this.total = response.total;
  721. this.loading = false;
  722. });
  723. },
  724. // 取消按钮
  725. cancel() {
  726. this.open = false;
  727. this.reset();
  728. },
  729. // 表单重置
  730. reset() {
  731. this.form = {
  732. id: null,
  733. inspectedUnitId: null,
  734. inspectedUnit: null,
  735. inspectionTime: null,
  736. score: null,
  737. rectificationTime: null,
  738. currentState: null,
  739. question: null,
  740. chargePeopleId: null,
  741. chargePeople: null,
  742. correctiveAction: null,
  743. pictureProof: null,
  744. documentProof: null,
  745. createTime: null,
  746. createUserId: null,
  747. createUser: null,
  748. updateTime: null,
  749. };
  750. this.resetForm("form");
  751. },
  752. /** 搜索按钮操作 */
  753. handleQuery() {
  754. this.queryParams.pageNum = 1;
  755. this.getList();
  756. },
  757. /** 重置按钮操作 */
  758. resetQuery() {
  759. this.resetForm("queryForm");
  760. this.handleQuery();
  761. },
  762. // 多选框选中数据
  763. handleSelectionChange(selection) {
  764. this.ids = selection.map((item) => item.id);
  765. this.single = selection.length !== 1;
  766. this.multiple = !selection.length;
  767. },
  768. /** 新增按钮操作 */
  769. handleAdd() {
  770. this.reset();
  771. this.open = true;
  772. this.title = "专项检查";
  773. this.jiannum = 0;
  774. this.btnnum = null;
  775. var today = new Date();
  776. var y = today.getFullYear();
  777. var M = today.getMonth() + 1;
  778. var d = today.getDate();
  779. var h = today.getHours();
  780. var m = today.getMinutes();
  781. var s = today.getSeconds();
  782. var w = today.getDay();
  783. if (M < 10) {
  784. M = "0" + M;
  785. }
  786. if (d < 10) {
  787. d = "0" + d;
  788. }
  789. if (h < 10) {
  790. h = "0" + h;
  791. }
  792. if (m < 10) {
  793. m = "0" + m;
  794. }
  795. if (s < 10) {
  796. s = "0" + s;
  797. }
  798. this.form.inspectionTime = y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s;
  799. },
  800. /** 修改按钮操作 */
  801. handleUpdate(row) {
  802. this.reset();
  803. const id = row.id || this.ids;
  804. getSpecialinfo(id).then((response) => {
  805. this.form = response.data;
  806. this.open = true;
  807. this.title = "修改专项检查";
  808. this.jiannum = 1;
  809. this.btnnum = null;
  810. this.disabled = false;
  811. if (this.form.currentState == "未通过") {
  812. this.currentState = 1;
  813. this.curr = true;
  814. }
  815. });
  816. },
  817. /** 审批按钮操作 */
  818. shenpifun(row) {
  819. this.reset();
  820. const id = row.id || this.ids;
  821. getSpecialinfo(id).then((response) => {
  822. this.disabled = true;
  823. this.form = response.data;
  824. this.open = true;
  825. this.title = "修改经常性检查";
  826. this.jiannum = 1;
  827. this.btnnum = 0;
  828. });
  829. },
  830. //通过
  831. tongguofun() {
  832. editissuccess(this.form).then((res) => {
  833. if (res.code == 200) {
  834. this.$modal.msgSuccess("审批成功");
  835. this.open = false;
  836. this.getList();
  837. }
  838. });
  839. },
  840. //重新整改
  841. zhenggaifun() {
  842. this.jiannum = 0;
  843. this.btnnum = 1;
  844. this.disabled = false;
  845. this.currentState = 1;
  846. this.curr = false;
  847. },
  848. //未通过提交
  849. weitongguofun() {
  850. editisfalse(this.form).then((res) => {
  851. this.$modal.msgSuccess("操作成功");
  852. this.open = false;
  853. this.getList();
  854. });
  855. },
  856. /** 提交按钮 */
  857. submitForm() {
  858. this.$refs["form"].validate((valid) => {
  859. if (valid) {
  860. if (this.form.documentProof) {
  861. this.form.documentProof = this.form.documentProof[0].url;
  862. }
  863. if (this.form.id != null) {
  864. this.form.caoZuoType = this.queryParams.caoZuoType;
  865. editquestion(this.form).then((response) => {
  866. this.$modal.msgSuccess("修改成功");
  867. this.open = false;
  868. this.getList();
  869. });
  870. } else {
  871. this.form.caoZuoType = this.queryParams.caoZuoType;
  872. addSpecialinfo(this.form).then((response) => {
  873. this.$modal.msgSuccess("新增成功");
  874. this.open = false;
  875. this.getList();
  876. });
  877. }
  878. }
  879. });
  880. },
  881. /** 删除按钮操作 */
  882. handleDelete(row) {
  883. const ids = row.id || this.ids;
  884. this.$modal
  885. .confirm("是否确认删除专项检查的数据项?")
  886. .then(function () {
  887. return delSpecialinfo(ids);
  888. })
  889. .then(() => {
  890. this.getList();
  891. this.$modal.msgSuccess("删除成功");
  892. })
  893. .catch(() => {});
  894. },
  895. /** 导出按钮操作 */
  896. handleExport() {
  897. const queryParams = this.queryParams;
  898. this.$modal
  899. .confirm("是否确认导出所有专项检查数据项?")
  900. .then(() => {
  901. this.exportLoading = true;
  902. return exportSpecialinfo(queryParams);
  903. })
  904. .then((response) => {
  905. this.$download.name(response.msg);
  906. this.exportLoading = false;
  907. })
  908. .catch(() => {});
  909. },
  910. //检查单位
  911. unitCheckIdfun(val) {
  912. this.form.unitCheckId = val.deptId;
  913. this.form.unitCheck = val.deptName;
  914. },
  915. //受检单位
  916. inspectedUnitfun(val) {
  917. this.form.inspectedUnitId = val.deptId;
  918. this.form.inspectedUnit = val.deptName;
  919. },
  920. //负责人
  921. chargePeoplefun(val) {
  922. console.log(val);
  923. this.form.chargePeopleId = val.id;
  924. this.form.chargePeople = val.name;
  925. },
  926. caoZuoTypefun() {
  927. this.getList();
  928. },
  929. scoreblur() {
  930. if (this.form.score < 0) {
  931. this.form.score = null;
  932. }
  933. },
  934. },
  935. };
  936. </script>
  937. <style scoped>
  938. ::v-deep .el-dialog {
  939. width: 1030px !important;
  940. background-color: #004d86;
  941. }
  942. ::v-deep .el-dialog__header {
  943. border-bottom: 1px solid #718a9d;
  944. }
  945. ::v-deep .el-dialog__title {
  946. color: #fff;
  947. font: 18px;
  948. }
  949. ::v-deep .el-dialog__headerbtn .el-dialog__close {
  950. color: #fff;
  951. }
  952. .el-form-item ::v-deep .el-input__inner {
  953. width: 200px;
  954. height: 36px;
  955. background: #004d86;
  956. color: #fff;
  957. border: 1px solid #fff !important;
  958. }
  959. ::v-deep .el-date-editor.el-input {
  960. width: 200px;
  961. height: 36px;
  962. }
  963. ::v-deep .el-upload--picture-card {
  964. height: 210px;
  965. width: 170px;
  966. line-height: 210px;
  967. }
  968. .el-upload--picture-card /deep/ .el-upload--picture-card i {
  969. font-size: 48px;
  970. }
  971. ::v-deep .el-upload__tip {
  972. display: none;
  973. }
  974. ::v-deep .el-textarea__inner {
  975. width: 980px;
  976. height: 104px;
  977. }
  978. .div-box-title span {
  979. width: 25px;
  980. height: 25px;
  981. display: inline-block;
  982. background-color: #1c86e1;
  983. line-height: 25px;
  984. text-align: center;
  985. font-size: 16px;
  986. cursor: pointer;
  987. margin-left: 865px;
  988. }
  989. .el-select-dropdown__item:hover {
  990. color: #1c86e1;
  991. }
  992. .el-select-dropdown__item {
  993. color: #000;
  994. }
  995. .el-tree {
  996. background-color: #00365f;
  997. color: #fff;
  998. }
  999. ::v-deep .el-tree-node__content:hover {
  1000. color: #1c86e1;
  1001. }
  1002. ::v-deep .el-upload-list--picture-card .el-upload-list__item {
  1003. height: 210px;
  1004. width: 170px;
  1005. }
  1006. ::v-deep .el-input-number__increase {
  1007. background-color: transparent !important;
  1008. border: none;
  1009. color: #cccccc;
  1010. border-bottom: none !important;
  1011. }
  1012. ::v-deep .el-input-number__decrease {
  1013. background-color: transparent !important;
  1014. border: none !important;
  1015. color: #cccccc;
  1016. }
  1017. ::v-deep .el-dialog__body {
  1018. padding: 30px 0px 30px 25px;
  1019. }
  1020. ::v-deep .el-dialog__footer {
  1021. margin-right: 5px;
  1022. }
  1023. .isSubmit {
  1024. margin-left: 42% !important;
  1025. }
  1026. .el-radio-button {
  1027. width: 122px !important;
  1028. height: 30px !important;
  1029. line-height: 30px !important;
  1030. border: none !important;
  1031. }
  1032. ::v-deep .el-radio-button__inner {
  1033. width: 120px !important;
  1034. height: 30px !important;
  1035. line-height: 8px !important;
  1036. background: #196299;
  1037. border: none;
  1038. color: #fff;
  1039. }
  1040. ::v-deep .el-radio-button:first-child .el-radio-button__inner {
  1041. border-left: none !important;
  1042. }
  1043. ::v-deep .el-radio-button__orig-radio:checked + .el-radio-button__inner {
  1044. color: #ffffff;
  1045. background-color: #006cff !important;
  1046. border-color: #006cff !important;
  1047. -webkit-box-shadow: -1px 0 0 0 #006cff !important;
  1048. box-shadow: -1px 0 0 0 #006cff !important;
  1049. }
  1050. /* 将水平线设为红色: */
  1051. hr {
  1052. border: none;
  1053. height: 1px;
  1054. background-color: rgba(204, 204, 204, 0.5);
  1055. }
  1056. </style>