modify_list.vue 23 KB

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