policy_list.vue 30 KB

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