modify_list.vue 18 KB

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