policy_list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901
  1. <template>
  2. <div class="app-container">
  3. <div
  4. v-show="!isShowDetail && !isShowForm && !isShowExamine && !isShowReturn"
  5. >
  6. <!-- 筛选条件 -->
  7. <div class="screen-container">
  8. <el-form
  9. ref="screenForm"
  10. :model="screenForm"
  11. label-width="100px"
  12. size="mini"
  13. label-position="left"
  14. >
  15. <el-row :gutter="20">
  16. <el-col :xs="24" :sm="24" :lg="24">
  17. <el-form-item prop="status" label-width="0">
  18. <el-radio-group
  19. v-model="screenForm.status"
  20. size="mini"
  21. @change="getList()"
  22. >
  23. <el-radio-button label="">全部</el-radio-button>
  24. <el-radio-button
  25. v-for="(item, index) in statusList"
  26. :key="index"
  27. :label="item.value"
  28. >{{ item.label }}</el-radio-button>
  29. </el-radio-group>
  30. </el-form-item>
  31. </el-col>
  32. <el-col :xs="24" :sm="12" :lg="6">
  33. <el-form-item label="订单号" prop="orderNum">
  34. <el-input
  35. v-model="screenForm.orderNum"
  36. placeholder="请输入订单号"
  37. />
  38. </el-form-item>
  39. </el-col>
  40. <el-col :xs="24" :sm="12" :lg="6">
  41. <el-form-item label="销售政策编号" prop="policyCode">
  42. <el-input
  43. v-model="screenForm.policyCode"
  44. placeholder="请输入销售政策编号"
  45. />
  46. </el-form-item>
  47. </el-col>
  48. <el-col :xs="24" :sm="12" :lg="6">
  49. <el-form-item label="销售政策说明" prop="policyRemark">
  50. <el-input
  51. v-model="screenForm.policyRemark"
  52. placeholder="请输入销售政策说明"
  53. />
  54. </el-form-item>
  55. </el-col>
  56. <el-col :xs="24" :sm="12" :lg="6">
  57. <el-form-item label="经销商" prop="jxsName">
  58. <el-input
  59. v-model="screenForm.jxsName"
  60. placeholder="请输入经销商"
  61. />
  62. </el-form-item>
  63. </el-col>
  64. <el-col :xs="24" :sm="12" :lg="6">
  65. <el-form-item label="订单日期" prop="date">
  66. <!-- <el-date-picker
  67. v-model="screenForm.date"
  68. class="dateStyle"
  69. type="datetime"
  70. value-format="yyyy-MM-dd HH:mm:ss"
  71. placeholder="选择订单日期"
  72. >
  73. </el-date-picker> -->
  74. <el-date-picker
  75. v-model="screenForm.date"
  76. type="datetimerange"
  77. range-separator="至"
  78. style="width: 100%"
  79. value-format="yyyy-MM-dd HH:mm:ss"
  80. start-placeholder="开始日期"
  81. end-placeholder="结束日期"
  82. />
  83. </el-form-item>
  84. </el-col>
  85. <el-col :xs="24" :sm="12" :lg="6">
  86. <el-form-item label="制表人" prop="zbMan">
  87. <el-input
  88. v-model="screenForm.zbMan"
  89. placeholder="请输入制表人"
  90. />
  91. </el-form-item>
  92. </el-col>
  93. <el-col :xs="24" :sm="12" :lg="6">
  94. <el-form-item label="审核人" prop="shMan">
  95. <el-input
  96. v-model="screenForm.shMan"
  97. placeholder="请输入审核人"
  98. />
  99. </el-form-item>
  100. </el-col>
  101. <el-col :xs="24" :sm="12" :lg="6">
  102. <el-form-item label="表头业务员" prop="k3ServiceId">
  103. <el-select v-model="screenForm.k3ServiceId" placeholder="选择表头业务员" size="small" clearable filterable style="width: 100%">
  104. <el-option
  105. v-for="item in salesmanList"
  106. :key="item.adminUserId"
  107. :label="item.nickName"
  108. :value="item.adminUserId">
  109. </el-option>
  110. </el-select>
  111. </el-form-item>
  112. </el-col>
  113. <el-col :xs="24" :sm="12" :lg="6">
  114. <el-form-item label="表体业务员" prop="serviceId">
  115. <el-select v-model="screenForm.serviceId" placeholder="选择表体业务员" size="small" clearable filterable style="width: 100%">
  116. <el-option
  117. v-for="item in salesmanList"
  118. :key="item.adminUserId"
  119. :label="item.nickName"
  120. :value="item.adminUserId">
  121. </el-option>
  122. </el-select>
  123. </el-form-item>
  124. </el-col>
  125. <el-col :xs="24" :sm="12" :lg="6">
  126. <el-form-item label="是否直调" prop="isDirectTransfer">
  127. <el-select v-model="screenForm.isDirectTransfer" placeholder="选择是否直" size="small" style="width: 100%">
  128. <el-option :value="null" label="默认"></el-option>
  129. <el-option
  130. v-for="item in transfer"
  131. :key="item.value"
  132. :label="item.label"
  133. :value="item.value">
  134. </el-option>
  135. </el-select>
  136. </el-form-item>
  137. </el-col>
  138. <el-col :xs="24" :sm="12" :lg="6">
  139. <el-form-item label="规格型号
  140. " prop="specification">
  141. <el-input
  142. v-model="screenForm.specification"
  143. placeholder="请输入规格型号
  144. "
  145. />
  146. </el-form-item>
  147. </el-col>
  148. <el-col :xs="24" :sm="24" :lg="6" class="tr">
  149. <el-form-item label="">
  150. <el-button
  151. size="mini"
  152. @click="resetScreenForm"
  153. >清空</el-button>
  154. <el-button
  155. size="mini"
  156. type="primary"
  157. @click="submitScreenForm"
  158. >搜索</el-button>
  159. </el-form-item>
  160. </el-col>
  161. </el-row>
  162. </el-form>
  163. </div>
  164. <div class="mymain-container">
  165. <div class="btn-group clearfix">
  166. <div class="fl">
  167. <el-button
  168. v-if="$checkBtnRole('add', $route.meta.roles)"
  169. size="mini"
  170. type="primary"
  171. icon="el-icon-plus"
  172. @click="toForm()"
  173. >新增</el-button>
  174. <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>
  175. </div>
  176. <div class="fr">
  177. <ExportButton :ex-url="'retail/export'" :ex-params="exParams" />
  178. </div>
  179. </div>
  180. <div class="table">
  181. <el-table
  182. v-loading="listLoading"
  183. :data="dataList"
  184. element-loading-text="Loading"
  185. border
  186. fit
  187. highlight-current-row
  188. stripe
  189. show-summary
  190. :summary-method="$getSummaries"
  191. @select-all="handleSelectionAllChange"
  192. @selection-change="handleSelectionAllChange"
  193. >
  194. <!-- <el-table-column
  195. align="center"
  196. label="提货进度"
  197. prop="thjd"
  198. min-width="180"
  199. show-overflow-tooltip
  200. >
  201. <template slot-scope="scope">
  202. <el-progress :percentage="scope.row.thjd || 0"></el-progress>
  203. </template>
  204. </el-table-column> -->
  205. <el-table-column align="left" type="selection" width="55" />
  206. <el-table-column
  207. align="left"
  208. label="订单号"
  209. prop="id"
  210. min-width="180"
  211. show-overflow-tooltip
  212. />
  213. <el-table-column
  214. align="left"
  215. label="订单日期"
  216. prop="theTime"
  217. min-width="150"
  218. show-overflow-tooltip
  219. >
  220. <template slot-scope="scope">
  221. <div>
  222. <span>{{ scope.row.theTime | dateToDayFilter }}</span>
  223. <el-button
  224. v-if="$checkBtnRole('date', $route.meta.roles)"
  225. type="text"
  226. icon="el-icon-edit"
  227. style="padding: 0; margin-left: 6px"
  228. @click="editDate(scope.row)"
  229. />
  230. </div>
  231. </template>
  232. </el-table-column>
  233. <el-table-column
  234. align="left"
  235. label="销售类型"
  236. prop="saleTypeName"
  237. min-width="200"
  238. show-overflow-tooltip
  239. />
  240. <el-table-column
  241. align="left"
  242. label="销售政策编号"
  243. prop="policyCode"
  244. min-width="200"
  245. show-overflow-tooltip
  246. />
  247. <el-table-column
  248. align="left"
  249. label="销售政策说明"
  250. prop="policyTitle"
  251. min-width="160"
  252. show-overflow-tooltip
  253. />
  254. <el-table-column
  255. align="left"
  256. label="经销商"
  257. prop="customerName"
  258. min-width="200"
  259. show-overflow-tooltip
  260. >
  261. <template slot-scope="scope">
  262. <CopyButton :copyText="scope.row.customerName" />
  263. <span>{{scope.row.customerName}}</span>
  264. </template>
  265. </el-table-column>
  266. <el-table-column
  267. align="left"
  268. label="物料编码"
  269. prop="materialCode"
  270. min-width="160"
  271. show-overflow-tooltip
  272. >
  273. <template slot-scope="scope">
  274. <CopyButton :copyText="scope.row.materialCode" />
  275. <span>{{scope.row.materialCode}}</span>
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. align="left"
  280. label="产品名称"
  281. prop="materialName"
  282. min-width="160"
  283. show-overflow-tooltip
  284. >
  285. <template slot-scope="scope">
  286. <CopyButton :copyText="scope.row.materialName" />
  287. <span>{{scope.row.materialName}}</span>
  288. </template>
  289. </el-table-column>
  290. <el-table-column
  291. align="left"
  292. label="规格型号"
  293. prop="specification"
  294. min-width="300"
  295. show-overflow-tooltip
  296. >
  297. <template slot-scope="scope">
  298. <CopyButton :copyText="scope.row.specification" />
  299. <span>{{scope.row.specification}}</span>
  300. </template>
  301. </el-table-column>
  302. <el-table-column
  303. align="left"
  304. label="计量单位"
  305. prop="unit"
  306. min-width="100"
  307. show-overflow-tooltip
  308. />
  309. <el-table-column
  310. align="left"
  311. label="是否直调"
  312. prop="isDirectTransfer"
  313. min-width="100"
  314. show-overflow-tooltip
  315. >
  316. <template slot-scope="scope">
  317. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  318. </template>
  319. </el-table-column>
  320. <el-table-column
  321. align="right"
  322. label="总数量"
  323. prop="qty"
  324. min-width="100"
  325. show-overflow-tooltip
  326. />
  327. <el-table-column
  328. align="right"
  329. label="单价"
  330. prop="price"
  331. min-width="100"
  332. show-overflow-tooltip
  333. >
  334. <template slot-scope="scope">
  335. {{ scope.row.price | numToFixed }}
  336. </template>
  337. </el-table-column>
  338. <el-table-column
  339. align="right"
  340. label="实付金额"
  341. sortable
  342. prop="payAmount"
  343. min-width="100"
  344. show-overflow-tooltip
  345. >
  346. <template slot-scope="scope">
  347. {{ scope.row.payAmount | numToFixed }}
  348. </template>
  349. </el-table-column>
  350. <el-table-column
  351. align="left"
  352. label="返利类型"
  353. prop="customerWalletName2"
  354. min-width="100"
  355. show-overflow-tooltip
  356. >
  357. <template slot-scope="scope">
  358. <el-tag
  359. v-if="scope.row.customerWalletName2"
  360. type="success"
  361. size="small"
  362. >
  363. {{ scope.row.customerWalletName2 }}
  364. </el-tag>
  365. </template>
  366. </el-table-column>
  367. <el-table-column
  368. align="right"
  369. label="返利金额"
  370. sortable
  371. prop="payRebateAmount"
  372. min-width="100"
  373. show-overflow-tooltip
  374. >
  375. <template slot-scope="scope">
  376. <div>{{ scope.row.payRebateAmount | numToFixed }}</div>
  377. </template>
  378. </el-table-column>
  379. <el-table-column
  380. align="right"
  381. label="格力折扣"
  382. sortable
  383. prop="totalDiscAmount"
  384. min-width="100"
  385. show-overflow-tooltip
  386. >
  387. <template slot-scope="scope">
  388. {{ scope.row.totalDiscAmount | numToFixed }}
  389. </template></el-table-column>
  390. <el-table-column
  391. align="right"
  392. label="直调数量"
  393. prop="directTransferQty"
  394. min-width="100"
  395. show-overflow-tooltip
  396. />
  397. <el-table-column
  398. align="right"
  399. label="出库数量"
  400. prop="hasSendQty"
  401. min-width="100"
  402. show-overflow-tooltip
  403. />
  404. <el-table-column align="left" label="表体备注" prop="itemRemark" min-width="160" show-overflow-tooltip></el-table-column>
  405. <el-table-column align="left" label="表头备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  406. <el-table-column
  407. align="left"
  408. label="业务员"
  409. prop="k3ServiceName"
  410. min-width="100"
  411. show-overflow-tooltip
  412. />
  413. <el-table-column
  414. align="left"
  415. label="表体业务员"
  416. prop="serviceName"
  417. min-width="100"
  418. show-overflow-tooltip
  419. />
  420. <el-table-column
  421. align="left"
  422. label="制表人"
  423. prop="createName"
  424. min-width="100"
  425. show-overflow-tooltip
  426. />
  427. <el-table-column
  428. align="left"
  429. label="制表日期"
  430. prop="createTime"
  431. min-width="200"
  432. show-overflow-tooltip
  433. />
  434. <el-table-column
  435. align="left"
  436. label="审核人"
  437. prop="examineName"
  438. min-width="200"
  439. show-overflow-tooltip
  440. />
  441. <el-table-column
  442. align="left"
  443. label="审核日期"
  444. prop="examineTime"
  445. min-width="160"
  446. show-overflow-tooltip
  447. />
  448. <el-table-column
  449. align="left"
  450. label="审核状态"
  451. prop="examineStatus"
  452. min-width="100"
  453. show-overflow-tooltip
  454. >
  455. <template slot-scope="scope">
  456. {{ scope.row.examineStatus | statusFilter }}
  457. </template>
  458. </el-table-column>
  459. <el-table-column
  460. align="center"
  461. label="操作"
  462. width="220"
  463. fixed="right"
  464. >
  465. <template slot-scope="scope">
  466. <el-popconfirm
  467. v-if="scope.row.examineStatus === 'SAVE'"
  468. style="margin-left: 10px"
  469. title="确定提审?"
  470. @onConfirm="handleSubmit(scope.row.id)"
  471. >
  472. <el-button slot="reference" type="text">提审</el-button>
  473. </el-popconfirm>
  474. <el-button
  475. style="margin-left: 10px"
  476. v-if="
  477. scope.row.examineStatus == 'WAIT' &&
  478. $checkBtnRole('examine', $route.meta.roles)
  479. "
  480. type="text"
  481. @click="toExamine(scope.row)"
  482. >审核</el-button>
  483. <el-popconfirm v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)">
  484. <el-button slot="reference" type="text">删除</el-button>
  485. </el-popconfirm>
  486. <el-button
  487. style="margin-left: 10px"
  488. v-if="
  489. scope.row.examineStatus === 'SAVE' &&
  490. $checkBtnRole('edit', $route.meta.roles)
  491. "
  492. type="text"
  493. @click="toForm(scope.row)"
  494. >编辑</el-button>
  495. <el-popconfirm style="margin-left: 10px" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.id)">
  496. <el-button slot="reference" type="text">弃审</el-button>
  497. </el-popconfirm>
  498. <el-popconfirm
  499. v-if="
  500. scope.row.examineStatus == 'WAIT' &&
  501. $checkBtnRole('apply', $route.meta.roles)
  502. "
  503. style="margin-left: 10px"
  504. title="确定撤回?"
  505. @onConfirm="handleCancel(scope.row.id)"
  506. >
  507. <el-button slot="reference" type="text">撤回</el-button>
  508. </el-popconfirm>
  509. <el-button
  510. style="margin-left: 10px"
  511. type="text"
  512. @click="toDetail(scope.row)"
  513. >详情</el-button>
  514. <el-button
  515. style="margin-left: 10px"
  516. v-if="
  517. scope.row.examineStatus === 'OK' &&
  518. $checkBtnRole('examine', $route.meta.roles)
  519. "
  520. type="text"
  521. @click="toReturn(scope.row)"
  522. >退订</el-button>
  523. <el-popconfirm
  524. v-if="
  525. scope.row.examineStatus === 'SAVE' &&
  526. $checkBtnRole('examine', $route.meta.roles)
  527. "
  528. style="margin-left: 10px"
  529. title="确定关闭吗?"
  530. @onConfirm="handleClose(scope.row.id)"
  531. >
  532. <el-button slot="reference" type="text">关闭</el-button>
  533. </el-popconfirm>
  534. </template>
  535. </el-table-column>
  536. </el-table>
  537. </div>
  538. </div>
  539. <div class="pagination clearfix">
  540. <div class="fr">
  541. <el-pagination
  542. :current-page="currentPage"
  543. :page-sizes="[10, 20, 30, 50,500]"
  544. :page-size="10"
  545. layout="total, sizes, prev, pager, next, jumper"
  546. :total="listTotal"
  547. @size-change="handleSizeChange"
  548. @current-change="handleCurrentChange"
  549. />
  550. </div>
  551. </div>
  552. </div>
  553. <RetailDetail
  554. v-if="isShowDetail"
  555. :list-item="queryItem"
  556. @backListFormDetail="backList"
  557. />
  558. <RetailForm
  559. v-if="isShowForm"
  560. :list-item="queryItem"
  561. @backListFormDetail="backList"
  562. />
  563. <RetailExamine
  564. v-if="isShowExamine"
  565. :list-item="queryItem"
  566. @backListFormDetail="backList"
  567. />
  568. <RetailReturn
  569. v-if="isShowReturn"
  570. :list-item="queryItem"
  571. @backListFormDetail="backList"
  572. />
  573. <EditDateDialog
  574. :is-show.sync="isShowEditDateDialog"
  575. :date-form.sync="dateForm"
  576. />
  577. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  578. </div>
  579. </template>
  580. <script>
  581. import {
  582. abandonData,
  583. closeData,
  584. deleteList,
  585. editData,
  586. examineData,
  587. getList,
  588. submitCancel,
  589. submitData
  590. } from '@/api/supply/policy'
  591. import RetailDetail from './components/retail_detail'
  592. import RetailForm from './components/retail_form'
  593. import RetailExamine from './components/retail_examine'
  594. import RetailReturn from './components/retail_return'
  595. import EditDateDialog from '@/components/Common/edit-date-dialog'
  596. import ExamineDialog from '@/components/Common/examine-dialog'
  597. import { getSalesmanList } from '@/api/common'
  598. let that
  599. export default {
  600. components: {
  601. RetailDetail,
  602. RetailForm,
  603. RetailExamine,
  604. RetailReturn,
  605. EditDateDialog,
  606. ExamineDialog
  607. },
  608. filters: {
  609. statusFilter(val) {
  610. const obj = that.statusList.find((o) => o.value == val)
  611. return obj ? obj.label : ''
  612. }
  613. },
  614. data() {
  615. return {
  616. currentPage: 1, // 当前页码
  617. pageSize: 10, // 每页数量
  618. listTotal: 0, // 列表总数
  619. dataList: null, // 列表数据
  620. listLoading: false, // 列表加载loading
  621. screenForm: {
  622. // 筛选表单数据
  623. orderNum: '',
  624. policyCode: '',
  625. policyRemark: '',
  626. jxsName: '',
  627. date: '',
  628. zbMan: '',
  629. shMan: '',
  630. status: '',
  631. salesMan:'',
  632. isDirectTransfer:null,
  633. specification:'',
  634. k3ServiceId:'',
  635. serviceId:''
  636. },
  637. transfer:[
  638. {label:'是',value:true},
  639. {label:'否',value:false}
  640. ],
  641. statusList: [
  642. { label: '已保存', value: 'SAVE' },
  643. { label: '待审核', value: 'WAIT' },
  644. { label: '审核通过', value: 'OK' },
  645. // { label: '审核驳回', value: 'FAIL' },
  646. ],
  647. queryItem: {},
  648. isShowDetail: false,
  649. isShowForm: false,
  650. isShowExamine: false,
  651. isShowReturn: false,
  652. isShowEditDateDialog: false,
  653. dateForm: {
  654. date: ''
  655. },
  656. salesmanList:[],
  657. selectData:[],
  658. isShowExamineDialog: false,
  659. examineForm: {
  660. status: 'OK',
  661. remark: '',
  662. },
  663. }
  664. },
  665. computed: {
  666. exParams() {
  667. return {
  668. examineStatus: this.screenForm.status,
  669. id: this.screenForm.orderNum,
  670. policyCode: this.screenForm.policyCode,
  671. policyRemark: this.screenForm.policyRemark,
  672. customer: this.screenForm.jxsName,
  673. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  674. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  675. createBy: this.screenForm.zbMan,
  676. examineBy: this.screenForm.shMan,
  677. type: 2 // 1:普通零售单,2:政策零售单
  678. }
  679. }
  680. },
  681. beforeCreate() {
  682. that = this
  683. },
  684. created() {
  685. this.getList()
  686. this.getSalesmanList();
  687. },
  688. methods: {
  689. // 获取业务员列表
  690. getSalesmanList() {
  691. getSalesmanList({
  692. pageNum: 1,
  693. pageSize: -1,
  694. isCustomer: 0,
  695. status: true,
  696. }).then(res => {
  697. this.salesmanList = res.data.records;
  698. })
  699. },
  700. handleSelectionAllChange(e) {
  701. this.selectData = e
  702. },
  703. // 打开 批量审批
  704. batchExamine() {
  705. if (this.selectData.length) {
  706. this.isShowExamineDialog = true;
  707. return
  708. }
  709. this.$errorMsg('请选择审核项')
  710. },
  711. // 提交 批量审批
  712. submitExamineForm() {
  713. let ids = this.selectData.map(item => {
  714. return item.id;
  715. });
  716. ids = [...new Set(ids)]
  717. examineData({
  718. id: ids.join(','),
  719. examineStatus: this.examineForm.status,
  720. examineRemark: this.examineForm.remark,
  721. serviceId:''
  722. })
  723. .then((res) => {
  724. this.isShowExamineDialog = false;
  725. this.$successMsg("修改成功");
  726. this.getList();
  727. })
  728. },
  729. // 查询按钮权限
  730. checkBtnRole(value) {
  731. // let btnRole = this.$route.meta.roles;
  732. // if(!btnRole) {return true}
  733. // let index = btnRole.indexOf(value);
  734. // return index >= 0;
  735. return true
  736. },
  737. handleDelete(id) {
  738. deleteList({ id }).then(res => {
  739. this.$successMsg('删除成功')
  740. this.getList()
  741. })
  742. },
  743. // 查询列表
  744. getList() {
  745. this.listLoading = true
  746. const params = {
  747. pageNum: this.currentPage,
  748. pageSize: this.pageSize,
  749. examineStatus: this.screenForm.status,
  750. id: this.screenForm.orderNum,
  751. policyCode: this.screenForm.policyCode,
  752. policyRemark: this.screenForm.policyRemark,
  753. customer: this.screenForm.jxsName,
  754. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  755. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  756. createBy: this.screenForm.zbMan,
  757. status: true,
  758. examineBy: this.screenForm.shMan,
  759. k3ServiceId:this.screenForm.k3ServiceId,
  760. serviceId:this.screenForm.serviceId,
  761. isDirectTransfer: this.screenForm.isDirectTransfer,
  762. specification:this.screenForm.specification,
  763. type: 2 // 1:普通零售单,2:政策零售单
  764. }
  765. getList(params).then((res) => {
  766. res.data.records.forEach(item => {
  767. item.sums1 = ['qty', 'directTransferQty', 'hasSendQty', 'refundableQty','payRebateAmount'];
  768. item.sums2 = ['price', 'payAmount', 'rebateAmount', 'payRebateAmount', 'totalDiscAmount'];
  769. })
  770. this.dataList = res.data.records
  771. this.listTotal = res.data.total
  772. this.listLoading = false
  773. })
  774. },
  775. // 提交筛选表单
  776. submitScreenForm() {
  777. this.currentPage = 1
  778. this.getList()
  779. },
  780. // 重置筛选表单
  781. resetScreenForm() {
  782. this.$refs.screenForm.resetFields()
  783. this.currentPage = 1
  784. this.getList()
  785. },
  786. // 更改每页数量
  787. handleSizeChange(val) {
  788. this.pageSize = val
  789. this.currentPage = 1
  790. this.getList()
  791. },
  792. // 更改当前页
  793. handleCurrentChange(val) {
  794. this.currentPage = val
  795. this.getList()
  796. },
  797. // 进入表单
  798. toForm(item) {
  799. this.queryItem = item
  800. this.isShowForm = true
  801. },
  802. // 进入详情
  803. toDetail(item) {
  804. this.queryItem = item
  805. this.isShowDetail = true
  806. },
  807. // 进入审批
  808. toExamine(item) {
  809. this.queryItem = item
  810. this.isShowExamine = true
  811. },
  812. // 进入退订
  813. toReturn(item) {
  814. this.queryItem = item
  815. this.isShowReturn = true
  816. },
  817. // 弃审
  818. handleAbandon(id) {
  819. abandonData({ id }).then(res => {
  820. this.$successMsg()
  821. this.getList()
  822. })
  823. },
  824. backList() {
  825. this.queryItem = {}
  826. this.isShowDetail = false
  827. this.isShowForm = false
  828. this.isShowExamine = false
  829. this.isShowReturn = false
  830. },
  831. // 关闭
  832. handleClose(id) {
  833. closeData({ id }).then((res) => {
  834. this.$successMsg()
  835. this.getList()
  836. })
  837. },
  838. // 提审
  839. handleSubmit(id) {
  840. submitData({ id }).then((res) => {
  841. this.$successMsg()
  842. this.getList()
  843. })
  844. },
  845. // 撤回
  846. handleCancel(id) {
  847. submitCancel({ id }).then((res) => {
  848. this.$successMsg()
  849. this.getList()
  850. })
  851. },
  852. // 打开 修改订单日期
  853. editDate(item) {
  854. this.editId = item.id
  855. this.dateForm.date = item.theTime.slice(0, 10)
  856. this.isShowEditDateDialog = true
  857. },
  858. // 提交 修改订单日期
  859. submitDateForm() {
  860. editData({
  861. id: this.editId,
  862. theTime: this.dateForm.date + ' 00:00:00'
  863. }).then((res) => {
  864. this.isShowEditDateDialog = false
  865. this.getList()
  866. this.$successMsg('修改成功')
  867. })
  868. }
  869. }
  870. }
  871. </script>
  872. <style lang="scss" scoped></style>