outputInvoice.vue 7.1 KB

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