retail_list.vue 30 KB

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