approvalExamination.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. <template>
  2. <div class="simple-container approvalExamination-container">
  3. <simple-form
  4. :form="table_form"
  5. :handle="table_handle"
  6. @search="handleSearch"
  7. @track="handleQueryTrack"
  8. @batch="handleBatch"
  9. @turn="handleReturn"
  10. >
  11. </simple-form>
  12. <simple-table
  13. :list="table_list"
  14. :config="table_config"
  15. :loading="table_loading"
  16. :handle-row="table_handle_row"
  17. @download="handleDownload"
  18. @selection="handleSelect"
  19. @back="handleBack"
  20. ></simple-table>
  21. <simple-pagination
  22. :page="page"
  23. :total="total"
  24. @change="handleChange"
  25. ></simple-pagination>
  26. <simple-dialog
  27. title="审批"
  28. width="40%"
  29. @cancel="handleVisible('opinion')"
  30. :visible="opinion_visible"
  31. >
  32. <el-form label-width="80px" :model="opinion_form" ref="opinion_ref">
  33. <el-form-item label="审批意见" prop="opinion">
  34. <el-input
  35. :rows="8"
  36. type="textarea"
  37. v-model="opinion_form.opinion"
  38. ></el-input>
  39. </el-form-item>
  40. </el-form>
  41. <template v-slot:footer>
  42. <div>
  43. <el-button v-if="!isAgree" @click="handleOpinion('1')" type="default"
  44. >退回修改</el-button
  45. >
  46. <el-button v-else @click="handleOpinion('0')" type="primary"
  47. >同意</el-button
  48. >
  49. </div>
  50. </template>
  51. </simple-dialog>
  52. <simple-dialog
  53. title="审批轨迹"
  54. :fullscreen="true"
  55. @cancel="handleVisible('track')"
  56. :visible="track_visible"
  57. >
  58. <simple-table
  59. :list="table_list_track"
  60. :config="table_config_track"
  61. :loading="table_loading_track"
  62. ></simple-table>
  63. <template v-slot:footer>
  64. <!-- <div>
  65. <el-button @click="handleVisible('track')" type="default"
  66. >退回修改</el-button
  67. >
  68. <el-button @click="handleConsent" type="primary">同意</el-button>
  69. </div> -->
  70. <el-button @click="handleConsent" type="primary">确定</el-button>
  71. </template>
  72. </simple-dialog>
  73. </div>
  74. </template>
  75. <script>
  76. import simpleForm from "../performance/components/form.vue";
  77. import simpleTable from "../performance/components/table.vue";
  78. import simpleDialog from "../performance/components/dialog.vue";
  79. import simplePagination from "../performance/components/pagination.vue";
  80. export default {
  81. components: {
  82. simpleForm,
  83. simpleDialog,
  84. simpleTable,
  85. simplePagination,
  86. },
  87. data() {
  88. return {
  89. // 审批意见
  90. opinion_visible: false,
  91. track_visible: false,
  92. opinion_form: {},
  93. status: "",
  94. isAgree: false,
  95. // 单条审批id
  96. ids: "",
  97. parentId: "",
  98. adoptIds: [],
  99. page: 1,
  100. rows: 10,
  101. total: 0,
  102. table_form: [
  103. {
  104. label: "公司名称",
  105. props: "companyName",
  106. type: "input",
  107. },
  108. {
  109. label: "状态",
  110. props: "sts",
  111. type: "select",
  112. // 0.待办 1.已办
  113. dictionary: [
  114. {
  115. label: "待办",
  116. value: "0",
  117. },
  118. {
  119. label: "已办",
  120. value: "1",
  121. },
  122. ],
  123. },
  124. ],
  125. table_loading: false,
  126. table_handle: [
  127. {
  128. label: "返回",
  129. props: "turn",
  130. },
  131. {
  132. label: "审批轨迹",
  133. props: "track",
  134. },
  135. {
  136. label: "批量审批",
  137. props: "batch",
  138. },
  139. ],
  140. // 列表数据
  141. table_list: [],
  142. // 表头配置
  143. table_config: [
  144. {
  145. label: "序号",
  146. props: "No",
  147. },
  148. {
  149. label: "公司名称",
  150. props: "companyName",
  151. },
  152. {
  153. label: "提出人",
  154. props: "proposer",
  155. },
  156. {
  157. label: "联系电话",
  158. props: "telephone",
  159. },
  160. {
  161. label: "网格划分需求",
  162. props: "wanggeText",
  163. },
  164. {
  165. label: "附件",
  166. props: "fileNames",
  167. type: "file",
  168. },
  169. {
  170. label: "状态",
  171. props: "sts",
  172. type: "dictionary",
  173. dictionary: { 0: "待办", 1: "已办" },
  174. },
  175. ],
  176. // 表格里的操作按钮
  177. table_handle_row: [
  178. {
  179. label: "不通过",
  180. props: "back",
  181. visible: { sts: [0] },
  182. },
  183. {},
  184. {},
  185. ],
  186. table_loading_track: false,
  187. // 审批轨迹内表数据
  188. table_list_track: [],
  189. // 审批轨迹内表头配置
  190. table_config_track: [
  191. {
  192. label: "编号",
  193. props: "No",
  194. },
  195. {
  196. label: "流程环节",
  197. props: "taskName",
  198. },
  199. {
  200. label: "处理人",
  201. props: "opName",
  202. },
  203. {
  204. label: "处理工号",
  205. props: "opNo",
  206. },
  207. {
  208. label: "处理时间",
  209. props: "opTime",
  210. },
  211. {
  212. label: "审批意见",
  213. props: "remark",
  214. // type: "dictionary",
  215. // dictionary: { 0: "同意", 1: "不同意" },
  216. },
  217. ],
  218. };
  219. },
  220. watch: {
  221. parentId() {
  222. this.status = this.$route.query.status;
  223. this.handleInit();
  224. },
  225. },
  226. created() {
  227. this.parentId = this.$route.query.parentId;
  228. },
  229. methods: {
  230. // 表格数据初始化
  231. handleInit() {
  232. this.table_loading = true;
  233. let reqdata = {
  234. ...this.table_search,
  235. type: "2",
  236. page: this.page,
  237. parentId: this.parentId,
  238. pageSize: this.rows,
  239. };
  240. this.$http({
  241. url: "/market/mkWangge/queryPage",
  242. method: "post",
  243. headers: {
  244. "Content-Type": "application/json",
  245. },
  246. data: reqdata,
  247. }).then(({ data: { count, data } }) => {
  248. this.table_loading = false;
  249. this.total = count;
  250. this.table_list = data
  251. ? data.map((element, index) => ({
  252. ...element,
  253. No: index + 1,
  254. sts: Number(this.status),
  255. }))
  256. : [];
  257. this.table_list && this.table_list[0].sts === 0
  258. ? (this.table_handle = [
  259. {
  260. label: "返回",
  261. props: "turn",
  262. },
  263. {
  264. label: "审批轨迹",
  265. props: "track",
  266. },
  267. {
  268. label: "批量审批",
  269. props: "batch",
  270. },
  271. ])
  272. : (this.table_handle = [
  273. {
  274. label: "返回",
  275. props: "turn",
  276. },
  277. {
  278. label: "审批轨迹",
  279. props: "track",
  280. },
  281. ]);
  282. data.forEach((item) => {
  283. this.adoptIds.push(item.id.toString());
  284. });
  285. // console.log(this.table_list,'table_list');
  286. // console.log(this.adoptIds);
  287. });
  288. },
  289. // 搜索事件
  290. handleSearch(data) {
  291. this.table_search = data;
  292. this.page = 1;
  293. this.handleInit();
  294. },
  295. // 翻页
  296. handleChange(page) {
  297. this.page = page;
  298. this.handleInit();
  299. },
  300. handleDownload(data) {
  301. console.log(data, "data");
  302. },
  303. handleVisible(props) {
  304. switch (props) {
  305. case "opinion":
  306. this.opinion_visible = !this.opinion_visible;
  307. this.isAgree = false;
  308. this.opinion_form = {};
  309. break;
  310. case "track":
  311. this.track_visible = !this.track_visible;
  312. break;
  313. case "batch":
  314. this.opinion_visible = !this.opinion_visible;
  315. this.isAgree = true;
  316. break;
  317. }
  318. },
  319. // 查询审批轨迹
  320. handleQueryTrack() {
  321. // let type = this.parentId === null ? "1" : "0";
  322. this.$http({
  323. url: "/market/mkWangge/getMkWanggeById",
  324. method: "get",
  325. headers: {
  326. "Content-Type": "application/json",
  327. },
  328. params: {
  329. id: this.parentId,
  330. type: 0,
  331. },
  332. }).then(({ data }) => {
  333. let body = data.body;
  334. console.log(body, "body");
  335. // this.ids = [body.id.toString()];
  336. this.table_list_track = body.bpmTaskList.map((item, index) => ({
  337. ...item,
  338. No: index + 1,
  339. }));
  340. });
  341. this.handleVisible("track");
  342. },
  343. // 批量审批
  344. handleBatch() {
  345. this.handleVisible("batch");
  346. },
  347. handleSelect(val) {
  348. console.log(val);
  349. },
  350. // 审批不通过
  351. handleBack(row) {
  352. // console.log(row);
  353. this.ids = row.id.toString();
  354. this.handleVisible("opinion");
  355. this.isAgree = false;
  356. },
  357. // 审批意见提交
  358. handleOpinion(type) {
  359. let reqdata = {};
  360. if (type === "1") {
  361. // 批量退回
  362. reqdata = {
  363. parentId: this.parentId,
  364. mkWanggeList: [
  365. {
  366. id: this.ids,
  367. remark: this.opinion_form.opinion,
  368. },
  369. ],
  370. };
  371. console.log(reqdata);
  372. this.$http({
  373. url: "/market/mkWangge/backList",
  374. method: "post",
  375. headers: {
  376. "Content-Type": "application/json",
  377. },
  378. data: {
  379. ...reqdata,
  380. },
  381. }).then((res) => {
  382. console.log(res);
  383. this.handleInit();
  384. });
  385. } else {
  386. // 批量审批(多条)
  387. reqdata = {
  388. adoptIds: this.adoptIds,
  389. remark: this.opinion_form.opinion,
  390. parentId: this.parentId,
  391. type: type,
  392. };
  393. console.log(reqdata);
  394. this.$http({
  395. url: "/market/mkWangge/reviewMore",
  396. method: "post",
  397. headers: {
  398. "Content-Type": "application/json",
  399. },
  400. data: {
  401. ...reqdata,
  402. },
  403. }).then((res) => {
  404. console.log(res);
  405. this.status = 1;
  406. this.handleInit();
  407. });
  408. }
  409. this.handleVisible("opinion");
  410. },
  411. handleReturn() {
  412. this.$router.go(-1);
  413. },
  414. // 审批轨迹--确定关闭模态框
  415. handleConsent() {
  416. this.handleVisible("track");
  417. },
  418. },
  419. };
  420. </script>
  421. <style lang="scss" scoped>
  422. .approvalExamination-container {
  423. background: #ffffff;
  424. padding: 0 20px;
  425. padding-top: 20px;
  426. margin: 15px;
  427. overflow: auto;
  428. width: calc(100% - 30px);
  429. max-width: calc(100% - 30px);
  430. height: 100%;
  431. overflow-x: hidden;
  432. }
  433. ::v-deep .el-row {
  434. padding-bottom: 12px;
  435. }
  436. </style>