detail.vue 14 KB

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