modify_list.vue 21 KB

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