policy_list.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908
  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="fileNo"
  313. min-width="100"
  314. show-overflow-tooltip
  315. />
  316. <el-table-column
  317. align="left"
  318. label="是否直调"
  319. prop="isDirectTransfer"
  320. min-width="100"
  321. show-overflow-tooltip
  322. >
  323. <template slot-scope="scope">
  324. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  325. </template>
  326. </el-table-column>
  327. <el-table-column
  328. align="right"
  329. label="总数量"
  330. prop="qty"
  331. min-width="100"
  332. show-overflow-tooltip
  333. />
  334. <el-table-column
  335. align="right"
  336. label="单价"
  337. prop="price"
  338. min-width="100"
  339. show-overflow-tooltip
  340. >
  341. <template slot-scope="scope">
  342. {{ scope.row.price | numToFixed }}
  343. </template>
  344. </el-table-column>
  345. <el-table-column
  346. align="right"
  347. label="实付金额"
  348. sortable
  349. prop="payAmount"
  350. min-width="100"
  351. show-overflow-tooltip
  352. >
  353. <template slot-scope="scope">
  354. {{ scope.row.payAmount | numToFixed }}
  355. </template>
  356. </el-table-column>
  357. <el-table-column
  358. align="left"
  359. label="返利类型"
  360. prop="customerWalletName2"
  361. min-width="100"
  362. show-overflow-tooltip
  363. >
  364. <template slot-scope="scope">
  365. <el-tag
  366. v-if="scope.row.customerWalletName2"
  367. type="success"
  368. size="small"
  369. >
  370. {{ scope.row.customerWalletName2 }}
  371. </el-tag>
  372. </template>
  373. </el-table-column>
  374. <el-table-column
  375. align="right"
  376. label="返利金额"
  377. sortable
  378. prop="payRebateAmount"
  379. min-width="100"
  380. show-overflow-tooltip
  381. >
  382. <template slot-scope="scope">
  383. <div>{{ scope.row.payRebateAmount | numToFixed }}</div>
  384. </template>
  385. </el-table-column>
  386. <el-table-column
  387. align="right"
  388. label="格力折扣"
  389. sortable
  390. prop="totalDiscAmount"
  391. min-width="100"
  392. show-overflow-tooltip
  393. >
  394. <template slot-scope="scope">
  395. {{ scope.row.totalDiscAmount | numToFixed }}
  396. </template></el-table-column>
  397. <el-table-column
  398. align="right"
  399. label="直调数量"
  400. prop="directTransferQty"
  401. min-width="100"
  402. show-overflow-tooltip
  403. />
  404. <el-table-column
  405. align="right"
  406. label="出库数量"
  407. prop="hasSendQty"
  408. min-width="100"
  409. show-overflow-tooltip
  410. />
  411. <el-table-column align="left" label="表体备注" prop="itemRemark" min-width="160" show-overflow-tooltip></el-table-column>
  412. <el-table-column align="left" label="表头备注" prop="remark" min-width="160" show-overflow-tooltip></el-table-column>
  413. <el-table-column
  414. align="left"
  415. label="业务员"
  416. prop="k3ServiceName"
  417. min-width="100"
  418. show-overflow-tooltip
  419. />
  420. <el-table-column
  421. align="left"
  422. label="表体业务员"
  423. prop="serviceName"
  424. min-width="100"
  425. show-overflow-tooltip
  426. />
  427. <el-table-column
  428. align="left"
  429. label="制表人"
  430. prop="createName"
  431. min-width="100"
  432. show-overflow-tooltip
  433. />
  434. <el-table-column
  435. align="left"
  436. label="制表日期"
  437. prop="createTime"
  438. min-width="200"
  439. show-overflow-tooltip
  440. />
  441. <el-table-column
  442. align="left"
  443. label="审核人"
  444. prop="examineName"
  445. min-width="200"
  446. show-overflow-tooltip
  447. />
  448. <el-table-column
  449. align="left"
  450. label="审核日期"
  451. prop="examineTime"
  452. min-width="160"
  453. show-overflow-tooltip
  454. />
  455. <el-table-column
  456. align="left"
  457. label="审核状态"
  458. prop="examineStatus"
  459. min-width="100"
  460. show-overflow-tooltip
  461. >
  462. <template slot-scope="scope">
  463. {{ scope.row.examineStatus | statusFilter }}
  464. </template>
  465. </el-table-column>
  466. <el-table-column
  467. align="center"
  468. label="操作"
  469. width="220"
  470. fixed="right"
  471. >
  472. <template slot-scope="scope">
  473. <el-popconfirm
  474. v-if="scope.row.examineStatus === 'SAVE'"
  475. style="margin-left: 10px"
  476. title="确定提审?"
  477. @onConfirm="handleSubmit(scope.row.id)"
  478. >
  479. <el-button slot="reference" type="text">提审</el-button>
  480. </el-popconfirm>
  481. <el-button
  482. style="margin-left: 10px"
  483. v-if="
  484. scope.row.examineStatus == 'WAIT' &&
  485. $checkBtnRole('examine', $route.meta.roles)
  486. "
  487. type="text"
  488. @click="toExamine(scope.row)"
  489. >审核</el-button>
  490. <el-popconfirm v-if="$checkBtnRole('del', $route.meta.roles) && scope.row.examineStatus === 'SAVE'" style="margin-left: 10px;" title="确定删除吗?" @onConfirm="handleDelete(scope.row.id)">
  491. <el-button slot="reference" type="text">删除</el-button>
  492. </el-popconfirm>
  493. <el-button
  494. style="margin-left: 10px"
  495. v-if="
  496. scope.row.examineStatus === 'SAVE' &&
  497. $checkBtnRole('edit', $route.meta.roles)
  498. "
  499. type="text"
  500. @click="toForm(scope.row)"
  501. >编辑</el-button>
  502. <el-popconfirm style="margin-left: 10px" v-if="$checkBtnRole('examine', $route.meta.roles) && scope.row.examineStatus === 'OK'" title="确定弃审吗?" @onConfirm="handleAbandon(scope.row.id)">
  503. <el-button slot="reference" type="text">弃审</el-button>
  504. </el-popconfirm>
  505. <el-popconfirm
  506. v-if="
  507. scope.row.examineStatus == 'WAIT' &&
  508. $checkBtnRole('apply', $route.meta.roles)
  509. "
  510. style="margin-left: 10px"
  511. title="确定撤回?"
  512. @onConfirm="handleCancel(scope.row.id)"
  513. >
  514. <el-button slot="reference" type="text">撤回</el-button>
  515. </el-popconfirm>
  516. <el-button
  517. style="margin-left: 10px"
  518. type="text"
  519. @click="toDetail(scope.row)"
  520. >详情</el-button>
  521. <el-button
  522. style="margin-left: 10px"
  523. v-if="
  524. scope.row.examineStatus === 'OK' &&
  525. $checkBtnRole('examine', $route.meta.roles)
  526. "
  527. type="text"
  528. @click="toReturn(scope.row)"
  529. >退订</el-button>
  530. <el-popconfirm
  531. v-if="
  532. scope.row.examineStatus === 'SAVE' &&
  533. $checkBtnRole('examine', $route.meta.roles)
  534. "
  535. style="margin-left: 10px"
  536. title="确定关闭吗?"
  537. @onConfirm="handleClose(scope.row.id)"
  538. >
  539. <el-button slot="reference" type="text">关闭</el-button>
  540. </el-popconfirm>
  541. </template>
  542. </el-table-column>
  543. </el-table>
  544. </div>
  545. </div>
  546. <div class="pagination clearfix">
  547. <div class="fr">
  548. <el-pagination
  549. :current-page="currentPage"
  550. :page-sizes="[10, 20, 30, 50,500]"
  551. :page-size="10"
  552. layout="total, sizes, prev, pager, next, jumper"
  553. :total="listTotal"
  554. @size-change="handleSizeChange"
  555. @current-change="handleCurrentChange"
  556. />
  557. </div>
  558. </div>
  559. </div>
  560. <RetailDetail
  561. v-if="isShowDetail"
  562. :list-item="queryItem"
  563. @backListFormDetail="backList"
  564. />
  565. <RetailForm
  566. v-if="isShowForm"
  567. :list-item="queryItem"
  568. @backListFormDetail="backList"
  569. />
  570. <RetailExamine
  571. v-if="isShowExamine"
  572. :list-item="queryItem"
  573. @backListFormDetail="backList"
  574. />
  575. <RetailReturn
  576. v-if="isShowReturn"
  577. :list-item="queryItem"
  578. @backListFormDetail="backList"
  579. />
  580. <EditDateDialog
  581. :is-show.sync="isShowEditDateDialog"
  582. :date-form.sync="dateForm"
  583. />
  584. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  585. </div>
  586. </template>
  587. <script>
  588. import {
  589. abandonData,
  590. closeData,
  591. deleteList,
  592. editData,
  593. examineData,
  594. getList,
  595. submitCancel,
  596. submitData
  597. } from '@/api/supply/policy'
  598. import RetailDetail from './components/retail_detail'
  599. import RetailForm from './components/retail_form'
  600. import RetailExamine from './components/retail_examine'
  601. import RetailReturn from './components/retail_return'
  602. import EditDateDialog from '@/components/Common/edit-date-dialog'
  603. import ExamineDialog from '@/components/Common/examine-dialog'
  604. import { getSalesmanList } from '@/api/common'
  605. let that
  606. export default {
  607. components: {
  608. RetailDetail,
  609. RetailForm,
  610. RetailExamine,
  611. RetailReturn,
  612. EditDateDialog,
  613. ExamineDialog
  614. },
  615. filters: {
  616. statusFilter(val) {
  617. const obj = that.statusList.find((o) => o.value == val)
  618. return obj ? obj.label : ''
  619. }
  620. },
  621. data() {
  622. return {
  623. currentPage: 1, // 当前页码
  624. pageSize: 10, // 每页数量
  625. listTotal: 0, // 列表总数
  626. dataList: null, // 列表数据
  627. listLoading: false, // 列表加载loading
  628. screenForm: {
  629. // 筛选表单数据
  630. orderNum: '',
  631. policyCode: '',
  632. policyRemark: '',
  633. jxsName: '',
  634. date: '',
  635. zbMan: '',
  636. shMan: '',
  637. status: '',
  638. salesMan:'',
  639. isDirectTransfer:null,
  640. specification:'',
  641. k3ServiceId:'',
  642. serviceId:''
  643. },
  644. transfer:[
  645. {label:'是',value:true},
  646. {label:'否',value:false}
  647. ],
  648. statusList: [
  649. { label: '已保存', value: 'SAVE' },
  650. { label: '待审核', value: 'WAIT' },
  651. { label: '审核通过', value: 'OK' },
  652. // { label: '审核驳回', value: 'FAIL' },
  653. ],
  654. queryItem: {},
  655. isShowDetail: false,
  656. isShowForm: false,
  657. isShowExamine: false,
  658. isShowReturn: false,
  659. isShowEditDateDialog: false,
  660. dateForm: {
  661. date: ''
  662. },
  663. salesmanList:[],
  664. selectData:[],
  665. isShowExamineDialog: false,
  666. examineForm: {
  667. status: 'OK',
  668. remark: '',
  669. },
  670. }
  671. },
  672. computed: {
  673. exParams() {
  674. return {
  675. examineStatus: this.screenForm.status,
  676. id: this.screenForm.orderNum,
  677. policyCode: this.screenForm.policyCode,
  678. policyRemark: this.screenForm.policyRemark,
  679. customer: this.screenForm.jxsName,
  680. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  681. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  682. createBy: this.screenForm.zbMan,
  683. examineBy: this.screenForm.shMan,
  684. type: 2 // 1:普通零售单,2:政策零售单
  685. }
  686. }
  687. },
  688. beforeCreate() {
  689. that = this
  690. },
  691. created() {
  692. this.getList()
  693. this.getSalesmanList();
  694. },
  695. methods: {
  696. // 获取业务员列表
  697. getSalesmanList() {
  698. getSalesmanList({
  699. pageNum: 1,
  700. pageSize: -1,
  701. isCustomer: 0,
  702. status: true,
  703. }).then(res => {
  704. this.salesmanList = res.data.records;
  705. })
  706. },
  707. handleSelectionAllChange(e) {
  708. this.selectData = e
  709. },
  710. // 打开 批量审批
  711. batchExamine() {
  712. if (this.selectData.length) {
  713. this.isShowExamineDialog = true;
  714. return
  715. }
  716. this.$errorMsg('请选择审核项')
  717. },
  718. // 提交 批量审批
  719. submitExamineForm() {
  720. let ids = this.selectData.map(item => {
  721. return item.id;
  722. });
  723. ids = [...new Set(ids)]
  724. examineData({
  725. id: ids.join(','),
  726. examineStatus: this.examineForm.status,
  727. examineRemark: this.examineForm.remark,
  728. serviceId:''
  729. })
  730. .then((res) => {
  731. this.isShowExamineDialog = false;
  732. this.$successMsg("修改成功");
  733. this.getList();
  734. })
  735. },
  736. // 查询按钮权限
  737. checkBtnRole(value) {
  738. // let btnRole = this.$route.meta.roles;
  739. // if(!btnRole) {return true}
  740. // let index = btnRole.indexOf(value);
  741. // return index >= 0;
  742. return true
  743. },
  744. handleDelete(id) {
  745. deleteList({ id }).then(res => {
  746. this.$successMsg('删除成功')
  747. this.getList()
  748. })
  749. },
  750. // 查询列表
  751. getList() {
  752. this.listLoading = true
  753. const params = {
  754. pageNum: this.currentPage,
  755. pageSize: this.pageSize,
  756. examineStatus: this.screenForm.status,
  757. id: this.screenForm.orderNum,
  758. policyCode: this.screenForm.policyCode,
  759. policyRemark: this.screenForm.policyRemark,
  760. customer: this.screenForm.jxsName,
  761. startTime: this.screenForm.date ? this.screenForm.date[0] : '',
  762. endTime: this.screenForm.date ? this.screenForm.date[1] : '',
  763. createBy: this.screenForm.zbMan,
  764. status: true,
  765. examineBy: this.screenForm.shMan,
  766. k3ServiceId:this.screenForm.k3ServiceId,
  767. serviceId:this.screenForm.serviceId,
  768. isDirectTransfer: this.screenForm.isDirectTransfer,
  769. specification:this.screenForm.specification,
  770. type: 2 // 1:普通零售单,2:政策零售单
  771. }
  772. getList(params).then((res) => {
  773. res.data.records.forEach(item => {
  774. item.sums1 = ['qty', 'directTransferQty', 'hasSendQty', 'refundableQty','payRebateAmount'];
  775. item.sums2 = ['price', 'payAmount', 'rebateAmount', 'payRebateAmount', 'totalDiscAmount'];
  776. })
  777. this.dataList = res.data.records
  778. this.listTotal = res.data.total
  779. this.listLoading = false
  780. })
  781. },
  782. // 提交筛选表单
  783. submitScreenForm() {
  784. this.currentPage = 1
  785. this.getList()
  786. },
  787. // 重置筛选表单
  788. resetScreenForm() {
  789. this.$refs.screenForm.resetFields()
  790. this.currentPage = 1
  791. this.getList()
  792. },
  793. // 更改每页数量
  794. handleSizeChange(val) {
  795. this.pageSize = val
  796. this.currentPage = 1
  797. this.getList()
  798. },
  799. // 更改当前页
  800. handleCurrentChange(val) {
  801. this.currentPage = val
  802. this.getList()
  803. },
  804. // 进入表单
  805. toForm(item) {
  806. this.queryItem = item
  807. this.isShowForm = true
  808. },
  809. // 进入详情
  810. toDetail(item) {
  811. this.queryItem = item
  812. this.isShowDetail = true
  813. },
  814. // 进入审批
  815. toExamine(item) {
  816. this.queryItem = item
  817. this.isShowExamine = true
  818. },
  819. // 进入退订
  820. toReturn(item) {
  821. this.queryItem = item
  822. this.isShowReturn = true
  823. },
  824. // 弃审
  825. handleAbandon(id) {
  826. abandonData({ id }).then(res => {
  827. this.$successMsg()
  828. this.getList()
  829. })
  830. },
  831. backList() {
  832. this.queryItem = {}
  833. this.isShowDetail = false
  834. this.isShowForm = false
  835. this.isShowExamine = false
  836. this.isShowReturn = false
  837. },
  838. // 关闭
  839. handleClose(id) {
  840. closeData({ id }).then((res) => {
  841. this.$successMsg()
  842. this.getList()
  843. })
  844. },
  845. // 提审
  846. handleSubmit(id) {
  847. submitData({ id }).then((res) => {
  848. this.$successMsg()
  849. this.getList()
  850. })
  851. },
  852. // 撤回
  853. handleCancel(id) {
  854. submitCancel({ id }).then((res) => {
  855. this.$successMsg()
  856. this.getList()
  857. })
  858. },
  859. // 打开 修改订单日期
  860. editDate(item) {
  861. this.editId = item.id
  862. this.dateForm.date = item.theTime.slice(0, 10)
  863. this.isShowEditDateDialog = true
  864. },
  865. // 提交 修改订单日期
  866. submitDateForm() {
  867. editData({
  868. id: this.editId,
  869. theTime: this.dateForm.date + ' 00:00:00'
  870. }).then((res) => {
  871. this.isShowEditDateDialog = false
  872. this.getList()
  873. this.$successMsg('修改成功')
  874. })
  875. }
  876. }
  877. }
  878. </script>
  879. <style lang="scss" scoped></style>