modify_list.vue 26 KB

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