index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option" :data="dataList" ref="crud" v-model="form" :page.sync="page" :search.sync="search"
  4. :table-loading="loading" :cell-style="cellStyle" @search-change="searchChange" @search-reset="searchReset"
  5. @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
  6. @refresh-change="refreshChange" @on-load="onLoad">
  7. <template slot="corpIdSearch">
  8. <select-component v-model="search.corpId" :configuration="configuration"></select-component>
  9. </template>
  10. <template slot-scope="scope" slot="checkType">
  11. <span v-if="scope.row.checkType == 'ffsq'">付费申请</span>
  12. <span v-else-if="scope.row.checkType == 'xsqh'">销售请核</span>
  13. <span v-else-if="scope.row.checkType == 'cgqh'">采购请核</span>
  14. <span v-else-if="scope.row.checkType == 'xsgz'">小学部工资审批</span>
  15. <span v-else-if="scope.row.checkType == 'czgz'">初中部工资审批</span>
  16. <span v-else-if="scope.row.checkType == 'gzgz'">高中部工资审批</span>
  17. <span v-else-if="scope.row.checkType == 'hqgz'">后勤工资审批</span>
  18. <span v-else-if="scope.row.checkType == 'yrygz'">幼儿园工资审批</span>
  19. <span v-else-if="scope.row.checkType == 'yryhqgz'">幼儿园后勤工资审批</span>
  20. <span v-else-if="scope.row.checkType == 'ocg'">办公用品采购审批</span>
  21. <span v-else-if="scope.row.checkType == 'oly'">办公用品领用审批</span>
  22. <span v-else-if="scope.row.checkType == 'fybx'">费用报销审批</span>
  23. <span v-else-if="scope.row.checkType == 'jjd'">交接单审批</span>
  24. <span v-else-if="scope.row.checkType == 'xstpqh'">销售特批请核</span>
  25. <span v-else-if="scope.row.checkType == 'dldd'">代理订单请核</span>
  26. <span v-else-if="scope.row.checkType == 'xsjh'">销售机会请核</span>
  27. </template>
  28. <template slot="menuLeft">
  29. <el-button size="small" type="success" :disabled="selectionList.length == 0" @click.stop="batchCheck">批量审批
  30. </el-button>
  31. </template>
  32. <template slot-scope="scope" slot="menu">
  33. <el-button type="text" size="small" :disabled="scope.row.operate" @click.stop="jumpPage(scope.row)">查看
  34. </el-button>
  35. <el-button type="text" size="small" :disabled="scope.row.auditStatus != 'S'" @click.stop="openCheck(scope.row)">
  36. 审批
  37. </el-button>
  38. <el-button type="text" size="small" @click.stop="openCheckSchedule(scope.row)">审批流程
  39. </el-button>
  40. </template>
  41. </avue-crud>
  42. <el-dialog append-to-body title="审批进度" class="el-dialogDeep" :visible.sync="checkScheduleDialog" width="40%"
  43. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  44. <check-schedule :checkId="checkId" :batchNo="batchNo" @choceScheduleFun="choceScheduleFun">
  45. </check-schedule>
  46. </el-dialog>
  47. <el-dialog append-to-body title="审批" class="el-dialogDeep" :visible.sync="checkDialog" width="50%"
  48. :close-on-click-modal="false" :destroy-on-close="true" :close-on-press-escape="false" v-dialog-drag>
  49. <check :checkData="checkData" :checkDetail="true" :idList="idList" @operationType="operationType"
  50. @choceCheckFun="choceCheckFun">
  51. </check>
  52. </el-dialog>
  53. </basic-container>
  54. </template>
  55. <script>
  56. import option from "./configuration/mainList.json";
  57. import option2 from "./configuration/mainList2.json";
  58. import { getList, approvePass } from "@/api/approveData/main";
  59. import checkSchedule from "@/components/check/checkSchedule";
  60. import check from "@/components/check/check";
  61. import { getUserInfo } from "@/api/system/user";
  62. import { gainUser } from "@/api/basicData/customerInquiry";
  63. let previousRouterName = "";
  64. let checkRefresh = "";
  65. export default {
  66. components: {
  67. check,
  68. checkSchedule
  69. },
  70. data() {
  71. return {
  72. loading: false,
  73. form: {},
  74. search: {},
  75. show: true,
  76. checkDialog: false,
  77. checkId: "",
  78. batchNo: "",
  79. checkScheduleDialog: false,
  80. detailData: {},
  81. option: {},
  82. parentId: 0,
  83. checkData: {},
  84. dataList: [],
  85. idList: [],
  86. selectionList: [],
  87. page: {
  88. pageSize: 10,
  89. pagerCount: 5,
  90. total: 0
  91. },
  92. query: {},
  93. configuration: {
  94. multipleChoices: false,
  95. multiple: false,
  96. disabled: false,
  97. searchShow: true,
  98. collapseTags: false,
  99. clearable: true,
  100. placeholder: "请点击右边按钮选择",
  101. dicData: []
  102. }
  103. };
  104. },
  105. created() {
  106. getUserInfo().then(res => {
  107. if (res.data.data.billType == 1) {
  108. this.option = option2;
  109. } else {
  110. this.option = option;
  111. }
  112. this.getWorkDicts("auditStatus").then(res => {
  113. this.findObject(this.option.column, "auditStatus").dicData =
  114. res.data.data;
  115. });
  116. gainUser().then(res => {
  117. this.findObject(this.option.column, "sendUserId").dicData =
  118. res.data.data;
  119. });
  120. this.getWorkDicts("Approval_business_type").then(res => {
  121. console.log(res)
  122. this.findObject(this.option.column, "processType").dicData =
  123. res.data.data;
  124. });
  125. });
  126. },
  127. mounted() {
  128. // option.height = window.innerHeight - 200 ;
  129. },
  130. activated() {
  131. if (this.$route.query.check === "refresh") {
  132. this.onLoad(this.page, this.search);
  133. }
  134. },
  135. methods: {
  136. batchCheck() {
  137. for (let i = 0; i < this.selectionList.length; i++) {
  138. if (this.selectionList[i].auditStatus != "S") {
  139. return this.$message.error("审核状态必须都为待审核状态!");
  140. } else {
  141. this.idList.push(this.selectionList[i].id);
  142. }
  143. }
  144. //打开cheack
  145. this.checkDialog = true;
  146. },
  147. operationType() {
  148. this.checkDialog = false;
  149. this.refreshChange();
  150. this.idList = [];
  151. },
  152. //跳转页面
  153. jumpPage(row) {
  154. if (row.url) {
  155. if (eval("(" + row.pageStatus + ")")) {
  156. this.$alert(
  157. "" +
  158. row.pageLabel +
  159. "页面已存在,请关闭" +
  160. row.pageLabel +
  161. "页面再进行操作",
  162. "温馨提示",
  163. {
  164. confirmButtonText: "确定",
  165. type: "warning",
  166. callback: action => { }
  167. }
  168. );
  169. } else {
  170. this.$router.$avueRouter.closeTag(row.url);
  171. this.$router.push({
  172. path: row.url,
  173. query: { check: row }
  174. });
  175. }
  176. }
  177. },
  178. //审批通过
  179. pass(row, operate) {
  180. row.operate = operate;
  181. this.loading = true;
  182. approvePass(row)
  183. .then(res => {
  184. this.$message.success("操作成功!");
  185. this.refreshChange();
  186. })
  187. .finally(() => {
  188. this.loading = false;
  189. });
  190. },
  191. openCheck(row) {
  192. this.batch = false; //单条操作
  193. this.checkDialog = true;
  194. this.checkData = row;
  195. },
  196. choceCheckFun() {
  197. this.checkDialog = false;
  198. this.refreshChange();
  199. },
  200. openCheckSchedule(row) {
  201. this.checkId = row.srcBillId;
  202. this.batchNo = row.batchNo;
  203. this.checkScheduleDialog = true;
  204. },
  205. //关闭审批流程页面
  206. choceScheduleFun() {
  207. this.checkScheduleDialog = false;
  208. },
  209. //新单打开
  210. addReceipt(row) { },
  211. //编辑打开
  212. editOpen(row, status) {
  213. this.detailData = {
  214. id: row.id,
  215. status: status
  216. };
  217. this.show = false;
  218. },
  219. //点击搜索按钮触发
  220. searchChange(params, done) {
  221. this.query = params;
  222. this.page.currentPage = 1;
  223. this.onLoad(this.page, params);
  224. done();
  225. },
  226. searchReset() {
  227. console.log("1");
  228. },
  229. selectionChange(list) {
  230. this.idList = []
  231. this.selectionList = list;
  232. },
  233. currentChange(val) {
  234. this.page.currentPage = val;
  235. },
  236. sizeChange() {
  237. console.log("1");
  238. },
  239. refreshChange(params) {
  240. this.onLoad(this.page, params);
  241. },
  242. paramsAdjustment(params) {
  243. params = Object.assign({}, this.search);
  244. if (!params.auditStatus && params.auditStatus !== "") {
  245. params.auditStatus = "S";
  246. }
  247. return params;
  248. },
  249. onLoad(page, params) {
  250. this.loading = true;
  251. params = this.paramsAdjustment(params);
  252. if (params.sendTime) {
  253. params.applybegintime = params.sendTime[0]
  254. params.applyendtime = params.sendTime[1]
  255. delete params.sendTime
  256. }
  257. getList(page.currentPage, page.pageSize, params).then(res => {
  258. this.dataList = res.data.data.records;
  259. this.page.total = res.data.data.total;
  260. }).finally(() => {
  261. this.loading = false;
  262. });
  263. },
  264. cellStyle() {
  265. return "padding:0;height:40px;";
  266. }
  267. }
  268. };
  269. </script>
  270. <style scoped>
  271. </style>