index.vue 8.4 KB

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