detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <div class="jg-page-wrap onlinePayDetail-wrap">
  3. <a-spin :spinning="spinning" tip="Loading...">
  4. <a-page-header :ghost="false" :backIcon="false" class="onlinePayDetail-cont">
  5. <!-- 自定义的二级文字标题 -->
  6. <template slot="subTitle">
  7. <span class="billno">货架名称:{{ $route.params.shelfName ||'--' }}</span>
  8. <a-button id="onlinePayDetail-seeInfo-btn" type="link" class="button-default" @click="isShowBisiceInfo=!isShowBisiceInfo" style="margin-left:10px;vertical-align:middle;">
  9. <a-icon :type="isShowBisiceInfo ? 'eye-invisible' : 'eye'"/>
  10. {{ isShowBisiceInfo?'隐藏':'查看' }}信息
  11. </a-button>
  12. <a-button id="onlinePayDetail-back-btn" type="link" @click="handleBack" class="button-default"> <a-icon type="rollback" /> 返回列表</a-button>
  13. </template>
  14. </a-page-header>
  15. <div class="sales-detail-body">
  16. <!-- 数据统计 -->
  17. <a-card size="small" :bordered="false" class="onlinePayDetail-cont" v-show="isShowBisiceInfo">
  18. <a-descriptions size="small" :column="4">
  19. <div slot="title" style="display:flex;justify-content:space-between;align-items:center;">
  20. 数据统计
  21. </div>
  22. <a-descriptions-item label="账单总金额">{{ detailData&&(detailData.totalAmount||detailData.totalAmount==0)?toThousands(detailData.totalAmount) :'--' }}</a-descriptions-item>
  23. <a-descriptions-item label="收款金额">{{ detailData&&(detailData.skAmount||detailData.skAmount==0)?toThousands(detailData.skAmount) :'--' }}</a-descriptions-item>
  24. <a-descriptions-item label="退款中金额">{{ detailData&&(detailData.tkzAmount||detailData.tkzAmount==0)?toThousands(detailData.tkzAmount) :'--' }}</a-descriptions-item>
  25. <a-descriptions-item label="已退款金额">{{ detailData&&(detailData.tkAmount||detailData.tkAmount==0)?toThousands(detailData.tkAmount) :'--' }}</a-descriptions-item>
  26. </a-descriptions>
  27. </a-card>
  28. <a-card size="small" :bordered="false" class="pages-wrap">
  29. <div ref="tableSearch" class="table-page-search-wrapper">
  30. <a-form layout="inline" id="onlinePayDetail-form" @keyup.enter.native="$refs.table.refresh(true)">
  31. <a-row :gutter="15">
  32. <a-col :xl="6" :lg="6" :md="12" :sm="24">
  33. <a-form-item label="下单时间">
  34. <rangeDate id="onlinePayDetail-time" ref="rangeDate" :value="orderDate" @change="orderDateChange" />
  35. </a-form-item>
  36. </a-col>
  37. <a-col :xl="6" :lg="6" :md="12" :sm="24">
  38. <a-form-item label="付款时间">
  39. <rangeDate id="onlinePayDetail-qhtime" ref="rangePayDate" :value="payDate" @change="date=>{dataChange(date,'pay')}" />
  40. </a-form-item>
  41. </a-col>
  42. <a-col :xl="6" :lg="6" :md="12" :sm="24">
  43. <a-form-item label="退款时间">
  44. <rangeDate id="onlinePayDetail-time" ref="rangeRefundDate" :value="refundDate" @change="date=>{dataChange(date,'refund')}" />
  45. </a-form-item>
  46. </a-col>
  47. <a-col :xl="6" :lg="6" :md="12" :sm="24">
  48. <a-form-item label="采购单号">
  49. <a-input id="onlinePayDetail-purchaseBillNo" placeholder="请输入采购单号" v-model.trim="queryParam.purchaseBillNo" allowClear/>
  50. </a-form-item>
  51. </a-col>
  52. <a-col :xl="6" :lg="6" :md="12" :sm="24">
  53. <a-form-item label="销售单号">
  54. <a-input id="onlinePayDetail-salesBillNo" placeholder="请输入销售单号" v-model.trim="queryParam.salesBillNo" allowClear/>
  55. </a-form-item>
  56. </a-col>
  57. <a-col :md="6" :sm="24">
  58. <a-form-item label="业务状态">
  59. <v-select
  60. id="onlinePayDetail-billStatus"
  61. code="SALES_BILL_STATUS"
  62. :notIn="['WAIT_SUBMIT','SUPERIOR_CHANGE']"
  63. v-model="queryParam.billStatus"
  64. allowClear
  65. placeholder="请选择业务状态"></v-select>
  66. </a-form-item>
  67. </a-col>
  68. <a-col :md="6" :sm="24">
  69. <a-form-item label="财务状态">
  70. <v-select id="onlinePayDetail-financialStatus" code="FINANCIAL_ONLINE_RECEIVE_STATUS" v-model="queryParam.financialStatus" allowClear placeholder="请选择财务状态"></v-select>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :md="6" :sm="24">
  74. <a-form-item label="到账状态">
  75. <v-select id="onlinePayDetail-receivedMoneyFlag" code="RECEIVED_MONEY_FLAG" v-model="queryParam.receivedMoneyFlag" allowClear placeholder="请选择到账状态"></v-select>
  76. </a-form-item>
  77. </a-col>
  78. <a-col :xl="24" :lg="24" :md="24" :sm="24" style="text-align:center;">
  79. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="onlinePayDetail-refresh" >查询</a-button>
  80. <a-button style="margin-left: 8px" @click="resetSearchForm" :disabled="disabled" id="onlinePayDetail-reset">重置</a-button>
  81. </a-col>
  82. </a-row>
  83. </a-form>
  84. </div>
  85. <div style="margin-bottom:8px;">
  86. 账单总金额:<strong>{{ countData&&(countData.totalAmount || countData.totalAmount==0) ? toThousands(countData.totalAmount) : '--' }}</strong>;
  87. 其中收款金额:<strong>{{ countData&&(countData.paymentAmount || countData.paymentAmount==0) ? toThousands(countData.paymentAmount) : '--' }}</strong>;
  88. 退款中金额:<strong>{{ countData&&(countData.refundingAmount || countData.refundingAmount==0) ? toThousands(countData.refundingAmount) : '--' }}</strong>;
  89. 已退款金额:<strong>{{ countData&&(countData.refundedAmount || countData.refundedAmount ==0) ? toThousands(countData.refundedAmount) : '--' }}</strong>;
  90. </div>
  91. <!-- 列表 -->
  92. <s-table
  93. class="sTable"
  94. ref="table"
  95. size="small"
  96. :rowKey="(record) => record.id"
  97. :columns="columns"
  98. :data="loadData"
  99. :defaultLoadData="false"
  100. bordered>
  101. <!-- 财务状态 -->
  102. <template slot="financialStatusInfo" slot-scope="text, record">
  103. <div v-if="record.financialStatus&&record.financialStatusDictValue">
  104. <span v-if="record.financialStatus=='REFUNDING'" style="color:#ED1C24;">{{ record.financialStatusDictValue }}</span>
  105. <span v-else>{{ record.financialStatusDictValue }}</span>
  106. </div>
  107. <div v-else>--</div>
  108. </template>
  109. </s-table>
  110. </a-card>
  111. </div>
  112. </a-spin>
  113. <!-- 编辑备注 -->
  114. <editRemarkModal :openModal="openEditModal" @close="openEditModal=false" @ok="handleEditOk"></editRemarkModal>
  115. </div>
  116. </template>
  117. <script>
  118. import { commonMixin } from '@/utils/mixin'
  119. // 组件
  120. import { STable, VSelect } from '@/components'
  121. import rangeDate from '@/views/common/rangeDate.vue'
  122. // 接口
  123. import { queryByBizTradeList, queryShelfSettleRuleCount, queryByBizTradeCount } from '@/api/merchantNew'
  124. export default {
  125. name: 'OnlinePayInvoiceDetail',
  126. components: { STable, VSelect, rangeDate },
  127. mixins: [commonMixin],
  128. props: {
  129. outBizSn: { // 有值则为弹框,无值则为页面
  130. type: [Number, String],
  131. default: ''
  132. }
  133. },
  134. data () {
  135. const _this = this
  136. return {
  137. spinning: false,
  138. disabled: false,
  139. openEditModal: false, // 打开编辑备注弹窗
  140. orderDate: [],
  141. payDate: [],
  142. refundDate: [],
  143. queryParam: {
  144. beginDate: undefined, // 下单时间
  145. endDate: undefined,
  146. payStartData: undefined, // 付款时间
  147. payEndData: undefined,
  148. refundStartData: undefined, // 退款时间
  149. refundEndData: undefined,
  150. purchaseBillNo: '', // 采购单号
  151. salesBillNo: '', // 销售单号
  152. billStatus: undefined, // 业务状态
  153. financialStatus: undefined, // 财务状态
  154. receivedMoneyFlag: undefined// 到账
  155. },
  156. // 加载数据方法 必须为 Promise 对象
  157. loadData: parameter => {
  158. this.disabled = true
  159. this.queryParam.buyerSnSource = this.$route.params.sn
  160. this.queryParam.shelfSn = this.$route.params.shelfSn
  161. const params = Object.assign(parameter, this.queryParam)
  162. return queryByBizTradeList(params).then(res => {
  163. let data
  164. if (res.status == 200) {
  165. data = res.data
  166. this.getCount(params)
  167. const no = (data.pageNo - 1) * data.pageSize
  168. for (var i = 0; i < data.list.length; i++) {
  169. data.list[i].no = no + i + 1
  170. }
  171. this.disabled = false
  172. }
  173. return data
  174. })
  175. },
  176. detailData: null, // 详情数据
  177. isShowBisiceInfo: false, // 显示基础内容
  178. countData: null, // 统计信息
  179. columns: [
  180. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  181. { title: '下单时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  182. { title: '采购单号', dataIndex: 'purchaseBillNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  183. { title: '关联销售单号', dataIndex: 'salesBillNo', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
  184. { title: '财务收款单号', dataIndex: 'settleNo', width: '9%', align: 'center', customRender: function (text) { return text && text != ' ' ? text : '--' } },
  185. { title: '订单金额', dataIndex: 'totalAmount', width: '6%', align: 'right', customRender: function (text) { return ((text || text == 0) ? _this.toThousands(text) : '--') } },
  186. { title: '结算方式', dataIndex: 'settleStyleSnDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  187. { title: '付款时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  188. { title: '退款时间', dataIndex: 'refundData', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  189. { title: '业务状态', dataIndex: 'billStatusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  190. { title: '财务状态', dataIndex: 'financialStatusDictValue', width: '6%', align: 'center', scopedSlots: { customRender: 'financialStatusInfo' } },
  191. { title: '到账状态', dataIndex: 'receivedMoneyFlagDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } }
  192. ]
  193. }
  194. },
  195. methods: {
  196. // 编辑备注完成
  197. handleEditOk () {
  198. this.openEditModal = false
  199. },
  200. // 统计
  201. getCount (val) {
  202. queryByBizTradeCount(val).then(res => {
  203. if (res.status == 200) {
  204. this.countData = res.data
  205. }
  206. })
  207. },
  208. // 返回
  209. handleBack () {
  210. this.$router.push({ name: 'onlinePayInvoiceList' })
  211. },
  212. // 详情
  213. getDetail () {
  214. queryShelfSettleRuleCount({ shelfSn: this.$route.params.shelfSn, buyerSnSource: this.$route.params.sn }).then(res => {
  215. if (res.status == 200) {
  216. this.detailData = res.data
  217. } else {
  218. this.detailData = null
  219. }
  220. })
  221. },
  222. orderDateChange (date) {
  223. this.queryParam.beginDate = date[0]
  224. this.queryParam.endDate = date[1]
  225. },
  226. dataChange (val, name) {
  227. this.queryParam[name + 'StartData'] = val[0]
  228. this.queryParam[name + 'EndData'] = val[1]
  229. },
  230. // 重置
  231. resetSearchForm () {
  232. this.queryParam = {
  233. beginDate: undefined, // 下单时间
  234. endDate: undefined,
  235. payStartData: undefined, // 付款时间
  236. payEndData: undefined,
  237. refundStartData: undefined, // 退款时间
  238. refundEndData: undefined,
  239. purchaseBillNo: '', // 采购单号
  240. salesBillNo: '', // 销售单号
  241. billStatus: undefined, // 业务状态
  242. financialStatus: undefined, // 财务状态
  243. receivedMoneyFlag: undefined// 到账
  244. }
  245. this.orderDate = []
  246. this.payDate = []
  247. this.refundDate = []
  248. this.$refs.rangeDate.resetDate([])
  249. this.$refs.rangePayDate.resetDate([])
  250. this.$refs.rangeRefundDate.resetDate([])
  251. this.$refs.table.refresh(true)
  252. },
  253. // 页面初始
  254. pageInit () {
  255. const vm = this
  256. vm.$nextTick(() => {
  257. vm.spinning = false
  258. vm.disabled = false
  259. // 查询列表
  260. vm.$refs.table.refresh(true)
  261. // 获取单据详情
  262. vm.getDetail()
  263. })
  264. }
  265. },
  266. mounted () {
  267. if (!this.$store.state.app.isNewTab || this.outBizSn) { // 页签刷新时调用
  268. this.pageInit()
  269. }
  270. },
  271. activated () {
  272. this.pageInit()
  273. },
  274. beforeRouteEnter (to, from, next) {
  275. next(vm => {
  276. })
  277. }
  278. }
  279. </script>
  280. <style lang="less" scoped>
  281. .onlinePayDetail-wrap{
  282. position: relative;
  283. height: 100%;
  284. .billno{
  285. font-size: 16px;
  286. font-weight: 600;
  287. display: inline-block;
  288. vertical-align: middle;
  289. color: #333;
  290. margin-right: 15px;
  291. }
  292. .ant-tag-green,.ant-tag-orange{
  293. vertical-align: middle;
  294. }
  295. .onlinePayDetail-cont{
  296. margin-bottom: 10px;
  297. /deep/ .ant-descriptions-title{
  298. margin-bottom: 10px;
  299. }
  300. }
  301. .pages-wrap{
  302. strong{
  303. color:#f12929;
  304. }
  305. }
  306. }
  307. </style>