index.vue 7.5 KB

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