policy_list.vue 27 KB

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