list.vue 27 KB

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