dialog.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. <template>
  2. <DialogCom
  3. :title="title"
  4. :visible.sync="open"
  5. width="1200px"
  6. append-to-body
  7. @close="cancel"
  8. >
  9. <div class="page-body">
  10. <el-descriptions
  11. :column="2"
  12. class="margin-top"
  13. size="medium"
  14. border
  15. :label-style="labelStyle"
  16. :contentStyle="content_style"
  17. >
  18. <el-descriptions-item label="机构名称">{{
  19. data.orgName
  20. }}</el-descriptions-item>
  21. <el-descriptions-item label="隐患来源">{{
  22. data.srcTaskName
  23. }}</el-descriptions-item>
  24. <el-descriptions-item label="标准项">{{
  25. data.checkItem
  26. }}</el-descriptions-item>
  27. <el-descriptions-item label="标准依据">
  28. <pre>{{ data.checkContent }}</pre>
  29. </el-descriptions-item>
  30. <el-descriptions-item label="隐患描述">
  31. {{ data.questionDesc }}</el-descriptions-item
  32. >
  33. <el-descriptions-item label="提出人">
  34. {{ data.submitorName }}</el-descriptions-item
  35. >
  36. <el-descriptions-item label="发现时间">
  37. {{
  38. dayjs(data.submitTime).format("YYYY-MM-DD HH:mm")
  39. }}</el-descriptions-item
  40. >
  41. <el-descriptions-item label="整改期限">
  42. {{
  43. dayjs(data.reformDeadline).format("YYYY年MM月DD日")
  44. }}</el-descriptions-item
  45. >
  46. <el-descriptions-item label="隐患图片">
  47. <div class="imageList">
  48. <el-image
  49. style="width: 100px"
  50. v-for="url in data.images"
  51. :src="url"
  52. :preview-src-list="data.images"
  53. >
  54. </el-image></div
  55. ></el-descriptions-item>
  56. </el-descriptions>
  57. <el-descriptions
  58. :column="2"
  59. class="margin-top"
  60. size="medium"
  61. border
  62. :label-style="labelStyle"
  63. :contentStyle="content_style"
  64. v-if="data.confirm"
  65. >
  66. <el-descriptions-item label="确认结果">{{
  67. data.confirm.executeStatus == 0 ? "确认" : "提出异议"
  68. }}</el-descriptions-item>
  69. <el-descriptions-item label="确认人">{{
  70. data.confirm.executorName
  71. }}</el-descriptions-item>
  72. <el-descriptions-item
  73. label="异议内容"
  74. :span="2"
  75. v-if="data.confirm.executeStatus == 1"
  76. >{{ data.confirm.description }}</el-descriptions-item
  77. >
  78. </el-descriptions>
  79. <el-descriptions
  80. :column="2"
  81. class="margin-top"
  82. size="medium"
  83. border
  84. :label-style="labelStyle"
  85. :contentStyle="content_style"
  86. v-if="data.confirmDissent"
  87. >
  88. <el-descriptions-item label="审核结果">{{
  89. data.confirmDissent.executeStatus == 0 ? "同意" : "不同意"
  90. }}</el-descriptions-item>
  91. <el-descriptions-item label="审核人">{{
  92. data.confirmDissent.executorName
  93. }}</el-descriptions-item>
  94. <el-descriptions-item
  95. label="描述"
  96. :span="2"
  97. v-if="data.confirmDissent.executeStatus == 1"
  98. >{{ data.confirmDissent.description }}</el-descriptions-item
  99. >
  100. </el-descriptions>
  101. <el-descriptions
  102. :column="2"
  103. class="margin-top"
  104. size="medium"
  105. border
  106. :label-style="labelStyle"
  107. :contentStyle="content_style"
  108. v-if="data.reform"
  109. >
  110. <el-descriptions-item label="整改时间">{{
  111. dayjs(data.reform.executeTime).format("YYYY年MM月DD日")
  112. }}</el-descriptions-item>
  113. <el-descriptions-item label="整改状态">{{
  114. data.reform.executeStatus == 0 ? "已整改" : "未整改"
  115. }}</el-descriptions-item>
  116. <el-descriptions-item label="描述" :span="2">{{
  117. data.reform.description
  118. }}</el-descriptions-item>
  119. <el-descriptions-item label="整改图片" :span="2">
  120. <div class="imageList">
  121. <el-image
  122. style="width: 100px; height: 100px"
  123. v-for="url in data.reform.images"
  124. :src="url"
  125. :preview-src-list="data.reform.images"
  126. >
  127. </el-image></div
  128. ></el-descriptions-item>
  129. </el-descriptions>
  130. <el-form
  131. ref="confirmForm"
  132. :model="confirmData"
  133. label-width="100px"
  134. class="form"
  135. v-if="type == 'confirm'"
  136. :rules="confirmRule"
  137. >
  138. <el-form-item label="确认结果" prop="status">
  139. <el-radio-group v-model="confirmData.status">
  140. <el-radio :label="0">确认</el-radio>
  141. <el-radio :label="1">提出异议</el-radio>
  142. </el-radio-group>
  143. </el-form-item>
  144. <el-form-item
  145. label="异议内容"
  146. prop="description"
  147. v-if="confirmData.status == 1"
  148. >
  149. <el-input
  150. v-model="confirmData.description"
  151. maxlength="255"
  152. placeHolder="请输入异议内容"
  153. ></el-input>
  154. </el-form-item>
  155. </el-form>
  156. <el-form
  157. ref="confirmDissentForm"
  158. :model="confirmDissentData"
  159. label-width="100px"
  160. class="form"
  161. v-if="type == 'confirmDissent'"
  162. :rules="confirmDissentRule"
  163. >
  164. <el-form-item label="审核结果" prop="status">
  165. <el-radio-group v-model="confirmDissentData.status">
  166. <el-radio :label="0">同意</el-radio>
  167. <el-radio :label="1">不同意</el-radio>
  168. </el-radio-group>
  169. </el-form-item>
  170. <el-form-item
  171. label="原因"
  172. prop="description"
  173. v-if="confirmDissentData.status == 1"
  174. >
  175. <el-input
  176. v-model="confirmDissentData.description"
  177. placeHolder="请输入原因"
  178. maxlength="255"
  179. ></el-input>
  180. </el-form-item>
  181. </el-form>
  182. </div>
  183. <div slot="footer" class="dialog-footer" v-if="type != 'detail'">
  184. <el-button type="primary" @click="submitForm"
  185. >确定</el-button
  186. >
  187. <el-button @click="cancel">取消</el-button>
  188. </div>
  189. <div slot="footer" class="dialog-footer" style="margin-top:40px" v-else>
  190. <el-button @click="cancel">关闭</el-button>
  191. </div>
  192. </DialogCom>
  193. </template>
  194. <script>
  195. import {
  196. getQuestion,
  197. confirm,
  198. confirmDissent,
  199. reform,
  200. } from "@/api/question/list.js";
  201. import dayjs from "dayjs";
  202. import imgUpload from "@/components/ImageUpload/index.vue";
  203. export default {
  204. data() {
  205. return {
  206. labelStyle: {
  207. color: "#000",
  208. "text-align": "center",
  209. height: "40px",
  210. "width": "150px",
  211. "word-break": "keep-all",
  212. },
  213. content_style: {
  214. "text-align": "left",
  215. "width": "300px",
  216. "word-break": "break-all",
  217. },
  218. // 弹出层标题
  219. title: "",
  220. // 是否显示弹出层
  221. open: false,
  222. // 表单参数
  223. form: {},
  224. // 表单校验
  225. rules: {},
  226. row: null,
  227. type: null,
  228. data: {},
  229. confirmData: {
  230. id: null,
  231. status: 0,
  232. description: null,
  233. },
  234. confirmDissentData: {
  235. id: null,
  236. status: 0,
  237. description: null,
  238. },
  239. reformData: {
  240. id: null,
  241. reformDate: null,
  242. description: null,
  243. images: null,
  244. },
  245. confirmRule: {
  246. description: [
  247. { required: true, message: "请输入异议内容", trigger: "blur" },
  248. ],
  249. },
  250. confirmDissentRule: {
  251. description: [
  252. { required: true, message: "请输入原因", trigger: "blur" },
  253. ],
  254. },
  255. reformRule: {
  256. reformDate: [
  257. { required: true, message: "请选择整改日期", trigger: "blur" },
  258. ],
  259. },
  260. pickerOptions: {
  261. disabledDate(time) {
  262. return time.getTime() > Date.now();
  263. },
  264. },
  265. };
  266. },
  267. components: { imgUpload },
  268. methods: {
  269. dayjs,
  270. // 取消按钮
  271. cancel() {
  272. this.open = false;
  273. this.reset();
  274. },
  275. show(row, type) {
  276. this.row = row;
  277. this.type = type;
  278. this.setTitle(type);
  279. getQuestion(row.id).then((r) => {
  280. this.data = r.data;
  281. this.data.confirmDissent = r.data.flows.find((d) => d.executeStep == 2);
  282. this.data.confirm = r.data.flows.find((d) => d.executeStep == 1);
  283. this.data.reform = r.data.flows.find((d) => d.executeStep == 11);
  284. if (this.data.reform && this.data.reform.images) {
  285. this.data.reform.images = this.data.reform.images.split(",");
  286. }
  287. this.open = true;
  288. });
  289. },
  290. setTitle(type) {
  291. switch (type) {
  292. case "detail":
  293. this.title = "隐患问题详情";
  294. break;
  295. case "confirm":
  296. this.title = "隐患确认";
  297. break;
  298. case "confirmDissent":
  299. this.title = "异议审批";
  300. break;
  301. case "reform":
  302. this.title = "隐患整改";
  303. break;
  304. }
  305. },
  306. // 表单重置
  307. reset() {
  308. this.confirmData = {
  309. id: null,
  310. status: 0,
  311. description: null,
  312. };
  313. this.confirmDissentData = {
  314. id: null,
  315. status: 0,
  316. description: null,
  317. };
  318. this.reformData = {
  319. id: null,
  320. reformDate: null,
  321. description: null,
  322. images: null,
  323. };
  324. this.resetForm("confirmForm");
  325. this.resetForm("confirmDissentForm");
  326. this.resetForm("reformForm");
  327. },
  328. imageListChanged(value) {
  329. this.reformData.images = value;
  330. },
  331. /** 提交按钮 */
  332. submitForm() {
  333. if (this.type == "confirm") {
  334. this.submitConfirm();
  335. } else if (this.type == "confirmDissent") {
  336. this.submitConfirmDissent();
  337. } else if (this.type === "reform") {
  338. this.submitReform();
  339. }
  340. },
  341. submitConfirm() {
  342. this.$refs["confirmForm"].validate((valid) => {
  343. if (!valid) {
  344. return;
  345. }
  346. let data = { ...this.confirmData, id: this.data.id };
  347. confirm(data).then((r) => {
  348. if (r.data) {
  349. this.$message.info("确认成功");
  350. this.$emit("success");
  351. this.open = false;
  352. }
  353. });
  354. });
  355. },
  356. submitConfirmDissent() {
  357. this.$refs["confirmDissentForm"].validate((valid) => {
  358. if (!valid) {
  359. return;
  360. }
  361. let data = { ...this.confirmDissentData, id: this.data.id };
  362. confirmDissent(data).then((r) => {
  363. if (r.data) {
  364. this.$message.info("异议审批成功");
  365. this.$emit("success");
  366. this.open = false;
  367. }
  368. });
  369. });
  370. },
  371. submitReform() {
  372. this.$refs["reformForm"].validate((valid) => {
  373. if (!valid) {
  374. return;
  375. }
  376. let data = { ...this.reformData, id: this.data.id };
  377. reform(data).then((r) => {
  378. if (r.data) {
  379. this.$message.info("整改成功");
  380. this.$emit("success");
  381. this.open = false;
  382. }
  383. });
  384. });
  385. },
  386. // handleConfirmStatusChange(value) {
  387. // if (value == 1) {
  388. // this.confirmRule["description"].required = true;
  389. // } else {
  390. // this.confirmRule["description"].required = false;
  391. // }
  392. // },
  393. // handleConfirmDissentStatusChange(value) {
  394. // if (value == 1) {
  395. // this.confirmDissentRule["description"].required = true;
  396. // } else {
  397. // this.confirmRule["description"].required = false;
  398. // }
  399. // },
  400. },
  401. };
  402. </script>
  403. <style lang="scss" scoped>
  404. .margin-top{
  405. margin-bottom: -21px;
  406. }
  407. .form {
  408. padding-top: 20px;
  409. }
  410. .imageList div {
  411. margin-left: 5px;
  412. margin-right: 5px;
  413. ::v-deep .el-image__error {
  414. display: none !important;
  415. }
  416. }
  417. .question-dialog-body {
  418. max-height: 500px;
  419. overflow-y: auto;
  420. padding-right: 20px;
  421. }
  422. .question-dialog-body > div {
  423. border-bottom: 1px solid #606266;
  424. padding-bottom: 20px;
  425. ::v-deep .el-descriptions-item__label {
  426. width: 100px;
  427. text-align: right;
  428. display: inline-block;
  429. }
  430. }
  431. .question-dialog-body > div:not(:first-child) {
  432. padding-top: 20px;
  433. }
  434. .question-dialog-body > div:last-child {
  435. border: none;
  436. }
  437. </style>