detail.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <div class="companyCollectionPaymentDetail-wrap jg-page-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. <span style="margin-right: 30px;color: #000;font-size: 14px;font-weight: 600;">客户:{{ $route.params.name!='undefined'?$route.params.name: '--' }}</span>
  8. <a-button id="companyCollectionPaymentDetail-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
  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 id="companyReceivablePayableDetail-auditTime" 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. </span>
  31. </a-col>
  32. </a-row>
  33. </a-form>
  34. </div>
  35. <!-- alert -->
  36. <div class="table-operator">
  37. <div class="alert-message">
  38. 共 <strong>{{ total }}</strong> 条明细,
  39. 金额合计 <strong>{{ (productTotal&&(productTotal.totalAmount || productTotal.totalAmount==0)) ? toThousands(productTotal.totalAmount) : '--' }}</strong> ,
  40. 余额合计 <strong>{{ (productTotal&&(productTotal.unsettleAmount || productTotal.unsettleAmount==0)) ? toThousands(productTotal.unsettleAmount) : '--' }}</strong>
  41. </div>
  42. </div>
  43. <!-- 列表 -->
  44. <s-table
  45. class="sTable"
  46. ref="table"
  47. size="small"
  48. :rowKey="(record) => record.id"
  49. :columns="columns"
  50. :data="loadData"
  51. :defaultLoadData="false"
  52. bordered>
  53. <!-- 采购数量 -->
  54. <template slot="purchaseNum" slot-scope="text, record">
  55. <span>{{ record.purchaseNum }}</span>
  56. </template>
  57. <!-- 缺货数量 -->
  58. <template slot="outOfStockNum" slot-scope="text, record">
  59. <span>{{ record.outOfStockNum }}</span>
  60. </template>
  61. </s-table>
  62. </a-card>
  63. </a-spin>
  64. </div>
  65. </template>
  66. <script>
  67. import { commonMixin } from '@/utils/mixin'
  68. import { STable, VSelect } from '@/components'
  69. import rangeDate from '@/views/common/rangeDate.vue'
  70. import { settleInfoList, settleInfoQueryReceiptOrPaySum } from '@/api/settle'
  71. export default {
  72. name: 'CompanyReceivablePayableDetail',
  73. components: { STable, VSelect, rangeDate },
  74. mixins: [commonMixin],
  75. data () {
  76. const _this = this
  77. return {
  78. spinning: false,
  79. disabled: false, // 查询、重置按钮是否可操作
  80. // 查询参数
  81. queryParam: {
  82. auditBeginDate: '', // 开始审核时间
  83. auditEndDate: '', // 结束审核时间
  84. bizNo: '' // 单据号
  85. },
  86. exportLoading: false, // 导出loading
  87. // 表头
  88. columns: [
  89. { title: '序号', dataIndex: 'no', width: '6%', align: 'center' },
  90. { title: '单据号', dataIndex: 'bizNo', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
  91. { title: '类型', dataIndex: 'bizTypeDictValue', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
  92. { title: '审核时间', dataIndex: 'auditTime', width: '14%', align: 'center', customRender: function (text) { return text || '--' } },
  93. { title: '总款数', dataIndex: 'bizTotalCategory', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  94. { title: '总数量', dataIndex: 'bizTotalQty', width: '12%', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  95. { title: '金额', dataIndex: 'totalAmount', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  96. { title: '余额', dataIndex: 'unsettleAmount', width: '14%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } }
  97. ],
  98. // 加载数据方法 必须为 Promise 对象
  99. loadData: parameter => {
  100. this.disabled = true
  101. this.spinning = true
  102. const params = Object.assign(parameter, this.queryParam, { settleClientSn: this.$route.params.sn, settleClientType: this.$route.params.type })
  103. return settleInfoList(params).then(res => {
  104. let data
  105. if (res.status == 200) {
  106. data = res.data
  107. this.getTotal(params)
  108. const no = (data.pageNo - 1) * data.pageSize
  109. for (var i = 0; i < data.list.length; i++) {
  110. data.list[i].no = no + i + 1
  111. }
  112. this.disabled = false
  113. this.total = data.count || 0
  114. }
  115. this.spinning = false
  116. return data
  117. })
  118. },
  119. basicInfoData: null, // 基本信息
  120. total: 0, // 总条数
  121. productTotal: null // 合计
  122. }
  123. },
  124. methods: {
  125. // 审核时间 change
  126. dateChange (date) {
  127. this.queryParam.auditBeginDate = date[0]
  128. this.queryParam.auditEndDate = date[1]
  129. },
  130. // 返回列表
  131. handleBack () {
  132. this.$router.push({ name: 'companyReceivablePayableNewList' })
  133. },
  134. // 合计
  135. getTotal (param) {
  136. settleInfoQueryReceiptOrPaySum(param).then(res => {
  137. if (res.status == 200 && res.data) {
  138. this.productTotal = res.data
  139. } else {
  140. this.productTotal = null
  141. }
  142. })
  143. },
  144. // 重置
  145. resetSearchForm () {
  146. this.$refs.rangeDate.resetDate()
  147. this.queryParam.auditBeginDate = ''
  148. this.queryParam.auditEndDate = ''
  149. this.queryParam.bizNo = ''
  150. this.$refs.table.refresh(true)
  151. }
  152. },
  153. mounted () {
  154. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  155. this.resetSearchForm()
  156. }
  157. },
  158. activated () {
  159. // 如果是新页签打开或者进入新的子页(例:存在列表第2条数据编辑页页签时再打开第4条数据的编辑页),则重置当前页面
  160. if (this.$store.state.app.isNewTab || !this.$store.state.app.isNewSubTab) {
  161. this.resetSearchForm()
  162. }
  163. },
  164. beforeRouteEnter (to, from, next) {
  165. next(vm => {})
  166. }
  167. }
  168. </script>
  169. <style lang="less">
  170. .companyCollectionPaymentDetail-cont{
  171. margin-bottom: 6px;
  172. }
  173. </style>