HwPaymentList.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div class="page-header-index-wide">
  3. <a-card :bordered="false">
  4. <!-- 查询区域 -->
  5. <div class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="searchQuery">
  7. <a-row :gutter="24">
  8. <a-col :md="6" :sm="8">
  9. <a-form-item label="付款单号">
  10. <a-input placeholder="请输入付款单号" v-model="queryParam.paymentCode"></a-input>
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="8">
  14. <a-form-item label="付款企业">
  15. <a-input placeholder="请输入付款企业" v-model="queryParam.companyName"></a-input>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="8">
  19. <a-form-item label="状态">
  20. <j-dict-select-tag :triggerChange="false" v-model="queryParam.status" placeholder="请选择状态查询"
  21. dictCode="payment_status" v-decorator="['status', {}]"/>
  22. </a-form-item>
  23. </a-col>
  24. <!-- <template v-if="toggleSearchStatus">-->
  25. <!-- </template>-->
  26. <a-col :md="6" :sm="8">
  27. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  28. <!-- <a @click="handleToggleSearch">-->
  29. <!-- {{ toggleSearchStatus ? '取消' : '展开' }}-->
  30. <!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
  31. <!-- </a>-->
  32. <a-button ghost type='primary' @click="searchQuery" icon="search">查询</a-button>
  33. <a-button ghost type='primary' @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  34. </span>
  35. </a-col>
  36. </a-row>
  37. </a-form>
  38. </div>
  39. <!-- 查询区域-END -->
  40. <!-- 操作按钮区域 -->
  41. <div class="table-operator">
  42. <a class="ant-btn ant-btn-primary" @click="handleImportExcel1()" icon="import" type="primary"
  43. v-has="'payment:import'">导入付款信息</a>
  44. </div>
  45. <!-- table区域-begin -->
  46. <div>
  47. <a-table
  48. ref="table"
  49. size="middle"
  50. bordered
  51. rowKey="id"
  52. :columns="columns"
  53. :dataSource="dataSource"
  54. :pagination="ipagination"
  55. :loading="deloading"
  56. :scroll="{ x: 1730}"
  57. class="j-table-force-nowrap"
  58. @change="handleTableChange">
  59. <span slot="paymentCode" slot-scope="text, record">
  60. <a @click="handleEdit(record)">{{record.paymentCode}}</a>
  61. </span>
  62. <span slot="status" slot-scope="text,record">
  63. <template v-if="record.isAllSuccess === 0">
  64. <span style="color: #D9001B">{{text}}</span>
  65. </template>
  66. <template v-else>
  67. {{text}}
  68. </template>
  69. </span>
  70. <span slot="action" slot-scope="text, record">
  71. <template v-if="record.status === 0">
  72. <a style="color: #D9001B" @click="handleDelete(record.id)" v-has="'payment:del'">删除</a>
  73. </template>
  74. <template v-else>
  75. --
  76. </template>
  77. </span>
  78. </a-table>
  79. </div>
  80. <hwPayment-modal ref="modalForm"></hwPayment-modal>
  81. <hw-payment-export-modal ref="modalSelectRequireForm" @ok="modalFormOk"></hw-payment-export-modal>
  82. </a-card>
  83. </div>
  84. </template>
  85. <script>
  86. import '@/assets/less/TableExpand.less'
  87. import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  88. import HwPaymentModal from './modules/HwPaymentModal'
  89. import { filterObj } from '@/utils/util'
  90. import { getAction, deleteAction, putAction, postAction } from '@/api/manage'
  91. import HwPaymentExportModal from './modules/HwPaymentExportModal'
  92. import qs from 'qs';
  93. const deletePayment = (params) => deleteAction('/hwpayment/hwPayment/delete', params)
  94. export default {
  95. name: 'HwPaymentList',
  96. mixins: [JeecgListMixin],
  97. components: {
  98. HwPaymentModal,
  99. HwPaymentExportModal,
  100. },
  101. data() {
  102. return {
  103. description: 'hw_payment管理页面',
  104. // 查询条件
  105. queryParam: {
  106. createTimeRange: []
  107. },
  108. // 表头
  109. columns: [
  110. {
  111. title: '付款单号',
  112. align: 'left',
  113. dataIndex: 'paymentCode',
  114. scopedSlots: { customRender: 'paymentCode' }
  115. },
  116. {
  117. title: '服务商',
  118. align: 'left',
  119. dataIndex: 'subcontractorName',
  120. customRender: (value,record) => {
  121. return value ? value:'--'
  122. }
  123. },
  124. {
  125. title: '付款总额',
  126. align: 'left',
  127. dataIndex: 'totalPayment'
  128. },
  129. {
  130. title: '付款金额',
  131. align: 'left',
  132. dataIndex: 'payment'
  133. },
  134. {
  135. title:'服务费',
  136. align:"left",
  137. dataIndex: 'serviceFee'
  138. },
  139. {
  140. title:'服务费率',
  141. align:"left",
  142. dataIndex: 'serviceRate',
  143. customRender: (value,record) => {
  144. return value ? value + '%':'--'
  145. }
  146. },
  147. {
  148. title: '业务处理情况',
  149. align: 'left',
  150. dataIndex: 'remark'
  151. },
  152. // (0:待复核 1:付款中 2:复核未通过 3:已付款)
  153. {
  154. title: '状态',
  155. align: 'left',
  156. dataIndex: 'status_dictText',
  157. // scopedSlots: { customRender: 'status' }
  158. },
  159. {
  160. title: '导入时间',
  161. align: 'left',
  162. dataIndex: 'createTime'
  163. },
  164. {
  165. title: '付款企业',
  166. align: 'left',
  167. dataIndex: 'companyName'
  168. },
  169. // {
  170. // title: '导入人',
  171. // align: 'left',
  172. // dataIndex: 'createBy'
  173. // },
  174. {
  175. title: '操作',
  176. dataIndex: 'action',
  177. align: 'left',
  178. fixed: 'right',
  179. width: 160,
  180. scopedSlots: { customRender: 'action' }
  181. }
  182. ],
  183. url: {
  184. list: '/hwpayment/hwPayment/list',
  185. delete: '/hwpayment/hwPayment/delete',
  186. deleteBatch: '/hwpayment/hwPayment/deleteBatch',
  187. exportXlsUrl: '/hwpayment/hwPayment/exportXls',
  188. importExcelUrl: 'hwpayment/hwPayment/importExcel'
  189. },
  190. dictOptions: {},
  191. //自定义加载层
  192. deloading:{
  193. spinning:false,
  194. tip:''
  195. },
  196. allowClear:false,
  197. }
  198. },
  199. computed: {
  200. importExcelUrl: function() {
  201. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
  202. }
  203. },
  204. methods: {
  205. getQueryParams() {
  206. console.log(this.queryParam)
  207. var param = Object.assign({}, this.queryParam, this.isorter)
  208. param.field = this.getQueryField()
  209. param.pageNo = this.ipagination.current
  210. param.pageSize = this.ipagination.pageSize
  211. delete param.createTimeRange // 时间参数不传递后台
  212. return filterObj(param)
  213. },
  214. initDictConfig() {
  215. },
  216. onDateChange: function(value, dateString) {
  217. console.log(dateString[0], dateString[1])
  218. this.queryParam.createTime_begin = dateString[0] + ' 00:00:00'
  219. this.queryParam.createTime_end = dateString[1] + ' 23:59:59'
  220. },
  221. onDateOk(value) {
  222. console.log(value)
  223. },
  224. loadData(arg) {
  225. if(!this.url.list){
  226. this.$message.error("请设置url.list属性!")
  227. return
  228. }
  229. //加载数据 若传入参数1则加载第一页的内容
  230. if (arg === 1) {
  231. this.ipagination.current = 1;
  232. }
  233. var params = this.getQueryParams();//查询条件
  234. this.deloading.spinning = true
  235. this.deloading.tip = '';
  236. getAction(this.url.list, params).then((res) => {
  237. if (res.success) {
  238. this.dataSource = res.result.records;
  239. this.ipagination.total = res.result.total;
  240. }
  241. if(res.code===510){
  242. this.$message.warning(res.message)
  243. }
  244. this.deloading.spinning = false
  245. })
  246. },
  247. handleDelete(id) {
  248. let that = this
  249. const modal = that.$confirm({
  250. title: '删除付款',
  251. closable: true,
  252. keyboard: false,
  253. maskClosable: true,
  254. content: '确定要删除该付款吗?',
  255. okText: '确定删除',
  256. cancelText: '取消',
  257. onOk: function() {
  258. deletePayment({ id: id }).then((res) => {
  259. if (res.success) {
  260. that.$message.success(res.message)
  261. that.loadData(1)
  262. } else {
  263. that.$error({
  264. title: '删除失败',
  265. content: res.message,
  266. okText: '确定'
  267. })
  268. }
  269. })
  270. },
  271. onCancel(e) {
  272. modal.destroy()
  273. }
  274. })
  275. },
  276. handleEdit(record) {
  277. this.$refs.modalForm.edit(record)
  278. this.$refs.modalForm.title = '付款详情'
  279. this.$refs.modalForm.disableSubmit = false
  280. },
  281. handleImportExcel1() {
  282. this.$refs.modalSelectRequireForm.edit()
  283. this.$refs.modalSelectRequireForm.title = '导入付款信息'
  284. this.$refs.modalSelectRequireForm.disableSubmit = false
  285. },
  286. modalFormOk(){
  287. this.loadData(1);
  288. this.onClearSelected();
  289. },
  290. handleLink(id){
  291. },
  292. handleReview(id){
  293. }
  294. }
  295. }
  296. </script>
  297. <style scoped>
  298. @import '~@assets/less/common.less';
  299. ::v-deep .ant-table-pagination{
  300. float: none;
  301. display: flex;
  302. align-items: center;
  303. justify-content: center;
  304. }
  305. </style>