detail.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <template>
  2. <div class="companyCollectionPaymentDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <a id="companyCollectionPaymentDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  8. <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
  9. </template>
  10. </a-page-header>
  11. <a-card>
  12. <!-- 搜索条件 -->
  13. <div class="table-page-search-wrapper">
  14. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  15. <a-row :gutter="15">
  16. <a-col :md="6" :sm="24">
  17. <a-form-item label="单据号">
  18. <a-input id="companyReceivablePayableDetail-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单据号"/>
  19. </a-form-item>
  20. </a-col>
  21. <a-col :md="6" :sm="24">
  22. <a-form-item label="审核时间">
  23. <rangeDate ref="rangeDate" @change="dateChange" />
  24. </a-form-item>
  25. </a-col>
  26. <a-col :md="6" :sm="24">
  27. <span class="table-page-search-submitButtons">
  28. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="companyReceivablePayableDetail-refresh">查询</a-button>
  29. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="companyReceivablePayableDetail-reset">重置</a-button>
  30. <!-- <a-button
  31. type="danger"
  32. style="margin-left: 8px"
  33. @click="handleExport"
  34. :disabled="disabled"
  35. :loading="exportLoading"
  36. id="companyReceivablePayableDetail-export-btn">导出</a-button> -->
  37. </span>
  38. </a-col>
  39. </a-row>
  40. </a-form>
  41. </div>
  42. <!-- alert -->
  43. <a-alert type="info" style="margin-bottom:10px">
  44. <div slot="message">
  45. 共 <strong>{{ total }}</strong> 条明细,
  46. 金额合计 <strong>{{ (productTotal&&(productTotal.totalAmount || productTotal.totalAmount==0)) ? '¥'+productTotal.totalAmount : '--' }}</strong> ,
  47. 余额合计 <strong>{{ (productTotal&&(productTotal.unsettleAmount || productTotal.unsettleAmount==0)) ? '¥'+productTotal.unsettleAmount : '--' }}</strong>
  48. </div>
  49. </a-alert>
  50. <!-- 列表 -->
  51. <s-table
  52. class="sTable"
  53. ref="table"
  54. size="small"
  55. :rowKey="(record) => record.id"
  56. :columns="columns"
  57. :data="loadData"
  58. :defaultLoadData="false"
  59. bordered>
  60. <!-- 采购数量 -->
  61. <template slot="purchaseNum" slot-scope="text, record">
  62. <span>{{ record.purchaseNum }}</span>
  63. </template>
  64. <!-- 缺货数量 -->
  65. <template slot="outOfStockNum" slot-scope="text, record">
  66. <span>{{ record.outOfStockNum }}</span>
  67. </template>
  68. </s-table>
  69. </a-card>
  70. </a-spin>
  71. </div>
  72. </template>
  73. <script>
  74. import { commonMixin } from '@/utils/mixin'
  75. // import { downloadExcel } from '@/libs/JGPrint.js'
  76. import { STable, VSelect } from '@/components'
  77. import rangeDate from '@/views/common/rangeDate.vue'
  78. import { settleInfoList, settleInfoQueryReceiptOrPaySum } from '@/api/settle'
  79. export default {
  80. name: 'CompanyReceivablePayableDetail',
  81. components: { STable, VSelect, rangeDate },
  82. mixins: [commonMixin],
  83. data () {
  84. return {
  85. spinning: false,
  86. disabled: false, // 查询、重置按钮是否可操作
  87. // 查询参数
  88. queryParam: {
  89. auditBeginDate: '',
  90. auditEndDate: '',
  91. bizNo: ''
  92. },
  93. exportLoading: false, // 导出loading
  94. // 表头
  95. columns: [
  96. { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
  97. { title: '单据号', dataIndex: 'bizNo', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
  98. { title: '类型', dataIndex: 'bizTypeDictValue', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
  99. { title: '审核时间', dataIndex: 'auditTime', width: '20%', align: 'center', customRender: function (text) { return text || '--' } },
  100. { title: '金额', dataIndex: 'totalAmount', width: '17%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  101. { title: '余额', dataIndex: 'unsettleAmount', width: '17%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  102. ],
  103. // 加载数据方法 必须为 Promise 对象
  104. loadData: parameter => {
  105. this.disabled = true
  106. this.spinning = true
  107. const params = Object.assign(parameter, this.queryParam, { settleClientSn: this.$route.params.sn })
  108. return settleInfoList(params).then(res => {
  109. let data
  110. if (res.status == 200) {
  111. data = res.data
  112. this.getTotal(params)
  113. const no = (data.pageNo - 1) * data.pageSize
  114. for (var i = 0; i < data.list.length; i++) {
  115. data.list[i].no = no + i + 1
  116. }
  117. this.disabled = false
  118. this.total = data.count || 0
  119. }
  120. this.spinning = false
  121. return data
  122. })
  123. },
  124. basicInfoData: null, // 基本信息
  125. total: 0, // 总条数
  126. productTotal: null // 合计
  127. }
  128. },
  129. methods: {
  130. // 时间 change
  131. dateChange (date) {
  132. this.queryParam.auditBeginDate = date[0]
  133. this.queryParam.auditEndDate = date[1]
  134. },
  135. // 返回列表
  136. handleBack () {
  137. this.$router.push({ path: '/financialManagement/companyReceivablePayable/list' })
  138. },
  139. // 合计
  140. getTotal (param) {
  141. settleInfoQueryReceiptOrPaySum(param).then(res => {
  142. if (res.status == 200 && res.data) {
  143. this.productTotal = res.data
  144. } else {
  145. this.productTotal = null
  146. }
  147. })
  148. },
  149. // 重置
  150. resetSearchForm () {
  151. this.$refs.rangeDate.resetDate()
  152. this.queryParam.auditBeginDate = ''
  153. this.queryParam.auditEndDate = ''
  154. this.queryParam.bizNo = ''
  155. this.$refs.table.refresh(true)
  156. },
  157. // 导出
  158. handleExport () {
  159. const params = this.queryParam
  160. this.exportLoading = true
  161. // customerBundleExportDelay(params).then(res => {
  162. // this.exportLoading = false
  163. // downloadExcel(res, '单位应收应付')
  164. // })
  165. }
  166. },
  167. mounted () {
  168. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  169. this.$refs.table.refresh(true)
  170. this.resetSearchForm()
  171. }
  172. },
  173. activated () {
  174. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  175. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  176. this.$refs.table.refresh(true)
  177. this.resetSearchForm()
  178. }
  179. },
  180. beforeRouteEnter (to, from, next) {
  181. next(vm => {})
  182. }
  183. }
  184. </script>
  185. <style lang="less">
  186. .companyCollectionPaymentDetail-cont{
  187. margin-bottom: 10px;
  188. }
  189. </style>