standbook_list.vue 43 KB

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