list.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="searchBoxNormal">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper">
  6. <a-form layout="inline" @keyup.enter.native="$refs.table.refresh(true)">
  7. <a-row :gutter="15">
  8. <a-col :md="6" :sm="24">
  9. <a-form-item label="创建时间">
  10. <rangeDate ref="rangeDate" :value="creatDate" @change="dateChange" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="收款单号">
  15. <a-input id="financialCollectionList-bookNo" v-model.trim="queryParam.bookNo" allowClear placeholder="请输入收款单号"/>
  16. </a-form-item>
  17. </a-col>
  18. <a-col :md="6" :sm="24">
  19. <a-form-item label="关联单据单号">
  20. <a-input id="financialCollectionList-dispatchBillNo" v-model.trim="queryParam.dispatchBillNo" allowClear placeholder="请输入关联单据单号"/>
  21. </a-form-item>
  22. </a-col>
  23. <template v-if="advanced">
  24. <a-col :md="6" :sm="24">
  25. <a-form-item label="申请人">
  26. <employee style="width: 100%;" id="financialCollectionList-Employee" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
  27. </a-form-item>
  28. </a-col>
  29. <a-col :md="6" :sm="24">
  30. <a-form-item label="收款事由">
  31. <a-input id="financialCollectionList-bookReason" v-model.trim="queryParam.bookReason" allowClear placeholder="请输入收款事由"/>
  32. </a-form-item>
  33. </a-col>
  34. <a-col :md="6" :sm="24">
  35. <a-form-item label="付款方类型">
  36. <v-select
  37. v-model="queryParam.payerType"
  38. ref="payType"
  39. code="PAYER_TYPE"
  40. placeholder="请选择付款方式类型"
  41. allowClear></v-select>
  42. </a-form-item>
  43. </a-col>
  44. <a-col :md="6" :sm="24">
  45. <a-form-item label="付款方">
  46. <a-input id="financialCollectionList-payerNames" v-model.trim="queryParam.payerName" allowClear placeholder="请输入付款方"/>
  47. </a-form-item>
  48. </a-col>
  49. <a-col :md="6" :sm="24">
  50. <a-form-item label="审核时间">
  51. <rangeDate ref="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
  52. </a-form-item>
  53. </a-col>
  54. <a-col :md="6" :sm="24">
  55. <a-form-item label="状态">
  56. <v-select
  57. v-model="queryParam.status"
  58. ref="status"
  59. id="financialCollectionList-status"
  60. code="FINANCE_BOOK_STATE"
  61. placeholder="请选择状态"
  62. allowClear></v-select>
  63. </a-form-item>
  64. </a-col>
  65. <a-col :md="6" :sm="24" v-show="isShowCustomerSearch">
  66. <a-form-item label="客服">
  67. <customerService ref="customerName" v-model="queryParam.bizUserSn"></customerService>
  68. </a-form-item>
  69. </a-col>
  70. </template>
  71. <a-col :md="6" :sm="24" style="margin-bottom: 10px;">
  72. <a-button type="primary" @click="$refs.table.refresh(true)" :disabled="disabled" id="financialCollectionList-refresh">查询</a-button>
  73. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="financialCollectionList-reset">重置</a-button>
  74. <a @click="advanced=!advanced" style="margin-left: 5px">
  75. {{ advanced ? '收起' : '展开' }}
  76. <a-icon :type="advanced ? 'up' : 'down'"/>
  77. </a>
  78. </a-col>
  79. </a-row>
  80. </a-form>
  81. </div>
  82. </a-card>
  83. <a-card size="small" :bordered="false" class="financialCollectionList-wrap">
  84. <a-spin :spinning="spinning" tip="Loading...">
  85. <!-- 操作按钮 -->
  86. <div class="table-operator">
  87. <div class="flex-center">
  88. <a-button type="primary" v-if="$hasPermissions('B_fc_new')" @click="handleAdd">新增</a-button>
  89. <div class="tongji-bar">
  90. 订单总金额:{{ toThousands(countData&&countData.orderTotalAmount||0) }};
  91. 收款总金额:{{ toThousands(countData&&countData.receiptTotalAmount||0) }};
  92. 使用授信总金额:{{ toThousands(countData&&countData.useTotalAmount||0) }};
  93. 授信还款总金额:{{ toThousands(countData&&countData.payTotalAmount||0) }};
  94. 余款抵扣总金额:{{ toThousands(countData&&countData.balanceTotalAmount||0) }};
  95. </div>
  96. </div>
  97. <div></div>
  98. </div>
  99. <!-- 列表 -->
  100. <s-table
  101. class="sTable fixPagination"
  102. ref="table"
  103. :style="{ height: tableHeight+70+'px' }"
  104. size="small"
  105. :rowKey="(record) => record.id"
  106. :columns="columns"
  107. :data="loadData"
  108. :scroll="{ y: tableHeight }"
  109. :pageSize="30"
  110. :defaultLoadData="false"
  111. bordered>
  112. <!-- 单号 -->
  113. <template slot="bookNo" slot-scope="text, record">
  114. <span v-if="$hasPermissions('B_fc_detail')" class="link-bule" @click="handleDetail(record)">{{ record.bookNo }}</span>
  115. <span v-else>{{ record.bookNo }}</span>
  116. </template>
  117. <!-- 关联备货单 -->
  118. <template slot="dispatchNum" slot-scope="text, record">
  119. <span v-if="$hasPermissions('B_glDispatch')&&record.dispatchNum" class="link-bule" @click="handleBhDetail(record)">{{ record.dispatchNum }}单</span>
  120. <span v-else>--</span>
  121. </template>
  122. <!-- 操作 -->
  123. <template slot="action" slot-scope="text, record">
  124. <a-button
  125. v-if="record.status=='WAIT_SUBMIT'&&$hasPermissions('B_fc_edit')"
  126. size="small"
  127. type="link"
  128. class="button-info"
  129. @click="handleEdit(record)"
  130. >
  131. 编辑
  132. </a-button>
  133. <a-button
  134. v-if="record.status=='WAIT_SUBMIT'&&$hasPermissions('B_fc_del')"
  135. size="small"
  136. type="link"
  137. class="button-error"
  138. @click="handleDel(record)"
  139. >
  140. 删除
  141. </a-button>
  142. <a-button
  143. v-if="record.status!='WAIT_SUBMIT'&&$hasPermissions('B_fc_Audit')"
  144. size="small"
  145. type="link"
  146. class="button-info"
  147. @click="handleSH(record)"
  148. >
  149. 审核进度
  150. </a-button>
  151. <a-button
  152. v-if="record.status=='AUDIT_REJECT'&&$hasPermissions('B_againEdit')"
  153. size="small"
  154. type="link"
  155. class="button-info"
  156. @click="againEdit(record)"
  157. >
  158. 再次编辑
  159. </a-button>
  160. </template>
  161. </s-table>
  162. </a-spin>
  163. <!-- 审核进度 -->
  164. <verifyModal v-drag :openModal="openModal" :itemSn="itemSn" @close="openModal=false"></verifyModal>
  165. <!-- 基础信息 -->
  166. <baseModal v-drag :show="baseModal" @cancel="baseModal=false"></baseModal>
  167. <!-- 关联备货单 -->
  168. <dispatchModal v-drag ref="openDisModal" :openModal="openDisModal" :itemSn="itemSn" @close="openDisModal=false"></dispatchModal>
  169. </a-card>
  170. </div>
  171. </template>
  172. <script>
  173. import { commonMixin } from '@/utils/mixin'
  174. import { STable, VSelect } from '@/components'
  175. import rangeDate from '@/views/common/rangeDate.vue'
  176. import baseModal from './baseModal.vue'
  177. import employee from '../../expenseManagement/expenseReimbursement/employee.js'
  178. import verifyModal from './verifyModal.vue'
  179. import dispatchModal from './dispatchModal.vue'
  180. import customerService from '@/views/common/customerService'
  181. import { financeBookQueryPage, financeBookDeleteBySn, financeBookDgainEditBySn, financeBookQueryCount } from '@/api/financeBook.js'
  182. export default {
  183. name: 'FinancialCollectionList',
  184. mixins: [commonMixin],
  185. components: { STable, VSelect, rangeDate, baseModal, employee, verifyModal, dispatchModal, customerService },
  186. data () {
  187. return {
  188. spinning: false,
  189. openModal: false,
  190. openDisModal: false,
  191. baseModal: false,
  192. tableHeight: 0,
  193. queryParam: { // 查询条件
  194. payerType: '',
  195. beginDate: '',
  196. endDate: '',
  197. bookNo: '',
  198. dispatchBillNo: '',
  199. auditBeginDate: '',
  200. auditEndDate: '',
  201. applyPersonSn: undefined,
  202. bookReason: '',
  203. status: undefined,
  204. payerName: '',
  205. bizUserSn: undefined
  206. },
  207. disabled: false, // 查询、重置按钮是否可操作
  208. creatDate: [], // 创建时间
  209. auditDate: [], // 审核时间
  210. advanced: true,
  211. itemSn: null,
  212. // 加载数据方法 必须为 Promise 对象
  213. loadData: parameter => {
  214. this.disabled = true
  215. this.spinning = true
  216. const params = Object.assign(parameter, this.queryParam)
  217. return financeBookQueryPage(params).then(res => {
  218. let data
  219. if (res.status == 200) {
  220. data = res.data
  221. const no = (data.pageNo - 1) * data.pageSize
  222. for (var i = 0; i < data.list.length; i++) {
  223. data.list[i].no = no + i + 1
  224. }
  225. this.total = data.count || 0
  226. this.disabled = false
  227. }
  228. this.spinning = false
  229. this.getCount(params)
  230. return data
  231. })
  232. },
  233. total: 0, // 合计
  234. countData: null
  235. }
  236. },
  237. // 根据权限显示列表字段
  238. computed: {
  239. columns () {
  240. const arr = [
  241. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  242. { title: '创建时间', dataIndex: 'createDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  243. { title: '收款单号', scopedSlots: { customRender: 'bookNo' }, width: '8%', align: 'center' },
  244. { title: '关联单据', scopedSlots: { customRender: 'dispatchNum' }, width: '6%', align: 'center' },
  245. { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  246. { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' }, ellipsis: true },
  247. { title: '付款方', dataIndex: 'payerName', width: '9%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true },
  248. { title: '订单总金额', dataIndex: 'orderTotalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  249. { title: '收款总金额', dataIndex: 'receiptTotalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  250. { title: '使用授信总金额', dataIndex: 'useTotalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  251. { title: '授信还款总金额', dataIndex: 'payTotalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  252. { title: '余款抵扣总金额', dataIndex: 'balanceTotalAmount', width: '6%', align: 'right', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  253. { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  254. { title: '状态', dataIndex: 'statusDictValue', width: '6%', align: 'center', customRender: function (text) { return text || '--' } },
  255. { title: '操作', scopedSlots: { customRender: 'action' }, width: '8%', align: 'center' }
  256. ]
  257. return arr
  258. }
  259. },
  260. methods: {
  261. getCount (params) {
  262. financeBookQueryCount(params).then(res => {
  263. this.countData = res.data
  264. })
  265. },
  266. // 创建时间 change
  267. dateChange (date) {
  268. this.queryParam.beginDate = date[0] ? date[0] : ''
  269. this.queryParam.endDate = date[1] ? date[1] : ''
  270. },
  271. // 审核时间 change
  272. dateAuditChange (date) {
  273. this.queryParam.auditBeginDate = date[0] ? date[0] : ''
  274. this.queryParam.auditEndDate = date[1] ? date[1] : ''
  275. },
  276. // 重置
  277. resetSearchForm () {
  278. this.creatDate = []
  279. this.$refs.rangeDate.resetDate(this.creatDate)
  280. this.queryParam.beginDate = ''
  281. this.queryParam.endDate = ''
  282. this.auditDate = []
  283. if (this.advanced) {
  284. this.$refs.rangeAuditDate.resetDate(this.auditDate)
  285. }
  286. this.queryParam.payerName = ''
  287. this.queryParam.auditBeginDate = ''
  288. this.queryParam.auditEndDate = ''
  289. this.queryParam.bookNo = ''
  290. this.queryParam.dispatchBillNo = ''
  291. this.queryParam.applyPersonSn = undefined
  292. this.queryParam.bookReason = ''
  293. this.queryParam.status = undefined
  294. this.queryParam.payerType = undefined
  295. this.queryParam.bizUserSn = undefined
  296. this.$refs.table.refresh(true)
  297. },
  298. // 新增
  299. handleAdd () {
  300. this.baseModal = true
  301. },
  302. // 查看关联备货单
  303. handleBhDetail (row) {
  304. this.openDisModal = true
  305. this.itemSn = row.bookSn
  306. this.$nextTick(() => {
  307. this.$refs.openDisModal.setDetail(row)
  308. })
  309. },
  310. // 详情
  311. handleDetail (row) {
  312. this.$router.push({ name: 'financialCollectionDetail', params: { sn: row.bookSn } })
  313. },
  314. // 编辑
  315. handleEdit (row) {
  316. this.$router.push({ name: 'financialCollectionEdit', params: { sn: row.bookSn } })
  317. },
  318. // 删除
  319. handleDel (row) {
  320. const _this = this
  321. this.$confirm({
  322. title: '提示',
  323. content: '确认要删除吗?',
  324. centered: true,
  325. closable: true,
  326. onOk () {
  327. _this.spinning = true
  328. financeBookDeleteBySn({ bookSn: row.bookSn }).then(res => {
  329. if (res.status == 200) {
  330. _this.$message.success(res.message)
  331. _this.$refs.table.refresh()
  332. _this.spinning = false
  333. } else {
  334. _this.spinning = false
  335. }
  336. })
  337. }
  338. })
  339. },
  340. // 审核进度
  341. handleSH (row) {
  342. this.openModal = true
  343. this.itemSn = row.bookSn
  344. },
  345. // 再次编辑
  346. againEdit (row) {
  347. const _this = this
  348. this.$confirm({
  349. title: '操作提示',
  350. content: '系统将自动生成一个新的财务收款单,与原审核不通过的单据内容相同。您可以对新单据进行编辑、提交等操作,原单据保持不变,确认操作吗?',
  351. centered: true,
  352. closable: true,
  353. onOk () {
  354. _this.spinning = true
  355. financeBookDgainEditBySn({ bookSn: row.bookSn }).then(res => {
  356. if (res.status == 200) {
  357. _this.$message.success(res.message)
  358. _this.resetSearchForm()
  359. }
  360. _this.spinning = false
  361. })
  362. }
  363. })
  364. },
  365. pageInit () {
  366. const _this = this
  367. this.$nextTick(() => { // 页面渲染完成后的回调
  368. _this.setTableH()
  369. })
  370. },
  371. setTableH () {
  372. const tableSearchH = this.$refs.tableSearch.offsetHeight
  373. this.tableHeight = window.innerHeight - tableSearchH - 240
  374. }
  375. },
  376. watch: {
  377. advanced (newValue, oldValue) {
  378. const _this = this
  379. this.$nextTick(() => { // 页面渲染完成后的回调
  380. _this.setTableH()
  381. })
  382. },
  383. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  384. this.setTableH()
  385. }
  386. },
  387. mounted () {
  388. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  389. this.pageInit()
  390. this.resetSearchForm()
  391. }
  392. },
  393. activated () {
  394. // 如果是新页签打开,则重置当前页面
  395. if (this.$store.state.app.isNewTab) {
  396. this.pageInit()
  397. this.resetSearchForm()
  398. }
  399. // 仅刷新列表,不重置页面
  400. if (this.$store.state.app.updateList) {
  401. this.pageInit()
  402. this.$refs.table.refresh()
  403. }
  404. },
  405. beforeRouteEnter (to, from, next) {
  406. next(vm => {})
  407. }
  408. }
  409. </script>
  410. <style lang="less">
  411. .financialCollectionList-wrap{
  412. .active{
  413. color: #ed1c24;
  414. cursor: pointer;
  415. }
  416. .common{
  417. color: rgba(0, 0, 0);
  418. }
  419. }
  420. </style>