receiptSettle.vue 6.3 KB

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