index.vue 8.4 KB

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