modify_list.vue 26 KB

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