list.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false" class="collectionDetail-wrap">
  4. <!-- 搜索条件 -->
  5. <div ref="tableSearch" class="table-page-search-wrapper newTableSearchName">
  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="rangeAuditDate" :value="auditDate" @change="dateAuditChange" />
  11. </a-form-item>
  12. </a-col>
  13. <a-col :md="6" :sm="24">
  14. <a-form-item label="收款单号">
  15. <a-input id="collectionDetail-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. <v-select
  21. v-model="queryParam.printStatus"
  22. code="PRINT_STATUS"
  23. placeholder="请选择收款打印状态"
  24. allowClear
  25. ></v-select>
  26. </a-form-item>
  27. </a-col>
  28. <a-col :md="6" :sm="24">
  29. <a-form-item label="开票状态">
  30. <v-select
  31. v-model="queryParam.invoiceStatus"
  32. code="FINANCE_BOOK_INVOICE_STATUS"
  33. placeholder="请选择开票状态"
  34. allowClear
  35. ></v-select>
  36. </a-form-item>
  37. </a-col>
  38. <a-col :md="6" :sm="24">
  39. <a-form-item label="申请人">
  40. <employee style="width: 100%;" id="collectionDetail-Employee" placeholder="请选择申请人" v-model="queryParam.applyPersonSn"></employee>
  41. </a-form-item>
  42. </a-col>
  43. <a-col :md="6" :sm="24">
  44. <a-form-item label="收款日期">
  45. <rangeDate ref="receiptDate" :value="receiptDate" @change="receiptDateChange" />
  46. </a-form-item>
  47. </a-col>
  48. <a-col :md="6" :sm="24">
  49. <a-form-item label="付款方类型">
  50. <v-select
  51. v-model="queryParam.payerType"
  52. code="PAYER_TYPE"
  53. placeholder="请选择付款方类型"
  54. ></v-select>
  55. </a-form-item>
  56. </a-col>
  57. <a-col :md="6" :sm="24">
  58. <a-form-item label="付款方">
  59. <a-input id="financialCollectionList-payerName" v-model.trim="queryParam.payerName" allowClear placeholder="请输入付款方"/>
  60. </a-form-item>
  61. </a-col>
  62. <template v-if="advanced">
  63. <a-col :md="6" :sm="24">
  64. <a-form-item label="财务编码">
  65. <a-input id="collectionDetail-kdMidCustomerFnumber" placeholder="请输入财务编码" v-model="queryParam.kdMidCustomerFnumber"></a-input>
  66. </a-form-item>
  67. </a-col>
  68. <a-col :md="6" :sm="24">
  69. <a-form-item label="付款账户">
  70. <a-input id="collectionDetail-payerAccountInfo" placeholder="请输入付款账户" v-model="queryParam.payerAccountInfo"></a-input>
  71. </a-form-item>
  72. </a-col>
  73. <a-col :md="6" :sm="24">
  74. <a-form-item label="足额打款">
  75. <v-select
  76. v-model="queryParam.fullPaymentFlag"
  77. ref="fullPaymentFlag"
  78. id="collectionDetail-fullPaymentFlag"
  79. code="FLAG"
  80. placeholder="请选择是否足额打款"
  81. allowClear></v-select>
  82. </a-form-item>
  83. </a-col>
  84. <a-col :md="6" :sm="24">
  85. <a-form-item label="户名/汇入银行">
  86. <a-select placeholder="请选择户名" allowClear v-model="queryParam.bankAccount" style="width: 100%" @change="handleChange">
  87. <a-select-option v-for="item in bankList" :value="item.bankAccount">
  88. {{ item.bankAccount }}
  89. </a-select-option>
  90. </a-select>
  91. </a-form-item></a-col>
  92. <a-col :md="6" :sm="24">
  93. <a-form-item>
  94. <a-select placeholder="请选择汇入银行" allowClear v-model="queryParam.bankName" style="width: 100%">
  95. <a-select-option v-for="item in bankNameList" :value="item">
  96. {{ item }}
  97. </a-select-option>
  98. </a-select>
  99. </a-form-item>
  100. </a-col>
  101. <a-col :md="6" :sm="24">
  102. <a-form-item label="开票日期">
  103. <rangeDate ref="invoiceDate" :value="invoiceDate" @change="invoiceDateChange" />
  104. </a-form-item>
  105. </a-col>
  106. <a-col :md="6" :sm="24">
  107. <a-form-item label="所属区域">
  108. <subarea id="collectionDetail-subarea" ref="subarea" @change="subareaChange"></subarea>
  109. </a-form-item>
  110. </a-col>
  111. <a-col :md="6" :sm="24">
  112. <a-form-item label="所属省份">
  113. <Area id="collectionDetail-provinceSn" v-model="queryParam.provinceSn" placeholder="请选择省"></Area>
  114. </a-form-item>
  115. </a-col>
  116. <a-col :md="6" :sm="24" v-show="isShowWarehouse">
  117. <a-form-model-item label="仓库">
  118. <chooseWarehouse ref="warehouse" v-model="queryParam.warehouseSn" :isPermission="true"></chooseWarehouse>
  119. </a-form-model-item>
  120. </a-col>
  121. </template>
  122. <a-col :md="24" :sm="24" style="text-align:center;">
  123. <a-button type="primary" @click="searchForm" :disabled="disabled" id="collectionDetail-refresh">查询</a-button>
  124. <a-button style="margin-left: 5px" @click="resetSearchForm" :disabled="disabled" id="collectionDetail-reset">重置</a-button>
  125. <a-button
  126. style="margin-left: 10px"
  127. type="primary"
  128. class="button-warning"
  129. @click="handleExport"
  130. :disabled="disabled"
  131. :loading="exportLoading"
  132. v-if="$hasPermissions('M_FC_Details_Export')"
  133. id="sendOut-export">导出</a-button>
  134. <a @click="advanced=!advanced" style="margin-left: 5px;">
  135. {{ advanced ? '收起' : '展开' }}
  136. <a-icon :type="advanced ? 'up' : 'down'"/>
  137. </a>
  138. </a-col>
  139. </a-row>
  140. </a-form>
  141. </div>
  142. </a-card>
  143. <a-card size="small" :bordered="false" class="collectionDetail-wrap" style="margin-top:5px;">
  144. <div class="gatherMessage">
  145. 订单总金额:<strong> {{ toThousands(countData&&countData.orderAmount||0) }}</strong>;
  146. 收款总金额:<strong>{{ toThousands(countData&&countData.receiptAmount||0) }}</strong>;
  147. 使用授信总金额:<strong>{{ toThousands(countData&&countData.useCreditAmount||0) }}</strong>;
  148. 授信还款总金额:<strong>{{ toThousands(countData&&countData.payCreditAmount||0) }}</strong>;
  149. 余款抵扣总金额:<strong>{{ toThousands(countData&&countData.balanceAmount||0) }}</strong>;
  150. 跨月打款总金额:<strong>{{ toThousands(countData&&countData.nextMonthAmount||0) }}</strong>;
  151. </div>
  152. <div class="gatherMessage">
  153. <a-dropdown>
  154. <a-menu slot="overlay" @click="handleMenuClick">
  155. <a-menu-item key="1"> <a-icon type="printer" />批量允许打印 </a-menu-item>
  156. <a-menu-item key="2"> <a-icon type="block" />批量设置开票 </a-menu-item>
  157. </a-menu>
  158. <a-button type="primary" ghost> 批量处理 <a-icon type="down" /></a-button>
  159. </a-dropdown>
  160. <span v-if="selNums" style="margin-left:10px;">已选{{ selNums }}项</span>
  161. </div>
  162. <a-spin :spinning="spinning" tip="Loading...">
  163. <!-- 列表 -->
  164. <s-table
  165. class="sTable fixPagination"
  166. ref="table"
  167. :style="{ height: tableHeight+84.5+'px' }"
  168. size="small"
  169. :rowKey="(record) => record.id"
  170. :columns="columns"
  171. :data="loadData"
  172. :row-selection="{ columnWidth: 40 }"
  173. @rowSelection="rowSelectionFun"
  174. :scroll="{ y: tableHeight }"
  175. bordered>
  176. <!-- 开票日期 -->
  177. <template slot="draftDate" slot-scope="text, record">
  178. <div @click="handleInvoice(record)">
  179. <span v-if="record.invoiceDate" class="link-bule">{{ record.invoiceDate }}</span>
  180. <span class="link-bule" v-else>--</span>
  181. </div>
  182. </template>
  183. <!-- 收款打印状态 -->
  184. <template slot="printStatus" slot-scope="text, record">
  185. <span v-if="record.printStatus=='NO_PRINT' || record.printStatus=='PRINT'">{{ record.printStatusDictValue }}</span>
  186. <span @click="handlePrint(record)" class="link-bule" v-else>{{ record.printStatusDictValue }}</span>
  187. </template>
  188. <!-- 备注 -->
  189. <template slot="note" slot-scope="text, record">
  190. <div @click="handleNote(record)">
  191. <span :title="record.remarks" class="link-bule" style="overflow: hidden;white-space: nowrap;text-overflow: ellipsis;width:100%;display:block;">{{ record.remarks || '--' }}</span>
  192. </div>
  193. </template>
  194. </s-table>
  195. </a-spin>
  196. <!-- 开票日期弹窗 -->
  197. <invoiceModal v-drag :show="invoiceIsShow" :info="invoiceInfo" @cancel="cancel"></invoiceModal>
  198. <plInvoiceModal v-drag :show="plinvoiceIsShow" @ok="plinvoiceOk" @cancel="cancel"></plInvoiceModal>
  199. <!-- 备注弹窗 -->
  200. <noteModal ref="remarksModal" v-drag :show="noteIsShow" @cancel="cancel"></noteModal>
  201. <!-- 收款打印状态 -->
  202. <printModal v-drag :show="printIsShow" :info="printInfo" @cancel="cancel"></printModal>
  203. </a-card>
  204. </div>
  205. </template>
  206. <script>
  207. import { commonMixin } from '@/utils/mixin'
  208. import moment from 'moment'
  209. import { STable, VSelect } from '@/components'
  210. import getDate from '@/libs/getDate.js'
  211. import rangeDate from '@/views/common/rangeDate.vue'
  212. import subarea from '@/views/common/subarea.js'
  213. import Area from '@/views/common/area.js'
  214. import { hdExportExcel } from '@/libs/exportExcel'
  215. import employee from '../../expenseManagement/expenseReimbursement/employee.js'
  216. import dealerSubareaScopeList from '@/views/common/dealerSubareaScopeList.vue'
  217. import invoiceModal from './invoiceModal.vue'
  218. import plInvoiceModal from './plInvoiceModal.vue'
  219. import noteModal from './noteModal.vue'
  220. import printModal from './printModal.vue'
  221. import chooseWarehouse from '@/views/common/chooseWarehouse'
  222. import { financeBookDetailQueryPage, financeBookDetailExport, financeBookReportDetailCount, financeBookDetailUpdateBatch } from '@/api/financeBook.js'
  223. export default {
  224. name: 'CollectionDetailStaticList',
  225. mixins: [commonMixin],
  226. components: { STable, VSelect, rangeDate, employee, dealerSubareaScopeList, subarea, Area, invoiceModal, plInvoiceModal, noteModal, printModal, chooseWarehouse },
  227. data () {
  228. return {
  229. spinning: false,
  230. exportLoading: false,
  231. plinvoiceIsShow: false,
  232. tableHeight: 0,
  233. queryParam: { // 查询条件
  234. bookNo: '',
  235. auditBeginDate: getDate.getCurrMonthDays().starttime,
  236. auditEndDate: getDate.getCurrMonthDays().endtime,
  237. receiptBeginDate: '',
  238. receiptEndDate: '',
  239. applyPersonSn: undefined,
  240. payerName: undefined,
  241. kdMidCustomerFnumber: '',
  242. payerAccountInfo: '',
  243. fullPaymentFlag: undefined,
  244. bankAccount: undefined,
  245. bankName: undefined,
  246. subareaArea: {
  247. subareaSn: undefined,
  248. subareaAreaSn: undefined
  249. },
  250. provinceSn: undefined,
  251. printStatus: undefined,
  252. invoiceStatus: undefined,
  253. invoiceDateType: undefined,
  254. invoiceBeginDate: '',
  255. invoiceEndDate: '',
  256. payerType: undefined,
  257. warehouseSn: undefined // 仓库
  258. },
  259. invoiceIsShow: false,
  260. noteIsShow: false,
  261. printIsShow: false,
  262. disabled: false, // 查询、重置按钮是否可操作
  263. receiptDate: [], // 收款时间
  264. invoiceDate: [], // 开票日期
  265. plinvoiceInfo: null,
  266. auditDate: [
  267. getDate.getCurrMonthDays().starttime,
  268. getDate.getCurrMonthDays().endtime
  269. ], // 审核时间
  270. advanced: false,
  271. // 加载数据方法 必须为 Promise 对象
  272. loadData: parameter => {
  273. this.disabled = true
  274. this.spinning = true
  275. const params = Object.assign(parameter, this.queryParam)
  276. params.invoiceDate = params.invoiceDate ? moment(params.invoiceDate).format('YYYY-MM-DD') : ''
  277. return financeBookDetailQueryPage(params).then(res => {
  278. let data
  279. if (res.status == 200) {
  280. data = res.data
  281. const no = (data.pageNo - 1) * data.pageSize
  282. for (var i = 0; i < data.list.length; i++) {
  283. data.list[i].no = no + i + 1
  284. }
  285. this.total = data.count || 0
  286. this.disabled = false
  287. }
  288. this.spinning = false
  289. this.getCount(params)
  290. return data
  291. })
  292. },
  293. total: 0, // 合计
  294. countData: null,
  295. bankList: [
  296. {
  297. bankAccount: '张丽友',
  298. bankName: ['建设银行', '微信收款']
  299. },
  300. {
  301. bankAccount: '张丽添',
  302. bankName: ['农业银行']
  303. },
  304. {
  305. bankAccount: '东莞箭冠',
  306. bankName: ['东莞银行']
  307. },
  308. {
  309. bankAccount: '江西箭冠',
  310. bankName: ['九江银行']
  311. }
  312. ],
  313. bankNameList: [],
  314. invoiceInfo: null,
  315. printInfo: null,
  316. rowSelectionInfo: null
  317. }
  318. },
  319. // 根据权限显示列表字段
  320. computed: {
  321. selNums () {
  322. return this.rowSelectionInfo && this.rowSelectionInfo.selectedRowKeys.length || 0
  323. },
  324. columns () {
  325. const arr = [
  326. { title: '序号', dataIndex: 'no', width: '4%', align: 'center' },
  327. { title: '审核时间', dataIndex: 'auditDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  328. { title: '收款单号', dataIndex: 'bookNo', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  329. { title: '申请人', dataIndex: 'applyPersonName', align: 'center', width: '5%', customRender: function (text) { return text || '--' }, ellipsis: true },
  330. { title: '收款事由', dataIndex: 'bookReason', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  331. { title: '收款日期', dataIndex: 'receiptDate', width: '8%', align: 'center', customRender: function (text) { return text || '--' } },
  332. { title: '付款方类型', dataIndex: 'payerTypeDictValue', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  333. { title: '付款方', dataIndex: 'payerName', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  334. { title: '财务编码', dataIndex: 'kdMidCustomerFnumber', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  335. { title: '付款账户(营业执照)', dataIndex: 'payerAccountInfo', align: 'center', width: '8%', customRender: function (text) { return text || '--' } },
  336. { title: '订单金额', dataIndex: 'orderAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  337. { title: '收款金额', dataIndex: 'receiptAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  338. { title: '使用授信', dataIndex: 'useCreditAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  339. { title: '授信还款', dataIndex: 'payCreditAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  340. { title: '余款抵扣', dataIndex: 'balanceAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  341. { title: '跨月打款', dataIndex: 'nextMonthAmount', align: 'right', width: '5%', customRender: text => ((text || text == 0) ? this.toThousands(text) : '--') },
  342. { title: '户名', dataIndex: 'bankAccount', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  343. { title: '汇入银行', dataIndex: 'bankName', align: 'center', width: '5%', customRender: function (text) { return text || '--' } },
  344. { title: '足额打款', dataIndex: 'fullPaymentFlagDictValue', align: 'center', width: '5%', customRender: function (text) { return (text == 0 || text) ? text : '--' } },
  345. { title: '说明', dataIndex: 'explainInfo', align: 'center', width: '8%', customRender: function (text) { return text || '--' }, ellipsis: true },
  346. { title: '开票日期', scopedSlots: { customRender: 'draftDate' }, align: 'center', width: '8%' },
  347. { title: '收款打印状态', scopedSlots: { customRender: 'printStatus' }, align: 'center', width: '8%' },
  348. { title: '备注', scopedSlots: { customRender: 'note' }, align: 'center', width: '8%' }
  349. ]
  350. if (this.isShowWarehouse) {
  351. arr.splice(4, 0, { title: '仓库', dataIndex: 'warehouseName', width: '8%', align: 'left', customRender: function (text) { return text || '--' }, ellipsis: true })
  352. }
  353. return arr
  354. }
  355. },
  356. methods: {
  357. // 关闭弹窗刷新表格
  358. cancel (flag) {
  359. console.log(flag)
  360. this.invoiceIsShow = false
  361. this.noteIsShow = false
  362. this.printIsShow = false
  363. this.plinvoiceIsShow = false
  364. if (flag === 1) {
  365. this.searchForm()
  366. }
  367. },
  368. getCount (params) {
  369. financeBookReportDetailCount(params).then(res => {
  370. this.countData = res.data
  371. })
  372. },
  373. handleMenuClick (e) {
  374. console.log('click', e)
  375. const _this = this
  376. const rows = _this.rowSelectionInfo && _this.rowSelectionInfo.selectedRows || []
  377. const slen = rows.length
  378. if (!_this.rowSelectionInfo || (_this.rowSelectionInfo && slen < 1)) {
  379. _this.$message.warning('请在列表勾选后再进行批量操作!')
  380. return false
  381. }
  382. if (e.key == 1) { // 批量允许打印
  383. const dataList = rows.filter(item => !(item.printStatus == 'NO_PRINT' || item.printStatus == 'PRINT'))
  384. if (dataList.length) {
  385. this.$confirm({
  386. title: '批量允许打印',
  387. content: `已选有效数据 ${dataList.length} 条,确认将收款打印状态变更为允许打印吗?`,
  388. okText: '确定',
  389. centered: true,
  390. cancelText: '取消',
  391. onOk () {
  392. // 批量允许打印接口
  393. const data = []
  394. dataList.map(item => {
  395. data.push({ id: item.id, printStatus: 'NO_PRINT' })
  396. })
  397. _this.plUpdateStatus(data)
  398. }
  399. })
  400. } else {
  401. _this.$message.warning('没有可操作的有效数据!')
  402. }
  403. }
  404. if (e.key == 2) { // 批量开票
  405. const data = []
  406. rows.map(item => {
  407. data.push({ id: item.id, invoiceDate: '', remarks: '' })
  408. })
  409. _this.plinvoiceInfo = data
  410. _this.plinvoiceIsShow = true
  411. }
  412. },
  413. // 批量操作
  414. plUpdateStatus (data) {
  415. this.spinning = true
  416. financeBookDetailUpdateBatch(data).then(res => {
  417. if (res.status == 200) {
  418. this.searchForm()
  419. }
  420. this.spinning = false
  421. })
  422. },
  423. // 确定批量开票
  424. plinvoiceOk (data) {
  425. this.plinvoiceInfo.map(item => {
  426. item.invoiceDate = data.invoiceDate
  427. item.remarks = data.remarks
  428. })
  429. this.plUpdateStatus(this.plinvoiceInfo)
  430. },
  431. // 表格选中项
  432. rowSelectionFun (obj) {
  433. this.rowSelectionInfo = obj || null
  434. },
  435. handleChange (v) {
  436. if (v) {
  437. const row = this.bankList.find(item => item.bankAccount == v)
  438. this.bankNameList = row.bankName
  439. this.queryParam.bankName = undefined
  440. } else {
  441. this.queryParam.bankAccount = undefined
  442. this.queryParam.bankName = undefined
  443. }
  444. },
  445. // 收款日期 change
  446. receiptDateChange (date) {
  447. this.queryParam.receiptBeginDate = date[0] ? date[0] : ''
  448. this.queryParam.receiptEndDate = date[1] ? date[1] : ''
  449. },
  450. // 开票时间 change
  451. invoiceDateChange (date) {
  452. this.queryParam.invoiceBeginDate = date[0] ? date[0] : ''
  453. this.queryParam.invoiceEndDate = date[1] ? date[1] : ''
  454. },
  455. // 审核时间 change
  456. dateAuditChange (date) {
  457. this.queryParam.auditBeginDate = date[0] ? date[0] : ''
  458. this.queryParam.auditEndDate = date[1] ? date[1] : ''
  459. },
  460. searchForm () {
  461. this.$refs.table.refresh(true)
  462. this.$refs.table.clearSelected()
  463. },
  464. subareaChange (val) {
  465. this.queryParam.subareaArea.subareaSn = val[0] ? val[0] : undefined
  466. this.queryParam.subareaArea.subareaAreaSn = val[1] ? val[1] : undefined
  467. },
  468. // 重置
  469. resetSearchForm () {
  470. // 审核日期
  471. this.auditDate = [
  472. getDate.getCurrMonthDays().starttime,
  473. getDate.getCurrMonthDays().endtime
  474. ]
  475. this.$refs.rangeAuditDate.resetDate(this.auditDate)
  476. this.queryParam.auditBeginDate = getDate.getCurrMonthDays().starttime
  477. this.queryParam.auditEndDate = getDate.getCurrMonthDays().endtime
  478. // 收款日期
  479. this.receiptDate = []
  480. this.queryParam.receiptBeginDate = ''
  481. this.queryParam.receiptEndDate = ''
  482. this.$refs.receiptDate.resetDate(this.receiptDate)
  483. // 开票日期
  484. this.invoiceDate = []
  485. this.queryParam.invoiceBeginDate = ''
  486. this.queryParam.invoiceEndDate = ''
  487. if (this.advanced) {
  488. this.$refs.invoiceDate.resetDate(this.invoiceDate)
  489. }
  490. this.queryParam.bookNo = ''
  491. this.queryParam.dispatchBillNo = ''
  492. this.queryParam.applyPersonSn = undefined
  493. this.queryParam.kdMidCustomerFnumber = ''
  494. this.queryParam.payerName = undefined
  495. this.queryParam.payerAccountInfo = ''
  496. this.queryParam.fullPaymentFlag = undefined
  497. this.queryParam.bankName = undefined
  498. this.queryParam.bankAccount = undefined
  499. this.queryParam.subareaArea.subareaSn = undefined
  500. this.queryParam.subareaArea.subareaAreaSn = undefined
  501. this.queryParam.provinceSn = undefined
  502. this.queryParam.invoiceDateType = undefined
  503. this.queryParam.invoiceDate = ''
  504. this.queryParam.printStatus = undefined
  505. this.queryParam.invoiceStatus = undefined
  506. this.queryParam.payerType = undefined
  507. if (this.advanced) {
  508. this.$refs.subarea.clearData()
  509. }
  510. this.searchForm()
  511. },
  512. // 导出
  513. handleExport () {
  514. const _this = this
  515. _this.exportLoading = true
  516. _this.spinning = true
  517. _this.$store.state.app.curActionPermission = 'M_FC_Details_Export'
  518. hdExportExcel(financeBookDetailExport, _this.queryParam, '财务收款明细统计', function () {
  519. _this.exportLoading = false
  520. _this.spinning = false
  521. _this.$store.state.app.curActionPermission = ''
  522. })
  523. },
  524. pageInit () {
  525. const _this = this
  526. this.$nextTick(() => { // 页面渲染完成后的回调
  527. _this.setTableH()
  528. })
  529. },
  530. setTableH () {
  531. const tableSearchH = this.$refs.tableSearch.offsetHeight
  532. this.tableHeight = window.innerHeight - tableSearchH - 310
  533. },
  534. // 开票操作
  535. handleInvoice (con) {
  536. const obj = {
  537. no: con.bookNo,
  538. payerName: con.payerName,
  539. bookDetailSn: con.bookDetailSn,
  540. invoiceDate: con.invoiceDate,
  541. remarks: con.remarks ? con.remarks : ''
  542. }
  543. this.invoiceInfo = obj
  544. this.$nextTick(() => {
  545. this.invoiceIsShow = true
  546. })
  547. },
  548. // 修改备注
  549. handleNote (info) {
  550. const obj = {
  551. no: info.bookNo,
  552. payerName: info.payerName,
  553. bookDetailSn: info.bookDetailSn,
  554. remarks: info.remarks ? info.remarks : '',
  555. invoiceDate: info.invoiceDate
  556. }
  557. this.noteIsShow = true
  558. const _this = this
  559. _this.$nextTick(() => {
  560. _this.$refs.remarksModal.setData(JSON.stringify(obj))
  561. })
  562. },
  563. // 允许打印
  564. handlePrint (item) {
  565. const obj = {
  566. no: item.bookNo,
  567. payerName: item.payerName,
  568. id: item.id,
  569. printStatus: item.printStatus
  570. }
  571. this.printInfo = obj
  572. this.$nextTick(() => {
  573. this.printIsShow = true
  574. })
  575. }
  576. },
  577. watch: {
  578. advanced (newValue, oldValue) {
  579. const _this = this
  580. this.$nextTick(() => { // 页面渲染完成后的回调
  581. _this.setTableH()
  582. })
  583. },
  584. '$store.state.app.winHeight' (newValue, oldValue) { // 窗口变更时,需同时更改表格高度
  585. this.setTableH()
  586. }
  587. },
  588. mounted () {
  589. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  590. this.pageInit()
  591. this.resetSearchForm()
  592. }
  593. },
  594. activated () {
  595. // 如果是新页签打开,则重置当前页面
  596. if (this.$store.state.app.isNewTab) {
  597. this.pageInit()
  598. this.resetSearchForm()
  599. }
  600. // 仅刷新列表,不重置页面
  601. if (this.$store.state.app.updateList) {
  602. this.pageInit()
  603. this.$refs.table.refresh()
  604. }
  605. },
  606. beforeRouteEnter (to, from, next) {
  607. next(vm => {})
  608. }
  609. }
  610. </script>
  611. <style lang="less">
  612. .collectionDetail-wrap{
  613. .active{
  614. color: #ed1c24;
  615. cursor: pointer;
  616. }
  617. .common{
  618. color: rgba(0, 0, 0);
  619. }
  620. }
  621. </style>