paymentSettle.vue 6.9 KB

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