rebate_list.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. <template>
  2. <div class="app-container">
  3. <div v-if="showPage == 1">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <Collapse :screen-form="searchForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="cancelFn">清空</el-button>
  9. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  10. </template>
  11. <template #left_btn>
  12. <el-radio-group @change="changeRadioFn" v-model="searchForm.examineStatus" size="mini">
  13. <el-radio-button label="">全部</el-radio-button>
  14. <el-radio-button label="SAVE">保存</el-radio-button>
  15. <el-radio-button label="WAIT">待审核</el-radio-button>
  16. <el-radio-button label="OK_ONE">初审通过</el-radio-button>
  17. <el-radio-button label="FAIL_ONE">初审不通过</el-radio-button>
  18. <el-radio-button label="OK">复核通过</el-radio-button>
  19. <el-radio-button label="FAIL">复核不通过</el-radio-button>
  20. <el-radio-button label="CLOSE">已关闭</el-radio-button>
  21. <el-radio-button label="OK_ONE_AND_CONFIRM">已确认未复核</el-radio-button>
  22. </el-radio-group>
  23. </template>
  24. <template #search>
  25. <el-form ref="searchForm" :model="searchForm" label-width="100px" size="mini" label-position="left">
  26. <el-row :gutter="20">
  27. <el-col :xs="24" :sm="12" :lg="6">
  28. <el-form-item label="经销商名称" prop="customerName">
  29. <el-input v-model="searchForm.customerName" placeholder="请输入经销商名称"></el-input>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="返利类型" prop="walletName">
  34. <el-input v-model="searchForm.walletName" placeholder="请输入"></el-input>
  35. </el-form-item>
  36. </el-col>
  37. <el-col :xs="24" :sm="12" :lg="6">
  38. <el-form-item label="经销商编码" prop="customerNumber">
  39. <el-input v-model="searchForm.customerNumber" placeholder="请输入"></el-input>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :xs="24" :sm="12" :lg="6">
  43. <el-form-item label="返利单号" prop="id">
  44. <el-input v-model="searchForm.id" placeholder="请输入"></el-input>
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="12" :lg="6">
  48. <el-form-item label="开始时间" prop="startTime">
  49. <el-date-picker
  50. class="selectStyle"
  51. v-model="searchForm.startTime"
  52. placeholder="选择日期"
  53. type="datetime"
  54. value-format="yyyy-MM-dd HH:mm:ss"
  55. >
  56. </el-date-picker>
  57. </el-form-item>
  58. </el-col>
  59. <el-col :xs="24" :sm="12" :lg="6">
  60. <el-form-item label="结束时间" prop="endTime">
  61. <el-date-picker
  62. class="selectStyle"
  63. v-model="searchForm.endTime"
  64. placeholder="选择日期"
  65. type="datetime"
  66. value-format="yyyy-MM-dd HH:mm:ss"
  67. >
  68. </el-date-picker>
  69. </el-form-item>
  70. </el-col>
  71. <el-col :xs="24" :sm="12" :lg="6">
  72. <el-form-item label="商家已确认" prop="isConfirm">
  73. <el-radio-group v-model="searchForm.isConfirm">
  74. <el-radio-button label="">全部</el-radio-button>
  75. <el-radio-button label="true">是</el-radio-button>
  76. <el-radio-button label="false">否</el-radio-button>
  77. </el-radio-group>
  78. </el-form-item>
  79. </el-col>
  80. </el-row>
  81. </el-form>
  82. </template>
  83. </Collapse>
  84. </div>
  85. <!-- 按钮 -->
  86. <div class="btn-group clearfix">
  87. <div class="fl">
  88. <el-popconfirm
  89. style="margin-right: 15px"
  90. v-if="$checkBtnRole('del', $route.meta.roles)"
  91. class="delClass"
  92. @onConfirm="deleFn"
  93. title="确定删除吗?"
  94. >
  95. <el-button :disabled="deleList.length < 1" slot="reference" type="danger" icon="el-icon-minus" size="mini"
  96. >批量删除</el-button
  97. >
  98. </el-popconfirm>
  99. <el-popconfirm
  100. style="margin-right: 15px"
  101. v-if="$checkBtnRole('apply', $route.meta.roles) && searchForm.examineStatus === 'SAVE'"
  102. class="delClass"
  103. @onConfirm="batchApplication"
  104. title="确定执行批量申请吗?"
  105. >
  106. <el-button
  107. :disabled="deleList.length < 1"
  108. slot="reference"
  109. type="warning"
  110. icon="el-icon-finished"
  111. size="mini"
  112. >批量申请</el-button
  113. >
  114. </el-popconfirm>
  115. <el-button
  116. @click="batchAudit('audit')"
  117. v-if="$checkBtnRole('examine', $route.meta.roles) && searchForm.examineStatus === 'WAIT'"
  118. :disabled="deleList.length < 1"
  119. slot="reference"
  120. type="warning"
  121. icon="el-icon-finished"
  122. size="mini"
  123. >批量审核</el-button
  124. >
  125. <el-button
  126. @click="batchReview('review')"
  127. v-if="$checkBtnRole('examine', $route.meta.roles) && searchForm.examineStatus === 'OK_ONE_AND_CONFIRM'"
  128. :disabled="deleList.length < 1"
  129. slot="reference"
  130. type="warning"
  131. icon="el-icon-finished"
  132. size="mini"
  133. >批量复核</el-button
  134. >
  135. <!-- <el-button @click="batchApplication" :disabled='deleList.length < 1' size="mini" type="warning" icon="el-icon-finished" v-if="$checkBtnRole('examine', $route.meta.roles) && searchForm.examineStatus ==='SAVE'">批量申请</el-button> -->
  136. </div>
  137. <div class="fr">
  138. <ExportButton :exUrl="'rebate/order/export'" :exParams="exParams" />
  139. </div>
  140. </div>
  141. <!-- 列表 -->
  142. <div class="mymain-container">
  143. <div class="table">
  144. <el-table
  145. @selection-change="selectionChangeFn"
  146. v-loading="listLoading"
  147. :data="dataList"
  148. element-loading-text="Loading"
  149. border
  150. fit
  151. highlight-current-row
  152. stripe
  153. show-summary
  154. :summary-method="$getSummaries"
  155. >
  156. <el-table-column
  157. v-if="$checkBtnRole('del', $route.meta.roles)"
  158. :selectable="selectableFn"
  159. align="center"
  160. type="selection"
  161. width="51"
  162. show-overflow-tooltip
  163. ></el-table-column>
  164. <el-table-column
  165. align="left"
  166. label="状态"
  167. prop="examineStatus"
  168. min-width="160"
  169. show-overflow-tooltip
  170. v-if="!isCustomer"
  171. >
  172. <template slot-scope="scope">
  173. <el-tag size="mini" v-show="scope.row.examineStatus == 'SAVE'">保存</el-tag>
  174. <el-tag size="mini" v-show="scope.row.examineStatus == 'WAIT'" type="warning">待审核</el-tag>
  175. <el-tag size="mini" v-show="scope.row.examineStatus == 'OK_ONE'" type="success">初审通过</el-tag>
  176. <el-tag size="mini" v-show="scope.row.examineStatus == 'FAIL_ONE'" type="danger">初审不通过</el-tag>
  177. <el-tag size="mini" v-show="scope.row.examineStatus == 'OK'" type="success">复核通过</el-tag>
  178. <el-tag size="mini" v-show="scope.row.examineStatus == 'FAIL'" type="danger">不通过</el-tag>
  179. <el-tag size="mini" v-show="scope.row.examineStatus == 'CLOSE'" type="info">已关闭</el-tag>
  180. </template>
  181. </el-table-column>
  182. <el-table-column
  183. v-if="isCustomer"
  184. align="left"
  185. label="是否确认"
  186. prop="customerIsConfirm"
  187. min-width="160"
  188. show-overflow-tooltip
  189. >
  190. <template slot-scope="scope">
  191. <el-tag size="mini" v-show="scope.row.customerIsConfirm == true">已确认</el-tag>
  192. <el-tag size="mini" v-show="scope.row.customerIsConfirm == false">未确认</el-tag>
  193. </template>
  194. </el-table-column>
  195. <el-table-column align="left" label="返利单号" prop="rebateOrderId" min-width="200" show-overflow-tooltip>
  196. <template slot-scope="scope">
  197. <CopyButton :copyText="scope.row.rebateOrderId" />
  198. <span>{{ scope.row.rebateOrderId }}</span>
  199. </template>
  200. </el-table-column>
  201. <el-table-column
  202. align="left"
  203. label="返利日期"
  204. prop="theTime"
  205. min-width="180"
  206. show-overflow-tooltip
  207. ></el-table-column>
  208. <el-table-column
  209. v-if="isCustomer"
  210. align="left"
  211. label="标题备注"
  212. prop="policyDocNo"
  213. min-width="160"
  214. show-overflow-tooltip
  215. ></el-table-column>
  216. <el-table-column
  217. v-if="!isCustomer"
  218. align="left"
  219. label="经销商编码"
  220. prop="customerNumber"
  221. min-width="160"
  222. show-overflow-tooltip
  223. >
  224. <template slot-scope="scope">
  225. <CopyButton :copyText="scope.row.customerNumber" />
  226. <span>{{ scope.row.customerNumber }}</span>
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. v-if="!isCustomer"
  231. align="left"
  232. label="经销商名称"
  233. prop="customerName"
  234. min-width="260"
  235. show-overflow-tooltip
  236. >
  237. <template slot-scope="scope">
  238. <CopyButton :copyText="scope.row.customerName" />
  239. <span>{{ scope.row.customerName }}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column
  243. align="left"
  244. label="返利类型"
  245. prop="walletName"
  246. min-width="160"
  247. show-overflow-tooltip
  248. ></el-table-column>
  249. <el-table-column align="right" label="总返利金额" prop="amount" min-width="160" show-overflow-tooltip>
  250. <template slot-scope="scope">
  251. {{ scope.row.amount | numToFixed }}
  252. </template>
  253. </el-table-column>
  254. <el-table-column align="right" label="返利金额" prop="rebateAmount" min-width="160" show-overflow-tooltip>
  255. <template slot-scope="scope">
  256. {{ scope.row.rebateAmount | numToFixed }}
  257. </template>
  258. </el-table-column>
  259. <el-table-column align="right" label="暂扣返利" prop="withholdAmount" min-width="160" show-overflow-tooltip>
  260. <template slot-scope="scope">
  261. {{ scope.row.withholdAmount | numToFixed }}
  262. </template>
  263. </el-table-column>
  264. <!-- <el-table-column-->
  265. <!-- align="right"-->
  266. <!-- label="折让金额"-->
  267. <!-- prop="allowanceAmount"-->
  268. <!-- min-width="160"-->
  269. <!-- show-overflow-tooltip-->
  270. <!-- >-->
  271. <!-- <template slot-scope="scope">-->
  272. <!-- {{ scope.row.allowanceAmount | numToFixed }}-->
  273. <!-- </template>-->
  274. <!-- </el-table-column>-->
  275. <el-table-column
  276. v-if="!isCustomer"
  277. align="left"
  278. label="折让编号"
  279. prop="allowanceCode"
  280. min-width="160"
  281. show-overflow-tooltip
  282. ></el-table-column>
  283. <el-table-column
  284. v-if="!isCustomer"
  285. align="left"
  286. label="折让账号"
  287. prop="allowanceAccount"
  288. min-width="160"
  289. show-overflow-tooltip
  290. ></el-table-column>
  291. <el-table-column
  292. v-if="!isCustomer"
  293. align="right"
  294. label="已办理折让金额"
  295. prop="handledAllowanceAmount"
  296. min-width="160"
  297. show-overflow-tooltip
  298. >
  299. <template slot-scope="scope">
  300. {{ scope.row.handledAllowanceAmount | numToFixed }}
  301. </template>
  302. </el-table-column>
  303. <el-table-column
  304. v-if="!isCustomer"
  305. align="left"
  306. label="折让对应收款单号"
  307. prop="allowanceOrderNo"
  308. min-width="160"
  309. show-overflow-tooltip
  310. ></el-table-column>
  311. <el-table-column
  312. v-if="!isCustomer"
  313. align="left"
  314. label="政策文件流水号"
  315. prop="policyFileNo"
  316. min-width="160"
  317. show-overflow-tooltip
  318. ></el-table-column>
  319. <el-table-column
  320. v-if="!isCustomer"
  321. align="left"
  322. label="政策文号"
  323. prop="policyDocNo"
  324. min-width="160"
  325. show-overflow-tooltip
  326. ></el-table-column>
  327. <el-table-column
  328. v-if="!isCustomer"
  329. align="left"
  330. label="政策年份"
  331. prop="policyYear"
  332. min-width="160"
  333. show-overflow-tooltip
  334. ></el-table-column>
  335. <el-table-column
  336. v-if="!isCustomer"
  337. align="left"
  338. label="政策月份"
  339. prop="policyMonth"
  340. min-width="160"
  341. show-overflow-tooltip
  342. ></el-table-column>
  343. <el-table-column
  344. v-if="!isCustomer"
  345. align="left"
  346. label="政策归属部门"
  347. prop="policyOrg"
  348. min-width="160"
  349. show-overflow-tooltip
  350. ></el-table-column>
  351. <el-table-column
  352. align="left"
  353. v-if="!isCustomer"
  354. label="客户区域"
  355. prop="customerArea"
  356. min-width="160"
  357. show-overflow-tooltip
  358. ></el-table-column>
  359. <el-table-column
  360. v-if="!isCustomer"
  361. align="left"
  362. label="客户属性"
  363. prop="customerAttr"
  364. min-width="160"
  365. show-overflow-tooltip
  366. ></el-table-column>
  367. <el-table-column
  368. align="left"
  369. v-if="!isCustomer"
  370. label="奖励实际归属客户"
  371. prop="rewardActualCustomers"
  372. min-width="160"
  373. show-overflow-tooltip
  374. ></el-table-column>
  375. <el-table-column
  376. v-if="!isCustomer"
  377. align="left"
  378. label="备注1"
  379. prop="remark1"
  380. min-width="160"
  381. show-overflow-tooltip
  382. ></el-table-column>
  383. <el-table-column
  384. v-if="!isCustomer"
  385. align="left"
  386. label="备注2"
  387. prop="remark2"
  388. min-width="160"
  389. show-overflow-tooltip
  390. ></el-table-column>
  391. <el-table-column
  392. v-if="!isCustomer"
  393. align="left"
  394. label="制单人"
  395. prop="createBy"
  396. min-width="160"
  397. show-overflow-tooltip
  398. ></el-table-column>
  399. <el-table-column
  400. v-if="!isCustomer"
  401. align="left"
  402. label="制单时间"
  403. prop="createTime"
  404. min-width="160"
  405. show-overflow-tooltip
  406. ></el-table-column>
  407. <el-table-column
  408. v-if="!isCustomer"
  409. align="left"
  410. label="审核人"
  411. prop="examineBy"
  412. min-width="160"
  413. show-overflow-tooltip
  414. ></el-table-column>
  415. <el-table-column
  416. v-if="!isCustomer"
  417. align="left"
  418. label="审核时间"
  419. prop="examineTime"
  420. min-width="160"
  421. show-overflow-tooltip
  422. ></el-table-column>
  423. <el-table-column
  424. v-if="!isCustomer"
  425. align="left"
  426. label="确认人"
  427. prop="customerName"
  428. min-width="160"
  429. show-overflow-tooltip
  430. ></el-table-column>
  431. <el-table-column
  432. v-if="!isCustomer"
  433. align="left"
  434. label="确认时间"
  435. prop="customerConfirmTime"
  436. min-width="160"
  437. show-overflow-tooltip
  438. ></el-table-column>
  439. <el-table-column
  440. v-if="!isCustomer"
  441. align="left"
  442. label="复核人"
  443. prop="secondExamineBy"
  444. min-width="160"
  445. show-overflow-tooltip
  446. ></el-table-column>
  447. <el-table-column
  448. v-if="!isCustomer"
  449. align="left"
  450. label="复核时间"
  451. prop="secondExamineTime"
  452. min-width="160"
  453. show-overflow-tooltip
  454. ></el-table-column>
  455. <el-table-column
  456. v-if="isCustomer"
  457. align="left"
  458. label="确认时间"
  459. prop="customerConfirmTime"
  460. min-width="160"
  461. show-overflow-tooltip
  462. ></el-table-column>
  463. <el-table-column align="center" label="操作" min-width="240" show-overflow-tooltip fixed="right">
  464. <template slot-scope="scope">
  465. <el-button
  466. type="text"
  467. class="textColor"
  468. v-if="
  469. !isCustomer && $checkBtnRole('edit', $route.meta.roles) && scope.row.examineStatus != 'FAIL_ONE'
  470. "
  471. @click="editFn(scope.row.rebateOrderId)"
  472. >编辑</el-button
  473. >
  474. <el-button
  475. type="text"
  476. class="textColor"
  477. v-show="scope.row.examineStatus == 'SAVE' && !isCustomer && $checkBtnRole('apply', $route.meta.roles)"
  478. @click="applyFn(scope.row.rebateOrderId)"
  479. >申请</el-button
  480. >
  481. <el-button
  482. type="text"
  483. class="textColor"
  484. v-show="
  485. scope.row.examineStatus == 'WAIT' && !isCustomer && $checkBtnRole('examine', $route.meta.roles)
  486. "
  487. @click="examineFn(scope.row.rebateOrderId)"
  488. >审核</el-button
  489. >
  490. <el-button
  491. type="text"
  492. class="textColor"
  493. v-show="
  494. (scope.row.examineStatus == 'OK_ONE' ||
  495. scope.row.examineStatus == 'OK' ||
  496. scope.row.examineStatus == 'FAIL') &&
  497. !isCustomer &&
  498. $checkBtnRole('examine', $route.meta.roles)
  499. "
  500. @click="reviewFn(scope.row.rebateOrderId)"
  501. >{{ scope.row.examineStatus == 'OK' ? '取消复核' : '复核' }}</el-button
  502. >
  503. <el-button
  504. type="text"
  505. class="textColor"
  506. v-show="(scope.row.examineStatus == 'WAIT' || scope.row.examineStatus == 'SAVE') && !isCustomer"
  507. @click="infoFn(scope.row.rebateOrderId)"
  508. >详情</el-button
  509. >
  510. <el-button
  511. type="text"
  512. class="textColor"
  513. v-show="
  514. (scope.row.examineStatus == 'OK_ONE' ||
  515. scope.row.examineStatus == 'FAIL_ONE' ||
  516. scope.row.examineStatus == 'FAIL' ||
  517. scope.row.examineStatus == 'OK') &&
  518. !isCustomer
  519. "
  520. @click="detail2(scope.row.rebateOrderId)"
  521. >详情</el-button
  522. >
  523. <el-button
  524. type="text"
  525. class="textColor"
  526. v-if="
  527. isCustomer &&
  528. scope.row.withholdAmount == 0 &&
  529. (scope.row.examineStatus == 'OK_ONE' ||
  530. scope.row.examineStatus == 'OK' ||
  531. scope.row.examineStatus == 'FAIL')
  532. "
  533. @click="confirmFn(scope.row.rebateOrderId, scope.row.customerIsConfirm)"
  534. >{{
  535. scope.row.customerIsConfirm == true && scope.row.examineStatus == 'OK_ONE'
  536. ? '编辑'
  537. : scope.row.customerIsConfirm == false
  538. ? '确定'
  539. : '详情'
  540. }}</el-button
  541. >
  542. </template>
  543. </el-table-column>
  544. </el-table>
  545. </div>
  546. <!-- 分页 -->
  547. <div class="fr">
  548. <el-pagination
  549. @size-change="handleSizeChange"
  550. @current-change="handleCurrentChange"
  551. :current-page="currentPage"
  552. :page-sizes="[10, 20, 30, 50]"
  553. :page-size="pageSize"
  554. layout="total, sizes, prev, pager, next, jumper"
  555. :total="listTotal"
  556. >
  557. </el-pagination>
  558. </div>
  559. </div>
  560. </div>
  561. <RebateListApply :detailId="detailId" v-else-if="showPage == 2" />
  562. <RebateListExamine @updateList="updateList" :detailId="detailId" v-else-if="showPage == 3" />
  563. <RebateListReview @updateList="updateList" :detailId="detailId" v-else-if="showPage == 4" />
  564. <!-- 详情 -->
  565. <RebateListDetail :detailId="detailId" v-else-if="showPage == 5" />
  566. <!-- 确定 -->
  567. <RebateListConfirm @updateList="updateList" :detailId="detailId" :isShow="isShow" v-else-if="showPage == 6" />
  568. <!-- 编辑 -->
  569. <RebateListEdit @updateList="updateList" :detailId="detailId" v-else-if="showPage == 7" />
  570. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  571. </div>
  572. </template>
  573. <script>
  574. import {
  575. getRebateOrderList,
  576. getRebateOrderApply,
  577. getRebateOrderBatchDel,
  578. getRebateOrderApplyBatch,
  579. getRebateOrderExamineBatch,
  580. getRebateOrderExamine2Batch
  581. } from '@/api/finance/rebate_list'
  582. import RebateListApply from './components/rebate_list-apply.vue'
  583. import RebateListExamine from './components/rebate_list-examine.vue'
  584. import RebateListReview from './components/rebate_list-review.vue'
  585. import RebateListDetail from './components/rebate_list-detail'
  586. import RebateListConfirm from './components/rebate_list-confirm'
  587. import RebateListEdit from './components/rebate_list-edit.vue'
  588. import ExamineDialog from '@/components/Common/examine-dialog'
  589. export default {
  590. name: 'rebate_list',
  591. components: {
  592. RebateListDetail,
  593. RebateListApply,
  594. RebateListExamine,
  595. RebateListReview,
  596. RebateListConfirm,
  597. RebateListEdit,
  598. ExamineDialog
  599. },
  600. data() {
  601. return {
  602. deleList: [],
  603. currentPage: 1, // 当前页码
  604. pageSize: 10, // 每页数量
  605. listTotal: 0, // 列表总数
  606. dataList: [], // 列表数据
  607. searchForm: {
  608. id: '',
  609. customerName: '',
  610. walletName: '',
  611. customerNumber: '',
  612. startTime: '',
  613. endTime: '',
  614. examineStatus: '',
  615. isConfirm: ''
  616. }, //搜索表单
  617. listLoading: false, // 列表加载loading
  618. showPage: 1,
  619. detailId: null,
  620. isCustomer: null,
  621. secondId: null,
  622. isShow: null,
  623. isCollapse: true,
  624. isShowExamineDialog: false,
  625. examineForm: {
  626. status: '',
  627. remark: ''
  628. },
  629. state: ''
  630. }
  631. },
  632. computed: {
  633. exParams() {
  634. return {
  635. ...this.searchForm,
  636. pageSize: this.pageSize,
  637. pageNum: this.currentPage
  638. }
  639. }
  640. },
  641. created() {
  642. this.getDataList()
  643. const res = JSON.parse(localStorage.getItem('supply_user'))
  644. this.isCustomer = res.isCustomer
  645. if (this.$route.query.id) {
  646. if (this.isCustomer) {
  647. this.confirmFn(this.$route.query.id, false)
  648. } else {
  649. this.examineFn(this.$route.query.id)
  650. }
  651. }
  652. },
  653. methods: {
  654. //批量复核
  655. batchReview(value) {
  656. this.state = value
  657. this.isShowExamineDialog = true
  658. },
  659. //批量审核
  660. batchAudit(value) {
  661. this.state = value
  662. this.isShowExamineDialog = true
  663. },
  664. //提交批量审核
  665. async submitExamineForm() {
  666. let res = this.deleList.toString()
  667. if (this.state === 'audit') {
  668. await getRebateOrderExamineBatch({
  669. ids: res,
  670. examineStatus: this.examineForm.status,
  671. examineRemark: this.examineForm.remark
  672. })
  673. this.$message.success('批量审核成功')
  674. } else {
  675. await getRebateOrderExamine2Batch({
  676. ids: res,
  677. examineStatus: this.examineForm.status,
  678. examineRemark: this.examineForm.remark
  679. })
  680. this.$message.success('批量复核成功')
  681. }
  682. this.deleList = []
  683. this.isShowExamineDialog = false
  684. this.getDataList()
  685. },
  686. //批量申请
  687. async batchApplication() {
  688. let res = this.deleList.toString()
  689. await getRebateOrderApplyBatch({ ids: res })
  690. this.getDataList()
  691. this.$message.success('批量申请成功')
  692. this.deleList = []
  693. },
  694. // 批量删除
  695. selectionChangeFn(value) {
  696. const res = value.map(v => v.rebateOrderId)
  697. this.deleList = res
  698. },
  699. //删除
  700. async deleFn() {
  701. let res = this.deleList.toString()
  702. // console.log(res);
  703. await getRebateOrderBatchDel({ ids: res })
  704. this.getDataList()
  705. this.$message.success('删除成功')
  706. this.deleList = []
  707. },
  708. selectableFn(row, index) {
  709. // console.log(row, index, 444);
  710. // if (row.examineStatus !== "SAVE") {
  711. // return false;
  712. // } else {
  713. // return true;
  714. // }
  715. return true
  716. },
  717. //切换radio获取数据
  718. changeRadioFn(v) {
  719. this.currentPage = 1
  720. this.getDataList()
  721. },
  722. //清除
  723. cancelFn() {
  724. this.$refs.searchForm.resetFields()
  725. },
  726. //搜索
  727. searchFn() {
  728. this.currentPage = 1
  729. this.getDataList()
  730. },
  731. // 更改每页数量
  732. handleSizeChange(val) {
  733. this.pageSize = val
  734. this.getDataList()
  735. },
  736. // 更改当前页
  737. handleCurrentChange(val) {
  738. this.currentPage = val
  739. this.getDataList()
  740. },
  741. //更新列表数据
  742. updateList() {
  743. this.getDataList()
  744. },
  745. //获取列表数据
  746. async getDataList() {
  747. let params = {
  748. pageSize: this.pageSize,
  749. pageNum: this.currentPage,
  750. customerName: this.searchForm.customerName,
  751. customerNumber: this.searchForm.customerNumber,
  752. endTime: this.searchForm.endTime,
  753. examineStatus: this.searchForm.examineStatus,
  754. id: this.searchForm.id,
  755. isConfirm: this.searchForm.isConfirm,
  756. isSecondExamine: '',
  757. startTime: this.searchForm.startTime,
  758. walletName: this.searchForm.walletName
  759. }
  760. const res = await getRebateOrderList(params)
  761. this.listTotal = res.data.total
  762. let arr = res.data.records
  763. arr.forEach(value => {
  764. value.sums1 = []
  765. value.sums2 = ['amount', 'rebateAmount', 'withholdAmount', 'allowanceAmount', 'handledAllowanceAmount']
  766. })
  767. if (this.isCustomer) {
  768. let arr2 = arr.filter(v => {
  769. if (
  770. (v.examineStatus == 'OK_ONE' || v.examineStatus == 'OK' || v.examineStatus == 'FAIL') &&
  771. v.withholdAmount == 0
  772. ) {
  773. return v
  774. }
  775. })
  776. this.dataList = arr2
  777. this.listTotal = arr2.length
  778. } else {
  779. this.dataList = arr
  780. this.listTotal = res.data.total
  781. }
  782. },
  783. //确认
  784. confirmFn(id, isShow) {
  785. this.isShow = isShow
  786. this.detailId = id
  787. this.showPage = 6
  788. },
  789. //复核
  790. reviewFn(id) {
  791. this.detailId = id
  792. this.showPage = 4
  793. },
  794. //审核
  795. examineFn(id) {
  796. this.detailId = id
  797. this.showPage = 3
  798. },
  799. //申请
  800. async applyFn(id) {
  801. await getRebateOrderApply({ id })
  802. this.getDataList()
  803. this.$message.success('申请成功')
  804. },
  805. //详情2
  806. detail2(id) {
  807. this.detailId = id
  808. this.showPage = 2
  809. },
  810. //详情
  811. infoFn(id) {
  812. this.detailId = id
  813. this.showPage = 5
  814. },
  815. //编辑
  816. editFn(id) {
  817. this.detailId = id
  818. this.showPage = 7
  819. }
  820. }
  821. }
  822. </script>
  823. <style lang="scss" scoped>
  824. .selectStyle {
  825. width: 100%;
  826. }
  827. </style>