policy_list.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556
  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="id"
  137. min-width="180"
  138. show-overflow-tooltip
  139. ></el-table-column>
  140. <el-table-column
  141. align="center"
  142. label="订单日期"
  143. prop="theTime"
  144. min-width="100"
  145. show-overflow-tooltip
  146. >
  147. <template slot-scope="scope">
  148. {{ scope.row.theTime | dateToDayFilter }}
  149. </template>
  150. </el-table-column>
  151. <el-table-column
  152. align="center"
  153. label="销售类型"
  154. prop="saleTypeName"
  155. min-width="100"
  156. show-overflow-tooltip
  157. ></el-table-column>
  158. <el-table-column
  159. align="center"
  160. label="产品名称"
  161. prop="materialName"
  162. min-width="160"
  163. show-overflow-tooltip
  164. ></el-table-column>
  165. <el-table-column
  166. align="center"
  167. label="规格型号"
  168. prop="specification"
  169. min-width="160"
  170. show-overflow-tooltip
  171. ></el-table-column>
  172. <el-table-column
  173. align="center"
  174. label="计量单位"
  175. prop="unit"
  176. min-width="100"
  177. show-overflow-tooltip
  178. ></el-table-column>
  179. <el-table-column
  180. align="center"
  181. label="是否直调"
  182. prop="isDirectTransfer"
  183. min-width="100"
  184. show-overflow-tooltip
  185. >
  186. <template slot-scope="scope">
  187. {{ scope.row.isDirectTransfer ? "是" : "否" }}
  188. </template>
  189. </el-table-column>
  190. <el-table-column
  191. align="center"
  192. label="总数量"
  193. prop="totalQty"
  194. min-width="100"
  195. show-overflow-tooltip
  196. ></el-table-column>
  197. <el-table-column
  198. align="center"
  199. label="直调数量"
  200. prop="directTransferQty"
  201. min-width="100"
  202. show-overflow-tooltip
  203. ></el-table-column>
  204. <el-table-column
  205. align="center"
  206. label="出库数量"
  207. prop="aaa"
  208. min-width="100"
  209. show-overflow-tooltip
  210. ></el-table-column>
  211. <el-table-column
  212. align="center"
  213. label="单价"
  214. prop="price"
  215. min-width="100"
  216. show-overflow-tooltip
  217. ></el-table-column>
  218. <el-table-column
  219. align="center"
  220. label="金额"
  221. prop="totalAmount"
  222. min-width="100"
  223. show-overflow-tooltip
  224. ></el-table-column>
  225. <el-table-column
  226. align="center"
  227. label="返利使用比例"
  228. prop="rebateRate"
  229. min-width="110"
  230. show-overflow-tooltip
  231. ></el-table-column>
  232. <el-table-column
  233. align="center"
  234. label="返利"
  235. prop="rebateAmount"
  236. min-width="100"
  237. show-overflow-tooltip
  238. ></el-table-column>
  239. <el-table-column
  240. align="center"
  241. label="制表人"
  242. prop="createName"
  243. min-width="100"
  244. show-overflow-tooltip
  245. ></el-table-column>
  246. <el-table-column
  247. align="center"
  248. label="制表日期"
  249. prop="createTime"
  250. min-width="160"
  251. show-overflow-tooltip
  252. ></el-table-column>
  253. <el-table-column
  254. align="center"
  255. label="审核人"
  256. prop="examineName"
  257. min-width="100"
  258. show-overflow-tooltip
  259. ></el-table-column>
  260. <el-table-column
  261. align="center"
  262. label="审核日期"
  263. prop="examineTime"
  264. min-width="160"
  265. show-overflow-tooltip
  266. ></el-table-column>
  267. <el-table-column
  268. align="center"
  269. label="审核状态"
  270. prop="examineStatus"
  271. min-width="100"
  272. show-overflow-tooltip
  273. >
  274. <template slot-scope="scope">
  275. {{ scope.row.examineStatus | statusFilter }}
  276. </template>
  277. </el-table-column>
  278. <el-table-column
  279. align="center"
  280. label="操作"
  281. width="220"
  282. fixed="right"
  283. >
  284. <template slot-scope="scope">
  285. <el-button
  286. type="text"
  287. @click="toForm(scope.row)"
  288. v-if="scope.row.examineStatus === 'SAVE'"
  289. >编辑</el-button
  290. >
  291. <el-button
  292. type="text"
  293. @click="toExamine(scope.row)"
  294. v-if="scope.row.examineStatus === 'WAIT'"
  295. >审批</el-button
  296. >
  297. <el-button type="text" @click="toReturn(scope.row)"
  298. >退订</el-button
  299. >
  300. <el-button type="text" @click="toDetail(scope.row)"
  301. >详情</el-button
  302. >
  303. <el-popconfirm
  304. style="margin-left: 10px"
  305. title="确定提审吗?"
  306. @onConfirm="handleSubmit(scope.row.id)"
  307. v-if="scope.row.examineStatus === 'SAVE'"
  308. >
  309. <el-button slot="reference" type="text">提审</el-button>
  310. </el-popconfirm>
  311. <el-popconfirm
  312. style="margin-left: 10px"
  313. title="确定关闭吗?"
  314. @onConfirm="handleClose(scope.row.id)"
  315. v-if="!scope.row.closeTime"
  316. >
  317. <el-button slot="reference" type="text">关闭</el-button>
  318. </el-popconfirm>
  319. </template>
  320. </el-table-column>
  321. </el-table>
  322. </div>
  323. </div>
  324. <div class="pagination clearfix">
  325. <div class="fr">
  326. <el-pagination
  327. @size-change="handleSizeChange"
  328. @current-change="handleCurrentChange"
  329. :current-page="currentPage"
  330. :page-sizes="[10, 20, 30, 50]"
  331. :page-size="10"
  332. layout="total, sizes, prev, pager, next, jumper"
  333. :total="listTotal"
  334. >
  335. </el-pagination>
  336. </div>
  337. </div>
  338. </div>
  339. <RetailDetail
  340. :listItem="queryItem"
  341. v-if="isShowDetail"
  342. @backListFormDetail="backList"
  343. />
  344. <RetailForm
  345. :listItem="queryItem"
  346. v-if="isShowForm"
  347. @backListFormDetail="backList"
  348. />
  349. <RetailExamine
  350. :listItem="queryItem"
  351. v-if="isShowExamine"
  352. @backListFormDetail="backList"
  353. />
  354. <RetailReturn
  355. :listItem="queryItem"
  356. v-if="isShowReturn"
  357. @backListFormDetail="backList"
  358. />
  359. </div>
  360. </template>
  361. <script>
  362. import { getList, closeData, submitData } from "@/api/supply/retail";
  363. import RetailDetail from "@/views/supply/retail/components/retail_detail";
  364. import RetailForm from "@/views/supply/retail/components/retail_form";
  365. import RetailExamine from "@/views/supply/retail/components/retail_examine";
  366. import RetailReturn from "@/views/supply/retail/components/retail_return";
  367. let that;
  368. export default {
  369. components: {
  370. RetailDetail,
  371. RetailForm,
  372. RetailExamine,
  373. RetailReturn,
  374. },
  375. filters: {
  376. statusFilter(val) {
  377. let obj = that.statusList.find((o) => o.value == val);
  378. return obj ? obj.label : "";
  379. },
  380. },
  381. data() {
  382. return {
  383. currentPage: 1, // 当前页码
  384. pageSize: 10, // 每页数量
  385. listTotal: 0, // 列表总数
  386. dataList: null, // 列表数据
  387. listLoading: false, // 列表加载loading
  388. screenForm: {
  389. // 筛选表单数据
  390. orderNum: "",
  391. policyCode: "",
  392. policyRemark: "",
  393. jxsName: "",
  394. date: "",
  395. zbMan: "",
  396. shMan: "",
  397. status: "",
  398. },
  399. statusList: [
  400. { label: "已保存", value: "SAVE" },
  401. { label: "待审核", value: "WAIT" },
  402. { label: "审核通过", value: "OK" },
  403. { label: "审核驳回", value: "FAIL" },
  404. ],
  405. queryItem: {},
  406. isShowDetail: false,
  407. isShowForm: false,
  408. isShowExamine: false,
  409. isShowReturn: false,
  410. };
  411. },
  412. computed: {
  413. exParams() {
  414. return {
  415. examineStatus: this.screenForm.status,
  416. id: this.screenForm.orderNum,
  417. policyCode: this.screenForm.policyCode,
  418. policyRemark: this.screenForm.policyRemark,
  419. customer: this.screenForm.jxsName,
  420. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  421. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  422. createBy: this.screenForm.zbMan,
  423. examineBy: this.screenForm.shMan,
  424. type: 2, // 1:普通零售单,2:政策零售单
  425. };
  426. },
  427. },
  428. beforeCreate() {
  429. that = this;
  430. },
  431. created() {
  432. this.getList();
  433. },
  434. methods: {
  435. // 查询按钮权限
  436. checkBtnRole(value) {
  437. // let btnRole = this.$route.meta.roles;
  438. // if(!btnRole) {return true}
  439. // let index = btnRole.indexOf(value);
  440. // return index >= 0;
  441. return true;
  442. },
  443. // 查询列表
  444. getList() {
  445. this.listLoading = true;
  446. let params = {
  447. pageNum: this.currentPage,
  448. pageSize: this.pageSize,
  449. examineStatus: this.screenForm.status,
  450. id: this.screenForm.orderNum,
  451. policyCode: this.screenForm.policyCode,
  452. policyRemark: this.screenForm.policyRemark,
  453. customer: this.screenForm.jxsName,
  454. startTime: this.screenForm.date ? this.screenForm.date[0] : "",
  455. endTime: this.screenForm.date ? this.screenForm.date[1] : "",
  456. createBy: this.screenForm.zbMan,
  457. examineBy: this.screenForm.shMan,
  458. type: 2, // 1:普通零售单,2:政策零售单
  459. };
  460. getList(params).then((res) => {
  461. this.dataList = res.data.records;
  462. this.listTotal = res.data.total;
  463. this.listLoading = false;
  464. });
  465. },
  466. // 提交筛选表单
  467. submitScreenForm() {
  468. this.currentPage = 1;
  469. this.getList();
  470. },
  471. // 重置筛选表单
  472. resetScreenForm() {
  473. this.$refs.screenForm.resetFields();
  474. this.currentPage = 1;
  475. this.getList();
  476. },
  477. // 更改每页数量
  478. handleSizeChange(val) {
  479. this.pageSize = val;
  480. this.currentPage = 1;
  481. this.getList();
  482. },
  483. // 更改当前页
  484. handleCurrentChange(val) {
  485. this.currentPage = val;
  486. this.getList();
  487. },
  488. // 进入表单
  489. toForm(item) {
  490. this.queryItem = item;
  491. this.isShowForm = true;
  492. },
  493. // 进入详情
  494. toDetail(item) {
  495. this.queryItem = item;
  496. this.isShowDetail = true;
  497. },
  498. // 进入审批
  499. toExamine(item) {
  500. this.queryItem = item;
  501. this.isShowExamine = true;
  502. },
  503. // 进入退订
  504. toReturn(item) {
  505. this.queryItem = item;
  506. this.isShowReturn = true;
  507. },
  508. backList() {
  509. this.queryItem = {};
  510. this.isShowDetail = false;
  511. this.isShowForm = false;
  512. this.isShowExamine = false;
  513. this.isShowReturn = false;
  514. },
  515. // 关闭
  516. handleClose(id) {
  517. closeData({ id }).then((res) => {
  518. this.$successMsg();
  519. this.getList();
  520. });
  521. },
  522. // 提审
  523. handleSubmit(id) {
  524. submitData({ id }).then((res) => {
  525. this.$successMsg();
  526. this.getList();
  527. });
  528. },
  529. },
  530. };
  531. </script>
  532. <style lang="scss" scoped></style>