detail.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <div class="companyCollectionPaymentDetail-wrap">
  3. <a-page-header :ghost="false" :backIcon="false" class="companyCollectionPaymentDetail-cont" >
  4. <!-- 自定义的二级文字标题 -->
  5. <template slot="subTitle">
  6. <a id="companyCollectionPaymentDetail-back-btn" href="javascript:;" @click="handleBack"><a-icon type="left" /> 返回列表</a>
  7. <p style=" display: inline-block;margin: 0 0 0 60px;color: #000;font-size: 16px;font-weight: 600;">客户:{{ $route.params.name || '--' }}</p>
  8. </template>
  9. <!-- 操作区,位于 title 行的行尾 -->
  10. <template slot="extra">
  11. <a-button key="2" id="companyCollectionPaymentDetail-preview-btn">打印预览</a-button>
  12. <a-button key="1" type="primary" id="companyCollectionPaymentDetail-print-btn">快速打印</a-button>
  13. </template>
  14. </a-page-header>
  15. <a-card>
  16. <!-- 搜索条件 -->
  17. <div class="table-page-search-wrapper">
  18. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  19. <a-row :gutter="15">
  20. <a-col :md="6" :sm="24">
  21. <a-form-item label="单据号">
  22. <a-input id="companyReceivablePayableDetail-bizNo" v-model.trim="queryParam.bizNo" allowClear placeholder="请输入单据号"/>
  23. </a-form-item>
  24. </a-col>
  25. <a-col :md="6" :sm="24">
  26. <a-form-item label="审核时间">
  27. <a-range-picker
  28. style="width:100%"
  29. id="companyCollectionPaymentDetail-auditTime"
  30. :disabledDate="disabledDate"
  31. v-model="auditTime"
  32. :format="dateFormat"
  33. :placeholder="['开始时间', '结束时间']" />
  34. </a-form-item>
  35. </a-col>
  36. <a-col :md="6" :sm="24">
  37. <span class="table-page-search-submitButtons">
  38. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="companyReceivablePayableDetail-refresh">查询</a-button>
  39. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="companyReceivablePayableDetail-reset">重置</a-button>
  40. <a-button
  41. type="danger"
  42. style="margin-left: 8px"
  43. @click="handleExport"
  44. :disabled="disabled"
  45. :loading="exportLoading"
  46. id="companyReceivablePayableDetail-export-btn">导出</a-button>
  47. </span>
  48. </a-col>
  49. </a-row>
  50. </a-form>
  51. </div>
  52. <!-- alert -->
  53. <a-alert type="info" showIcon style="margin-bottom:15px">
  54. <div slot="message">共 <strong>{{ total }}</strong> 条明细,金额合计 <strong>¥{{ (productTotal&&productTotal.totalAmount) || 0 }}</strong> ,余额合计 <strong>¥{{ (productTotal&&productTotal.unsettleAmount) || 0 }}</strong> </div>
  55. </a-alert>
  56. <!-- 列表 -->
  57. <s-table
  58. class="sTable"
  59. ref="table"
  60. size="default"
  61. :rowKey="(record) => record.id"
  62. :columns="columns"
  63. :data="loadData"
  64. bordered>
  65. <!-- 采购数量 -->
  66. <template slot="purchaseNum" slot-scope="text, record">
  67. <span>{{ record.purchaseNum }}</span>
  68. </template>
  69. <!-- 缺货数量 -->
  70. <template slot="outOfStockNum" slot-scope="text, record">
  71. <span>{{ record.outOfStockNum }}</span>
  72. </template>
  73. </s-table>
  74. </a-card>
  75. </div>
  76. </template>
  77. <script>
  78. import moment from 'moment'
  79. import { STable, VSelect } from '@/components'
  80. import { settleInfoList, settleInfoQueryReceiptOrPaySum } from '@/api/settle'
  81. export default {
  82. components: { STable, VSelect },
  83. data () {
  84. return {
  85. disabled: false, // 查询、重置按钮是否可操作
  86. // 查询参数
  87. queryParam: {
  88. bizNo: ''
  89. },
  90. auditTime: [], // 审核时间
  91. dateFormat: 'YYYY-MM-DD',
  92. exportLoading: false, // 导出loading
  93. // 表头
  94. columns: [
  95. { title: '序号', dataIndex: 'no', width: 80, align: 'center' },
  96. { title: '单据号', dataIndex: 'bizNo', width: 140, align: 'center', customRender: function (text) { return text || '--' } },
  97. { title: '类型', dataIndex: 'bizTypeDictValue', align: 'center', customRender: function (text) { return text || '--' } },
  98. { title: '审核时间', dataIndex: 'auditTime', width: 160, align: 'center', customRender: function (text) { return text || '--' } },
  99. { title: '金额', dataIndex: 'totalAmount', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } },
  100. { title: '余额', dataIndex: 'unsettleAmount', align: 'center', customRender: function (text) { return ((text || text == 0) ? text : '--') } }
  101. ],
  102. // 加载数据方法 必须为 Promise 对象
  103. loadData: parameter => {
  104. this.disabled = true
  105. // 审核时间
  106. if (this.auditTime && this.auditTime.length > 0) {
  107. this.queryParam.auditBeginDate = moment(this.auditTime[0]).format(this.dateFormat) + '00:00:00'
  108. this.queryParam.auditEndDate = moment(this.auditTime[1]).format(this.dateFormat) + '23:59:59'
  109. } else {
  110. this.queryParam.auditBeginDate = undefined
  111. this.queryParam.auditEndDate = undefined
  112. }
  113. const params = Object.assign(parameter, this.queryParam, { settleClientSn: this.$route.params.sn })
  114. return settleInfoList(params).then(res => {
  115. const data = res.data
  116. const no = (data.pageNo - 1) * data.pageSize
  117. for (var i = 0; i < data.list.length; i++) {
  118. data.list[i].no = no + i + 1
  119. }
  120. this.disabled = false
  121. this.total = data.list.length
  122. this.getTotal(params)
  123. return data
  124. })
  125. },
  126. basicInfoData: null, // 基本信息
  127. total: 0, // 总条数
  128. productTotal: null // 合计
  129. }
  130. },
  131. methods: {
  132. // 不可选日期
  133. disabledDate (date, dateStrings) {
  134. return date && date.valueOf() > Date.now()
  135. },
  136. // 返回列表
  137. handleBack () {
  138. this.$router.push({ path: '/financialManagement/companyReceivablePayable/list' })
  139. },
  140. // 合计
  141. getTotal (param) {
  142. settleInfoQueryReceiptOrPaySum(param).then(res => {
  143. if (res.status == 200 && res.data) {
  144. this.productTotal = res.data
  145. } else {
  146. this.productTotal = null
  147. }
  148. })
  149. },
  150. // 重置
  151. resetSearchForm () {
  152. this.queryParam.bizNo = ''
  153. this.auditTime = []
  154. },
  155. // 导出
  156. handleExport () {
  157. const params = this.queryParam
  158. this.exportLoading = true
  159. // customerBundleExportDelay(params).then(res => {
  160. // this.exportLoading = false
  161. // this.download(res)
  162. // })
  163. },
  164. download (data) {
  165. if (!data) { return }
  166. const url = window.URL.createObjectURL(new Blob([data]))
  167. const link = document.createElement('a')
  168. link.style.display = 'none'
  169. link.href = url
  170. const a = moment().format('YYYYMMDDHHmmss')
  171. const fname = '仓库调拨' + a
  172. link.setAttribute('download', fname + '.xlsx')
  173. document.body.appendChild(link)
  174. link.click()
  175. }
  176. }
  177. }
  178. </script>
  179. <style lang="less">
  180. .companyCollectionPaymentDetail-cont{
  181. margin-bottom: 15px;
  182. }
  183. </style>