index.vue 8.6 KB

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