list.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <template>
  2. <a-card size="small" :bordered="false" class="companyCollectionPaymentList-wrap">
  3. <!-- 搜索条件 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  6. <a-row :gutter="15">
  7. <a-col :md="6" :sm="24">
  8. <a-form-item label="单位名称">
  9. <a-input id="companyCollectionPaymentList-settleClientName" v-model.trim="queryParam.settleClientName" allowClear placeholder="请输入单位名称"/>
  10. </a-form-item>
  11. </a-col>
  12. <a-col :md="6" :sm="24">
  13. <a-form-item label="单位类型">
  14. <v-select
  15. v-model="queryParam.settleClientType"
  16. ref="settleClientType"
  17. id="companyCollectionPaymentList-settleClientType"
  18. code="SETTLE_CLIENT_TYPE"
  19. placeholder="请选择单位类型"
  20. allowClear></v-select>
  21. </a-form-item>
  22. </a-col>
  23. <a-col :md="6" :sm="24">
  24. <a-form-item label="结算类型">
  25. <v-select
  26. v-model="queryParam.settleType"
  27. ref="settleType"
  28. id="companyCollectionPaymentList-settleType"
  29. code="SETTLE_TYPE"
  30. placeholder="请选择结算类型"
  31. allowClear></v-select>
  32. </a-form-item>
  33. </a-col>
  34. <template v-if="advanced">
  35. <a-col :md="6" :sm="24">
  36. <a-form-item label="结算单号">
  37. <a-input id="companyCollectionPaymentList-unitSettleNo" v-model.trim="queryParam.unitSettleNo" allowClear placeholder="请输入结算单号"/>
  38. </a-form-item>
  39. </a-col>
  40. <a-col :md="6" :sm="24">
  41. <a-form-item label="结算时间">
  42. <rangeDate ref="rangeDate" @change="dateChange" />
  43. </a-form-item>
  44. </a-col>
  45. <a-col :md="6" :sm="24">
  46. <a-form-item label="结算方式">
  47. <a-select id="companyCollectionPaymentList-settleStyleSn" v-model="queryParam.settleStyleSn" placeholder="请选择结算方式" allowClear>
  48. <a-select-option v-for="item in settleStyleList" :value="item.settleStyleSn" :key="item.settleStyleSn">{{ item.name }}</a-select-option>
  49. </a-select>
  50. </a-form-item>
  51. </a-col>
  52. </template>
  53. <a-col :md="6" :sm="24">
  54. <span class="table-page-search-submitButtons">
  55. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="companyCollectionPaymentList-refresh">查询</a-button>
  56. <a-button style="margin-left: 8px" @click="resetSearchForm()" :disabled="disabled" id="companyCollectionPaymentList-reset">重置</a-button>
  57. <a @click="advanced=!advanced" style="margin-left: 8px">
  58. {{ advanced ? '收起' : '展开' }}
  59. <a-icon :type="advanced ? 'up' : 'down'"/>
  60. </a>
  61. </span>
  62. </a-col>
  63. </a-row>
  64. </a-form>
  65. </div>
  66. <!-- alert -->
  67. <a-alert type="info" showIcon style="margin-bottom:10px">
  68. <div slot="message">
  69. 共 <strong>{{ total }}</strong> 条记录,
  70. 其中收款单 <strong>{{ (productTotal&&(productTotal.receiptCount || productTotal.receiptCount==0)) ? productTotal.receiptCount : '--' }}</strong> 条,
  71. 收款金额合计 <strong>{{ (productTotal&&(productTotal.receiptAmount || productTotal.receiptAmount==0)) ? '¥'+productTotal.receiptAmount : '--' }}</strong> ,
  72. 付款单 <strong>{{ (productTotal&&(productTotal.payCount || productTotal.payCount==0)) ? productTotal.payCount : '--' }}</strong> 条,
  73. 付款金额合计 <strong>{{ (productTotal&&(productTotal.payAmount || productTotal.payAmount==0)) ? '¥'+productTotal.payAmount : '--' }}</strong>
  74. </div>
  75. </a-alert>
  76. <!-- 列表 -->
  77. <s-table
  78. class="sTable"
  79. ref="table"
  80. size="small"
  81. :rowKey="(record) => record.id"
  82. :columns="columns"
  83. :data="loadData"
  84. :scroll="{ x: 1340, y: tableHeight }"
  85. bordered>
  86. <!-- 结算单号 -->
  87. <template slot="unitSettleNo" slot-scope="text, record">
  88. <span :class="$hasPermissions('M_companyCollectionPayment_detail')?'active':'common'" @click="handleDetail(record)">{{ record.unitSettleNo }}</span>
  89. </template>
  90. </s-table>
  91. </a-card>
  92. </template>
  93. <script>
  94. import { STable, VSelect } from '@/components'
  95. import rangeDate from '@/views/common/rangeDate.vue'
  96. import { settleStyleQueryAll } from '@/api/settleStyle'
  97. import { settleUnitList, settleUnitQuerySum } from '@/api/settle'
  98. export default {
  99. components: { STable, VSelect, rangeDate },
  100. data () {
  101. return {
  102. advanced: false, // 高级搜索 展开/关闭
  103. disabled: false, // 查询、重置按钮是否可操作
  104. tableHeight: 0,
  105. // 查询参数
  106. queryParam: {
  107. beginDate: '',
  108. endDate: '',
  109. settleClientName: '',
  110. settleClientType: undefined,
  111. settleType: undefined,
  112. unitSettleNo: '',
  113. settleStyleSn: undefined
  114. },
  115. // 表头
  116. columns: [
  117. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  118. { title: '单位名称', dataIndex: 'settleClientName', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  119. { title: '单位类型', dataIndex: 'settleClientTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  120. { title: '结算类型', dataIndex: 'settleTypeDictValue', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  121. { title: '结算单号', scopedSlots: { customRender: 'unitSettleNo' }, width: 220, align: 'center' },
  122. { title: '结算金额', dataIndex: 'realSettleAmount', width: 100, align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  123. { title: '结算时间', dataIndex: 'createDate', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  124. { title: '操作人', dataIndex: 'operateName', width: 140, align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  125. { title: '结算方式', dataIndex: 'settleStyleName', width: 140, align: 'center', customRender: function (text) { return text || '--' } }
  126. ],
  127. // 加载数据方法 必须为 Promise 对象
  128. loadData: parameter => {
  129. this.disabled = true
  130. if (this.tableHeight == 0) {
  131. this.tableHeight = window.innerHeight - 420
  132. }
  133. return settleUnitList(Object.assign(parameter, this.queryParam)).then(res => {
  134. const data = res.data
  135. const no = (data.pageNo - 1) * data.pageSize
  136. for (var i = 0; i < data.list.length; i++) {
  137. data.list[i].no = no + i + 1
  138. }
  139. this.disabled = false
  140. this.total = data.count
  141. this.getTotal(Object.assign(parameter, this.queryParam))
  142. return data
  143. })
  144. },
  145. settleStyleList: [],
  146. total: 0, // 总条数
  147. productTotal: null
  148. }
  149. },
  150. methods: {
  151. // 时间 change
  152. dateChange (date) {
  153. this.queryParam.beginDate = date[0]
  154. this.queryParam.endDate = date[1]
  155. },
  156. // 详情
  157. handleDetail (row) {
  158. if (this.$hasPermissions('M_companyCollectionPayment_detail')) {
  159. this.$router.push({ path: `/financialManagement/companyCollectionPayment/detail/${row.id}/${row.unitSettleSn}` })
  160. }
  161. },
  162. // 合计
  163. getTotal (param) {
  164. settleUnitQuerySum(param).then(res => {
  165. if (res.status == 200 && res.data) {
  166. this.productTotal = res.data
  167. } else {
  168. this.productTotal = null
  169. }
  170. })
  171. },
  172. // 重置
  173. resetSearchForm () {
  174. if (this.advanced) {
  175. this.$refs.rangeDate.resetDate()
  176. }
  177. this.queryParam.beginDate = ''
  178. this.queryParam.endDate = ''
  179. this.queryParam.settleClientName = ''
  180. this.queryParam.settleClientType = undefined
  181. this.queryParam.settleType = undefined
  182. this.queryParam.unitSettleNo = ''
  183. this.queryParam.settleStyleSn = undefined
  184. this.$refs.table.refresh(true)
  185. },
  186. // 结算方式
  187. getSettleStyle () {
  188. settleStyleQueryAll({}).then(res => {
  189. if (res.status == 200) {
  190. this.settleStyleList = res.data
  191. } else {
  192. this.settleStyleList = []
  193. }
  194. })
  195. }
  196. },
  197. beforeRouteEnter (to, from, next) {
  198. next(vm => {
  199. vm.getSettleStyle()
  200. })
  201. }
  202. }
  203. </script>
  204. <style lang="less">
  205. .companyCollectionPaymentList-wrap{
  206. .sTable{
  207. margin-top: 15px;
  208. }
  209. .active{
  210. color: #ed1c24;
  211. cursor: pointer;
  212. }
  213. .common{
  214. color: rgba(0, 0, 0, 0.65);
  215. }
  216. }
  217. </style>