modify_list.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829
  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-upload
  121. v-if="$checkBtnRole('add', $route.meta.roles)"
  122. style="margin-bottom: 10px;"
  123. class="import-btn"
  124. :action="baseURL + 'student/import'"
  125. :http-request="handleImport"
  126. :file-list="importFileList"
  127. :show-file-list="false"
  128. :disabled="importLoading"
  129. v-loading="importLoading"
  130. >
  131. <el-button
  132. type="primary"
  133. size="mini"
  134. >导入调价单
  135. </el-button>
  136. </el-upload>
  137. <el-button
  138. v-if="$checkBtnRole('add', $route.meta.roles)"
  139. type="primary"
  140. size="mini"
  141. @click="hanleDownloadFiles"
  142. >下载模板
  143. </el-button>
  144. <el-popconfirm
  145. v-if="$checkBtnRole('del', $route.meta.roles)"
  146. confirm-button-text="好的"
  147. cancel-button-text="不用了"
  148. icon="el-icon-info"
  149. icon-color="red"
  150. title="内容确定删除吗?"
  151. style="margin-right:10px"
  152. @onConfirm="hanleDeleteAll"
  153. >
  154. <el-button
  155. type="primary"
  156. size="mini"
  157. icon="el-icon-delete"
  158. slot="reference"
  159. class="el-popover-left"
  160. >删除</el-button
  161. >
  162. </el-popconfirm>
  163. <el-button size="mini" type="warning" icon="el-icon-finished" @click="batchExamine" v-if="$checkBtnRole('examine', $route.meta.roles)">批量审批</el-button>
  164. </div>
  165. <div class="fr">
  166. <ExportButton :exUrl="'/product-upd-price/export'" :exParams="exParams" />
  167. <!-- <el-button type="primary" size="mini">导入</el-button>
  168. <el-button type="primary" size="mini">导出</el-button>
  169. <el-button type="primary" size="mini">打印</el-button> -->
  170. </div>
  171. </div>
  172. <div class="mymain-container">
  173. <!-- 列表 -->
  174. <div class="table">
  175. <el-table
  176. v-loading="listLoading"
  177. :data="dataList"
  178. element-loading-text="Loading"
  179. border
  180. fit
  181. highlight-current-row
  182. @select-all="hanleSelectAll"
  183. @select="hanleSelectAll"
  184. stripe
  185. >
  186. <el-table-column
  187. type="selection"
  188. align="left"
  189. width="50"
  190. ></el-table-column>
  191. <el-table-column
  192. align="left"
  193. label="单据号"
  194. prop="updPriceBillId"
  195. min-width="200"
  196. show-overflow-tooltip
  197. >
  198. <template slot-scope="scope">
  199. <CopyButton :copyText="scope.row.updPriceBillId" />
  200. <span>{{scope.row.updPriceBillId}}</span>
  201. </template>
  202. </el-table-column>
  203. <el-table-column
  204. align="left"
  205. label="销售类型"
  206. prop="saleTypeName"
  207. :formatter="formatterType"
  208. min-width="160"
  209. show-overflow-tooltip
  210. ></el-table-column>
  211. <!-- <el-table-column
  212. align="left"
  213. label="产品类别"
  214. prop="mainName"
  215. min-width="160"
  216. show-overflow-tooltip
  217. ></el-table-column> -->
  218. <el-table-column
  219. align="left"
  220. label="物料编码"
  221. prop="materialNumber"
  222. min-width="160"
  223. show-overflow-tooltip
  224. >
  225. <template slot-scope="scope">
  226. <CopyButton :copyText="scope.row.materialNumber" />
  227. <span>{{scope.row.materialNumber}}</span>
  228. </template>
  229. </el-table-column>
  230. <el-table-column
  231. align="left"
  232. label="产品名称"
  233. prop="materialName"
  234. min-width="200"
  235. show-overflow-tooltip
  236. >
  237. <template slot-scope="scope">
  238. <CopyButton :copyText="scope.row.materialName" />
  239. <span>{{scope.row.materialName}}</span>
  240. </template>
  241. </el-table-column>
  242. <el-table-column
  243. align="left"
  244. label="产品编码"
  245. prop="materialOldNumber"
  246. min-width="200"
  247. show-overflow-tooltip
  248. >
  249. <template slot-scope="scope">
  250. <CopyButton :copyText="scope.row.materialOldNumber" />
  251. <span>{{scope.row.materialOldNumber}}</span>
  252. </template>
  253. </el-table-column>
  254. <el-table-column
  255. align="left"
  256. label="规格型号"
  257. prop="specification"
  258. min-width="200"
  259. show-overflow-tooltip
  260. >
  261. <template slot-scope="scope">
  262. <CopyButton :copyText="scope.row.specification" />
  263. <span>{{scope.row.specification}}</span>
  264. </template>
  265. </el-table-column>
  266. <el-table-column
  267. align="left"
  268. label="计量单位"
  269. prop="unit"
  270. min-width="160"
  271. show-overflow-tooltip
  272. ></el-table-column>
  273. <el-table-column
  274. align="right"
  275. label="数量"
  276. prop="qty"
  277. min-width="160"
  278. show-overflow-tooltip
  279. ></el-table-column>
  280. <el-table-column
  281. align="right"
  282. label="批发价"
  283. prop="batchPrice"
  284. min-width="160"
  285. show-overflow-tooltip
  286. ></el-table-column>
  287. <el-table-column
  288. align="right"
  289. label="格力折扣"
  290. prop="discAmount"
  291. min-width="160"
  292. show-overflow-tooltip
  293. ></el-table-column>
  294. <el-table-column
  295. align="left"
  296. label="调价日期"
  297. prop="createTime"
  298. min-width="200"
  299. show-overflow-tooltip
  300. ></el-table-column>
  301. <el-table-column
  302. align="left"
  303. label="生效日期"
  304. prop="startDate"
  305. min-width="200"
  306. show-overflow-tooltip
  307. ></el-table-column>
  308. <el-table-column
  309. align="left"
  310. label="失效日期"
  311. prop="endDate"
  312. min-width="200"
  313. show-overflow-tooltip
  314. ></el-table-column>
  315. <!-- <el-table-column
  316. align="left"
  317. label="是否促销价"
  318. prop="isPromote"
  319. min-width="160"
  320. show-overflow-tooltip
  321. >
  322. <template slot-scope="scope">
  323. <el-tag size="mini" type="success" v-if="scope.row.isPromote">是</el-tag>
  324. <el-tag size="mini" type="danger" v-else>否</el-tag>
  325. </template>
  326. </el-table-column> -->
  327. <el-table-column
  328. align="left"
  329. label="返利类型(钱包)"
  330. prop="wallets"
  331. min-width="250"
  332. show-overflow-tooltip
  333. >
  334. <template slot-scope="scope">
  335. <template v-for="(item, index) in comWallets( scope.row.wallets)">
  336. <template v-if="item.type === 'REBATE'">
  337. <el-tag
  338. type="success"
  339. style="margin: 0 10px"
  340. size="mini"
  341. :key="index"
  342. >
  343. {{ item.walletName }}
  344. </el-tag>
  345. </template
  346. >
  347. </template>
  348. </template>
  349. </el-table-column>
  350. <el-table-column
  351. align="left"
  352. label="现金钱包"
  353. prop="modifyPriceDepartment"
  354. min-width="350"
  355. show-overflow-tooltip
  356. >
  357. <template slot-scope="scope">
  358. <template v-for="(item, index) in comWallets(scope.row.wallets)">
  359. <template v-if="item.type === 'COMMONLY'">
  360. <el-tag
  361. type="success"
  362. style="margin: 0 10px"
  363. size="mini"
  364. :key="index"
  365. >
  366. {{ item.walletName }}
  367. </el-tag>
  368. </template
  369. >
  370. </template>
  371. </template>
  372. </el-table-column>
  373. <el-table-column
  374. align="left"
  375. label="调价部门"
  376. prop="adminWebsitName"
  377. min-width="200"
  378. show-overflow-tooltip
  379. ></el-table-column>
  380. <el-table-column
  381. align="left"
  382. label="调价业务员"
  383. prop="serviceName"
  384. min-width="200"
  385. show-overflow-tooltip
  386. ></el-table-column>
  387. <el-table-column
  388. align="left"
  389. label="制单日期"
  390. prop="createTime"
  391. min-width="200"
  392. show-overflow-tooltip
  393. ></el-table-column>
  394. <el-table-column
  395. align="left"
  396. label="审核人"
  397. prop="confirmName"
  398. min-width="200"
  399. show-overflow-tooltip
  400. ></el-table-column>
  401. <el-table-column
  402. align="left"
  403. label="审核日期"
  404. prop="confirmTime"
  405. min-width="200"
  406. show-overflow-tooltip
  407. ></el-table-column>
  408. <el-table-column
  409. align="left"
  410. label="状态"
  411. prop="examineStatus"
  412. min-width="160"
  413. show-overflow-tooltip
  414. >
  415. <template slot-scope="scope">
  416. <el-tag size="mini" type="success" v-if="scope.row.examineStatus == 'SAVE'"
  417. >保存</el-tag
  418. >
  419. <el-tag
  420. size="mini"
  421. type="danger"
  422. v-else-if="scope.row.examineStatus == 'WAIT'"
  423. >待审核</el-tag
  424. >
  425. <el-tag
  426. size="mini"
  427. type="danger"
  428. v-else-if="scope.row.examineStatus == 'OK'"
  429. >通过</el-tag
  430. >
  431. <el-tag
  432. size="mini"
  433. type="danger"
  434. v-else-if="scope.row.examineStatus == 'FAIL'"
  435. >不通过</el-tag
  436. >
  437. <el-tag size="mini" type="danger" v-else>审核</el-tag>
  438. </template>
  439. </el-table-column>
  440. <el-table-column
  441. align="center"
  442. label="操作"
  443. fixed="right"
  444. min-width="160"
  445. show-overflow-tooltip
  446. >
  447. <template slot-scope="scope">
  448. <template v-if="scope.row.examineStatus == 'SAVE'">
  449. <el-popconfirm
  450. title="确定提审吗?"
  451. @onConfirm="handleGetPriceSubmit(scope.row.updPriceBillId)"
  452. style="margin-right: 10px"
  453. >
  454. <el-button type="text" slot="reference">提审</el-button>
  455. </el-popconfirm>
  456. </template>
  457. <template v-if="scope.row.examineStatus == 'WAIT'">
  458. <el-button
  459. type="text"
  460. class="textColor"
  461. @click="approvalFn(scope.row.updPriceBillId)"
  462. >审批</el-button
  463. >
  464. </template>
  465. <el-button
  466. v-if="scope.row.examineStatus == 'SAVE'"
  467. type="text"
  468. class="textColor"
  469. @click="editFn(scope.row.updPriceBillId,scope.row)"
  470. >编辑</el-button
  471. >
  472. <el-button
  473. type="text"
  474. class="textColor"
  475. @click="detailFn(scope.row.updPriceBillId)"
  476. >详情</el-button
  477. >
  478. </template>
  479. </el-table-column>
  480. </el-table>
  481. </div>
  482. <!-- 分页 -->
  483. <div class="fr">
  484. <el-pagination
  485. @size-change="handleSizeChange"
  486. @current-change="handleCurrentChange"
  487. :current-page="currentPage"
  488. :page-sizes="[10, 20, 30, 50]"
  489. :page-size="10"
  490. layout="total, sizes, prev, pager, next, jumper"
  491. :total="listTotal"
  492. >
  493. </el-pagination>
  494. </div>
  495. </div>
  496. </div>
  497. <ModifyListApply v-else-if="show === 2 || show==5" :cid='cid'/>
  498. <ModifyListApproval v-else-if="show === 3 " :detail="detail" />
  499. <ModifyListDetail v-else :detail="detail" />
  500. <ExamineDialog :isShow.sync="isShowExamineDialog" :examineForm.sync="examineForm" />
  501. </div>
  502. </template>
  503. <script>
  504. import ModifyListApply from './components/modify_list-apply.vue'
  505. import ModifyListApproval from './components/modify_list-approval.vue'
  506. import ModifyListDetail from './components/modify_list-detail.vue'
  507. import ExamineDialog from '@/components/Common/examine-dialog'
  508. import Mixin from '@/mixin/index'
  509. import {
  510. getPriceSubmit,
  511. getProductRricedel,
  512. getProductRriceDetail,
  513. getProductRriceList,
  514. getTypeList,
  515. examineData
  516. } from '@/api/basic_data/material'
  517. import {downloadFiles, handleImport} from '@/utils/util'
  518. import { getCategoryList } from '@/api/common'
  519. export default {
  520. mixins: [Mixin],
  521. data() {
  522. return {
  523. baseURL: '',
  524. importFileList: [],
  525. importLoading: false,
  526. show: 1,
  527. currentPage: 1, // 当前页码
  528. pageSize: 10, // 每页数量
  529. listTotal: 0, // 列表总数
  530. dataList: [
  531. {
  532. baseUnitId: "",
  533. batchPrice: "",
  534. billId: "",
  535. endDate: "",
  536. id: null,
  537. isPromote: "",
  538. isPublish: "",
  539. materialId: "",
  540. materialName: "",
  541. materialNumber: "",
  542. parentId: "",
  543. qty: "",
  544. rebateUseRate: "",
  545. retailPrice: "",
  546. saleTypeId: "",
  547. specification: "",
  548. startDate: "",
  549. wallets: [],
  550. },
  551. ],
  552. screenForm: {
  553. materialName: "",
  554. materialNumber: "",
  555. startDate: "",
  556. materialOldNumber:'',
  557. saleTypeId:'',
  558. k3CategoryNumber:'',
  559. specification:''
  560. },
  561. liDetail: {},
  562. detail: {},
  563. obj: {
  564. baseUnitId: "",
  565. batchPrice: "",
  566. billId: "",
  567. endDate: "",
  568. id: null,
  569. isPromote: "",
  570. isPublish: "",
  571. materialId: "4",
  572. materialName: "",
  573. materialNumber: "",
  574. parentId: "",
  575. qty: "",
  576. rebateUseRate: "",
  577. retailPrice: "",
  578. saleTypeId: "",
  579. specification: "",
  580. startDate: "",
  581. wallets: [],
  582. },
  583. cid:'',
  584. typeList: [],
  585. dictList:[],
  586. isShowExamineDialog: false,
  587. examineForm: {
  588. status: 'OK',
  589. remark: '',
  590. },
  591. };
  592. },
  593. components: {
  594. ExamineDialog,
  595. ModifyListApply,
  596. ModifyListApproval,
  597. ModifyListDetail,
  598. },
  599. computed:{
  600. exParams() {
  601. return {
  602. materialName: this.screenForm.materialName,
  603. materialNumber: this.screenForm.materialNumber,
  604. startDate:this.screenForm.startDate
  605. };
  606. },
  607. comWallets(){
  608. return (e)=>{
  609. let map = new Map()
  610. for (const item of e) {
  611. map.set(item.walletId,item)
  612. }
  613. return [...map.values()]
  614. }
  615. }
  616. },
  617. mounted() {
  618. let params = {
  619. pageNum: 1,
  620. pageSize: -1,
  621. saleCode: "",
  622. saleName: "",
  623. status: "",
  624. };
  625. getTypeList(params).then((res) => {
  626. this.typeList = res.data.records;
  627. });
  628. getCategoryList({ pageNum:1,pageSize:-1}).then((res) => {
  629. this.dictList = res.data.records
  630. console.log(this.dictList,777777)
  631. })
  632. },
  633. methods: {
  634. formatterType(row) {
  635. for (let i = 0; i < this.typeList.length; i++) {
  636. if (this.typeList[i].id == row.saleTypeId) {
  637. return this.typeList[i].saleName;
  638. }
  639. }
  640. },
  641. addFn() {
  642. this.show = 2;
  643. },
  644. hanleDeleteAll(id) {
  645. this.hanleDeleteAllPromise(id).then((ids) => {
  646. getProductRricedel(ids).then((res) => {
  647. this.$successMsg("删除成功");
  648. this.getList();
  649. });
  650. });
  651. },
  652. // 打开 批量审批
  653. batchExamine() {
  654. if (this.ids.length) {
  655. this.isShowExamineDialog = true;
  656. return
  657. }
  658. this.$errorMsg('请选择审核项')
  659. },
  660. // 提交 批量审批
  661. submitExamineForm() {
  662. // let ids = this.dis.map(item => {
  663. // return item
  664. // });
  665. const ids = [...new Set(this.ids)]
  666. examineData({
  667. ids: ids.join(','),
  668. examineStatus: this.examineForm.status,
  669. examineRemark: this.examineForm.remark,
  670. })
  671. .then((res) => {
  672. this.isShowExamineDialog = false;
  673. this.$successMsg("修改成功");
  674. this.getList();
  675. })
  676. },
  677. handleGetPriceSubmit(id) {
  678. console.log(id);
  679. getPriceSubmit({ ids:id }).then((res) => {
  680. this.$successMsg("已提审");
  681. this.getList();
  682. });
  683. },
  684. approvalFn(id) {
  685. getProductRriceDetail({ id }).then((res) => {
  686. this.detail = res.data;
  687. this.show = 3;
  688. });
  689. },
  690. detailFn(id) {
  691. getProductRriceDetail({ id }).then((res) => {
  692. this.detail = res.data;
  693. this.show = 4;
  694. });
  695. },
  696. getList() {
  697. this.listLoading = true;
  698. console.log(456654);
  699. let params = {
  700. pageNum: this.currentPage,
  701. pageSize: this.pageSize,
  702. materialName: this.screenForm.materialName,
  703. materialNumber: this.screenForm.materialNumber,
  704. startDate: this.screenForm.startDate,
  705. materialOldNumber:this.screenForm.materialOldNumber,
  706. saleTypeId:this.screenForm.saleTypeId,
  707. k3CategoryNumber:this.screenForm.k3CategoryNumber,
  708. specification:this.screenForm.specification
  709. };
  710. getProductRriceList(params).then((res) => {
  711. this.dataList = res.data.records;
  712. this.listTotal = res.data.total;
  713. this.listLoading = false;
  714. });
  715. },
  716. editFn(id, row) {
  717. this.cid = id
  718. this.show = 5;
  719. // this.diaLogForm = {
  720. // id,
  721. // composeNumber: row.composeNumber,
  722. // items: row.items === undefined ? [] : row.items,
  723. // materialId: row.materialId,
  724. // orgNumber: row.orgNumber,
  725. // productModel: row.productModel,
  726. // productVolume: row.productVolume,
  727. // };
  728. // this.showDialogForm = true;
  729. },
  730. hanleInfo() {
  731. if (this.type === 1) {
  732. getProductAdd(this.diaLogForm).then((res) => {
  733. this.$successMsg("保存成功");
  734. console.log(params, 123);
  735. this.getList();
  736. });
  737. } else if (this.type === 2) {
  738. const params = {
  739. ...this.diaLogForm,
  740. };
  741. console.log(params, 123);
  742. getProductEdit(params).then((res) => {
  743. this.$successMsg("编辑成功");
  744. this.getList();
  745. });
  746. this.diaLogForm.id = null;
  747. }
  748. this.showDialogForm = false;
  749. },
  750. hanleDelete(id) {
  751. this.hanleDeleteAllPromise(id).then((ids) => {
  752. getProductDel(ids).then((res) => {
  753. this.$successMsg("删除成功");
  754. });
  755. });
  756. },
  757. handleExport() {
  758. let screenData = {
  759. customerName: this.screenForm.customerName,
  760. freeDay: this.screenForm.freeDay,
  761. toll: this.screenForm.toll,
  762. };
  763. downloadFiles("/product-compose/export", screenData);
  764. },
  765. resetInfo() {
  766. this.diaLogForm = {
  767. composeNumber: "",
  768. id: "",
  769. items: [],
  770. materialId: "",
  771. orgNumber: 0,
  772. productModel: "",
  773. productVolume: "",
  774. };
  775. },
  776. // 导入
  777. async handleImport(param) {
  778. this.importLoading = true
  779. const file = param.file
  780. const formData = new FormData()
  781. formData.append('file', file)
  782. const result = await handleImport('/product-upd-price/material/import', formData)
  783. this.importLoading = false
  784. this.importFileList = []
  785. if (result.code === 200) {
  786. this.$alert('成功处理记录数:' + result.data, '导入成功', {
  787. confirmButtonText: '确定'
  788. })
  789. this.getList()
  790. } else {
  791. this.$alert(result.message, '导入失败', {
  792. confirmButtonText: '确定'
  793. })
  794. }
  795. },
  796. // 下载经销商模板
  797. hanleDownloadFiles() {
  798. downloadFiles('/product-upd-price/download')
  799. },
  800. },
  801. };
  802. </script>
  803. <style lang="scss" scoped>
  804. ::v-deep .el-select--small {
  805. width: 100%;
  806. }
  807. .import-btn{
  808. display: inline-block;
  809. margin: 0 10px;
  810. }
  811. </style>