index.vue 7.1 KB

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