modify_list.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  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="createTime"
  175. min-width="160"
  176. show-overflow-tooltip
  177. ></el-table-column>
  178. <el-table-column
  179. align="center"
  180. label="销售类型"
  181. prop="saleTypeName"
  182. :formatter="formatterType"
  183. min-width="160"
  184. show-overflow-tooltip
  185. ></el-table-column>
  186. <!-- <el-table-column
  187. align="center"
  188. label="产品品类"
  189. prop="mainName"
  190. min-width="160"
  191. show-overflow-tooltip
  192. ></el-table-column> -->
  193. <el-table-column
  194. align="center"
  195. label="存货编码"
  196. prop="materialNumber"
  197. min-width="160"
  198. show-overflow-tooltip
  199. ></el-table-column>
  200. <el-table-column
  201. align="center"
  202. label="存货名称"
  203. prop="materialName"
  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="startDate"
  246. min-width="160"
  247. show-overflow-tooltip
  248. ></el-table-column>
  249. <el-table-column
  250. align="center"
  251. label="失效日期"
  252. prop="endDate"
  253. min-width="160"
  254. show-overflow-tooltip
  255. ></el-table-column>
  256. <el-table-column
  257. align="center"
  258. label="是否促销价"
  259. prop="isPromote"
  260. min-width="160"
  261. show-overflow-tooltip
  262. >
  263. <template slot-scope="scope">
  264. <el-tag type="success" v-if="scope.row.isPromote">是</el-tag>
  265. <el-tag type="danger" v-else>否</el-tag>
  266. </template>
  267. </el-table-column>
  268. <el-table-column
  269. align="center"
  270. label="返利类型(钱包)"
  271. prop="wallets"
  272. min-width="200"
  273. show-overflow-tooltip
  274. >
  275. <template slot-scope="scope">
  276. <template v-for="(item, index) in scope.row.wallets">
  277. <template v-if="item.type === 'REBATE'">
  278. <el-tag
  279. type="success"
  280. style="margin: 0 10px"
  281. size="small"
  282. :key="index"
  283. >
  284. {{ item.walletName }}
  285. </el-tag>
  286. </template
  287. >
  288. </template>
  289. </template>
  290. </el-table-column>
  291. <el-table-column
  292. align="center"
  293. label="现金钱包"
  294. prop="modifyPriceDepartment"
  295. min-width="200"
  296. show-overflow-tooltip
  297. >
  298. <template slot-scope="scope">
  299. <template v-for="(item, index) in scope.row.wallets">
  300. <template v-if="item.type === 'COMMONLY'">
  301. <el-tag
  302. type="success"
  303. style="margin: 0 10px"
  304. size="small"
  305. :key="index"
  306. >
  307. {{ item.walletName }}
  308. </el-tag>
  309. </template
  310. >
  311. </template>
  312. </template>
  313. </el-table-column>
  314. <el-table-column
  315. align="center"
  316. label="调价部门"
  317. prop="adminWebsitName"
  318. min-width="160"
  319. show-overflow-tooltip
  320. ></el-table-column>
  321. <el-table-column
  322. align="center"
  323. label="调价业务员"
  324. prop="serviceName"
  325. min-width="160"
  326. show-overflow-tooltip
  327. ></el-table-column>
  328. <el-table-column
  329. align="center"
  330. label="制单日期"
  331. prop="createTime"
  332. min-width="160"
  333. show-overflow-tooltip
  334. ></el-table-column>
  335. <el-table-column
  336. align="center"
  337. label="审核人"
  338. prop="confirmName"
  339. min-width="160"
  340. show-overflow-tooltip
  341. ></el-table-column>
  342. <el-table-column
  343. align="center"
  344. label="审核日期"
  345. prop="confirmTime"
  346. min-width="160"
  347. show-overflow-tooltip
  348. ></el-table-column>
  349. <el-table-column
  350. align="center"
  351. label="状态"
  352. prop="examineStatus"
  353. min-width="160"
  354. show-overflow-tooltip
  355. >
  356. <template slot-scope="scope">
  357. <el-tag type="success" v-if="scope.row.examineStatus == 'SAVE'"
  358. >保存</el-tag
  359. >
  360. <el-tag
  361. type="danger"
  362. v-else-if="scope.row.examineStatus == 'WAIT'"
  363. >待审核</el-tag
  364. >
  365. <el-tag
  366. type="danger"
  367. v-else-if="scope.row.examineStatus == 'OK'"
  368. >通过</el-tag
  369. >
  370. <el-tag
  371. type="danger"
  372. v-else-if="scope.row.examineStatus == 'FAIL'"
  373. >不通过</el-tag
  374. >
  375. <el-tag type="danger" v-else>审核</el-tag>
  376. </template>
  377. </el-table-column>
  378. <el-table-column
  379. align="center"
  380. label="操作"
  381. min-width="160"
  382. show-overflow-tooltip
  383. >
  384. <template slot-scope="scope">
  385. <template v-if="scope.row.examineStatus == 'SAVE'">
  386. <el-popconfirm
  387. title="这是一段内容确定删除吗?"
  388. @onConfirm="handleGetPriceSubmit(scope.row.updPriceBillId)"
  389. style="margin-right: 10px"
  390. >
  391. <el-button type="text" slot="reference">提审</el-button>
  392. </el-popconfirm>
  393. </template>
  394. <template v-if="scope.row.examineStatus == 'WAIT'">
  395. <el-button
  396. type="text"
  397. class="textColor"
  398. @click="approvalFn(scope.row.updPriceBillId)"
  399. >审批</el-button
  400. >
  401. </template>
  402. <el-button
  403. v-if="scope.row.examineStatus == 'SAVE'"
  404. type="text"
  405. class="textColor"
  406. @click="editFn(scope.row.updPriceBillId,scope.row)"
  407. >编辑</el-button
  408. >
  409. <el-button
  410. type="text"
  411. class="textColor"
  412. @click="detailFn(scope.row.updPriceBillId)"
  413. >详情</el-button
  414. >
  415. </template>
  416. </el-table-column>
  417. </el-table>
  418. </div>
  419. <!-- 分页 -->
  420. <div class="fr">
  421. <el-pagination
  422. @size-change="handleSizeChange"
  423. @current-change="handleCurrentChange"
  424. :current-page="currentPage"
  425. :page-sizes="[10, 20, 30, 50]"
  426. :page-size="10"
  427. layout="total, sizes, prev, pager, next, jumper"
  428. :total="listTotal"
  429. >
  430. </el-pagination>
  431. </div>
  432. </div>
  433. </div>
  434. <ModifyListApply v-else-if="show === 2 || show==5" :cid='cid'/>
  435. <ModifyListApproval v-else-if="show === 3 " :detail="detail" />
  436. <ModifyListDetail v-else :detail="detail" />
  437. </div>
  438. </template>
  439. <script>
  440. import ModifyListApply from './components/modify_list-apply.vue'
  441. import ModifyListApproval from './components/modify_list-approval.vue'
  442. import ModifyListDetail from './components/modify_list-detail.vue'
  443. import Mixin from '@/mixin/index'
  444. import {
  445. getPriceSubmit,
  446. getProductRricedel,
  447. getProductRriceDetail,
  448. getProductRriceList,
  449. getTypeList
  450. } from '@/api/basic_data/material'
  451. import { downloadFiles } from '@/utils/util'
  452. import { getDictList } from '@/api/common'
  453. export default {
  454. mixins: [Mixin],
  455. data() {
  456. return {
  457. show: 1,
  458. currentPage: 1, // 当前页码
  459. pageSize: 10, // 每页数量
  460. listTotal: 0, // 列表总数
  461. dataList: [
  462. {
  463. baseUnitId: "",
  464. batchPrice: "",
  465. billId: "",
  466. endDate: "",
  467. id: null,
  468. isPromote: "",
  469. isPublish: "",
  470. materialId: "",
  471. materialName: "",
  472. materialNumber: "",
  473. parentId: "",
  474. qty: "",
  475. rebateUseRate: "",
  476. retailPrice: "",
  477. saleTypeId: "",
  478. specification: "",
  479. startDate: "",
  480. wallets: [],
  481. },
  482. ],
  483. screenForm: {
  484. materialName: "",
  485. materialNumber: "",
  486. startDate: "",
  487. materialOldNumber:'',
  488. saleTypeId:'',
  489. mainId:'',
  490. specification:''
  491. },
  492. liDetail: {},
  493. detail: {},
  494. obj: {
  495. baseUnitId: "",
  496. batchPrice: "",
  497. billId: "",
  498. endDate: "",
  499. id: null,
  500. isPromote: "",
  501. isPublish: "",
  502. materialId: "4",
  503. materialName: "",
  504. materialNumber: "",
  505. parentId: "",
  506. qty: "",
  507. rebateUseRate: "",
  508. retailPrice: "",
  509. saleTypeId: "",
  510. specification: "",
  511. startDate: "",
  512. wallets: [],
  513. },
  514. cid:'',
  515. typeList: [],
  516. dictList:[]
  517. };
  518. },
  519. components: {
  520. ModifyListApply,
  521. ModifyListApproval,
  522. ModifyListDetail,
  523. },
  524. computed:{
  525. exParams() {
  526. return {
  527. materialName: this.screenForm.materialName,
  528. materialNumber: this.screenForm.materialNumber,
  529. startDate:this.screenForm.startDate
  530. };
  531. },
  532. },
  533. mounted() {
  534. let params = {
  535. pageNum: 1,
  536. pageSize: -1,
  537. saleCode: "",
  538. saleName: "",
  539. status: "",
  540. };
  541. getTypeList(params).then((res) => {
  542. this.typeList = res.data.records;
  543. });
  544. getDictList({ sysDictEnum: "PRODUCT_TYPE" }).then((res) => {
  545. this.dictList = res.data;
  546. console.log(this.dictList)
  547. });
  548. },
  549. methods: {
  550. formatterType(row) {
  551. for (let i = 0; i < this.typeList.length; i++) {
  552. if (this.typeList[i].id == row.saleTypeId) {
  553. return this.typeList[i].saleName;
  554. }
  555. }
  556. },
  557. addFn() {
  558. this.show = 2;
  559. },
  560. hanleDeleteAll(id) {
  561. this.hanleDeleteAllPromise(id).then((ids) => {
  562. getProductRricedel(ids).then((res) => {
  563. this.$successMsg("删除成功");
  564. this.getList();
  565. });
  566. });
  567. },
  568. handleGetPriceSubmit(id) {
  569. console.log(id);
  570. getPriceSubmit({ id }).then((res) => {
  571. this.$successMsg("已提审");
  572. this.getList();
  573. });
  574. },
  575. approvalFn(id) {
  576. getProductRriceDetail({ id }).then((res) => {
  577. this.detail = res.data;
  578. this.show = 3;
  579. });
  580. },
  581. detailFn(id) {
  582. getProductRriceDetail({ id }).then((res) => {
  583. this.detail = res.data;
  584. this.show = 4;
  585. });
  586. },
  587. getList() {
  588. this.listLoading = true;
  589. console.log(456654);
  590. let params = {
  591. pageNum: this.currentPage,
  592. pageSize: this.pageSize,
  593. materialName: this.screenForm.materialName,
  594. materialNumber: this.screenForm.materialNumber,
  595. startDate: this.screenForm.startDate,
  596. materialOldNumber:this.screenForm.materialOldNumber,
  597. saleTypeId:this.screenForm.saleTypeId,
  598. mainId:this.screenForm.mainId,
  599. specification:this.screenForm.specification
  600. };
  601. getProductRriceList(params).then((res) => {
  602. this.dataList = res.data.records;
  603. this.listTotal = res.data.total;
  604. this.listLoading = false;
  605. });
  606. },
  607. editFn(id, row) {
  608. this.cid = id
  609. this.show = 5;
  610. // this.diaLogForm = {
  611. // id,
  612. // composeNumber: row.composeNumber,
  613. // items: row.items === undefined ? [] : row.items,
  614. // materialId: row.materialId,
  615. // orgNumber: row.orgNumber,
  616. // productModel: row.productModel,
  617. // productVolume: row.productVolume,
  618. // };
  619. // this.showDialogForm = true;
  620. },
  621. hanleInfo() {
  622. if (this.type === 1) {
  623. getProductAdd(this.diaLogForm).then((res) => {
  624. this.$successMsg("保存成功");
  625. console.log(params, 123);
  626. this.getList();
  627. });
  628. } else if (this.type === 2) {
  629. const params = {
  630. ...this.diaLogForm,
  631. };
  632. console.log(params, 123);
  633. getProductEdit(params).then((res) => {
  634. this.$successMsg("编辑成功");
  635. this.getList();
  636. });
  637. this.diaLogForm.id = null;
  638. }
  639. this.showDialogForm = false;
  640. },
  641. hanleDelete(id) {
  642. this.hanleDeleteAllPromise(id).then((ids) => {
  643. getProductDel(ids).then((res) => {
  644. this.$successMsg("删除成功");
  645. });
  646. });
  647. },
  648. handleExport() {
  649. let screenData = {
  650. customerName: this.screenForm.customerName,
  651. freeDay: this.screenForm.freeDay,
  652. toll: this.screenForm.toll,
  653. };
  654. downloadFiles("/product-compose/export", screenData);
  655. },
  656. resetInfo() {
  657. this.diaLogForm = {
  658. id: null,
  659. composeNumber: "",
  660. id: "",
  661. items: [],
  662. materialId: "",
  663. orgNumber: 0,
  664. productModel: "",
  665. productVolume: "",
  666. };
  667. },
  668. },
  669. };
  670. </script>
  671. <style lang="scss" scoped>
  672. ::v-deep .el-select--small {
  673. width: 100%;
  674. }
  675. </style>