paymentSettle.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. <template>
  2. <basic-container v-if="show">
  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. @saveColumn="saveColumn"
  17. @resetColumn="resetColumn"
  18. @on-load="onLoad">
  19. <template slot="corpIdSearch">
  20. <select-component
  21. v-model="search.corpId"
  22. :configuration="configuration"
  23. ></select-component>
  24. </template>
  25. <template slot="menuLeft">
  26. <el-button type="primary"
  27. size="small"
  28. icon="el-icon-plus"
  29. @click="addReceipt">创建单据
  30. </el-button>
  31. <el-button size="small"
  32. type="info"
  33. @click.stop="openReport()"
  34. >报表
  35. </el-button>
  36. </template>
  37. <template slot-scope="scope" slot="menu">
  38. <el-button
  39. type="text"
  40. size="small"
  41. icon="el-icon-edit"
  42. @click.stop="editOpen(scope.row, 2)"
  43. >编辑
  44. </el-button>
  45. <el-button
  46. type="text"
  47. size="small"
  48. icon="el-icon-delete"
  49. @click.stop="rowDel(scope.row, scope.index)"
  50. >删除
  51. </el-button>
  52. </template>
  53. </avue-crud>
  54. </basic-container>
  55. <detail-page
  56. ref="detail"
  57. @goBack="goBack"
  58. :detailData="detailData"
  59. v-else
  60. ></detail-page>
  61. </template>
  62. <script>
  63. import option from "./configuration/mainList.json";
  64. import {getList ,remove} from "@/api/financialManagement/financialManagement"
  65. import detailPage from "./paymentSettleDetailsPage";
  66. export default {
  67. data() {
  68. return {
  69. loading : false,
  70. form: {},
  71. search:{},
  72. show:true,
  73. detailData:{},
  74. option: {},
  75. parentId:0,
  76. dataList: [],
  77. page: {
  78. pageSize: 10,
  79. pagerCount: 5,
  80. total: 0,
  81. },
  82. query:{},
  83. configuration:{
  84. multipleChoices:false,
  85. multiple:false,
  86. disabled:false,
  87. searchShow:true,
  88. collapseTags:false,
  89. clearable:true,
  90. placeholder:'请点击右边按钮选择',
  91. dicData:[]
  92. },
  93. }
  94. },
  95. activated() {
  96. if(!this.show && !this.$store.getters.paySettle){
  97. this.show = true;
  98. }
  99. setTimeout(() => {
  100. if(this.$route.query.params && this.show){
  101. this.detailData={
  102. id:this.$route.query.params
  103. }
  104. this.show = false;
  105. this.$store.commit("PAY_IN_DETAIL");
  106. }
  107. }, 100);
  108. },
  109. components:{
  110. detailPage
  111. },
  112. async created() {
  113. this.option = await this.getColumnData(this.getColumnName(63), option);
  114. },
  115. mounted() {
  116. // this.option.height = window.innerHeight - 200;
  117. },
  118. methods: {
  119. //新单打开
  120. addReceipt(row){
  121. this.detailData = {
  122. id: row.id,
  123. status: 1
  124. };
  125. this.show = false;
  126. this.$store.commit("PAY_IN_DETAIL");
  127. },
  128. //编辑打开
  129. editOpen(row, status){
  130. const data = {
  131. moduleName: 'ff',
  132. tableName: 'finance_settlement',
  133. billId: row.id,
  134. no: localStorage.getItem('browserID')
  135. }
  136. this.inDetailsKey(this.$route.name, {
  137. moduleName: 'ff',
  138. tableName: 'finance_settlement',
  139. billId: row.id,
  140. })
  141. this.checkLock(data).then(res => {
  142. if (res.data.code == 200) {
  143. this.detailData = {
  144. disabled: true,
  145. id: row.id,
  146. status: status
  147. };
  148. this.show = false;
  149. this.$store.commit("PAY_IN_DETAIL");
  150. }
  151. }).catch(error => {
  152. this.detailData = {
  153. disabled: true,
  154. id: row.id,
  155. status: status
  156. };
  157. this.show = false;
  158. this.$store.commit("PAY_IN_DETAIL");
  159. })
  160. },
  161. rowDel(row, index, done) {
  162. if(row.id){
  163. this.$confirm("确定将选择数据删除?", {
  164. confirmButtonText: "确定",
  165. cancelButtonText: "取消",
  166. type: "warning"
  167. }).then(() => {
  168. remove(row.id).then(res =>{
  169. if(res.data.success){
  170. this.$message.success("操作成功!");
  171. this.onLoad(this.page);
  172. }
  173. })
  174. });
  175. }
  176. },
  177. //点击搜索按钮触发
  178. searchChange(params, done) {
  179. this.query = params;
  180. this.page.currentPage = 1;
  181. this.onLoad(this.page, params);
  182. done()
  183. },
  184. searchReset() {
  185. console.log('1')
  186. },
  187. selectionChange() {
  188. console.log('1')
  189. },
  190. currentChange(val) {
  191. this.page.currentPage = val
  192. },
  193. sizeChange() {
  194. console.log('1')
  195. },
  196. refreshChange(params) {
  197. this.onLoad(this.page,params)
  198. },
  199. paramsAdjustment(params) {
  200. params = Object.assign({}, this.search);
  201. if (params.settlementDate && params.settlementDate.length !==0 ) { //合同
  202. params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
  203. params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
  204. this.$delete(params,'settlementDate')
  205. }
  206. return params
  207. },
  208. onLoad(page, params) {
  209. this.loading = true
  210. params = this.paramsAdjustment(params)
  211. params.billType = "付费"
  212. params.settlementType = 1
  213. getList(page.currentPage, page.pageSize,params).then(res =>{
  214. this.dataList = res.data.data.records
  215. this.page.total = res.data.data.total
  216. }).finally(()=>{
  217. this.loading = false
  218. })
  219. },
  220. goBack() {
  221. this.detailData=this.$options.data().detailData
  222. this.show = true;
  223. this.onLoad(this.page,this.search)
  224. },
  225. //列保存触发
  226. async saveColumn() {
  227. const inSave = await this.saveColumnData(
  228. this.getColumnName(63),
  229. this.option
  230. );
  231. if (inSave) {
  232. this.$message.success("保存成功");
  233. //关闭窗口
  234. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  235. }
  236. },
  237. async resetColumn() {
  238. const inSave = await this.delColumnData(
  239. this.getColumnName(63),
  240. option
  241. );
  242. if (inSave) {
  243. this.$message.success("重置成功");
  244. this.option = option;
  245. //关闭窗口
  246. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  247. }
  248. },
  249. }
  250. }
  251. </script>
  252. <style scoped>
  253. </style>