modify_list.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  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. type="text"
  349. class="textColor"
  350. @click="detailFn(scope.row.updPriceBillId)"
  351. >详情</el-button
  352. >
  353. </template>
  354. </el-table-column>
  355. </el-table>
  356. </div>
  357. <!-- 分页 -->
  358. <div class="fr">
  359. <el-pagination
  360. @size-change="handleSizeChange"
  361. @current-change="handleCurrentChange"
  362. :current-page="currentPage"
  363. :page-sizes="[10, 20, 30, 50]"
  364. :page-size="10"
  365. layout="total, sizes, prev, pager, next, jumper"
  366. :total="listTotal"
  367. >
  368. </el-pagination>
  369. </div>
  370. </div>
  371. </div>
  372. <ModifyListApply v-else-if="show === 2" />
  373. <ModifyListApproval v-else-if="show === 3" :detail="detail" />
  374. <ModifyListDetail v-else :detail="detail" />
  375. </div>
  376. </template>
  377. <script>
  378. import ModifyListApply from "./components/modify_list-apply.vue";
  379. import ModifyListApproval from "./components/modify_list-approval.vue";
  380. import ModifyListDetail from "./components/modify_list-detail.vue";
  381. import Mixin from "@/mixin/index";
  382. import {
  383. getProductRriceDetail,
  384. getProductRriceList,
  385. getProductRricedel,
  386. getTypeList,
  387. getPriceSubmit,
  388. } from "@/api/basic_data/material";
  389. import { downloadFiles } from "@/utils/util";
  390. export default {
  391. mixins: [Mixin],
  392. data() {
  393. return {
  394. show: 1,
  395. currentPage: 1, // 当前页码
  396. pageSize: 10, // 每页数量
  397. listTotal: 0, // 列表总数
  398. dataList: [
  399. {
  400. baseUnitId: "",
  401. batchPrice: "",
  402. billId: "",
  403. endDate: "",
  404. id: null,
  405. isPromote: "",
  406. isPublish: "",
  407. materialId: "",
  408. materialName: "",
  409. materialNumber: "",
  410. parentId: "",
  411. qty: "",
  412. rebateUseRate: "",
  413. retailPrice: "",
  414. saleTypeId: "",
  415. specification: "",
  416. startDate: "",
  417. wallets: [],
  418. },
  419. ],
  420. screenForm: {
  421. materialName: "",
  422. materialNumber: "",
  423. startDate: "",
  424. },
  425. liDetail: {},
  426. detail: {},
  427. obj: {
  428. baseUnitId: "",
  429. batchPrice: "",
  430. billId: "",
  431. endDate: "",
  432. id: null,
  433. isPromote: "",
  434. isPublish: "",
  435. materialId: "4",
  436. materialName: "",
  437. materialNumber: "",
  438. parentId: "",
  439. qty: "",
  440. rebateUseRate: "",
  441. retailPrice: "",
  442. saleTypeId: "",
  443. specification: "",
  444. startDate: "",
  445. wallets: [],
  446. },
  447. typeList: [],
  448. };
  449. },
  450. components: {
  451. ModifyListApply,
  452. ModifyListApproval,
  453. ModifyListDetail,
  454. },
  455. mounted() {
  456. let params = {
  457. pageNum: 1,
  458. pageSize: -1,
  459. saleCode: "",
  460. saleName: "",
  461. status: "",
  462. };
  463. getTypeList(params).then((res) => {
  464. this.typeList = res.data.records;
  465. });
  466. },
  467. methods: {
  468. formatterType(row) {
  469. for (let i = 0; i < this.typeList.length; i++) {
  470. if (this.typeList[i].id == row.saleTypeId) {
  471. return this.typeList[i].saleName;
  472. }
  473. }
  474. },
  475. addFn() {
  476. this.show = 2;
  477. },
  478. hanleDeleteAll(id) {
  479. this.hanleDeleteAllPromise(id).then((ids) => {
  480. getProductRricedel(ids).then((res) => {
  481. this.$successMsg("删除成功");
  482. this.getList();
  483. });
  484. });
  485. },
  486. handleGetPriceSubmit(id) {
  487. console.log(id);
  488. getPriceSubmit({ id }).then((res) => {
  489. this.$successMsg("已提审");
  490. this.getList();
  491. });
  492. },
  493. approvalFn(id) {
  494. getProductRriceDetail({ id }).then((res) => {
  495. this.detail = res.data;
  496. this.show = 3;
  497. });
  498. },
  499. detailFn(id) {
  500. getProductRriceDetail({ id }).then((res) => {
  501. this.detail = res.data;
  502. this.show = 4;
  503. });
  504. },
  505. getList() {
  506. this.listLoading = true;
  507. console.log(456654);
  508. let params = {
  509. pageNum: this.currentPage,
  510. pageSize: this.pageSize,
  511. materialName: this.screenForm.materialName,
  512. materialNumber: this.screenForm.materialNumber,
  513. startDate: this.screenForm.startDate,
  514. };
  515. getProductRriceList(params).then((res) => {
  516. this.dataList = res.data.records;
  517. this.listTotal = res.data.total;
  518. this.listLoading = false;
  519. });
  520. },
  521. editFn(id, row) {
  522. this.diaLogForm = {
  523. id,
  524. composeNumber: row.composeNumber,
  525. items: row.items === undefined ? [] : row.items,
  526. materialId: row.materialId,
  527. orgNumber: row.orgNumber,
  528. productModel: row.productModel,
  529. productVolume: row.productVolume,
  530. };
  531. this.showDialogForm = true;
  532. },
  533. hanleInfo() {
  534. if (this.type === 1) {
  535. getProductAdd(this.diaLogForm).then((res) => {
  536. this.$successMsg("保存成功");
  537. console.log(params, 123);
  538. this.getList();
  539. });
  540. } else if (this.type === 2) {
  541. const params = {
  542. ...this.diaLogForm,
  543. };
  544. console.log(params, 123);
  545. getProductEdit(params).then((res) => {
  546. this.$successMsg("编辑成功");
  547. this.getList();
  548. });
  549. this.diaLogForm.id = null;
  550. }
  551. this.showDialogForm = false;
  552. },
  553. hanleDelete(id) {
  554. this.hanleDeleteAllPromise(id).then((ids) => {
  555. getProductDel(ids).then((res) => {
  556. this.$successMsg("删除成功");
  557. });
  558. });
  559. },
  560. handleExport() {
  561. let screenData = {
  562. customerName: this.screenForm.customerName,
  563. freeDay: this.screenForm.freeDay,
  564. toll: this.screenForm.toll,
  565. };
  566. downloadFiles("/product-compose/export", screenData);
  567. },
  568. resetInfo() {
  569. this.diaLogForm = {
  570. id: null,
  571. composeNumber: "",
  572. id: "",
  573. items: [],
  574. materialId: "",
  575. orgNumber: 0,
  576. productModel: "",
  577. productVolume: "",
  578. };
  579. },
  580. },
  581. };
  582. </script>
  583. <style lang="scss" scoped>
  584. ::v-deep .el-select--small {
  585. width: 100%;
  586. }
  587. </style>