rebate_list.vue 30 KB

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