standbook_list.vue 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. <template>
  2. <div class="app-container">
  3. <div class="sty" v-if="isShow">
  4. <el-page-header @back="goBack"> </el-page-header>
  5. <br /><br />
  6. </div>
  7. <!-- <span v-else>台账</span>
  8. <el-divider></el-divider> -->
  9. <!-- <el-radio-group v-model="mainId" size="">
  10. <el-radio-button
  11. v-for="(v, i) in dictList"
  12. :key="i"
  13. :label="v.dictCode"
  14. >{{ v.dictValue }}</el-radio-button
  15. >
  16. </el-radio-group>
  17. <br /><br /> -->
  18. <h1></h1>
  19. <!-- 筛选条件 -->
  20. <div class="screen-container">
  21. <Collapse :screen-form="searchForm">
  22. <template #right_btn>
  23. <el-button size="mini" @click="resetFn">清空</el-button>
  24. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  25. </template>
  26. <template #left_btn>
  27. <el-radio-group v-model="bill" @change="checkFn" size="mini">
  28. <el-radio-button label="COMMONLY">货款台账</el-radio-button>
  29. <el-radio-button label="REBATE">返利台账</el-radio-button>
  30. </el-radio-group>
  31. </template>
  32. <template #search>
  33. <el-form ref="searchForm" :model="searchForm" label-width="120px" size="mini" label-position="left">
  34. <el-row :gutter="20">
  35. <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="经销商名称" prop="customerId">
  37. <el-select
  38. :disabled="isDisabled"
  39. class="selectStyle"
  40. v-model="searchForm.customerId"
  41. placeholder="请选择"
  42. filterable
  43. size="mini"
  44. @change="changeFn"
  45. >
  46. <el-option v-for="(v, i) in customerList" :key="i" :label="v.name" :value="v.id"> </el-option>
  47. </el-select>
  48. </el-form-item>
  49. </el-col>
  50. <el-col :xs="24" :sm="12" :lg="6">
  51. <el-form-item :label="bill === 'COMMONLY' ? '钱包类型' : '返利类型'" prop="customerWalletId">
  52. <el-select
  53. class="selectStyle"
  54. v-model="searchForm.customerWalletId"
  55. placeholder="请选择"
  56. filterable
  57. size="mini"
  58. >
  59. <el-option
  60. v-for="(v, i) in walletList"
  61. :key="i"
  62. :label="v.customerWalletName"
  63. :value="v.customerWalletId"
  64. >
  65. </el-option>
  66. </el-select>
  67. </el-form-item>
  68. </el-col>
  69. <el-col :xs="24" :sm="12" :lg="6">
  70. <el-form-item label="单据号" prop="billNo">
  71. <el-input v-model="searchForm.billNo" placeholder="请输入"></el-input>
  72. </el-form-item>
  73. </el-col>
  74. <el-col :xs="24" :sm="12" :lg="6">
  75. <el-form-item label="工程登录编号" prop="enginRecordNo">
  76. <el-input v-model="searchForm.enginRecordNo" placeholder="请输入"></el-input>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :xs="24" :sm="12" :lg="6">
  80. <el-form-item label="开始时间" prop="startTime">
  81. <el-date-picker
  82. class="selectStyle"
  83. v-model="searchForm.startTime"
  84. type="date"
  85. placeholder="选择日期时间"
  86. value-format="yyyy-MM-dd"
  87. size="mini"
  88. >
  89. </el-date-picker>
  90. </el-form-item>
  91. </el-col>
  92. <el-col :xs="24" :sm="12" :lg="6">
  93. <el-form-item label="结束时间" prop="endTime">
  94. <el-date-picker
  95. class="selectStyle"
  96. v-model="searchForm.endTime"
  97. type="date"
  98. placeholder="选择日期时间"
  99. value-format="yyyy-MM-dd"
  100. size="mini"
  101. >
  102. </el-date-picker>
  103. </el-form-item>
  104. </el-col>
  105. <el-col :xs="24" :sm="12" :lg="6">
  106. <el-form-item label="经销商编码" prop="customerNumber">
  107. <el-input v-model="searchForm.customerNumber" placeholder="请输入经销商编码"></el-input>
  108. </el-form-item>
  109. </el-col>
  110. <el-col :xs="24" :sm="12" :lg="6">
  111. <el-form-item label="单据类型" prop="billType">
  112. <el-select
  113. class="selectStyle"
  114. v-model="searchForm.billType"
  115. placeholder="请选择"
  116. filterable
  117. size="mini"
  118. >
  119. <el-option v-for="(v, i) in typeList" :key="i" :label="v" :value="v"></el-option>
  120. </el-select>
  121. </el-form-item>
  122. </el-col>
  123. <el-col :xs="24" :sm="12" :lg="6">
  124. <el-form-item label="摘要" prop="remark">
  125. <el-input v-model="searchForm.remark" placeholder="请输入摘要"> </el-input>
  126. </el-form-item>
  127. </el-col>
  128. </el-row>
  129. </el-form>
  130. </template>
  131. </Collapse>
  132. </div>
  133. <!-- 按钮 -->
  134. <div class="btn-group clearfix">
  135. <div class="fr">
  136. <ExportButton :exUrl="'finance/standing/book/export'" :exParams="exParams" />
  137. </div>
  138. </div>
  139. <div v-show="bill == 'COMMONLY'">
  140. <ul class="ulStyle">
  141. <li>
  142. 预付货款:<span>{{ amountList.preCount }}</span>
  143. </li>
  144. <li>
  145. 订单占款:<span>{{ amountList.orderCOunt }}</span>
  146. </li>
  147. <li>
  148. 支付货款:<span>{{ amountList.payCount }}</span>
  149. </li>
  150. <li>
  151. 押金:<span>{{ amountList.orderDate }}</span>
  152. </li>
  153. <li>
  154. 工程保证金:<span>{{ amountList.projectCount }}</span>
  155. </li>
  156. <li>
  157. 其他暂扣款:<span>{{ amountList.otherCount }}</span>
  158. </li>
  159. <li>
  160. 余额:<span>{{ amountList.totalBalanceAmount }}</span>
  161. </li>
  162. </ul>
  163. <!-- 列表 -->
  164. <div class="mymain-container">
  165. <div class="table">
  166. <el-table
  167. v-if="dataList.length"
  168. v-loading="listLoading"
  169. :data="dataList"
  170. element-loading-text="Loading"
  171. border
  172. fit
  173. highlight-current-row
  174. stripe
  175. show-summary
  176. :summary-method="getSummaries"
  177. height="620px"
  178. >
  179. <el-table-column
  180. label="序号"
  181. fixed="left"
  182. align="left"
  183. width="50"
  184. type="index"
  185. show-overflow-tooltip
  186. ></el-table-column>
  187. <el-table-column align="left" label="客户编码" prop="customerCode" min-width="160" show-overflow-tooltip>
  188. <template slot-scope="scope">
  189. <CopyButton :copyText="scope.row.customerCode" />
  190. <span>{{ scope.row.customerCode }}</span>
  191. </template>
  192. </el-table-column>
  193. <el-table-column align="left" label="客户名称" prop="customerName" min-width="260" show-overflow-tooltip>
  194. <template slot-scope="scope">
  195. <CopyButton :copyText="scope.row.customerName" />
  196. <span>{{ scope.row.customerName }}</span>
  197. </template>
  198. </el-table-column>
  199. <el-table-column
  200. align="left"
  201. label="单据日期"
  202. prop="theTime"
  203. min-width="160"
  204. fixed="left"
  205. show-overflow-tooltip
  206. ></el-table-column>
  207. <el-table-column
  208. align="left"
  209. label="单据类型"
  210. prop="billType"
  211. fixed="left"
  212. min-width="100"
  213. show-overflow-tooltip
  214. ></el-table-column>
  215. <el-table-column
  216. align="left"
  217. fixed="left"
  218. label="单据号"
  219. prop="billNo"
  220. min-width="150"
  221. show-overflow-tooltip
  222. >
  223. <template slot-scope="scope">
  224. <CopyButton :copyText="scope.row.billNo" />
  225. <span>{{ scope.row.billNo }}</span>
  226. </template>
  227. </el-table-column>
  228. <el-table-column
  229. align="left"
  230. fixed="left"
  231. label="工程登录编号"
  232. prop="enginRecordNo"
  233. min-width="150"
  234. show-overflow-tooltip
  235. >
  236. <template slot-scope="scope">
  237. <CopyButton :copyText="scope.row.enginRecordNo" />
  238. <span>{{ scope.row.enginRecordNo }}</span>
  239. </template>
  240. </el-table-column>
  241. <el-table-column
  242. align="left"
  243. label="钱包"
  244. prop="walletName"
  245. fixed="left"
  246. min-width="100"
  247. show-overflow-tooltip
  248. ></el-table-column>
  249. <el-table-column
  250. align="left"
  251. label="操作时间"
  252. prop="createTime"
  253. min-width="160"
  254. show-overflow-tooltip
  255. ></el-table-column>
  256. <el-table-column
  257. align="left"
  258. label="摘要"
  259. prop="remark"
  260. min-width="100"
  261. show-overflow-tooltip
  262. ></el-table-column>
  263. <el-table-column align="right" label="预付货款" prop="flag" min-width="120" show-overflow-tooltip>
  264. <template slot-scope="scope">
  265. {{
  266. scope.row.flag == 1
  267. ? scope.row.amountType == 'IN'
  268. ? scope.row.amount
  269. : scope.row.amountType == 'OUT'
  270. ? -scope.row.amount
  271. : ''
  272. : '-' | numToFixed
  273. }}
  274. </template>
  275. </el-table-column>
  276. <el-table-column align="right" label="订单占款" prop="flag" min-width="120" show-overflow-tooltip>
  277. <template slot-scope="scope">
  278. {{
  279. scope.row.flag == 2
  280. ? scope.row.amountType == 'IN'
  281. ? scope.row.amount
  282. : scope.row.amountType == 'OUT'
  283. ? -scope.row.amount
  284. : ''
  285. : '-' | numToFixed
  286. }}
  287. </template>
  288. </el-table-column>
  289. <el-table-column align="right" label="支付货款" prop="flag" min-width="120" show-overflow-tooltip>
  290. <template slot-scope="scope">
  291. {{
  292. scope.row.flag == 3
  293. ? scope.row.amountType == 'IN'
  294. ? scope.row.amount
  295. : scope.row.amountType == 'OUT'
  296. ? -scope.row.amount
  297. : ''
  298. : '-' | numToFixed
  299. }}
  300. </template>
  301. </el-table-column>
  302. <el-table-column align="right" label="押金" prop="flag" min-width="120" show-overflow-tooltip>
  303. <template slot-scope="scope">
  304. {{
  305. scope.row.flag == 4
  306. ? scope.row.amountType == 'IN'
  307. ? scope.row.amount
  308. : scope.row.amountType == 'OUT'
  309. ? -scope.row.amount
  310. : ''
  311. : '-' | numToFixed
  312. }}
  313. </template>
  314. </el-table-column>
  315. <el-table-column align="right" label="工程保证金" prop="flag" min-width="120" show-overflow-tooltip>
  316. <template slot-scope="scope">
  317. {{
  318. scope.row.flag == 5
  319. ? scope.row.amountType == 'IN'
  320. ? scope.row.amount
  321. : scope.row.amountType == 'OUT'
  322. ? -scope.row.amount
  323. : ''
  324. : '-' | numToFixed
  325. }}
  326. </template>
  327. </el-table-column>
  328. <el-table-column align="right" label="其他暂扣款" prop="flag" min-width="120" show-overflow-tooltip>
  329. <template slot-scope="scope">
  330. {{
  331. scope.row.flag == 6
  332. ? scope.row.amountType == 'IN'
  333. ? scope.row.amount
  334. : scope.row.amountType == 'OUT'
  335. ? -scope.row.amount
  336. : ''
  337. : '-' | numToFixed
  338. }}
  339. </template>
  340. </el-table-column>
  341. <el-table-column align="right" label="账户余额" prop="balanceAmount" min-width="120" show-overflow-tooltip>
  342. <template slot-scope="scope">
  343. {{ scope.row.balanceAmount | numToFixed }}
  344. </template>
  345. </el-table-column>
  346. </el-table>
  347. </div>
  348. <!-- 分页
  349. <div class="fr">
  350. <el-pagination
  351. @size-change="handleSizeChange"
  352. @current-change="handleCurrentChange"
  353. :current-page="currentPage"
  354. :page-sizes="[10, 20, 30, 50, 500]"
  355. :page-size="10"
  356. layout="total, sizes, prev, pager, next, jumper"
  357. :total="listTotal"
  358. >
  359. </el-pagination>
  360. </div> -->
  361. </div>
  362. </div>
  363. <div v-show="bill == 'REBATE'">
  364. <ul class="ulStyle">
  365. <li>
  366. 返利支出:<span>{{ amountList.outCount }}</span>
  367. </li>
  368. <li>
  369. 返利收入:<span>{{ amountList.inCount }}</span>
  370. </li>
  371. </ul>
  372. <!-- 列表 -->
  373. <div class="mymain-container">
  374. <div class="table">
  375. <el-table
  376. v-if="dataList.length"
  377. v-loading="listLoading"
  378. :data="dataList"
  379. element-loading-text="Loading"
  380. border
  381. fit
  382. highlight-current-row
  383. stripe
  384. show-summary
  385. :summary-method="getSummaries2"
  386. height="620px"
  387. >
  388. <el-table-column label="序号" align="left" width="50" type="index" show-overflow-tooltip></el-table-column>
  389. <el-table-column align="left" label="客户编码" prop="customerCode" min-width="160" show-overflow-tooltip>
  390. <template slot-scope="scope">
  391. <CopyButton :copyText="scope.row.customerCode" />
  392. <span>{{ scope.row.customerCode }}</span>
  393. </template>
  394. </el-table-column>
  395. <el-table-column align="left" label="客户名称" prop="customerName" min-width="260" show-overflow-tooltip>
  396. <template slot-scope="scope">
  397. <CopyButton :copyText="scope.row.customerName" />
  398. <span>{{ scope.row.customerName }}</span>
  399. </template>
  400. </el-table-column>
  401. <el-table-column
  402. align="left"
  403. label="单据日期"
  404. prop="theTime"
  405. min-width="160"
  406. show-overflow-tooltip
  407. ></el-table-column>
  408. <el-table-column
  409. align="left"
  410. label="审核日期"
  411. prop="examineTime"
  412. min-width="160"
  413. show-overflow-tooltip
  414. ></el-table-column>
  415. <el-table-column align="left" label="单据类型" prop="billType" min-width="160" show-overflow-tooltip>
  416. <template slot-scope="scope">
  417. {{ scope.row.billType == 3 ? '付款单' : scope.row.billType }}
  418. </template>
  419. </el-table-column>
  420. <el-table-column align="left" label="单据号" prop="billNo" min-width="160" show-overflow-tooltip>
  421. <template slot-scope="scope">
  422. <CopyButton :copyText="scope.row.billNo" />
  423. <span>{{ scope.row.billNo }}</span>
  424. </template>
  425. </el-table-column>
  426. <el-table-column
  427. align="left"
  428. label="返利类型"
  429. prop="walletName"
  430. min-width="100"
  431. show-overflow-tooltip
  432. ></el-table-column>
  433. <el-table-column
  434. align="left"
  435. label="操作时间"
  436. prop="createTime"
  437. min-width="160"
  438. show-overflow-tooltip
  439. ></el-table-column>
  440. <el-table-column
  441. align="left"
  442. label="摘要"
  443. prop="remark"
  444. min-width="100"
  445. show-overflow-tooltip
  446. ></el-table-column>
  447. <el-table-column align="right" label="收入" prop="amountType" min-width="120" show-overflow-tooltip>
  448. <template slot-scope="scope">
  449. {{ scope.row.amountType == 'IN' ? scope.row.amount : '-' | numToFixed }}
  450. </template>
  451. </el-table-column>
  452. <el-table-column align="right" label="支出" prop="amountType" min-width="120" show-overflow-tooltip>
  453. <template slot-scope="scope">
  454. {{ scope.row.amountType == 'OUT' ? scope.row.amount : '-' | numToFixed }}
  455. </template>
  456. </el-table-column>
  457. <el-table-column
  458. align="right"
  459. label="折让金额"
  460. prop="allowanceAmount"
  461. min-width="120"
  462. show-overflow-tooltip
  463. >
  464. <template slot-scope="scope">
  465. {{ scope.row.allowanceAmount | numToFixed }}
  466. </template>
  467. </el-table-column>
  468. <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="120" show-overflow-tooltip>
  469. <template slot-scope="scope">
  470. {{ scope.row.withholdAmount | numToFixed }}
  471. </template>
  472. </el-table-column>
  473. <el-table-column align="right" label="结存" prop="balanceAmount" min-width="120" show-overflow-tooltip>
  474. <template slot-scope="scope">
  475. {{ scope.row.balanceAmount | numToFixed }}
  476. </template>
  477. </el-table-column>
  478. </el-table>
  479. </div>
  480. <!-- 分页 -->
  481. <!-- <div class="fr">
  482. <el-pagination
  483. @size-change="handleSizeChange"
  484. @current-change="handleCurrentChange"
  485. :current-page="currentPage"
  486. :page-sizes="[10, 20, 30, 50, 500]"
  487. :page-size="10"
  488. layout="total, sizes, prev, pager, next, jumper"
  489. :total="listTotal"
  490. >
  491. </el-pagination>
  492. </div> -->
  493. </div>
  494. </div>
  495. <!-- 分页 -->
  496. <div class="fr">
  497. <el-pagination
  498. @size-change="handleSizeChange"
  499. @current-change="handleCurrentChange"
  500. :current-page="currentPage"
  501. :page-sizes="[10, 20, 30, 50, 500]"
  502. :page-size="pageSize"
  503. layout="total, sizes, prev, pager, next, jumper"
  504. :total="listTotal"
  505. >
  506. </el-pagination>
  507. </div>
  508. </div>
  509. </template>
  510. <script>
  511. // import { mapGetters } from "vuex";
  512. import { getWalletCustomerList } from '@/api/finance/change_apply'
  513. import { getAmountCount, getCustomerList, getStandbookList } from '@/api/finance/standbook_list'
  514. import { numToFixed } from '@/filters'
  515. // import sticky from '@/utils/table-sticky'
  516. export default {
  517. // mixins: [sticky],
  518. data() {
  519. return {
  520. isShow: false,
  521. amountList: {},
  522. customerList: [],
  523. currentPage: 1, // 当前页码
  524. pageSize: 10, // 每页数量
  525. listTotal: 0, // 列表总数
  526. // dataListRebate: [], // 列表数据
  527. // dataListLoan: [], // 列表数据
  528. dataList: [],
  529. isCollapse: true,
  530. walletList: [],
  531. parent: 'mymain-container',
  532. // dictList: [],
  533. customerName: '',
  534. customerNumber: '',
  535. searchForm: {
  536. customerId: '',
  537. customerWalletId: '',
  538. billNo: '',
  539. startTime: '',
  540. endTime: '',
  541. customerNumber: '',
  542. billType: '',
  543. remark: '',
  544. enginRecordNo: ''
  545. }, //搜索表单
  546. listLoading: false, // 列表加载loading
  547. bill: 'COMMONLY',
  548. isCustomer: JSON.parse(localStorage.getItem('supply_user')).isCustomer,
  549. isDisabled: false,
  550. isCustomerList: {
  551. customerId: JSON.parse(localStorage.getItem('supply_user')).customerId,
  552. customerName: JSON.parse(localStorage.getItem('supply_user')).customerName,
  553. customerNumber: JSON.parse(localStorage.getItem('supply_user')).customerNumber
  554. },
  555. typeList: [
  556. '收款单',
  557. '退款单',
  558. '返利单',
  559. '零售单扣款',
  560. '申请发货单',
  561. '零售订单退款',
  562. '退货单退单',
  563. '家用工程订单扣款-审批',
  564. '家用工程订单押金',
  565. '家用工程订单退押金',
  566. '家用工程订单返利退款-退订',
  567. '零售单返利扣款',
  568. '零售单返利退款',
  569. '直接调拨单销售退库单订单返利退款-退货单',
  570. '直接调拨单销售退库单订单退款-退货单',
  571. '商用工程订单扣款-审批',
  572. '商用工程订单返利扣款-审批',
  573. '商用工程申请发货订单返利退款-退货单',
  574. '商用工程发货申请发货订单退款-退货单',
  575. '商用工程销售退库单单返利退款-退货单',
  576. '商用工程发货销售退库单订单退款-退货单',
  577. '家用工程订单退款-弃审',
  578. '家用工程订单返利扣款-审批',
  579. '家用工程订单返利退款-弃审'
  580. ]
  581. }
  582. },
  583. computed: {
  584. exParams() {
  585. // return {
  586. // type: this.bill,
  587. // };
  588. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  589. return {
  590. ...this.searchForm,
  591. pageSize: this.pageSize,
  592. pageNum: this.currentPage,
  593. type: this.bill,
  594. customerNumber: this.$route.query.customerNumber,
  595. enginRecordNo: this.searchForm.enginRecordNo
  596. }
  597. } else if (this.isCustomer) {
  598. return {
  599. ...this.searchForm,
  600. pageSize: this.pageSize,
  601. pageNum: this.currentPage,
  602. type: this.bill,
  603. customerNumber: this.$store.state.user.customerNumber,
  604. enginRecordNo: this.searchForm.enginRecordNo
  605. }
  606. } else {
  607. return {
  608. ...this.searchForm,
  609. pageSize: this.pageSize,
  610. pageNum: this.currentPage,
  611. type: this.bill,
  612. customerNumber: this.customerNumber || this.searchForm.customerNumber,
  613. enginRecordNo: this.searchForm.enginRecordNo
  614. }
  615. }
  616. }
  617. },
  618. beforeRouteEnter(to, from, next) {
  619. // console.log(to, from, next, 898);
  620. next(async vm => {
  621. // 这个时候组件还没有创建,所以要通过vm来访问
  622. // console.log(vm);
  623. vm.getCustomerDataList()
  624. if (from.path == '/finance/balance_sum' && to.path == '/finance/standbook_list' && vm.$route.query.customerId) {
  625. //只有是从A进到B页面才执行
  626. // 将要执行的逻辑
  627. vm.isShow = true
  628. vm.isDisabled = true
  629. vm.searchForm.customerId = vm.$route.query.customerId
  630. vm.searchForm.customerNumber = vm.$route.query.customerNumber
  631. vm.changeFn(vm.$route.query.customerId)
  632. vm.getDataList({
  633. pageSize: vm.pageSize,
  634. pageNum: vm.currentPage,
  635. type: vm.bill,
  636. // customerName: vm.$route.query.customerName,
  637. customerNumber: vm.$route.query.customerNumber
  638. })
  639. vm.getAmountList({
  640. type: vm.bill,
  641. customerName: vm.$route.query.customerName,
  642. customerNumber: vm.$route.query.customerNumber
  643. })
  644. } else if (vm.isCustomer) {
  645. vm.isShow = false
  646. vm.isDisabled = true
  647. vm.searchForm.customerId = vm.$store.state.user.customerId
  648. vm.changeFn(vm.$store.state.user.customerId)
  649. vm.searchForm.customerId = vm.isCustomerList.customerId
  650. vm.searchForm.customerNumber = vm.isCustomerList.customerNumber
  651. vm.getDataList({
  652. pageSize: vm.pageSize,
  653. pageNum: vm.currentPage,
  654. type: vm.bill,
  655. customerId: vm.searchForm.customerId,
  656. customerNumber: vm.searchForm.customerNumber
  657. })
  658. vm.getAmountList({
  659. type: vm.bill,
  660. ...vm.isCustomerList
  661. })
  662. } else if (vm.$route.query && vm.$route.query.status) {
  663. vm.bill = vm.$route.query.status
  664. vm.isShow = true
  665. vm.isDisabled = true
  666. vm.searchForm.customerId = vm.$route.query.customerId
  667. vm.searchForm.customerNumber = vm.$route.query.customerNumber
  668. vm.changeFn(vm.$route.query.customerId)
  669. vm.getDataList({
  670. pageSize: vm.pageSize,
  671. pageNum: vm.currentPage,
  672. type: vm.bill,
  673. // customerName: this.$route.query.customerName,
  674. customerNumber: vm.$route.query.customerNumber
  675. })
  676. vm.getAmountList({
  677. type: vm.bill,
  678. customerName: vm.$route.query.customerName,
  679. customerNumber: vm.$route.query.customerNumber
  680. })
  681. } else {
  682. vm.isShow = false
  683. vm.searchForm.customerId = ''
  684. vm.isDisabled = false
  685. vm.getDataList()
  686. vm.getCustomerDataList()
  687. vm.getAmountList({
  688. type: vm.bill
  689. })
  690. }
  691. })
  692. },
  693. // activated() {
  694. // // 钱包余额页跳转过来
  695. // if (this.$route.query && this.$route.query.status){
  696. // this.bill = this.$route.query.status
  697. // this.changeFn(this.bill)
  698. // //只有是从A进到B页面才执行
  699. // // 将要执行的逻辑
  700. // this.isShow = true;
  701. // this.isDisabled = true;
  702. // this.searchForm.customerId = this.$route.query.customerId;
  703. // this.changeFn(this.$route.query.customerId);
  704. // this.getDataList({
  705. // pageSize: this.pageSize,
  706. // pageNum: this.currentPage,
  707. // type: this.bill,
  708. // customerName: this.$route.query.customerName,
  709. // customerNumber: this.$route.query.customerNumber,
  710. // });
  711. // this.getAmountList({
  712. // type: this.bill,
  713. // customerName: this.$route.query.customerName,
  714. // customerNumber: this.$route.query.customerNumber,
  715. // });
  716. // }
  717. // },
  718. created() {
  719. // if (this.$route.query && this.$route.query.status) {
  720. // this.bill = this.$route.query.status;
  721. // this.changeFn(this.bill);
  722. // //只有是从A进到B页面才执行
  723. // // 将要执行的逻辑
  724. // this.isShow = true;
  725. // this.isDisabled = true;
  726. // this.searchForm.customerId = this.$route.query.customerId;
  727. // this.searchForm.customerNumber = this.$route.query.customerNumber;
  728. // this.changeFn(this.$route.query.customerId);
  729. // this.getDataList({
  730. // pageSize: this.pageSize,
  731. // pageNum: this.currentPage,
  732. // type: this.bill,
  733. // // customerName: this.$route.query.customerName,
  734. // customerNumber: this.$route.query.customerNumber,
  735. // });
  736. // this.getAmountList({
  737. // type: this.bill,
  738. // customerName: this.$route.query.customerName,
  739. // customerNumber: this.$route.query.customerNumber,
  740. // });
  741. // }
  742. // console.log(
  743. // this.customerId,
  744. // this.$store.state.user.customerName,
  745. // this.$store.state.user.customerNumber,
  746. // 777777
  747. // );
  748. // if (this.$route.query.customerName && this.$route.query.customerNumber) {
  749. // this.isDisabled = true;
  750. // this.searchForm.customerId = this.$route.query.customerName;
  751. // this.changeFn(this.$route.query.customerId);
  752. // this.getDataList({
  753. // pageSize: this.pageSize,
  754. // pageNum: this.currentPage,
  755. // type: this.bill,
  756. // customerName: this.$route.query.customerName,
  757. // customerNumber: this.$route.query.customerNumber,
  758. // });
  759. // } else
  760. // if (this.isCustomer) {
  761. // this.isDisabled = true;
  762. // this.searchForm.customerId = this.$store.state.user.customerName;
  763. // this.changeFn(this.$store.state.user.customerId);
  764. // this.getDataList({
  765. // pageSize: this.pageSize,
  766. // pageNum: this.currentPage,
  767. // type: this.bill,
  768. // customerName: this.$store.state.user.customerName,
  769. // customerNumber: this.$store.state.user.customerNumber,
  770. // });
  771. // } else {
  772. // this.getDataList({
  773. // pageSize: this.pageSize,
  774. // pageNum: this.currentPage,
  775. // type: this.bill,
  776. // });
  777. // this.getCustomerDataList();
  778. // }
  779. // this.getCustomerDataList();
  780. // this.getWalletList();
  781. // this.getDataDict();
  782. },
  783. methods: {
  784. goBack() {
  785. this.$router.go(-1)
  786. this.$store.dispatch('tagsView/delView', this.$route)
  787. },
  788. //
  789. computedFn(data, i, sums, index) {
  790. let map1 = data.map(v => {
  791. if (v.flag == i && v.amountType == 'IN') {
  792. return v.amount
  793. }
  794. if (v.flag == i && v.amountType == 'OUT') {
  795. return -v.amount
  796. }
  797. })
  798. let sum1 = map1.reduce((prev, curr) => {
  799. const value = Number(curr)
  800. if (!isNaN(value)) {
  801. return prev + curr
  802. } else {
  803. return prev
  804. }
  805. }, 0)
  806. let sum = numToFixed(sum1)
  807. return sum
  808. },
  809. //合计
  810. //返利台账列表合计
  811. getSummaries2(param) {
  812. const { columns, data } = param
  813. const sums = []
  814. columns.forEach((column, index) => {
  815. if (index === 0) {
  816. sums[index] = '合计'
  817. }
  818. if (index === 10) {
  819. let map1 = data.map(v => {
  820. if (v.amountType == 'IN') {
  821. return v.amount
  822. }
  823. })
  824. let a = map1.reduce((prev, curr) => {
  825. const value = Number(curr)
  826. if (!isNaN(value)) {
  827. return prev + curr
  828. } else {
  829. return prev
  830. }
  831. }, 0)
  832. sums[index] = numToFixed(a)
  833. }
  834. if (index === 11) {
  835. let map1 = data.map(v => {
  836. if (v.amountType == 'OUT') {
  837. return v.amount
  838. }
  839. })
  840. let a = map1.reduce((prev, curr) => {
  841. const value = Number(curr)
  842. if (!isNaN(value)) {
  843. return prev + curr
  844. } else {
  845. return prev
  846. }
  847. }, 0)
  848. sums[index] = numToFixed(a)
  849. }
  850. if (index === 12) {
  851. let map1 = data.map(v => {
  852. return v.allowanceAmount
  853. })
  854. let a = map1.reduce((prev, curr) => {
  855. const value = Number(curr)
  856. if (!isNaN(value)) {
  857. return prev + curr
  858. } else {
  859. return prev
  860. }
  861. }, 0)
  862. sums[index] = numToFixed(a)
  863. }
  864. if (index === 13) {
  865. let map1 = data.map(v => {
  866. return v.withholdAmount
  867. })
  868. let a = map1.reduce((prev, curr) => {
  869. const value = Number(curr)
  870. if (!isNaN(value)) {
  871. return prev + curr
  872. } else {
  873. return prev
  874. }
  875. }, 0)
  876. sums[index] = numToFixed(a)
  877. }
  878. if (index === 14) {
  879. let map1 = data.map(v => {
  880. return v.balanceAmount
  881. })
  882. let a = map1.reduce((prev, curr) => {
  883. const value = Number(curr)
  884. if (!isNaN(value)) {
  885. return prev + curr
  886. } else {
  887. return prev
  888. }
  889. }, 0)
  890. sums[index] = numToFixed(a)
  891. }
  892. })
  893. return sums
  894. },
  895. //货款台账列表合计
  896. getSummaries(param) {
  897. const { columns, data } = param
  898. const sums = []
  899. columns.forEach((column, index) => {
  900. if (index === 0) {
  901. sums[index] = '合计'
  902. }
  903. if (index === 10) {
  904. sums[index] = this.computedFn(data, 1)
  905. }
  906. if (index === 11) {
  907. sums[index] = this.computedFn(data, 2)
  908. }
  909. if (index === 12) {
  910. sums[index] = this.computedFn(data, 3)
  911. }
  912. if (index === 13) {
  913. sums[index] = this.computedFn(data, 4)
  914. }
  915. if (index === 14) {
  916. sums[index] = this.computedFn(data, 5)
  917. }
  918. if (index === 15) {
  919. sums[index] = this.computedFn(data, 6)
  920. }
  921. // if (index === 13) {
  922. // let map2 = data.map((v) => {
  923. // return v.balanceAmount;
  924. // });
  925. // let aa = map2.reduce((prev, curr) => {
  926. // const value = Number(curr);
  927. // if (!isNaN(value)) {
  928. // return prev + curr;
  929. // } else {
  930. // return prev;
  931. // }`
  932. // }, 0);
  933. // sums[index] = numToFixed(aa);
  934. // }
  935. })
  936. return sums
  937. },
  938. //获取汇总总数
  939. async getAmountList(data) {
  940. let res = await getAmountCount(data)
  941. if (res.data) {
  942. this.amountList = res.data
  943. } else {
  944. this.amountList = {
  945. inCount: 0,
  946. orderCOunt: 0,
  947. orderDate: 0,
  948. otherCount: 0,
  949. outCount: 0,
  950. payCount: 0,
  951. preCount: 0,
  952. projectCount: 0,
  953. totalBalanceAmount: 0
  954. }
  955. }
  956. },
  957. //改变经销商
  958. async changeFn(v) {
  959. this.searchForm.customerWalletId = ''
  960. let res = await getWalletCustomerList({
  961. customerId: v,
  962. type: this.bill,
  963. hasRecord: true
  964. })
  965. this.walletList = res.data
  966. },
  967. //获取经销商列表
  968. async getCustomerDataList() {
  969. let res = await getCustomerList({
  970. pageNum: 1,
  971. pageSize: -1
  972. })
  973. this.customerList = res.data.records
  974. },
  975. // 更改每页数量
  976. handleSizeChange(val) {
  977. this.pageSize = val
  978. this.currentPage = 1
  979. // this.getDataList({
  980. // type: this.bill,
  981. // pageNum: this.currentPage,
  982. // pageSize: this.pageSize,
  983. // });
  984. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  985. // this.getDataList({
  986. // ...this.searchForm,
  987. // pageSize: this.pageSize,
  988. // pageNum: this.currentPage,
  989. // type: this.bill,
  990. // customerName: this.$route.query.customerName,
  991. // customerNumber: this.$route.query.customerNumber,
  992. // });
  993. this.getDataList()
  994. } else if (this.isCustomer) {
  995. // this.getDataList({
  996. // ...this.searchForm,
  997. // pageSize: this.pageSize,
  998. // pageNum: this.currentPage,
  999. // type: this.bill,
  1000. // ...this.isCustomerList,
  1001. // });
  1002. this.getDataList()
  1003. } else {
  1004. // this.getDataList({
  1005. // ...this.searchForm,
  1006. // pageSize: this.pageSize,
  1007. // pageNum: this.currentPage,
  1008. // type: this.bill,
  1009. // customerName: this.customerName,
  1010. // customerNumber: this.customerNumber,
  1011. // });
  1012. this.getDataList()
  1013. }
  1014. },
  1015. // 更改当前页
  1016. handleCurrentChange(val) {
  1017. this.currentPage = val
  1018. // this.getDataList({
  1019. // type: this.bill,
  1020. // pageNum: this.currentPage,
  1021. // pageSize: this.pageSize,
  1022. // });
  1023. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  1024. // this.getDataList({
  1025. // ...this.searchForm,
  1026. // pageSize: this.pageSize,
  1027. // pageNum: this.currentPage,
  1028. // type: this.bill,
  1029. // customerName: this.$route.query.customerName,
  1030. // customerNumber: this.$route.query.customerNumber,
  1031. // });
  1032. this.getDataList()
  1033. } else if (this.isCustomer) {
  1034. // this.getDataList({
  1035. // ...this.searchForm,
  1036. // pageSize: this.pageSize,
  1037. // pageNum: this.currentPage,
  1038. // type: this.bill,
  1039. // ...this.isCustomerList,
  1040. // });
  1041. this.getDataList()
  1042. } else {
  1043. // this.getDataList({
  1044. // ...this.searchForm,
  1045. // pageSize: this.pageSize,
  1046. // pageNum: this.currentPage,
  1047. // type: this.bill,
  1048. // customerName: this.customerName,
  1049. // customerNumber: this.customerNumber,
  1050. // });
  1051. this.getDataList()
  1052. }
  1053. },
  1054. // //获取品类
  1055. // async getDataDict() {
  1056. // const res = await getDictList({ sysDictEnum: "PRODUCT_TYPE" });
  1057. // console.log(res);
  1058. // this.dictList = res.data;
  1059. // },
  1060. //重置
  1061. async resetFn() {
  1062. // this.searchForm.customerId = "";
  1063. // this.walletList = [];
  1064. // this.customerName = "";
  1065. // this.customerNumber = "";
  1066. if (this.isCustomer) {
  1067. await this.$refs.searchForm.resetFields()
  1068. this.searchForm.customerId = this.$store.state.user.customerId
  1069. } else if (this.$route.query.customerId) {
  1070. this.searchForm.customerId = this.$route.query.customerId
  1071. } else {
  1072. this.walletList = []
  1073. this.customerName = ''
  1074. this.customerNumber = ''
  1075. await this.$refs.searchForm.resetFields()
  1076. }
  1077. },
  1078. //查询
  1079. searchFn() {
  1080. this.currentPage = 1
  1081. this.pageSize = 10
  1082. // this.customerName = null;
  1083. // this.customerNumber = null;
  1084. let res = this.customerList.filter(v => {
  1085. return v.id == this.searchForm.customerId
  1086. })
  1087. // return;
  1088. if (res.length > 0) {
  1089. this.customerName = res[0].name
  1090. this.customerNumber = res[0].number
  1091. this.searchForm.customerNumber = res[0].number
  1092. }
  1093. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  1094. // this.getDataList({
  1095. // ...this.searchForm,
  1096. // pageSize: this.pageSize,
  1097. // pageNum: this.currentPage,
  1098. // type: this.bill,
  1099. // // customerName: this.$route.query.customerName,
  1100. // customerNumber:
  1101. // this.$route.query.customerNumber || this.searchForm.customerNumber,
  1102. // });
  1103. this.getDataList()
  1104. this.getAmountList({
  1105. ...this.searchForm,
  1106. type: this.bill,
  1107. // customerName: this.$route.query.customerName,
  1108. customerNumber: this.$route.query.customerNumber
  1109. })
  1110. } else if (this.isCustomer) {
  1111. // this.getDataList({
  1112. // ...this.searchForm,
  1113. // pageSize: this.pageSize,
  1114. // pageNum: this.currentPage,
  1115. // type: this.bill,
  1116. // ...this.isCustomerList,
  1117. // });
  1118. this.getDataList()
  1119. this.getAmountList({
  1120. ...this.searchForm,
  1121. type: this.bill,
  1122. ...this.isCustomerList
  1123. })
  1124. } else {
  1125. // this.getDataList({
  1126. // ...this.searchForm,
  1127. // // customerName: this.customerName,
  1128. // customerNumber: this.customerNumber || this.searchForm.customerNumber,
  1129. // pageSize: this.pageSize,
  1130. // pageNum: this.currentPage,
  1131. // type: this.bill,
  1132. // });
  1133. this.getDataList()
  1134. this.getAmountList({
  1135. ...this.searchForm,
  1136. type: this.bill,
  1137. // customerName: this.customerName,
  1138. customerNumber: this.customerNumber
  1139. })
  1140. }
  1141. },
  1142. // //钱包数据
  1143. // async getWalletList() {
  1144. // let res = await getWalletCustomerList({
  1145. // customerId: this.customerId,
  1146. // type: this.bill,
  1147. // });
  1148. // this.selectList = res.data;
  1149. // },
  1150. //切换列表
  1151. checkFn(v) {
  1152. // this.getDataList({
  1153. // pageSize: 10,
  1154. // pageNum: 1,
  1155. // type: v,
  1156. // });
  1157. this.resetFn()
  1158. this.pageSize = 10
  1159. this.currentPage = 1
  1160. this.bill = v
  1161. if (this.$route.query.customerName && this.$route.query.customerNumber) {
  1162. this.changeFn(this.$route.query.customerId)
  1163. // this.getDataList({
  1164. // ...this.searchForm,
  1165. // pageSize: this.pageSize,
  1166. // pageNum: this.currentPage,
  1167. // type: v,
  1168. // customerId: this.$route.query.customerId,
  1169. // customerName: this.$route.query.customerName,
  1170. // customerNumber: this.$route.query.customerNumber,
  1171. // });
  1172. this.getDataList()
  1173. this.getAmountList({
  1174. ...this.searchForm,
  1175. type: v,
  1176. customerId: this.$route.query.customerId,
  1177. customerName: this.$route.query.customerName,
  1178. customerNumber: this.$route.query.customerNumber
  1179. })
  1180. } else if (this.isCustomer) {
  1181. this.changeFn(this.$store.state.user.customerId)
  1182. // this.getDataList({
  1183. // ...this.searchForm,
  1184. // pageSize: this.pageSize,
  1185. // pageNum: this.currentPage,
  1186. // type: v,
  1187. // ...this.isCustomerList,
  1188. // });
  1189. this.searchForm.customerId = this.isCustomerList.customerId
  1190. this.searchForm.customerNumber = this.isCustomerList.customerNumber
  1191. this.getDataList()
  1192. this.getAmountList({
  1193. ...this.searchForm,
  1194. type: v,
  1195. ...this.isCustomerList
  1196. })
  1197. } else {
  1198. // this.getDataList({
  1199. // // ...this.searchForm,
  1200. // // customerName: this.customerName,
  1201. // // customerNumber: this.customerNumber,
  1202. // pageSize: this.pageSize,
  1203. // pageNum: this.currentPage,
  1204. // type: v,
  1205. // });
  1206. this.getDataList()
  1207. this.getAmountList({
  1208. type: v
  1209. })
  1210. }
  1211. // this.getWalletList();
  1212. },
  1213. //
  1214. async getDataList(value) {
  1215. // let res;
  1216. // if (this.bill == "COMMONLY") {
  1217. // res = await getStandbookList(data);
  1218. // } else {
  1219. // res = await getStandbookList(data);
  1220. // }
  1221. if (value) {
  1222. let res = await getStandbookList(value)
  1223. this.dataList = res.data.records
  1224. this.listTotal = res.data.total
  1225. } else {
  1226. let params = {
  1227. billNo: this.searchForm.billNo,
  1228. billType: this.searchForm.billType,
  1229. customerId: this.searchForm.customerId,
  1230. enginRecordNo: this.searchForm.enginRecordNo,
  1231. customerName: '',
  1232. customerNumber: this.searchForm.customerNumber,
  1233. customerWalletId: this.searchForm.customerWalletId,
  1234. endTime: this.searchForm.endTime,
  1235. pageNum: this.currentPage,
  1236. pageSize: this.pageSize,
  1237. startTime: this.searchForm.startTime,
  1238. remark: this.searchForm.remark,
  1239. type: this.bill,
  1240. walletRebateId: ''
  1241. }
  1242. let res = await getStandbookList(params)
  1243. this.dataList = res.data.records
  1244. this.listTotal = res.data.total
  1245. }
  1246. }
  1247. }
  1248. }
  1249. </script>
  1250. <style>
  1251. .main-container {
  1252. height: 100vh !important;
  1253. overflow: auto;
  1254. }
  1255. </style>
  1256. <style lang="scss" scoped>
  1257. ::v-deep .ulStyle {
  1258. //position: sticky;
  1259. //top: 80px;
  1260. list-style: none;
  1261. margin: 0;
  1262. padding: 10px 0;
  1263. background-color: #ffffff;
  1264. z-index: 1;
  1265. li {
  1266. display: inline-block;
  1267. font-weight: 700;
  1268. span {
  1269. padding-left: 6px;
  1270. font-weight: 400;
  1271. }
  1272. // float: right;
  1273. margin-right: 20px;
  1274. }
  1275. }
  1276. .moneyStyle {
  1277. height: 130px;
  1278. border-radius: 20px;
  1279. padding: 20px 0 0 20px;
  1280. color: #fff;
  1281. span {
  1282. display: block;
  1283. font-size: 20px;
  1284. }
  1285. strong {
  1286. margin-top: 16px;
  1287. display: block;
  1288. font-size: 36px;
  1289. }
  1290. }
  1291. .selectStyle {
  1292. width: 100%;
  1293. }
  1294. .color1 {
  1295. background-color: #6c83d0;
  1296. }
  1297. .color2 {
  1298. background-color: #dfc062;
  1299. }
  1300. .color3 {
  1301. background-color: #dfc062;
  1302. }
  1303. .color4 {
  1304. background-color: #6bcfd7;
  1305. }
  1306. .el-date-editor--date {
  1307. height: 100% !important;
  1308. }
  1309. </style>