policy_list.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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="policyRemark"
  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-popconfirm
  376. style="margin-left: 10px"
  377. title="确定关闭吗?"
  378. @onConfirm="handleClose(scope.row.id)"
  379. v-if="!scope.row.closeTime"
  380. >
  381. <el-button slot="reference" type="text">关闭</el-button>
  382. </el-popconfirm>
  383. </template>
  384. </el-table-column>
  385. </el-table>
  386. </div>
  387. </div>
  388. <div class="pagination clearfix">
  389. <div class="fr">
  390. <el-pagination
  391. @size-change="handleSizeChange"
  392. @current-change="handleCurrentChange"
  393. :current-page="currentPage"
  394. :page-sizes="[10, 20, 30, 50]"
  395. :page-size="10"
  396. layout="total, sizes, prev, pager, next, jumper"
  397. :total="listTotal"
  398. >
  399. </el-pagination>
  400. </div>
  401. </div>
  402. </div>
  403. <RetailDetail
  404. :listItem="queryItem"
  405. v-if="isShowDetail"
  406. @backListFormDetail="backList"
  407. />
  408. <RetailForm
  409. :listItem="queryItem"
  410. v-if="isShowForm"
  411. @backListFormDetail="backList"
  412. />
  413. <RetailExamine
  414. :listItem="queryItem"
  415. v-if="isShowExamine"
  416. @backListFormDetail="backList"
  417. />
  418. <RetailReturn
  419. :listItem="queryItem"
  420. v-if="isShowReturn"
  421. @backListFormDetail="backList"
  422. />
  423. </div>
  424. </template>
  425. <script>
  426. import {
  427. getList,
  428. closeData,
  429. submitData,
  430. submitCancel,
  431. } from "@/api/supply/policy";
  432. import RetailDetail from "./components/retail_detail";
  433. import RetailForm from "./components/retail_form2";
  434. import RetailExamine from "./components/retail_examine";
  435. import RetailReturn from "./components/retail_return";
  436. let that;
  437. export default {
  438. components: {
  439. RetailDetail,
  440. RetailForm,
  441. RetailExamine,
  442. RetailReturn,
  443. },
  444. filters: {
  445. statusFilter(val) {
  446. let obj = that.statusList.find((o) => o.value == val);
  447. return obj ? obj.label : "";
  448. },
  449. },
  450. data() {
  451. return {
  452. currentPage: 1, // 当前页码
  453. pageSize: 10, // 每页数量
  454. listTotal: 0, // 列表总数
  455. dataList: null, // 列表数据
  456. listLoading: false, // 列表加载loading
  457. screenForm: {
  458. // 筛选表单数据
  459. orderNum: "",
  460. policyCode: "",
  461. policyRemark: "",
  462. jxsName: "",
  463. date: "",
  464. zbMan: "",
  465. shMan: "",
  466. status: "",
  467. },
  468. statusList: [
  469. { label: "已保存", value: "SAVE" },
  470. { label: "待审核", value: "WAIT" },
  471. { label: "审核通过", value: "OK" },
  472. { label: "审核驳回", value: "FAIL" },
  473. ],
  474. queryItem: {},
  475. isShowDetail: false,
  476. isShowForm: false,
  477. isShowExamine: false,
  478. isShowReturn: false,
  479. };
  480. },
  481. computed: {
  482. exParams() {
  483. return {
  484. examineStatus: this.screenForm.status,
  485. id: this.screenForm.orderNum,
  486. policyCode: this.screenForm.policyCode,
  487. policyRemark: this.screenForm.policyRemark,
  488. customer: this.screenForm.jxsName,
  489. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  490. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  491. createBy: this.screenForm.zbMan,
  492. examineBy: this.screenForm.shMan,
  493. type: 2, // 1:普通零售单,2:政策零售单
  494. };
  495. },
  496. },
  497. beforeCreate() {
  498. that = this;
  499. },
  500. created() {
  501. this.getList();
  502. },
  503. methods: {
  504. // 查询按钮权限
  505. checkBtnRole(value) {
  506. // let btnRole = this.$route.meta.roles;
  507. // if(!btnRole) {return true}
  508. // let index = btnRole.indexOf(value);
  509. // return index >= 0;
  510. return true;
  511. },
  512. // 查询列表
  513. getList() {
  514. this.listLoading = true;
  515. let params = {
  516. pageNum: this.currentPage,
  517. pageSize: this.pageSize,
  518. examineStatus: this.screenForm.status,
  519. id: this.screenForm.orderNum,
  520. policyCode: this.screenForm.policyCode,
  521. policyRemark: this.screenForm.policyRemark,
  522. customer: this.screenForm.jxsName,
  523. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  524. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  525. createBy: this.screenForm.zbMan,
  526. status: true,
  527. examineBy: this.screenForm.shMan,
  528. type: 2, // 1:普通零售单,2:政策零售单
  529. };
  530. getList(params).then((res) => {
  531. this.dataList = res.data.records;
  532. this.listTotal = res.data.total;
  533. this.listLoading = false;
  534. });
  535. },
  536. // 提交筛选表单
  537. submitScreenForm() {
  538. this.currentPage = 1;
  539. this.getList();
  540. },
  541. // 重置筛选表单
  542. resetScreenForm() {
  543. this.$refs.screenForm.resetFields();
  544. this.currentPage = 1;
  545. this.getList();
  546. },
  547. // 更改每页数量
  548. handleSizeChange(val) {
  549. this.pageSize = val;
  550. this.currentPage = 1;
  551. this.getList();
  552. },
  553. // 更改当前页
  554. handleCurrentChange(val) {
  555. this.currentPage = val;
  556. this.getList();
  557. },
  558. // 进入表单
  559. toForm(item) {
  560. this.queryItem = item;
  561. this.isShowForm = true;
  562. },
  563. // 进入详情
  564. toDetail(item) {
  565. this.queryItem = item;
  566. this.isShowDetail = true;
  567. },
  568. // 进入审批
  569. toExamine(item) {
  570. this.queryItem = item;
  571. this.isShowExamine = true;
  572. },
  573. // 进入退订
  574. toReturn(item) {
  575. this.queryItem = item;
  576. this.isShowReturn = true;
  577. },
  578. backList() {
  579. this.queryItem = {};
  580. this.isShowDetail = false;
  581. this.isShowForm = false;
  582. this.isShowExamine = false;
  583. this.isShowReturn = false;
  584. },
  585. // 关闭
  586. handleClose(id) {
  587. closeData({ id }).then((res) => {
  588. this.$successMsg();
  589. this.getList();
  590. });
  591. },
  592. // 提审
  593. handleSubmit(id) {
  594. submitData({ id }).then((res) => {
  595. this.$successMsg();
  596. this.getList();
  597. });
  598. },
  599. //撤回
  600. handleCancel(id) {
  601. submitCancel({ id }).then((res) => {
  602. this.$successMsg();
  603. this.getList();
  604. });
  605. },
  606. },
  607. };
  608. </script>
  609. <style lang="scss" scoped></style>