modify_list.vue 28 KB

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