policy_list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  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="small"
  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="medium"
  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. >
  30. </el-radio-group>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :xs="24" :sm="12" :lg="6">
  34. <el-form-item label="订单号" prop="orderNum">
  35. <el-input
  36. v-model="screenForm.orderNum"
  37. placeholder="请输入订单号"
  38. ></el-input>
  39. </el-form-item>
  40. </el-col>
  41. <el-col :xs="24" :sm="12" :lg="6">
  42. <el-form-item label="销售政策编号" prop="policyCode">
  43. <el-input
  44. v-model="screenForm.policyCode"
  45. placeholder="请输入销售政策编号"
  46. ></el-input>
  47. </el-form-item>
  48. </el-col>
  49. <el-col :xs="24" :sm="12" :lg="6">
  50. <el-form-item label="销售政策说明" prop="policyRemark">
  51. <el-input
  52. v-model="screenForm.policyRemark"
  53. placeholder="请输入销售政策说明"
  54. ></el-input>
  55. </el-form-item>
  56. </el-col>
  57. <el-col :xs="24" :sm="12" :lg="6">
  58. <el-form-item label="经销商" prop="jxsName">
  59. <el-input
  60. v-model="screenForm.jxsName"
  61. placeholder="请输入经销商"
  62. ></el-input>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :xs="24" :sm="12" :lg="6">
  66. <el-form-item label="订单日期" prop="date">
  67. <el-date-picker
  68. v-model="screenForm.date"
  69. type="datetimerange"
  70. range-separator="至"
  71. style="width: 100%"
  72. value-format="yyyy-MM-dd HH:mm:ss"
  73. start-placeholder="开始日期"
  74. end-placeholder="结束日期"
  75. >
  76. </el-date-picker>
  77. </el-form-item>
  78. </el-col>
  79. <el-col :xs="24" :sm="12" :lg="6">
  80. <el-form-item label="制表人" prop="zbMan">
  81. <el-input
  82. v-model="screenForm.zbMan"
  83. placeholder="请输入制表人"
  84. ></el-input>
  85. </el-form-item>
  86. </el-col>
  87. <el-col :xs="24" :sm="12" :lg="6">
  88. <el-form-item label="审核人" prop="shMan">
  89. <el-input
  90. v-model="screenForm.shMan"
  91. placeholder="请输入审核人"
  92. ></el-input>
  93. </el-form-item>
  94. </el-col>
  95. <el-col :xs="24" :sm="12" :lg="6" class="tr">
  96. <el-form-item label="">
  97. <el-button size="small" @click="resetScreenForm"
  98. >清空</el-button
  99. >
  100. <el-button size="small" type="primary" @click="submitScreenForm"
  101. >搜索</el-button
  102. >
  103. </el-form-item>
  104. </el-col>
  105. </el-row>
  106. </el-form>
  107. </div>
  108. <div class="mymain-container">
  109. <div class="btn-group clearfix">
  110. <div class="fl">
  111. <el-button
  112. size="small"
  113. type="primary"
  114. icon="el-icon-plus"
  115. @click="toForm()"
  116. >新增</el-button
  117. >
  118. </div>
  119. <div class="fr">
  120. <ExportButton :exUrl="'retail/export'" :exParams="exParams" />
  121. </div>
  122. </div>
  123. <div class="table">
  124. <el-table
  125. v-loading="listLoading"
  126. :data="dataList"
  127. element-loading-text="Loading"
  128. border
  129. fit
  130. highlight-current-row
  131. stripe
  132. >
  133. <!-- <el-table-column
  134. align="center"
  135. label="提货进度"
  136. prop="thjd"
  137. min-width="180"
  138. show-overflow-tooltip
  139. >
  140. <template slot-scope="scope">
  141. <el-progress :percentage="scope.row.thjd || 0"></el-progress>
  142. </template>
  143. </el-table-column> -->
  144. <el-table-column
  145. align="center"
  146. label="订单号"
  147. prop="id"
  148. min-width="180"
  149. show-overflow-tooltip
  150. ></el-table-column>
  151. <el-table-column
  152. align="center"
  153. label="订单日期"
  154. prop="theTime"
  155. min-width="100"
  156. show-overflow-tooltip
  157. >
  158. <template slot-scope="scope">
  159. {{ scope.row.theTime | dateToDayFilter }}
  160. </template>
  161. </el-table-column>
  162. <el-table-column
  163. align="center"
  164. label="销售政策编号"
  165. prop="policyCode"
  166. min-width="100"
  167. show-overflow-tooltip
  168. ></el-table-column>
  169. <el-table-column
  170. align="center"
  171. label="销售政策说明"
  172. prop="policyTitle"
  173. min-width="160"
  174. show-overflow-tooltip
  175. ></el-table-column>
  176. <el-table-column
  177. align="center"
  178. label="经销商"
  179. prop="customerName"
  180. min-width="160"
  181. show-overflow-tooltip
  182. ></el-table-column>
  183. <el-table-column
  184. align="center"
  185. label="产品编码"
  186. prop="materialCode"
  187. min-width="160"
  188. show-overflow-tooltip
  189. ></el-table-column>
  190. <el-table-column
  191. align="center"
  192. label="产品名称"
  193. prop="materialName"
  194. min-width="160"
  195. show-overflow-tooltip
  196. ></el-table-column>
  197. <el-table-column
  198. align="center"
  199. label="规格型号"
  200. prop="specification"
  201. min-width="160"
  202. show-overflow-tooltip
  203. ></el-table-column>
  204. <el-table-column
  205. align="center"
  206. label="计量单位"
  207. prop="unit"
  208. min-width="100"
  209. show-overflow-tooltip
  210. ></el-table-column>
  211. <el-table-column
  212. align="center"
  213. label="是否直调"
  214. prop="isDirectTransfer"
  215. min-width="100"
  216. show-overflow-tooltip
  217. >
  218. <template slot-scope="scope">
  219. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  220. </template>
  221. </el-table-column>
  222. <el-table-column
  223. align="center"
  224. label="总数量"
  225. prop="qty"
  226. min-width="100"
  227. show-overflow-tooltip
  228. ></el-table-column>
  229. <el-table-column
  230. align="center"
  231. label="单价"
  232. prop="price"
  233. min-width="100"
  234. show-overflow-tooltip
  235. ></el-table-column>
  236. <el-table-column
  237. align="center"
  238. label="金额"
  239. prop="payAmount"
  240. min-width="100"
  241. show-overflow-tooltip
  242. ></el-table-column>
  243. <el-table-column
  244. align="center"
  245. label="返利类型"
  246. prop="customerWalletName2"
  247. min-width="100"
  248. show-overflow-tooltip
  249. >
  250. <template slot-scope="scope">
  251. <el-tag
  252. type="success"
  253. size="small"
  254. v-if="scope.row.customerWalletName2"
  255. >
  256. {{ scope.row.customerWalletName2 }}
  257. </el-tag>
  258. </template>
  259. </el-table-column>
  260. <el-table-column
  261. align="center"
  262. label="返利金额"
  263. prop="payRebateAmount"
  264. min-width="100"
  265. show-overflow-tooltip
  266. ></el-table-column>
  267. <el-table-column
  268. align="center"
  269. label="格力折扣"
  270. prop="totalDiscAmount"
  271. min-width="100"
  272. show-overflow-tooltip
  273. ></el-table-column>
  274. <el-table-column
  275. align="center"
  276. label="直调数量"
  277. prop="directTransferQty"
  278. min-width="100"
  279. show-overflow-tooltip
  280. ></el-table-column>
  281. <el-table-column
  282. align="center"
  283. label="出库数量"
  284. prop="hasSendQty"
  285. min-width="100"
  286. show-overflow-tooltip
  287. ></el-table-column>
  288. <el-table-column
  289. align="center"
  290. label="业务员"
  291. prop="serviceName"
  292. min-width="100"
  293. show-overflow-tooltip
  294. ></el-table-column>
  295. <el-table-column
  296. align="center"
  297. label="制表人"
  298. prop="createName"
  299. min-width="100"
  300. show-overflow-tooltip
  301. ></el-table-column>
  302. <el-table-column
  303. align="center"
  304. label="制表日期"
  305. prop="createTime"
  306. min-width="160"
  307. show-overflow-tooltip
  308. ></el-table-column>
  309. <el-table-column
  310. align="center"
  311. label="审核人"
  312. prop="examineName"
  313. min-width="100"
  314. show-overflow-tooltip
  315. ></el-table-column>
  316. <el-table-column
  317. align="center"
  318. label="审核日期"
  319. prop="examineTime"
  320. min-width="160"
  321. show-overflow-tooltip
  322. ></el-table-column>
  323. <el-table-column
  324. align="center"
  325. label="审核状态"
  326. prop="examineStatus"
  327. min-width="100"
  328. show-overflow-tooltip
  329. >
  330. <template slot-scope="scope">
  331. {{ scope.row.examineStatus | statusFilter }}
  332. </template>
  333. </el-table-column>
  334. <el-table-column
  335. align="center"
  336. label="操作"
  337. width="220"
  338. fixed="right"
  339. >
  340. <template slot-scope="scope">
  341. <el-popconfirm
  342. v-if="scope.row.examineStatus === 'SAVE'"
  343. style="margin-right: 10px"
  344. title="确定提审?"
  345. @onConfirm="handleSubmit(scope.row.id)"
  346. >
  347. <el-button slot="reference" type="text">提审</el-button>
  348. </el-popconfirm>
  349. <el-button
  350. v-if="scope.row.examineStatus == 'WAIT'"
  351. type="text"
  352. @click="toExamine(scope.row)"
  353. >审核</el-button
  354. >
  355. <el-button
  356. type="text"
  357. v-if="scope.row.examineStatus === 'SAVE'"
  358. @click="toForm(scope.row)"
  359. >编辑</el-button
  360. >
  361. <el-popconfirm
  362. v-if="scope.row.examineStatus == 'WAIT'"
  363. style="margin-left: 10px"
  364. title="确定撤回?"
  365. @onConfirm="handleCancel(scope.row.id)"
  366. >
  367. <el-button slot="reference" type="text">撤回</el-button>
  368. </el-popconfirm>
  369. <el-button
  370. style="margin-left: 10px"
  371. type="text"
  372. @click="toDetail(scope.row)"
  373. >详情</el-button
  374. >
  375. <el-button
  376. type="text"
  377. @click="toReturn(scope.row)"
  378. v-if="scope.row.examineStatus === 'OK'"
  379. >退订</el-button
  380. >
  381. <el-popconfirm style="margin-left: 10px;" title="确定关闭吗?" @onConfirm="handleClose(scope.row.id)" v-if="!scope.row.closeTime" >
  382. <el-button slot="reference" type="text">关闭</el-button>
  383. </el-popconfirm>
  384. </template>
  385. </el-table-column>
  386. </el-table>
  387. </div>
  388. </div>
  389. <div class="pagination clearfix">
  390. <div class="fr">
  391. <el-pagination
  392. @size-change="handleSizeChange"
  393. @current-change="handleCurrentChange"
  394. :current-page="currentPage"
  395. :page-sizes="[10, 20, 30, 50]"
  396. :page-size="10"
  397. layout="total, sizes, prev, pager, next, jumper"
  398. :total="listTotal"
  399. >
  400. </el-pagination>
  401. </div>
  402. </div>
  403. </div>
  404. <RetailDetail
  405. :listItem="queryItem"
  406. v-if="isShowDetail"
  407. @backListFormDetail="backList"
  408. />
  409. <RetailForm
  410. :listItem="queryItem"
  411. v-if="isShowForm"
  412. @backListFormDetail="backList"
  413. />
  414. <RetailExamine
  415. :listItem="queryItem"
  416. v-if="isShowExamine"
  417. @backListFormDetail="backList"
  418. />
  419. <RetailReturn
  420. :listItem="queryItem"
  421. v-if="isShowReturn"
  422. @backListFormDetail="backList"
  423. />
  424. </div>
  425. </template>
  426. <script>
  427. import {
  428. getList,
  429. closeData,
  430. submitData,
  431. submitCancel,
  432. } from "@/api/supply/policy";
  433. import RetailDetail from "./components/retail_detail";
  434. import RetailForm from "./components/retail_form2";
  435. import RetailExamine from "./components/retail_examine";
  436. import RetailReturn from "./components/retail_return";
  437. let that;
  438. export default {
  439. components: {
  440. RetailDetail,
  441. RetailForm,
  442. RetailExamine,
  443. RetailReturn,
  444. },
  445. filters: {
  446. statusFilter(val) {
  447. let obj = that.statusList.find((o) => o.value == val);
  448. return obj ? obj.label : "";
  449. },
  450. },
  451. data() {
  452. return {
  453. currentPage: 1, // 当前页码
  454. pageSize: 10, // 每页数量
  455. listTotal: 0, // 列表总数
  456. dataList: null, // 列表数据
  457. listLoading: false, // 列表加载loading
  458. screenForm: {
  459. // 筛选表单数据
  460. orderNum: "",
  461. policyCode: "",
  462. policyRemark: "",
  463. jxsName: "",
  464. date: "",
  465. zbMan: "",
  466. shMan: "",
  467. status: "",
  468. },
  469. statusList: [
  470. { label: "已保存", value: "SAVE" },
  471. { label: "待审核", value: "WAIT" },
  472. { label: "审核通过", value: "OK" },
  473. { label: "审核驳回", value: "FAIL" },
  474. ],
  475. queryItem: {},
  476. isShowDetail: false,
  477. isShowForm: false,
  478. isShowExamine: false,
  479. isShowReturn: false,
  480. };
  481. },
  482. computed: {
  483. exParams() {
  484. return {
  485. examineStatus: this.screenForm.status,
  486. id: this.screenForm.orderNum,
  487. policyCode: this.screenForm.policyCode,
  488. policyRemark: this.screenForm.policyRemark,
  489. customer: this.screenForm.jxsName,
  490. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  491. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  492. createBy: this.screenForm.zbMan,
  493. examineBy: this.screenForm.shMan,
  494. type: 2, // 1:普通零售单,2:政策零售单
  495. };
  496. },
  497. },
  498. beforeCreate() {
  499. that = this;
  500. },
  501. created() {
  502. this.getList();
  503. },
  504. methods: {
  505. // 查询按钮权限
  506. checkBtnRole(value) {
  507. // let btnRole = this.$route.meta.roles;
  508. // if(!btnRole) {return true}
  509. // let index = btnRole.indexOf(value);
  510. // return index >= 0;
  511. return true;
  512. },
  513. // 查询列表
  514. getList() {
  515. this.listLoading = true;
  516. let params = {
  517. pageNum: this.currentPage,
  518. pageSize: this.pageSize,
  519. examineStatus: this.screenForm.status,
  520. id: this.screenForm.orderNum,
  521. policyCode: this.screenForm.policyCode,
  522. policyRemark: this.screenForm.policyRemark,
  523. customer: this.screenForm.jxsName,
  524. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  525. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  526. createBy: this.screenForm.zbMan,
  527. status: true,
  528. examineBy: this.screenForm.shMan,
  529. type: 2, // 1:普通零售单,2:政策零售单
  530. };
  531. getList(params).then((res) => {
  532. this.dataList = res.data.records;
  533. this.listTotal = res.data.total;
  534. this.listLoading = false;
  535. });
  536. },
  537. // 提交筛选表单
  538. submitScreenForm() {
  539. this.currentPage = 1;
  540. this.getList();
  541. },
  542. // 重置筛选表单
  543. resetScreenForm() {
  544. this.$refs.screenForm.resetFields();
  545. this.currentPage = 1;
  546. this.getList();
  547. },
  548. // 更改每页数量
  549. handleSizeChange(val) {
  550. this.pageSize = val;
  551. this.currentPage = 1;
  552. this.getList();
  553. },
  554. // 更改当前页
  555. handleCurrentChange(val) {
  556. this.currentPage = val;
  557. this.getList();
  558. },
  559. // 进入表单
  560. toForm(item) {
  561. this.queryItem = item;
  562. this.isShowForm = true;
  563. },
  564. // 进入详情
  565. toDetail(item) {
  566. this.queryItem = item;
  567. this.isShowDetail = true;
  568. },
  569. // 进入审批
  570. toExamine(item) {
  571. this.queryItem = item;
  572. this.isShowExamine = true;
  573. },
  574. // 进入退订
  575. toReturn(item) {
  576. this.queryItem = item;
  577. this.isShowReturn = true;
  578. },
  579. backList() {
  580. this.queryItem = {};
  581. this.isShowDetail = false;
  582. this.isShowForm = false;
  583. this.isShowExamine = false;
  584. this.isShowReturn = false;
  585. },
  586. // 关闭
  587. handleClose(id) {
  588. closeData({ id }).then((res) => {
  589. this.$successMsg();
  590. this.getList();
  591. });
  592. },
  593. // 提审
  594. handleSubmit(id) {
  595. submitData({ id }).then((res) => {
  596. this.$successMsg();
  597. this.getList();
  598. });
  599. },
  600. //撤回
  601. handleCancel(id) {
  602. submitCancel({ id }).then((res) => {
  603. this.$successMsg();
  604. this.getList();
  605. });
  606. },
  607. },
  608. };
  609. </script>
  610. <style lang="scss" scoped></style>