policy_list.vue 26 KB

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