list.vue 17 KB

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