modify_list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <div class="app-container">
  3. <div v-if="show === 1">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <el-form
  7. ref="screenForm"
  8. :model="screenForm"
  9. label-width="70px"
  10. size="small"
  11. label-position="left"
  12. >
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="存货编码" prop="materialNumber">
  16. <el-input
  17. placeholder="请输入存货编码"
  18. v-model="screenForm.materialNumber"
  19. ></el-input>
  20. </el-form-item>
  21. </el-col>
  22. <el-col :xs="24" :sm="12" :lg="6">
  23. <el-form-item label="存货名称" prop="materialName">
  24. <el-input
  25. placeholder="请输入存货名称"
  26. v-model="screenForm.materialName"
  27. ></el-input>
  28. </el-form-item>
  29. </el-col>
  30. <!-- <el-col :xs="24" :sm="12" :lg="6">
  31. <el-form-item label="存货代码" prop="account">
  32. <el-input placeholder="请输入存货代码" v-model="screenForm.account"></el-input>
  33. </el-form-item>
  34. </el-col> -->
  35. <el-col :xs="24" :sm="12" :lg="6">
  36. <el-form-item label="生效日期" prop="startDate">
  37. <el-date-picker
  38. v-model="screenForm.startDate"
  39. type="datetime"
  40. placeholder="请输入生效日期"
  41. value-format="yyyy-MM-dd HH:mm:ss"
  42. >
  43. </el-date-picker>
  44. <!-- <el-input placeholder="请输入生效日期" v-model="screenForm.startDate"></el-input> -->
  45. </el-form-item>
  46. </el-col>
  47. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  48. <el-form-item label="">
  49. <el-button size="small" @click="resetScreenForm"
  50. >清空</el-button
  51. >
  52. <el-button size="small" type="primary" @click="submitScreenForm"
  53. >搜索</el-button
  54. >
  55. </el-form-item>
  56. </el-col>
  57. </el-row>
  58. </el-form>
  59. </div>
  60. <!-- 按钮 -->
  61. <div class="btn-group clearfix">
  62. <div class="fl">
  63. <el-button type="primary" v-if="$checkBtnRole('add', $route.meta.roles)" icon="el-icon-plus" size="small" @click="addFn">新增</el-button>
  64. <!-- <el-button type="primary" size="small">编辑</el-button> -->
  65. <el-popconfirm
  66. v-if="$checkBtnRole('del', $route.meta.roles)"
  67. confirm-button-text="好的"
  68. cancel-button-text="不用了"
  69. icon="el-icon-info"
  70. icon-color="red"
  71. title="内容确定删除吗?"
  72. @onConfirm="hanleDeleteAll"
  73. >
  74. <el-button
  75. type="primary"
  76. size="small"
  77. icon="el-icon-delete"
  78. slot="reference"
  79. class="el-popover-left"
  80. >删除</el-button
  81. >
  82. </el-popconfirm>
  83. </div>
  84. <div class="fr">
  85. <!-- <el-button type="primary" size="small">导入</el-button>
  86. <el-button type="primary" size="small">导出</el-button>
  87. <el-button type="primary" size="small">打印</el-button> -->
  88. </div>
  89. </div>
  90. <div class="mymain-container">
  91. <!-- 列表 -->
  92. <div class="table">
  93. <el-table
  94. v-loading="listLoading"
  95. :data="dataList"
  96. element-loading-text="Loading"
  97. border
  98. fit
  99. highlight-current-row
  100. @select-all="hanleSelectAll"
  101. @select="hanleSelectAll"
  102. stripe
  103. >
  104. <el-table-column
  105. type="selection"
  106. align="center"
  107. width="50"
  108. ></el-table-column>
  109. <el-table-column
  110. align="center"
  111. label="单据号"
  112. prop="updPriceBillId"
  113. min-width="160"
  114. show-overflow-tooltip
  115. ></el-table-column>
  116. <el-table-column
  117. align="center"
  118. label="调价日期"
  119. prop="createTime"
  120. min-width="160"
  121. show-overflow-tooltip
  122. ></el-table-column>
  123. <el-table-column
  124. align="center"
  125. label="销售类型"
  126. prop="saleTypeName"
  127. :formatter="formatterType"
  128. min-width="160"
  129. show-overflow-tooltip
  130. ></el-table-column>
  131. <!-- <el-table-column
  132. align="center"
  133. label="产品品类"
  134. prop="mainName"
  135. min-width="160"
  136. show-overflow-tooltip
  137. ></el-table-column> -->
  138. <el-table-column
  139. align="center"
  140. label="存货编码"
  141. prop="materialNumber"
  142. min-width="160"
  143. show-overflow-tooltip
  144. ></el-table-column>
  145. <el-table-column
  146. align="center"
  147. label="存货名称"
  148. prop="materialName"
  149. min-width="160"
  150. show-overflow-tooltip
  151. ></el-table-column>
  152. <el-table-column
  153. align="center"
  154. label="规格型号"
  155. prop="specification"
  156. min-width="160"
  157. show-overflow-tooltip
  158. ></el-table-column>
  159. <el-table-column
  160. align="center"
  161. label="计量单位"
  162. prop="unit"
  163. min-width="160"
  164. show-overflow-tooltip
  165. ></el-table-column>
  166. <el-table-column
  167. align="center"
  168. label="数量"
  169. prop="qty"
  170. min-width="160"
  171. show-overflow-tooltip
  172. ></el-table-column>
  173. <el-table-column
  174. align="center"
  175. label="批发价"
  176. prop="batchPrice"
  177. min-width="160"
  178. show-overflow-tooltip
  179. ></el-table-column>
  180. <el-table-column
  181. align="center"
  182. label="格力折扣"
  183. prop="discAmount"
  184. min-width="160"
  185. show-overflow-tooltip
  186. ></el-table-column>
  187. <el-table-column
  188. align="center"
  189. label="生效日期"
  190. prop="startDate"
  191. min-width="160"
  192. show-overflow-tooltip
  193. ></el-table-column>
  194. <el-table-column
  195. align="center"
  196. label="失效日期"
  197. prop="endDate"
  198. min-width="160"
  199. show-overflow-tooltip
  200. ></el-table-column>
  201. <el-table-column
  202. align="center"
  203. label="是否促销价"
  204. prop="isPromote"
  205. min-width="160"
  206. show-overflow-tooltip
  207. >
  208. <template slot-scope="scope">
  209. <el-tag type="success" v-if="scope.row.isPromote">是</el-tag>
  210. <el-tag type="danger" v-else>否</el-tag>
  211. </template>
  212. </el-table-column>
  213. <el-table-column
  214. align="center"
  215. label="返利类型(钱包)"
  216. prop="wallets"
  217. min-width="200"
  218. show-overflow-tooltip
  219. >
  220. <template slot-scope="scope">
  221. <template v-for="(item, index) in scope.row.wallets">
  222. <template v-if="item.type === 'REBATE'">
  223. <el-tag
  224. type="success"
  225. style="margin: 0 10px"
  226. size="small"
  227. :key="index"
  228. >
  229. {{ item.walletName }}
  230. </el-tag>
  231. </template
  232. >
  233. </template>
  234. </template>
  235. </el-table-column>
  236. <el-table-column
  237. align="center"
  238. label="现金钱包"
  239. prop="modifyPriceDepartment"
  240. min-width="200"
  241. show-overflow-tooltip
  242. >
  243. <template slot-scope="scope">
  244. <template v-for="(item, index) in scope.row.wallets">
  245. <template v-if="item.type === 'COMMONLY'">
  246. <el-tag
  247. type="success"
  248. style="margin: 0 10px"
  249. size="small"
  250. :key="index"
  251. >
  252. {{ item.walletName }}
  253. </el-tag>
  254. </template
  255. >
  256. </template>
  257. </template>
  258. </el-table-column>
  259. <el-table-column
  260. align="center"
  261. label="调价部门"
  262. prop="adminWebsitName"
  263. min-width="160"
  264. show-overflow-tooltip
  265. ></el-table-column>
  266. <el-table-column
  267. align="center"
  268. label="调价业务员"
  269. prop="serviceName"
  270. min-width="160"
  271. show-overflow-tooltip
  272. ></el-table-column>
  273. <el-table-column
  274. align="center"
  275. label="制单日期"
  276. prop="createTime"
  277. min-width="160"
  278. show-overflow-tooltip
  279. ></el-table-column>
  280. <el-table-column
  281. align="center"
  282. label="审核人"
  283. prop="confirmName"
  284. min-width="160"
  285. show-overflow-tooltip
  286. ></el-table-column>
  287. <el-table-column
  288. align="center"
  289. label="审核日期"
  290. prop="confirmTime"
  291. min-width="160"
  292. show-overflow-tooltip
  293. ></el-table-column>
  294. <el-table-column
  295. align="center"
  296. label="状态"
  297. prop="examineStatus"
  298. min-width="160"
  299. show-overflow-tooltip
  300. >
  301. <template slot-scope="scope">
  302. <el-tag type="success" v-if="scope.row.examineStatus == 'SAVE'"
  303. >保存</el-tag
  304. >
  305. <el-tag
  306. type="danger"
  307. v-else-if="scope.row.examineStatus == 'WAIT'"
  308. >待审核</el-tag
  309. >
  310. <el-tag
  311. type="danger"
  312. v-else-if="scope.row.examineStatus == 'OK'"
  313. >通过</el-tag
  314. >
  315. <el-tag
  316. type="danger"
  317. v-else-if="scope.row.examineStatus == 'FAIL'"
  318. >不通过</el-tag
  319. >
  320. <el-tag type="danger" v-else>审核</el-tag>
  321. </template>
  322. </el-table-column>
  323. <el-table-column
  324. align="center"
  325. label="操作"
  326. min-width="160"
  327. show-overflow-tooltip
  328. >
  329. <template slot-scope="scope">
  330. <template v-if="scope.row.examineStatus == 'SAVE'">
  331. <el-popconfirm
  332. title="这是一段内容确定删除吗?"
  333. @onConfirm="handleGetPriceSubmit(scope.row.updPriceBillId)"
  334. style="margin-right: 10px"
  335. >
  336. <el-button type="text" slot="reference">提审</el-button>
  337. </el-popconfirm>
  338. </template>
  339. <template v-if="scope.row.examineStatus == 'WAIT'">
  340. <el-button
  341. type="text"
  342. class="textColor"
  343. @click="approvalFn(scope.row.updPriceBillId)"
  344. >审批</el-button
  345. >
  346. </template>
  347. <el-button
  348. v-if="scope.row.examineStatus == 'SAVE'"
  349. type="text"
  350. class="textColor"
  351. @click="editFn(scope.row.updPriceBillId,scope.row)"
  352. >编辑</el-button
  353. >
  354. <el-button
  355. type="text"
  356. class="textColor"
  357. @click="detailFn(scope.row.updPriceBillId)"
  358. >详情</el-button
  359. >
  360. </template>
  361. </el-table-column>
  362. </el-table>
  363. </div>
  364. <!-- 分页 -->
  365. <div class="fr">
  366. <el-pagination
  367. @size-change="handleSizeChange"
  368. @current-change="handleCurrentChange"
  369. :current-page="currentPage"
  370. :page-sizes="[10, 20, 30, 50]"
  371. :page-size="10"
  372. layout="total, sizes, prev, pager, next, jumper"
  373. :total="listTotal"
  374. >
  375. </el-pagination>
  376. </div>
  377. </div>
  378. </div>
  379. <ModifyListApply v-else-if="show === 2 || show==5" :cid='cid'/>
  380. <ModifyListApproval v-else-if="show === 3 " :detail="detail" />
  381. <ModifyListDetail v-else :detail="detail" />
  382. </div>
  383. </template>
  384. <script>
  385. import ModifyListApply from "./components/modify_list-apply.vue";
  386. import ModifyListApproval from "./components/modify_list-approval.vue";
  387. import ModifyListDetail from "./components/modify_list-detail.vue";
  388. import Mixin from "@/mixin/index";
  389. import {
  390. getProductRriceDetail,
  391. getProductRriceList,
  392. getProductRricedel,
  393. getTypeList,
  394. getPriceSubmit,
  395. } from "@/api/basic_data/material";
  396. import { downloadFiles } from "@/utils/util";
  397. export default {
  398. mixins: [Mixin],
  399. data() {
  400. return {
  401. show: 1,
  402. currentPage: 1, // 当前页码
  403. pageSize: 10, // 每页数量
  404. listTotal: 0, // 列表总数
  405. dataList: [
  406. {
  407. baseUnitId: "",
  408. batchPrice: "",
  409. billId: "",
  410. endDate: "",
  411. id: null,
  412. isPromote: "",
  413. isPublish: "",
  414. materialId: "",
  415. materialName: "",
  416. materialNumber: "",
  417. parentId: "",
  418. qty: "",
  419. rebateUseRate: "",
  420. retailPrice: "",
  421. saleTypeId: "",
  422. specification: "",
  423. startDate: "",
  424. wallets: [],
  425. },
  426. ],
  427. screenForm: {
  428. materialName: "",
  429. materialNumber: "",
  430. startDate: "",
  431. },
  432. liDetail: {},
  433. detail: {},
  434. obj: {
  435. baseUnitId: "",
  436. batchPrice: "",
  437. billId: "",
  438. endDate: "",
  439. id: null,
  440. isPromote: "",
  441. isPublish: "",
  442. materialId: "4",
  443. materialName: "",
  444. materialNumber: "",
  445. parentId: "",
  446. qty: "",
  447. rebateUseRate: "",
  448. retailPrice: "",
  449. saleTypeId: "",
  450. specification: "",
  451. startDate: "",
  452. wallets: [],
  453. },
  454. cid:'',
  455. typeList: [],
  456. };
  457. },
  458. components: {
  459. ModifyListApply,
  460. ModifyListApproval,
  461. ModifyListDetail,
  462. },
  463. mounted() {
  464. let params = {
  465. pageNum: 1,
  466. pageSize: -1,
  467. saleCode: "",
  468. saleName: "",
  469. status: "",
  470. };
  471. getTypeList(params).then((res) => {
  472. this.typeList = res.data.records;
  473. });
  474. },
  475. methods: {
  476. formatterType(row) {
  477. for (let i = 0; i < this.typeList.length; i++) {
  478. if (this.typeList[i].id == row.saleTypeId) {
  479. return this.typeList[i].saleName;
  480. }
  481. }
  482. },
  483. addFn() {
  484. this.show = 2;
  485. },
  486. hanleDeleteAll(id) {
  487. this.hanleDeleteAllPromise(id).then((ids) => {
  488. getProductRricedel(ids).then((res) => {
  489. this.$successMsg("删除成功");
  490. this.getList();
  491. });
  492. });
  493. },
  494. handleGetPriceSubmit(id) {
  495. console.log(id);
  496. getPriceSubmit({ id }).then((res) => {
  497. this.$successMsg("已提审");
  498. this.getList();
  499. });
  500. },
  501. approvalFn(id) {
  502. getProductRriceDetail({ id }).then((res) => {
  503. this.detail = res.data;
  504. this.show = 3;
  505. });
  506. },
  507. detailFn(id) {
  508. getProductRriceDetail({ id }).then((res) => {
  509. this.detail = res.data;
  510. this.show = 2;
  511. });
  512. },
  513. getList() {
  514. this.listLoading = true;
  515. console.log(456654);
  516. let params = {
  517. pageNum: this.currentPage,
  518. pageSize: this.pageSize,
  519. materialName: this.screenForm.materialName,
  520. materialNumber: this.screenForm.materialNumber,
  521. startDate: this.screenForm.startDate,
  522. };
  523. getProductRriceList(params).then((res) => {
  524. this.dataList = res.data.records;
  525. this.listTotal = res.data.total;
  526. this.listLoading = false;
  527. });
  528. },
  529. editFn(id, row) {
  530. this.cid = id
  531. this.show = 5;
  532. // this.diaLogForm = {
  533. // id,
  534. // composeNumber: row.composeNumber,
  535. // items: row.items === undefined ? [] : row.items,
  536. // materialId: row.materialId,
  537. // orgNumber: row.orgNumber,
  538. // productModel: row.productModel,
  539. // productVolume: row.productVolume,
  540. // };
  541. // this.showDialogForm = true;
  542. },
  543. hanleInfo() {
  544. if (this.type === 1) {
  545. getProductAdd(this.diaLogForm).then((res) => {
  546. this.$successMsg("保存成功");
  547. console.log(params, 123);
  548. this.getList();
  549. });
  550. } else if (this.type === 2) {
  551. const params = {
  552. ...this.diaLogForm,
  553. };
  554. console.log(params, 123);
  555. getProductEdit(params).then((res) => {
  556. this.$successMsg("编辑成功");
  557. this.getList();
  558. });
  559. this.diaLogForm.id = null;
  560. }
  561. this.showDialogForm = false;
  562. },
  563. hanleDelete(id) {
  564. this.hanleDeleteAllPromise(id).then((ids) => {
  565. getProductDel(ids).then((res) => {
  566. this.$successMsg("删除成功");
  567. });
  568. });
  569. },
  570. handleExport() {
  571. let screenData = {
  572. customerName: this.screenForm.customerName,
  573. freeDay: this.screenForm.freeDay,
  574. toll: this.screenForm.toll,
  575. };
  576. downloadFiles("/product-compose/export", screenData);
  577. },
  578. resetInfo() {
  579. this.diaLogForm = {
  580. id: null,
  581. composeNumber: "",
  582. id: "",
  583. items: [],
  584. materialId: "",
  585. orgNumber: 0,
  586. productModel: "",
  587. productVolume: "",
  588. };
  589. },
  590. },
  591. };
  592. </script>
  593. <style lang="scss" scoped>
  594. ::v-deep .el-select--small {
  595. width: 100%;
  596. }
  597. </style>