receiptSettle.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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.inDetailsKey(this.$route.name, {
  124. moduleName: 'sf',
  125. tableName: 'finance_settlement',
  126. billId: row.id,
  127. })
  128. this.checkLock(data).then(res => {
  129. if (res.data.code == 200) {
  130. this.detailData = {
  131. disabled: true,
  132. id: row.id,
  133. status: status
  134. };
  135. this.show = false;
  136. }
  137. }).catch(error => {
  138. this.detailData = {
  139. disabled: true,
  140. id: row.id,
  141. status: status
  142. };
  143. this.show = false;
  144. })
  145. },
  146. rowDel(row, index, done) {
  147. if(row.id){
  148. this.$confirm("确定将选择数据删除?", {
  149. confirmButtonText: "确定",
  150. cancelButtonText: "取消",
  151. type: "warning"
  152. }).then(() => {
  153. remove(row.id).then(res =>{
  154. if(res.data.success){
  155. this.$message.success("操作成功!");
  156. this.onLoad(this.page);
  157. }
  158. })
  159. });
  160. }
  161. },
  162. //点击搜索按钮触发
  163. searchChange(params, done) {
  164. this.query = params;
  165. this.page.currentPage = 1;
  166. this.onLoad(this.page, params);
  167. done()
  168. },
  169. searchReset() {
  170. console.log('1')
  171. },
  172. selectionChange() {
  173. console.log('1')
  174. },
  175. currentChange(val) {
  176. this.page.currentPage = val
  177. },
  178. sizeChange() {
  179. console.log('1')
  180. },
  181. refreshChange(params) {
  182. this.onLoad(this.page,params)
  183. },
  184. paramsAdjustment(params) {
  185. params = Object.assign({}, this.search);
  186. if (params.settlementDate && params.settlementDate.length !==0 ) { //合同
  187. params.settlementStartDate = params.settlementDate[0]+ " " + "00:00:00";
  188. params.settlementEndDate = params.settlementDate[1] + " " + "23:59:59";
  189. this.$delete(params,'settlementDate')
  190. }
  191. return params
  192. },
  193. onLoad(page, params) {
  194. this.loading = true
  195. params = this.paramsAdjustment(params)
  196. params.billType = "收费"
  197. params.settlementType = 1
  198. getList(page.currentPage, page.pageSize,params).then(res =>{
  199. this.dataList = res.data.data.records
  200. this.page.total = res.data.data.total
  201. }).finally(()=>{
  202. this.loading = false
  203. })
  204. },
  205. goBack() {
  206. this.detailData=this.$options.data().detailData
  207. this.show = true;
  208. this.onLoad(this.page,this.search)
  209. },
  210. //列保存触发
  211. async saveColumn() {
  212. const inSave = await this.saveColumnData(
  213. this.getColumnName(64),
  214. this.option
  215. );
  216. if (inSave) {
  217. this.$message.success("保存成功");
  218. //关闭窗口
  219. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  220. }
  221. },
  222. async resetColumn() {
  223. const inSave = await this.delColumnData(
  224. this.getColumnName(64),
  225. option
  226. );
  227. if (inSave) {
  228. this.$message.success("重置成功");
  229. this.option = option;
  230. //关闭窗口
  231. this.$refs.crud.$refs.dialogColumn.columnBox = false;
  232. }
  233. },
  234. }
  235. }
  236. </script>
  237. <style scoped>
  238. </style>