policy_list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  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="totalQty"
  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="totalAmount"
  240. min-width="100"
  241. show-overflow-tooltip
  242. ></el-table-column>
  243. <el-table-column
  244. align="center"
  245. label="返利使用比例"
  246. prop="rebateRate"
  247. min-width="110"
  248. show-overflow-tooltip
  249. ></el-table-column>
  250. <el-table-column
  251. align="center"
  252. label="返利"
  253. prop="rebateAmount"
  254. min-width="100"
  255. show-overflow-tooltip
  256. ></el-table-column>
  257. <el-table-column
  258. align="center"
  259. label="直调数量"
  260. prop="directTransferQty"
  261. min-width="100"
  262. show-overflow-tooltip
  263. ></el-table-column>
  264. <el-table-column
  265. align="center"
  266. label="出库数量"
  267. prop="hasSendQty"
  268. min-width="100"
  269. show-overflow-tooltip
  270. ></el-table-column>
  271. <el-table-column
  272. align="center"
  273. label="业务员"
  274. prop="serviceName"
  275. min-width="100"
  276. show-overflow-tooltip
  277. ></el-table-column>
  278. <el-table-column
  279. align="center"
  280. label="制表人"
  281. prop="createName"
  282. min-width="100"
  283. show-overflow-tooltip
  284. ></el-table-column>
  285. <el-table-column
  286. align="center"
  287. label="制表日期"
  288. prop="createTime"
  289. min-width="160"
  290. show-overflow-tooltip
  291. ></el-table-column>
  292. <el-table-column
  293. align="center"
  294. label="审核人"
  295. prop="examineName"
  296. min-width="100"
  297. show-overflow-tooltip
  298. ></el-table-column>
  299. <el-table-column
  300. align="center"
  301. label="审核日期"
  302. prop="examineTime"
  303. min-width="160"
  304. show-overflow-tooltip
  305. ></el-table-column>
  306. <el-table-column
  307. align="center"
  308. label="审核状态"
  309. prop="examineStatus"
  310. min-width="100"
  311. show-overflow-tooltip
  312. >
  313. <template slot-scope="scope">
  314. {{ scope.row.examineStatus | statusFilter }}
  315. </template>
  316. </el-table-column>
  317. <el-table-column
  318. align="center"
  319. label="操作"
  320. width="220"
  321. fixed="right"
  322. >
  323. <template slot-scope="scope">
  324. <el-popconfirm
  325. v-if="scope.row.examineStatus === 'SAVE'"
  326. style="margin-right: 10px"
  327. title="确定撤回?"
  328. @onConfirm="handleSubmit(scope.row.id)"
  329. >
  330. <el-button slot="reference" type="text">提审</el-button>
  331. </el-popconfirm>
  332. <el-button type="text" @click="toForm(scope.row)"
  333. >编辑</el-button
  334. >
  335. <el-popconfirm
  336. v-if="scope.row.examineStatus == 'WAIT'"
  337. style="margin-left: 10px"
  338. title="确定撤回?"
  339. @onConfirm="handleCancel(scope.row.id)"
  340. >
  341. <el-button slot="reference" type="text">撤回</el-button>
  342. </el-popconfirm>
  343. <el-button
  344. style="margin-left: 10px"
  345. type="text"
  346. @click="toDetail(scope.row)"
  347. >详情</el-button
  348. >
  349. <el-popconfirm
  350. style="margin-left: 10px"
  351. title="确定关闭吗?"
  352. @onConfirm="handleClose(scope.row.id)"
  353. v-if="!scope.row.closeTime"
  354. >
  355. <el-button slot="reference" type="text">关闭</el-button>
  356. </el-popconfirm>
  357. </template>
  358. </el-table-column>
  359. </el-table>
  360. </div>
  361. </div>
  362. <div class="pagination clearfix">
  363. <div class="fr">
  364. <el-pagination
  365. @size-change="handleSizeChange"
  366. @current-change="handleCurrentChange"
  367. :current-page="currentPage"
  368. :page-sizes="[10, 20, 30, 50]"
  369. :page-size="10"
  370. layout="total, sizes, prev, pager, next, jumper"
  371. :total="listTotal"
  372. >
  373. </el-pagination>
  374. </div>
  375. </div>
  376. </div>
  377. <RetailDetail
  378. :listItem="queryItem"
  379. v-if="isShowDetail"
  380. @backListFormDetail="backList"
  381. />
  382. <RetailForm
  383. :listItem="queryItem"
  384. v-if="isShowForm"
  385. @backListFormDetail="backList"
  386. />
  387. <RetailExamine
  388. :listItem="queryItem"
  389. v-if="isShowExamine"
  390. @backListFormDetail="backList"
  391. />
  392. <RetailReturn
  393. :listItem="queryItem"
  394. v-if="isShowReturn"
  395. @backListFormDetail="backList"
  396. />
  397. </div>
  398. </template>
  399. <script>
  400. import {
  401. getList,
  402. closeData,
  403. submitData,
  404. submitCancel,
  405. } from "@/api/supply/policy";
  406. import RetailDetail from "./components/retail_detail";
  407. import RetailForm from "./components/retail_form";
  408. import RetailExamine from "./components/retail_examine";
  409. import RetailReturn from "./components/retail_return";
  410. let that;
  411. export default {
  412. components: {
  413. RetailDetail,
  414. RetailForm,
  415. RetailExamine,
  416. RetailReturn,
  417. },
  418. filters: {
  419. statusFilter(val) {
  420. let obj = that.statusList.find((o) => o.value == val);
  421. return obj ? obj.label : "";
  422. },
  423. },
  424. data() {
  425. return {
  426. currentPage: 1, // 当前页码
  427. pageSize: 10, // 每页数量
  428. listTotal: 0, // 列表总数
  429. dataList: null, // 列表数据
  430. listLoading: false, // 列表加载loading
  431. screenForm: {
  432. // 筛选表单数据
  433. orderNum: "",
  434. policyCode: "",
  435. policyRemark: "",
  436. jxsName: "",
  437. date: "",
  438. zbMan: "",
  439. shMan: "",
  440. status: "",
  441. },
  442. statusList: [
  443. { label: "已保存", value: "SAVE" },
  444. { label: "待审核", value: "WAIT" },
  445. { label: "审核通过", value: "OK" },
  446. { label: "审核驳回", value: "FAIL" },
  447. ],
  448. queryItem: {},
  449. isShowDetail: false,
  450. isShowForm: false,
  451. isShowExamine: false,
  452. isShowReturn: false,
  453. };
  454. },
  455. computed: {
  456. exParams() {
  457. return {
  458. examineStatus: this.screenForm.status,
  459. id: this.screenForm.orderNum,
  460. policyCode: this.screenForm.policyCode,
  461. policyRemark: this.screenForm.policyRemark,
  462. customer: this.screenForm.jxsName,
  463. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  464. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  465. createBy: this.screenForm.zbMan,
  466. examineBy: this.screenForm.shMan,
  467. type: 2, // 1:普通零售单,2:政策零售单
  468. };
  469. },
  470. },
  471. beforeCreate() {
  472. that = this;
  473. },
  474. created() {
  475. this.getList();
  476. },
  477. methods: {
  478. // 查询按钮权限
  479. checkBtnRole(value) {
  480. // let btnRole = this.$route.meta.roles;
  481. // if(!btnRole) {return true}
  482. // let index = btnRole.indexOf(value);
  483. // return index >= 0;
  484. return true;
  485. },
  486. // 查询列表
  487. getList() {
  488. this.listLoading = true;
  489. let params = {
  490. pageNum: this.currentPage,
  491. pageSize: this.pageSize,
  492. examineStatus: this.screenForm.status,
  493. id: this.screenForm.orderNum,
  494. policyCode: this.screenForm.policyCode,
  495. policyRemark: this.screenForm.policyRemark,
  496. customer: this.screenForm.jxsName,
  497. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  498. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  499. createBy: this.screenForm.zbMan,
  500. examineBy: this.screenForm.shMan,
  501. type: 2, // 1:普通零售单,2:政策零售单
  502. };
  503. getList(params).then((res) => {
  504. this.dataList = res.data.records;
  505. this.listTotal = res.data.total;
  506. this.listLoading = false;
  507. });
  508. },
  509. // 提交筛选表单
  510. submitScreenForm() {
  511. this.currentPage = 1;
  512. this.getList();
  513. },
  514. // 重置筛选表单
  515. resetScreenForm() {
  516. this.$refs.screenForm.resetFields();
  517. this.currentPage = 1;
  518. this.getList();
  519. },
  520. // 更改每页数量
  521. handleSizeChange(val) {
  522. this.pageSize = val;
  523. this.currentPage = 1;
  524. this.getList();
  525. },
  526. // 更改当前页
  527. handleCurrentChange(val) {
  528. this.currentPage = val;
  529. this.getList();
  530. },
  531. // 进入表单
  532. toForm(item) {
  533. this.queryItem = item;
  534. this.isShowForm = true;
  535. },
  536. // 进入详情
  537. toDetail(item) {
  538. this.queryItem = item;
  539. this.isShowDetail = true;
  540. },
  541. // 进入审批
  542. toExamine(item) {
  543. this.queryItem = item;
  544. this.isShowExamine = true;
  545. },
  546. // 进入退订
  547. toReturn(item) {
  548. this.queryItem = item;
  549. this.isShowReturn = true;
  550. },
  551. backList() {
  552. this.queryItem = {};
  553. this.isShowDetail = false;
  554. this.isShowForm = false;
  555. this.isShowExamine = false;
  556. this.isShowReturn = false;
  557. },
  558. // 关闭
  559. handleClose(id) {
  560. closeData({ id }).then((res) => {
  561. this.$successMsg();
  562. this.getList();
  563. });
  564. },
  565. // 提审
  566. handleSubmit(id) {
  567. submitData({ id }).then((res) => {
  568. this.$successMsg();
  569. this.getList();
  570. });
  571. },
  572. //撤回
  573. handleCancel(id) {
  574. submitCancel({ id }).then((res) => {
  575. this.$successMsg();
  576. this.getList();
  577. });
  578. },
  579. },
  580. };
  581. </script>
  582. <style lang="scss" scoped></style>