index.vue 7.8 KB

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