audit.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. :page.sync="page"
  7. :permission="permissionList"
  8. :before-open="beforeOpen"
  9. v-model="form"
  10. ref="crud"
  11. @row-update="rowUpdate"
  12. @row-save="rowSave"
  13. @row-del="rowDel"
  14. @search-change="searchChange"
  15. @search-reset="searchReset"
  16. @selection-change="selectionChange"
  17. @current-change="currentChange"
  18. @size-change="sizeChange"
  19. @refresh-change="refreshChange"
  20. @on-load="onLoad">
  21. <template slot="menu" slot-scope="scope">
  22. <el-button v-if="scope.row.auditStatus =='WAITING_PLATFORM'" icon="el-icon-s-check" type="warning" size="small" @click="handleAudit(scope.row)"> 审 核</el-button>
  23. <el-button v-else icon="el-icon-view" type="primary" size="small" @click="handleAudit(scope.row)"> 查 看</el-button>
  24. </template>
  25. </avue-crud>
  26. </basic-container>
  27. </template>
  28. <script>
  29. import {getList, getDetail, add, update, remove} from "@/api/ldt_shop/audit";
  30. import {mapGetters} from "vuex";
  31. export default {
  32. data() {
  33. return {
  34. form: {},
  35. query: {},
  36. loading: true,
  37. page: {
  38. pageSize: 10,
  39. currentPage: 1,
  40. total: 0
  41. },
  42. selectionList: [],
  43. option: {
  44. card: true,
  45. addBtn: false,
  46. height:'auto',
  47. calcHeight: 30,
  48. tip: false,
  49. searchShow: true,
  50. searchMenuSpan: 6,
  51. border: true,
  52. index: true,
  53. viewBtn: false,
  54. delBtn: false,
  55. editBtn: false,
  56. selection: true,
  57. dialogClickModal: false,
  58. column: [
  59. {
  60. label: "名称",
  61. prop: "shopName",
  62. },
  63. {
  64. label: "logo",
  65. prop: "shopLogo",
  66. type: 'img'
  67. },
  68. {
  69. label: "主体信息",
  70. prop: "entity",
  71. },
  72. {
  73. label: "法人姓名",
  74. prop: "legalPerson",
  75. },
  76. {
  77. label: "进件类型",
  78. prop: "type",
  79. type: "select",
  80. search: true,
  81. dicData: [
  82. {label: "商场",value:"MALL"},
  83. {label: "商户",value:"SHOP"},
  84. ]
  85. },
  86. {
  87. label: "审核状态",
  88. prop: "auditStatus",
  89. type: "select",
  90. search: true,
  91. dicData: [
  92. {label: "待商场审核",value:"WAITING_MALL"},
  93. {label: "待平台审核",value:"WAITING_PLATFORM"},
  94. {label: "商户入驻评估",value:"WAITING_INVITATION"},
  95. {label: "待商户签约",value:"WAITING_SIGN"},
  96. {label: "待商户认证",value:"WAITING_AUTH"},
  97. {label: "审核通过",value:"PASS"},
  98. {label: "审核驳回",value:"FAIL"},
  99. {label: "停用",value:"STOP"},
  100. ]
  101. },
  102. {
  103. label: '提交时间',
  104. prop: 'createTime',
  105. valueFormat:'yyyy-MM-dd HH:mm:ss',
  106. type: 'date',
  107. }
  108. ]
  109. },
  110. data: []
  111. };
  112. },
  113. computed: {
  114. ...mapGetters(["permission"]),
  115. permissionList() {
  116. return {
  117. addBtn: this.vaildData(this.permission.audit_add, false),
  118. viewBtn: this.vaildData(this.permission.audit_view, false),
  119. delBtn: this.vaildData(this.permission.audit_delete, false),
  120. editBtn: this.vaildData(this.permission.audit_edit, false)
  121. };
  122. },
  123. ids() {
  124. let ids = [];
  125. this.selectionList.forEach(ele => {
  126. ids.push(ele.id);
  127. });
  128. return ids.join(",");
  129. }
  130. },
  131. methods: {
  132. handleAudit(row){
  133. this.$router.push(`/work/process/shop/handle/${row.processInstanceId}/${row.id}`);
  134. },
  135. rowSave(row, done, loading) {
  136. add(row).then(() => {
  137. this.onLoad(this.page);
  138. this.$message({
  139. type: "success",
  140. message: "操作成功!"
  141. });
  142. done();
  143. }, error => {
  144. loading();
  145. window.console.log(error);
  146. });
  147. },
  148. rowUpdate(row, index, done, loading) {
  149. update(row).then(() => {
  150. this.onLoad(this.page);
  151. this.$message({
  152. type: "success",
  153. message: "操作成功!"
  154. });
  155. done();
  156. }, error => {
  157. loading();
  158. console.log(error);
  159. });
  160. },
  161. rowDel(row) {
  162. this.$confirm("确定将选择数据删除?", {
  163. confirmButtonText: "确定",
  164. cancelButtonText: "取消",
  165. type: "warning"
  166. })
  167. .then(() => {
  168. return remove(row.id);
  169. })
  170. .then(() => {
  171. this.onLoad(this.page);
  172. this.$message({
  173. type: "success",
  174. message: "操作成功!"
  175. });
  176. });
  177. },
  178. handleDelete() {
  179. if (this.selectionList.length === 0) {
  180. this.$message.warning("请选择至少一条数据");
  181. return;
  182. }
  183. this.$confirm("确定将选择数据删除?", {
  184. confirmButtonText: "确定",
  185. cancelButtonText: "取消",
  186. type: "warning"
  187. })
  188. .then(() => {
  189. return remove(this.ids);
  190. })
  191. .then(() => {
  192. this.onLoad(this.page);
  193. this.$message({
  194. type: "success",
  195. message: "操作成功!"
  196. });
  197. this.$refs.crud.toggleSelection();
  198. });
  199. },
  200. beforeOpen(done, type) {
  201. if (["edit", "view"].includes(type)) {
  202. getDetail(this.form.id).then(res => {
  203. this.form = res.data.data;
  204. });
  205. }
  206. done();
  207. },
  208. searchReset() {
  209. this.query = {};
  210. this.onLoad(this.page);
  211. },
  212. searchChange(params, done) {
  213. this.query = params;
  214. this.page.currentPage = 1;
  215. this.onLoad(this.page, params);
  216. done();
  217. },
  218. selectionChange(list) {
  219. this.selectionList = list;
  220. },
  221. selectionClear() {
  222. this.selectionList = [];
  223. this.$refs.crud.toggleSelection();
  224. },
  225. currentChange(currentPage){
  226. this.page.currentPage = currentPage;
  227. },
  228. sizeChange(pageSize){
  229. this.page.pageSize = pageSize;
  230. },
  231. refreshChange() {
  232. this.onLoad(this.page, this.query);
  233. },
  234. onLoad(page, params = {}) {
  235. this.loading = true;
  236. getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
  237. const data = res.data.data;
  238. this.page.total = data.total;
  239. this.data = data.records;
  240. this.loading = false;
  241. this.selectionClear();
  242. });
  243. }
  244. }
  245. };
  246. </script>
  247. <style>
  248. </style>