displace_list.vue 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429
  1. <template>
  2. <div class="app-container">
  3. <div class="main-top">
  4. <div class="title">选择置换方式</div>
  5. <el-radio-group v-model="type" @change="changeType">
  6. <!-- <el-radio :label="1">订单置换</el-radio> -->
  7. <el-radio :label="2">批量置换</el-radio>
  8. </el-radio-group>
  9. </div>
  10. <div class="main-title">
  11. <div class="title">被置换产品信息</div>
  12. <div>
  13. <el-button size="mini" type="primary" @click="openBeiGoodsDialog">选择机型</el-button>
  14. </div>
  15. </div>
  16. <div class="table">
  17. <el-table :data="beiGoodsList" border fit highlight-current-row stripe>
  18. <el-table-column
  19. align="left"
  20. label="物料编码"
  21. prop="number"
  22. min-width="160"
  23. show-overflow-tooltip
  24. />
  25. <el-table-column
  26. align="left"
  27. label="产品编码"
  28. prop="oldNumber"
  29. min-width="160"
  30. show-overflow-tooltip
  31. />
  32. <el-table-column
  33. align="left"
  34. label="产品名称"
  35. prop="name"
  36. min-width="160"
  37. show-overflow-tooltip
  38. />
  39. <el-table-column
  40. align="left"
  41. label="规格型号"
  42. prop="specification"
  43. min-width="350"
  44. show-overflow-tooltip
  45. />
  46. <el-table-column
  47. align="left"
  48. label="单位"
  49. prop="baseUnitId"
  50. min-width="100"
  51. show-overflow-tooltip
  52. />
  53. <el-table-column align="center" label="操作" min-width="100" fixed="right">
  54. <template slot-scope="scope">
  55. <el-button type="text" @click="deleteBeiGoodsList(scope.$index)">删除</el-button>
  56. </template>
  57. </el-table-column>
  58. </el-table>
  59. </div>
  60. <div class="main-title">
  61. <div class="title">可置换产品信息</div>
  62. <div>
  63. <!-- <el-radio-group v-model="isEquivalent" :disabled="orderList.length">
  64. <el-radio
  65. v-for="item in [
  66. { label: '同价置换', value: 0 },
  67. { label: '非同价置换', value: 1 }
  68. ]"
  69. :key="item.value"
  70. :label="item.value"
  71. >{{ item.label }}</el-radio
  72. >
  73. </el-radio-group> -->
  74. <el-button size="mini" type="primary" @click="openKeGoodsDialog">选择机型</el-button>
  75. </div>
  76. </div>
  77. <div class="table">
  78. <el-table v-show="isEquivalent === 0" :data="keGoodsList" border fit highlight-current-row stripe>
  79. <el-table-column
  80. align="left"
  81. label="物料编码"
  82. prop="number"
  83. min-width="160"
  84. show-overflow-tooltip
  85. />
  86. <el-table-column
  87. align="left"
  88. label="产品编码"
  89. prop="oldNumber"
  90. min-width="160"
  91. show-overflow-tooltip
  92. />
  93. <el-table-column
  94. align="left"
  95. label="产品名称"
  96. prop="name"
  97. min-width="160"
  98. show-overflow-tooltip
  99. />
  100. <el-table-column
  101. align="left"
  102. label="规格型号"
  103. prop="specification"
  104. min-width="350"
  105. show-overflow-tooltip
  106. />
  107. <el-table-column
  108. align="left"
  109. label="单位"
  110. prop="baseUnitId"
  111. min-width="100"
  112. show-overflow-tooltip
  113. />
  114. <el-table-column align="center" label="操作" min-width="100" fixed="right">
  115. <template slot-scope="scope">
  116. <el-button type="text" @click="deleteKeGoodsList(scope.$index)">删除</el-button>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <el-table v-show="isEquivalent === 1" :data="keGoodsList" border fit highlight-current-row stripe>
  121. <el-table-column align="left" label="销售类型" prop="saleTypeCode" min-width="160" show-overflow-tooltip>
  122. <template slot-scope="scope">
  123. <el-select
  124. v-model="scope.row.saleTypeCode"
  125. placeholder="请选择"
  126. size="mini"
  127. clearable
  128. filterable
  129. @change="handleChange($event, scope.row)"
  130. >
  131. <el-option v-for="item in saleList" :key="item.saleCode" :label="item.saleName" :value="item.saleCode" />
  132. </el-select>
  133. </template>
  134. </el-table-column>
  135. <el-table-column
  136. align="left"
  137. label="物料编码"
  138. prop="number"
  139. min-width="160"
  140. show-overflow-tooltip
  141. />
  142. <el-table-column
  143. align="left"
  144. label="产品编码"
  145. prop="oldNumber"
  146. min-width="160"
  147. show-overflow-tooltip
  148. />
  149. <el-table-column
  150. align="left"
  151. label="产品名称"
  152. prop="name"
  153. min-width="160"
  154. show-overflow-tooltip
  155. />
  156. <el-table-column
  157. align="left"
  158. label="规格型号"
  159. prop="specification"
  160. min-width="350"
  161. show-overflow-tooltip
  162. />
  163. <el-table-column align="left" label="置换单价" prop="price" min-width="160" show-overflow-tooltip>
  164. <template slot-scope="scope">
  165. <el-input
  166. v-model.number="scope.row.price"
  167. type="number"
  168. placeholder="请输入"
  169. size="mini"
  170. clearable
  171. @change=""
  172. />
  173. </template>
  174. </el-table-column>
  175. <el-table-column align="left" label="格力折扣" prop="discAmount" min-width="160" show-overflow-tooltip>
  176. <template slot-scope="scope">
  177. <el-input
  178. v-model.number="scope.row.discAmount"
  179. type="number"
  180. placeholder="请输入"
  181. size="mini"
  182. clearable
  183. @change=""
  184. />
  185. </template>
  186. </el-table-column>
  187. <el-table-column align="left" label="返利类型" prop="walletRebateId" min-width="160" show-overflow-tooltip>
  188. <template slot-scope="scope">
  189. <el-select
  190. v-model="scope.row.walletRebateId"
  191. placeholder="请选择"
  192. size="mini"
  193. clearable
  194. filterable
  195. @change="handleChangeRebate($event, scope.row)"
  196. >
  197. <el-option
  198. v-for="item in rebateSaletypelist"
  199. :key="item.walletRebateId"
  200. :label="item.name"
  201. :value="item.walletRebateId"
  202. />
  203. </el-select>
  204. </template>
  205. </el-table-column>
  206. <el-table-column align="center" label="操作" min-width="100" fixed="right">
  207. <template slot-scope="scope">
  208. <el-button type="text" @click="deleteKeGoodsList(scope.$index)">删除</el-button>
  209. </template>
  210. </el-table-column>
  211. </el-table>
  212. </div>
  213. <div class="main-title">
  214. <div class="title">被置换订单信息</div>
  215. <div>
  216. <el-button size="mini" type="primary" @click="openOrderDialog">选择置换订单</el-button>
  217. </div>
  218. </div>
  219. <div class="table">
  220. <el-table :data="orderList" border fit highlight-current-row stripe>
  221. <el-table-column align="left" label="订单号" prop="id" min-width="120" show-overflow-tooltip />
  222. <el-table-column align="left" label="经销商信息" prop="displaceOrderId" min-width="250" show-overflow-tooltip>
  223. <template slot-scope="scope">
  224. {{ scope.row.customerName + '(' + scope.row.customerNumber + ')' }}
  225. </template>
  226. </el-table-column>
  227. <el-table-column align="center" label="被置换机型" prop="displaceOrderId" min-width="160" show-overflow-tooltip>
  228. <el-table-column
  229. align="left"
  230. label="销售类型"
  231. prop="saleTypeName"
  232. min-width="100"
  233. show-overflow-tooltip
  234. />
  235. <el-table-column
  236. align="left"
  237. label="产品名称"
  238. prop="materialName"
  239. min-width="160"
  240. show-overflow-tooltip
  241. />
  242. <el-table-column
  243. align="left"
  244. label="规格型号"
  245. prop="specification"
  246. min-width="250"
  247. show-overflow-tooltip
  248. />
  249. <el-table-column
  250. align="right"
  251. label="单价"
  252. prop="price"
  253. min-width="100"
  254. show-overflow-tooltip
  255. />
  256. <el-table-column
  257. align="right"
  258. label="可被置换数量"
  259. prop="refundableQty"
  260. min-width="100"
  261. show-overflow-tooltip
  262. />
  263. <el-table-column
  264. align="left"
  265. label="返利类型"
  266. prop="rebateWalletName"
  267. min-width="100"
  268. show-overflow-tooltip
  269. />
  270. <el-table-column
  271. align="right"
  272. label="使用返利金额"
  273. prop="payRebateAmount"
  274. min-width="100"
  275. show-overflow-tooltip
  276. />
  277. <el-table-column
  278. align="right"
  279. label="格力折扣"
  280. prop="totalDiscAmount"
  281. min-width="100"
  282. show-overflow-tooltip
  283. />
  284. <el-table-column
  285. align="left"
  286. label="现金钱包"
  287. prop="walletName"
  288. min-width="100"
  289. show-overflow-tooltip
  290. />
  291. <el-table-column
  292. align="right"
  293. label="实付金额"
  294. prop="payAmount"
  295. min-width="100"
  296. show-overflow-tooltip
  297. />
  298. </el-table-column>
  299. <el-table-column align="center" label="置换机型" prop="displaceOrderId" min-width="160" show-overflow-tooltip>
  300. <el-table-column
  301. align="left"
  302. label="销售类型"
  303. prop="ke_saleTypeName"
  304. min-width="160"
  305. show-overflow-tooltip
  306. />
  307. <el-table-column
  308. align="left"
  309. label="产品名称"
  310. prop="ke_materialName"
  311. min-width="160"
  312. show-overflow-tooltip
  313. />
  314. <el-table-column
  315. align="left"
  316. label="规格型号"
  317. prop="ke_specification"
  318. min-width="350"
  319. show-overflow-tooltip
  320. />
  321. <el-table-column
  322. align="right"
  323. label="单价"
  324. prop="ke_price"
  325. min-width="100"
  326. show-overflow-tooltip
  327. />
  328. <el-table-column align="right" label="置换数量" prop="ke_refundableQty" min-width="100" show-overflow-tooltip>
  329. <template slot-scope="scope">
  330. <el-input v-model="scope.row.ke_refundableQty" size="mini" type="number" />
  331. </template>
  332. </el-table-column>
  333. <el-table-column
  334. align="left"
  335. label="返利类型"
  336. prop="ke_rebateWalletName"
  337. min-width="100"
  338. show-overflow-tooltip
  339. />
  340. <el-table-column
  341. align="right"
  342. label="使用返利金额"
  343. min-width="100"
  344. show-overflow-tooltip
  345. >
  346. <template slot-scope="scope">
  347. <!-- {{ scope.row.singleRebateAmount * scope.row.ke_refundableQty }} -->
  348. {{
  349. (scope.row.ke_price * scope.row.ke_refundableQty -
  350. scope.row.ke_discAmount * scope.row.ke_refundableQty) *
  351. scope.row.ke_rebateRate
  352. }}
  353. </template>
  354. </el-table-column>
  355. <el-table-column align="right" label="格力折扣" prop="ke_discAmount" min-width="100" show-overflow-tooltip>
  356. <template slot-scope="scope">
  357. {{ scope.row.ke_discAmount * scope.row.ke_refundableQty }}
  358. </template>
  359. </el-table-column>
  360. <el-table-column
  361. align="left"
  362. label="现金钱包"
  363. prop="walletName"
  364. min-width="100"
  365. show-overflow-tooltip
  366. />
  367. <el-table-column align="right" label="实付金额" prop="payAmount" min-width="100" show-overflow-tooltip>
  368. <template slot-scope="scope">
  369. <!-- {{
  370. scope.row.ke_price * scope.row.ke_refundableQty -
  371. scope.row.singleRebateAmount * scope.row.ke_refundableQty -
  372. scope.row.ke_discAmount
  373. }} -->
  374. {{
  375. scope.row.ke_price * scope.row.ke_refundableQty -
  376. scope.row.ke_discAmount * scope.row.ke_refundableQty -
  377. (scope.row.ke_price * scope.row.ke_refundableQty -
  378. scope.row.ke_discAmount * scope.row.ke_refundableQty) *
  379. scope.row.ke_rebateRate
  380. }}
  381. </template>
  382. </el-table-column>
  383. </el-table-column>
  384. <el-table-column align="center" label="操作" min-width="100" fixed="right">
  385. <template slot-scope="scope">
  386. <el-button type="text" @click="deleteOrderList(scope.$index)">删除</el-button>
  387. </template>
  388. </el-table-column>
  389. </el-table>
  390. </div>
  391. <div class="page-footer">
  392. <div class="footer">
  393. <el-button type="primary" @click="submitForm">提交置换</el-button>
  394. <el-popconfirm title="确定要重置吗?" style="margin-left: 10px" @onConfirm="resetForm">
  395. <el-button slot="reference">重 置</el-button>
  396. </el-popconfirm>
  397. </div>
  398. </div>
  399. <el-dialog title="选择被置换产品" :visible.sync="beiGoodsDialog_show" width="80%">
  400. <el-form
  401. ref="beiGoodsDialog_screenForm"
  402. :model="beiGoodsDialog_screenForm"
  403. size="mini"
  404. label-position="left"
  405. label-width="80px"
  406. >
  407. <el-row :gutter="20">
  408. <el-col :xs="12" :sm="6" :lg="6">
  409. <el-form-item prop="number" label="物料编码">
  410. <el-input v-model="beiGoodsDialog_screenForm.number" placeholder="请输入物料编码" />
  411. </el-form-item>
  412. </el-col>
  413. <el-col :xs="12" :sm="6" :lg="6">
  414. <el-form-item prop="oldNumber" label="产品编码">
  415. <el-input v-model="beiGoodsDialog_screenForm.oldNumber" placeholder="请输入产品编码" />
  416. </el-form-item>
  417. </el-col>
  418. <el-col :xs="12" :sm="6" :lg="6">
  419. <el-form-item prop="keyword" label="产品名称">
  420. <el-input v-model="beiGoodsDialog_screenForm.keyword" placeholder="请输入产品名称" />
  421. </el-form-item>
  422. </el-col>
  423. <el-col :xs="12" :sm="6" :lg="6">
  424. <el-form-item label="规格型号" prop="specification">
  425. <el-input v-model="beiGoodsDialog_screenForm.specification" placeholder="请输入规格型号" />
  426. </el-form-item>
  427. </el-col>
  428. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  429. <el-form-item label="">
  430. <el-button @click="resetBeiGoodsDialogScreenForm">清空</el-button>
  431. <el-button type="primary" @click="submitBeiGoodsDialogScreenForm">搜索</el-button>
  432. </el-form-item>
  433. </el-col>
  434. </el-row>
  435. </el-form>
  436. <div class="table">
  437. <el-table
  438. :data="beiGoodsDialog_list"
  439. element-loading-text="Loading"
  440. border
  441. fit
  442. highlight-current-row
  443. stripe
  444. height="400"
  445. >
  446. <el-table-column align="center" width="80">
  447. <template slot-scope="scope">
  448. <el-button
  449. type="primary"
  450. size="mini"
  451. :disabled="scope.row.selected"
  452. @click="submitChooseBeiGoods(scope.row)"
  453. >选择
  454. </el-button>
  455. </template>
  456. </el-table-column>
  457. <el-table-column
  458. align="left"
  459. label="物料编码"
  460. prop="number"
  461. min-width="100"
  462. show-overflow-tooltip
  463. />
  464. <el-table-column
  465. align="left"
  466. label="产品编码"
  467. prop="oldNumber"
  468. min-width="100"
  469. show-overflow-tooltip
  470. />
  471. <el-table-column
  472. align="left"
  473. label="产品名称"
  474. prop="name"
  475. min-width="160"
  476. show-overflow-tooltip
  477. />
  478. <el-table-column
  479. align="left"
  480. label="规格型号"
  481. prop="specification"
  482. min-width="160"
  483. show-overflow-tooltip
  484. />
  485. <el-table-column
  486. align="left"
  487. label="是否可被置换"
  488. prop="unit"
  489. min-width="80"
  490. show-overflow-tooltip
  491. />
  492. </el-table>
  493. <div class="pagination clearfix" style="margin-top: 10px">
  494. <div class="fr">
  495. <el-pagination
  496. :current-page="beiGoodsDialog_currentPage"
  497. :page-size="100"
  498. background
  499. layout="prev, pager, next"
  500. :total="beiGoodsDialog_listTotal"
  501. @current-change="changeBeiGoodsDialogPage"
  502. />
  503. </div>
  504. </div>
  505. </div>
  506. <span slot="footer" class="dialog-footer">
  507. <el-button @click="closeBeiGoodsDialog">取 消</el-button>
  508. </span>
  509. </el-dialog>
  510. <el-dialog title="选择可置换产品" :visible.sync="keGoodsDialog_show" width="80%">
  511. <el-form
  512. ref="keGoodsDialog_screenForm"
  513. :model="keGoodsDialog_screenForm"
  514. size="mini"
  515. label-position="left"
  516. label-width="80px"
  517. >
  518. <el-row :gutter="20">
  519. <el-col :xs="12" :sm="6" :lg="6">
  520. <el-form-item prop="number" label="物料编码">
  521. <el-input v-model="keGoodsDialog_screenForm.number" placeholder="请输入物料编码" />
  522. </el-form-item>
  523. </el-col>
  524. <el-col :xs="12" :sm="6" :lg="6">
  525. <el-form-item prop="oldNumber" label="产品编码">
  526. <el-input v-model="keGoodsDialog_screenForm.oldNumber" placeholder="请输入产品编码" />
  527. </el-form-item>
  528. </el-col>
  529. <el-col :xs="12" :sm="6" :lg="6">
  530. <el-form-item prop="keyword" label="产品名称">
  531. <el-input v-model="keGoodsDialog_screenForm.keyword" placeholder="请输入产品名称" />
  532. </el-form-item>
  533. </el-col>
  534. <el-col :xs="12" :sm="6" :lg="6">
  535. <el-form-item label="规格型号" prop="specification">
  536. <el-input v-model="keGoodsDialog_screenForm.specification" placeholder="请输入规格型号" />
  537. </el-form-item>
  538. </el-col>
  539. <!-- <el-col :xs="12" :sm="6" :lg="6">
  540. <el-form-item label="置换产品价格类型" prop="displaceType" label-width="125px">
  541. <el-select v-model="keGoodsDialog_screenForm.displaceType" placeholder="请选择置换产品价格类型">
  542. <el-option
  543. v-for="item in displaceTypeList"
  544. :key="item.value"
  545. :label="item.label"
  546. :value="item.value">
  547. </el-option>
  548. </el-select>
  549. </el-form-item>
  550. </el-col> -->
  551. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  552. <el-form-item label="">
  553. <el-button @click="resetKeGoodsDialogScreenForm">清空</el-button>
  554. <el-button type="primary" @click="submitKeGoodsDialogScreenForm">搜索</el-button>
  555. </el-form-item>
  556. </el-col>
  557. </el-row>
  558. </el-form>
  559. <div class="table">
  560. <el-table
  561. v-show="type === 1"
  562. :data="keGoodsDialog_list"
  563. element-loading-text="Loading"
  564. border
  565. fit
  566. highlight-current-row
  567. stripe
  568. height="400"
  569. @selection-change="changeKeGoodsDialogSelection"
  570. >
  571. <el-table-column align="center" type="selection" width="55" :selectable="checkboxSelect" />
  572. <el-table-column
  573. align="left"
  574. label="物料编码"
  575. prop="number"
  576. min-width="100"
  577. show-overflow-tooltip
  578. />
  579. <el-table-column
  580. align="left"
  581. label="产品编码"
  582. prop="oldNumber"
  583. min-width="100"
  584. show-overflow-tooltip
  585. />
  586. <el-table-column
  587. align="left"
  588. label="产品名称"
  589. prop="name"
  590. min-width="160"
  591. show-overflow-tooltip
  592. />
  593. <el-table-column
  594. align="left"
  595. label="规格型号"
  596. prop="specification"
  597. min-width="160"
  598. show-overflow-tooltip
  599. />
  600. </el-table>
  601. <el-table
  602. v-show="type === 2"
  603. :data="keGoodsDialog_list"
  604. element-loading-text="Loading"
  605. border
  606. fit
  607. highlight-current-row
  608. stripe
  609. height="400"
  610. >
  611. <el-table-column align="center" width="80">
  612. <template slot-scope="scope">
  613. <el-button
  614. type="primary"
  615. size="mini"
  616. :disabled="scope.row.selected"
  617. @click="submitChooseKeGoods(scope.row)"
  618. >选择
  619. </el-button>
  620. </template>
  621. </el-table-column>
  622. <el-table-column
  623. align="left"
  624. label="物料编码"
  625. prop="number"
  626. min-width="100"
  627. show-overflow-tooltip
  628. />
  629. <el-table-column
  630. align="left"
  631. label="产品编码"
  632. prop="oldNumber"
  633. min-width="100"
  634. show-overflow-tooltip
  635. />
  636. <el-table-column
  637. align="left"
  638. label="产品名称"
  639. prop="name"
  640. min-width="160"
  641. show-overflow-tooltip
  642. />
  643. <el-table-column
  644. align="left"
  645. label="规格型号"
  646. prop="specification"
  647. min-width="160"
  648. show-overflow-tooltip
  649. />
  650. </el-table>
  651. <div class="pagination clearfix" style="margin-top: 10px">
  652. <div class="fr">
  653. <el-pagination
  654. :current-page="keGoodsDialog_currentPage"
  655. :page-size="100"
  656. background
  657. layout="prev, pager, next"
  658. :total="keGoodsDialog_listTotal"
  659. @current-change="changeKeGoodsDialogPage"
  660. />
  661. </div>
  662. </div>
  663. </div>
  664. <span slot="footer" class="dialog-footer">
  665. <el-button @click="closeKeGoodsDialog">取 消</el-button>
  666. <el-button v-if="type === 1" type="primary" @click="submitChooseKeGoods">确 定</el-button>
  667. </span>
  668. </el-dialog>
  669. <el-dialog title="选择被置换订单" :visible.sync="orderDialog_show" width="80%">
  670. <el-form
  671. ref="orderDialog_screenForm"
  672. :model="orderDialog_screenForm"
  673. size="mini"
  674. label-position="left"
  675. label-width="85px"
  676. >
  677. <el-row :gutter="20">
  678. <el-col :xs="12" :sm="6" :lg="6">
  679. <el-form-item prop="id" label="订单号">
  680. <el-input v-model="orderDialog_screenForm.id" placeholder="请输入订单号" />
  681. </el-form-item>
  682. </el-col>
  683. <el-col :xs="12" :sm="6" :lg="6">
  684. <el-form-item prop="customerName" label="经销商名称">
  685. <el-input v-model="orderDialog_screenForm.customerName" placeholder="请输入经销商名称" />
  686. </el-form-item>
  687. </el-col>
  688. <el-col :xs="12" :sm="6" :lg="6">
  689. <el-form-item prop="customerNumber" label="经销商编号">
  690. <el-input v-model="orderDialog_screenForm.customerNumber" placeholder="请输入经销商编号" />
  691. </el-form-item>
  692. </el-col>
  693. <el-col :xs="12" :sm="6" :lg="6">
  694. <el-form-item prop="priceType" label="价格类型">
  695. <el-select
  696. v-model="orderDialog_screenForm.priceType"
  697. placeholder="请选择价格类型"
  698. size="mini"
  699. clearable
  700. filterable
  701. >
  702. <el-option
  703. v-for="item in priceTypeLilst"
  704. :key="item.priceTypeId"
  705. :label="item.priceTypeName"
  706. :value="item.priceTypeName"
  707. />
  708. </el-select>
  709. </el-form-item>
  710. </el-col>
  711. <el-col :xs="24" :sm="24" :lg="24" class="tr">
  712. <el-form-item label="">
  713. <el-button @click="resetOrderDialogScreenForm">清空</el-button>
  714. <el-button type="primary" @click="submitOrderDialogScreenForm">搜索</el-button>
  715. </el-form-item>
  716. </el-col>
  717. </el-row>
  718. </el-form>
  719. <div class="table">
  720. <el-table
  721. v-show="type === 1"
  722. :data="orderDialog_list"
  723. element-loading-text="Loading"
  724. border
  725. fit
  726. highlight-current-row
  727. stripe
  728. height="400"
  729. >
  730. <el-table-column align="center" width="80">
  731. <template slot-scope="scope">
  732. <el-button
  733. type="primary"
  734. size="mini"
  735. :disabled="scope.row.selected"
  736. @click="submitChooseOrder(scope.row)"
  737. >选择
  738. </el-button>
  739. </template>
  740. </el-table-column>
  741. <el-table-column
  742. align="left"
  743. label="订单号"
  744. prop="id"
  745. min-width="120"
  746. show-overflow-tooltip
  747. />
  748. <el-table-column
  749. align="left"
  750. label="直调状态"
  751. prop="directTransferStatusName"
  752. min-width="100"
  753. show-overflow-tooltip
  754. />
  755. <el-table-column align="left" label="经销商信息" prop="materialName" min-width="250" show-overflow-tooltip>
  756. <template slot-scope="scope">
  757. {{ scope.row.customerName + '(' + scope.row.customerNumber + ')' }}
  758. </template>
  759. </el-table-column>
  760. <el-table-column
  761. align="left"
  762. label="销售类型"
  763. prop="saleTypeName"
  764. min-width="100"
  765. show-overflow-tooltip
  766. />
  767. <el-table-column
  768. align="left"
  769. label="产品名称"
  770. prop="materialName"
  771. min-width="160"
  772. show-overflow-tooltip
  773. />
  774. <el-table-column
  775. align="left"
  776. label="规格型号"
  777. prop="specification"
  778. min-width="250"
  779. show-overflow-tooltip
  780. />
  781. <el-table-column
  782. align="left"
  783. label="可被置换数量"
  784. prop="refundableQty"
  785. min-width="100"
  786. show-overflow-tooltip
  787. />
  788. </el-table>
  789. <el-table
  790. v-show="type === 2"
  791. :data="orderDialog_list"
  792. element-loading-text="Loading"
  793. border
  794. fit
  795. highlight-current-row
  796. stripe
  797. height="400"
  798. @selection-change="changeOrderDialogSelection"
  799. >
  800. <el-table-column
  801. v-if="type === 2"
  802. align="center"
  803. type="selection"
  804. width="55"
  805. :selectable="checkboxSelect"
  806. />
  807. <el-table-column
  808. align="left"
  809. label="订单号"
  810. prop="id"
  811. min-width="120"
  812. show-overflow-tooltip
  813. />
  814. <el-table-column
  815. align="left"
  816. label="直调状态"
  817. prop="directTransferStatusName"
  818. min-width="100"
  819. show-overflow-tooltip
  820. />
  821. <el-table-column align="left" label="经销商信息" prop="materialName" min-width="250" show-overflow-tooltip>
  822. <template slot-scope="scope">
  823. {{ scope.row.customerName + '(' + scope.row.customerNumber + ')' }}
  824. </template>
  825. </el-table-column>
  826. <el-table-column
  827. align="left"
  828. label="销售类型"
  829. prop="saleTypeName"
  830. min-width="100"
  831. show-overflow-tooltip
  832. />
  833. <el-table-column
  834. align="left"
  835. label="产品名称"
  836. prop="materialName"
  837. min-width="160"
  838. show-overflow-tooltip
  839. />
  840. <el-table-column
  841. align="left"
  842. label="规格型号"
  843. prop="specification"
  844. min-width="250"
  845. show-overflow-tooltip
  846. />
  847. <el-table-column
  848. align="left"
  849. label="价格类型"
  850. prop="priceType"
  851. min-width="250"
  852. show-overflow-tooltip
  853. />
  854. <el-table-column
  855. align="left"
  856. label="可被置换数量"
  857. prop="refundableQty"
  858. min-width="100"
  859. show-overflow-tooltip
  860. />
  861. </el-table>
  862. <div class="pagination clearfix" style="margin-top: 10px">
  863. <div class="fr">
  864. <el-pagination
  865. :current-page="orderDialog_currentPage"
  866. :page-size="100"
  867. background
  868. layout="prev, pager, next"
  869. :total="orderDialog_listTotal"
  870. @current-change="changeOrderDialogPage"
  871. />
  872. </div>
  873. </div>
  874. </div>
  875. <span slot="footer" class="dialog-footer">
  876. <el-button @click="closeOrderDialog">取 消</el-button>
  877. <el-button v-if="type === 2" type="primary" @click="submitChooseOrder">确 定</el-button>
  878. </span>
  879. </el-dialog>
  880. </div>
  881. </template>
  882. <script>
  883. import { getTypeList } from '@/api/common.js'
  884. import { getProductPriceListV2 } from '@/api/priceType.js'
  885. import { getWalletRebateSaletypelist } from '@/api/policy_list'
  886. import { getGoodsList, getOrderList, addDisplace } from '@/api/supply/displace'
  887. export default {
  888. data() {
  889. return {
  890. // 主表单信息
  891. type: 2,
  892. beiGoodsList: [], // 被置换产品列表
  893. keGoodsList: [], // 可置换产品列表
  894. orderList: [], // 被置换订单列表
  895. // 被置换产品弹窗信息
  896. beiGoodsDialog_show: false,
  897. beiGoodsDialog_screenForm: {
  898. number: '',
  899. oldNumber: '',
  900. name: '',
  901. specification: ''
  902. },
  903. beiGoodsDialog_list: [],
  904. beiGoodsDialog_currentPage: 1,
  905. beiGoodsDialog_listTotal: 0,
  906. // 可置换产品弹窗信息
  907. keGoodsDialog_show: false,
  908. keGoodsDialog_screenForm: {
  909. number: '',
  910. oldNumber: '',
  911. name: '',
  912. specification: ''
  913. },
  914. keGoodsDialog_list: [],
  915. keGoodsDialog_selection: [],
  916. keGoodsDialog_currentPage: 1,
  917. keGoodsDialog_listTotal: 0,
  918. // 被置换订单弹窗信息
  919. orderDialog_show: false,
  920. orderDialog_screenForm: {
  921. id: '',
  922. customerName: '',
  923. customerNumber: '',
  924. priceType: ''
  925. },
  926. orderDialog_list: [],
  927. orderDialog_selection: [],
  928. orderDialog_currentPage: 1,
  929. orderDialog_listTotal: 0,
  930. // 其他
  931. displaceTypeList: [
  932. { label: '基础产品价格表', value: '1' },
  933. { label: '家用产品价格表', value: '2' },
  934. { label: '商用产品价格表', value: '3' }
  935. ],
  936. isEquivalent: 1,
  937. saleList: [],
  938. rebateSaletypelist: [],
  939. priceTypeLilst: []
  940. }
  941. },
  942. watch: {
  943. keGoodsList: {
  944. deep: true,
  945. handler: function(val, oal) {
  946. if (this.orderList.length && this.type === 2) {
  947. this.orderList.forEach(item => {
  948. item.ke_materialName = val[0].name
  949. item.ke_specification = val[0].specification
  950. item.ke_refundableQty = ''
  951. item.ke_saleTypeName = val[0].saleTypeName
  952. item.ke_saleTypeCode = val[0].saleTypeCode
  953. item.ke_saleTypeId = val[0].saleTypeId
  954. item.ke_price = val[0].price
  955. item.ke_rebateWalletName = val[0].rebateWalletName
  956. item.ke_walletRebateId = val[0].walletRebateId
  957. item.ke_discAmount = val[0].discAmount
  958. item.ke_rebateRate = val[0].rebateRate
  959. })
  960. }
  961. }
  962. }
  963. },
  964. created() {
  965. this.getTypeList()
  966. },
  967. methods: {
  968. // 切换置换类型
  969. changeType() {
  970. this.resetForm()
  971. },
  972. // 查询重复值并禁选
  973. checkboxSelect(row, rowIndex) {
  974. if (row.selected) {
  975. return false // 禁用
  976. } else {
  977. return true // 不禁用
  978. }
  979. },
  980. handleChange(e, row) {
  981. if (e) {
  982. const item = this.saleList.find(k => e == k.saleCode)
  983. if (Object.keys(item).length) {
  984. this.$set(row, 'saleTypeName', item.saleName)
  985. this.$set(row, 'saleTypeCode', item.saleCode)
  986. this.$set(row, 'saleTypeId', item.id)
  987. }
  988. this.getWalletRebateSaletypelist(e)
  989. } else {
  990. this.$set(row, 'saleTypeName', '')
  991. this.$set(row, 'saleTypeCode', '')
  992. this.$set(row, 'saleTypeId', '')
  993. }
  994. },
  995. handleChangeRebate(e, row) {
  996. if (e) {
  997. const item = this.rebateSaletypelist.find(k => e == k.walletRebateId)
  998. if (Object.keys(item).length) {
  999. this.$set(row, 'rebateWalletName', item.name)
  1000. this.$set(row, 'walletRebateId', item.walletRebateId)
  1001. this.$set(row, 'rebateRate', item.rebateRate)
  1002. }
  1003. } else {
  1004. this.$set(row, 'rebateWalletName', '')
  1005. this.$set(row, 'walletRebateId', '')
  1006. }
  1007. },
  1008. getTypeList() {
  1009. getTypeList({ pageNum: 1, pageSize: -1 }).then(res => {
  1010. this.saleList = res.data.records
  1011. })
  1012. return this.saleList
  1013. },
  1014. getWalletRebateSaletypelist(saleTypeCode) {
  1015. getWalletRebateSaletypelist({ pageNum: 1, pageSize: -1, saleTypeCode, status: 1 }).then(res => {
  1016. this.rebateSaletypelist = res.data.records
  1017. })
  1018. },
  1019. getProductPriceListV2() {
  1020. getProductPriceListV2({ pageNum: 1, pageSize: -1 }).then(res => {
  1021. this.priceTypeLilst = res.data.records
  1022. })
  1023. },
  1024. // 获取列表 - 被置换产品
  1025. getBeiGoodsList() {
  1026. getGoodsList({
  1027. pageNum: this.beiGoodsDialog_currentPage,
  1028. pageSize: 100,
  1029. ...this.beiGoodsDialog_screenForm
  1030. }).then(res => {
  1031. const oldGoodsList = this.beiGoodsList
  1032. const newGoodsList = res.data.records
  1033. for (let i = 0; i < oldGoodsList.length; i++) {
  1034. const oldItem = oldGoodsList[i]
  1035. for (let j = 0; j < newGoodsList.length; j++) {
  1036. const newItem = newGoodsList[j]
  1037. if (newItem.id === oldItem.id) {
  1038. newGoodsList[j].selected = true
  1039. break
  1040. }
  1041. }
  1042. }
  1043. this.beiGoodsDialog_list = newGoodsList
  1044. this.beiGoodsDialog_listTotal = res.data.total
  1045. })
  1046. },
  1047. // 收藏商品
  1048. handleCollect(id) {
  1049. if (!this.token) {
  1050. return console.log('请先登录')
  1051. }
  1052. collectData({ id }).then(res => {
  1053. // api请求
  1054. console.log('收藏成功', res.data)
  1055. })
  1056. },
  1057. // 加入购物车
  1058. addToCart(id) {
  1059. if (!this.token) {
  1060. return console.log('请先登录')
  1061. }
  1062. addData({ id }).then(res => {
  1063. // api请求
  1064. console.log('加入购物车成功', res.data)
  1065. })
  1066. },
  1067. // 立即购买
  1068. bug() {
  1069. if (!this.token) {
  1070. return console.log('请先登录')
  1071. }
  1072. buyData({ id }).then(res => {
  1073. // api请求
  1074. console.log('下单成功', res.data)
  1075. wx.requestPayment({
  1076. // 支付
  1077. timeStamp: '',
  1078. nonceStr: '',
  1079. package: '',
  1080. signType: 'MD5',
  1081. paySign: '',
  1082. success(res) {},
  1083. fail(res) {}
  1084. })
  1085. })
  1086. },
  1087. // 打开弹窗 - 被置换产品
  1088. openBeiGoodsDialog() {
  1089. if (this.orderList.length > 0) {
  1090. return this.$errorMsg('已选择订单不可更改产品')
  1091. }
  1092. this.beiGoodsDialog_show = true
  1093. this.getBeiGoodsList()
  1094. },
  1095. // 关闭弹窗 - 被置换产品
  1096. closeBeiGoodsDialog() {
  1097. this.beiGoodsDialog_show = false
  1098. },
  1099. // 提交筛选表单 - 被置换产品
  1100. submitBeiGoodsDialogScreenForm() {
  1101. this.beiGoodsDialog_currentPage = 1
  1102. this.getBeiGoodsList()
  1103. },
  1104. // 重置筛选表单 - 被置换产品
  1105. resetBeiGoodsDialogScreenForm() {
  1106. this.$refs.beiGoodsDialog_screenForm.resetFields()
  1107. this.beiGoodsDialog_currentPage = 1
  1108. this.beiGoodsDialog_list = []
  1109. this.getBeiGoodsList()
  1110. },
  1111. // 更改列表页码 - 被置换产品
  1112. changeBeiGoodsDialogPage(val) {
  1113. this.beiGoodsDialog_currentPage = val
  1114. this.getBeiGoodsList()
  1115. },
  1116. // 确认选择产品 - 被置换产品
  1117. submitChooseBeiGoods(item) {
  1118. this.beiGoodsList = [item]
  1119. this.closeBeiGoodsDialog()
  1120. },
  1121. // 删除产品 - 被置换产品
  1122. deleteBeiGoodsList(index) {
  1123. if (this.orderList.length > 0) {
  1124. return this.$errorMsg('已选择订单不可更改产品')
  1125. }
  1126. this.beiGoodsList.splice(index, 1)
  1127. },
  1128. // 获取列表 - 可置换产品
  1129. getKeGoodsList() {
  1130. getGoodsList({
  1131. pageNum: this.keGoodsDialog_currentPage,
  1132. pageSize: 100,
  1133. ...this.keGoodsDialog_screenForm
  1134. }).then(res => {
  1135. const oldGoodsList = this.keGoodsList
  1136. const newGoodsList = res.data.records
  1137. for (let i = 0; i < oldGoodsList.length; i++) {
  1138. const oldItem = oldGoodsList[i]
  1139. for (let j = 0; j < newGoodsList.length; j++) {
  1140. const newItem = newGoodsList[j]
  1141. if (newItem.id === oldItem.id) {
  1142. newGoodsList[j].selected = true
  1143. break
  1144. }
  1145. }
  1146. }
  1147. this.keGoodsDialog_list = newGoodsList
  1148. this.keGoodsDialog_listTotal = res.data.total
  1149. })
  1150. },
  1151. // 打开弹窗 - 可置换产品
  1152. openKeGoodsDialog() {
  1153. if (this.orderList.length > 0) {
  1154. return this.$errorMsg('已选择订单不可更改产品')
  1155. }
  1156. this.keGoodsDialog_show = true
  1157. this.getKeGoodsList()
  1158. },
  1159. // 关闭弹窗 - 可置换产品
  1160. closeKeGoodsDialog() {
  1161. this.keGoodsDialog_show = false
  1162. },
  1163. // 提交筛选表单 - 可置换产品
  1164. submitKeGoodsDialogScreenForm() {
  1165. this.keGoodsDialog_currentPage = 1
  1166. this.getKeGoodsList()
  1167. },
  1168. // 重置筛选表单 - 可置换产品
  1169. resetKeGoodsDialogScreenForm() {
  1170. this.$refs.keGoodsDialog_screenForm.resetFields()
  1171. this.keGoodsDialog_currentPage = 1
  1172. this.keGoodsDialog_list = []
  1173. this.getKeGoodsList()
  1174. },
  1175. // 更改列表页码 - 可置换产品
  1176. changeKeGoodsDialogPage(val) {
  1177. this.keGoodsDialog_currentPage = val
  1178. this.getKeGoodsList()
  1179. },
  1180. // 选择列 - 可置换产品
  1181. changeKeGoodsDialogSelection(val) {
  1182. this.keGoodsDialog_selection = val
  1183. },
  1184. // 确认选择产品 - 可置换产品
  1185. submitChooseKeGoods(item) {
  1186. // 订单置换(多选)
  1187. if (this.type === 1) {
  1188. this.keGoodsList = this.keGoodsList.concat(this.keGoodsDialog_selection)
  1189. }
  1190. // 批量置换(单选)
  1191. else {
  1192. this.$set(item, 'saleTypeName', '')
  1193. this.$set(item, 'saleTypeCode', '')
  1194. this.$set(item, 'saleTypeId', '')
  1195. this.$set(item, 'price', 0)
  1196. this.$set(item, 'discAmount', 0)
  1197. this.$set(item, 'rebateWalletName', '')
  1198. this.$set(item, 'walletRebateId', '')
  1199. this.$set(item, 'rebateRate', '')
  1200. this.keGoodsList = [item]
  1201. }
  1202. this.closeKeGoodsDialog()
  1203. },
  1204. // 删除产品 - 可置换产品
  1205. deleteKeGoodsList(index) {
  1206. if (this.orderList.length > 0) {
  1207. return this.$errorMsg('已选择订单不可更改产品')
  1208. }
  1209. this.keGoodsList.splice(index, 1)
  1210. },
  1211. // 获取列表 - 被置换订单
  1212. getOrderList() {
  1213. getOrderList({
  1214. pageNum: this.orderDialog_currentPage,
  1215. pageSize: 100,
  1216. type: 2,
  1217. materialOldNumber: this.beiGoodsList[0].oldNumber,
  1218. isOver: false,
  1219. ...this.orderDialog_screenForm
  1220. }).then(res => {
  1221. const oldGoodsList = this.orderList
  1222. const newGoodsList = res.data.records
  1223. for (let i = 0; i < oldGoodsList.length; i++) {
  1224. const oldItem = oldGoodsList[i]
  1225. for (let j = 0; j < newGoodsList.length; j++) {
  1226. const newItem = newGoodsList[j]
  1227. if (newItem.orderItemId === oldItem.orderItemId) {
  1228. newGoodsList[j].selected = true
  1229. break
  1230. }
  1231. }
  1232. }
  1233. this.orderDialog_list = newGoodsList
  1234. this.orderDialog_listTotal = res.data.total
  1235. })
  1236. },
  1237. // 打开弹窗 - 被置换订单
  1238. openOrderDialog() {
  1239. if (this.beiGoodsList.length < 1) {
  1240. return this.$errorMsg('请先选择被置换产品')
  1241. }
  1242. if (this.keGoodsList.length < 1) {
  1243. return this.$errorMsg('请先选择可置换产品')
  1244. }
  1245. this.orderDialog_show = true
  1246. this.getOrderList()
  1247. this.getProductPriceListV2()
  1248. },
  1249. // 关闭弹窗 - 被置换订单
  1250. closeOrderDialog() {
  1251. this.orderDialog_show = false
  1252. },
  1253. // 提交筛选表单 - 被置换订单
  1254. submitOrderDialogScreenForm() {
  1255. this.orderDialog_currentPage = 1
  1256. this.getOrderList()
  1257. },
  1258. // 重置筛选表单 - 被置换订单
  1259. resetOrderDialogScreenForm() {
  1260. this.$refs.orderDialog_screenForm.resetFields()
  1261. this.orderDialog_currentPage = 1
  1262. this.orderDialog_list = []
  1263. this.getOrderList()
  1264. },
  1265. // 更改列表页码 - 被置换订单
  1266. changeOrderDialogPage(val) {
  1267. this.orderDialog_currentPage = val
  1268. this.getOrderList()
  1269. },
  1270. // 选择列 - 被置换订单
  1271. changeOrderDialogSelection(val) {
  1272. this.orderDialog_selection = val
  1273. },
  1274. // 确认选择产品 - 被置换订单
  1275. submitChooseOrder(item) {
  1276. // 订单置换(单选)
  1277. if (this.type === 1) {
  1278. this.orderList = [item]
  1279. }
  1280. // 批量置换(多选)
  1281. else {
  1282. const orderList = JSON.parse(JSON.stringify(this.orderDialog_selection))
  1283. orderList.forEach(item => {
  1284. item.ke_materialName = this.keGoodsList[0].name
  1285. item.ke_specification = this.keGoodsList[0].specification
  1286. item.ke_refundableQty = ''
  1287. item.ke_saleTypeName = this.keGoodsList[0].saleTypeName
  1288. item.ke_saleTypeCode = this.keGoodsList[0].saleTypeCode
  1289. item.ke_saleTypeId = this.keGoodsList[0].saleTypeId
  1290. item.ke_price = this.keGoodsList[0].price
  1291. item.ke_rebateWalletName = this.keGoodsList[0].rebateWalletName
  1292. item.ke_walletRebateId = this.keGoodsList[0].walletRebateId
  1293. item.ke_discAmount = this.keGoodsList[0].discAmount
  1294. item.ke_rebateRate = this.keGoodsList[0].rebateRate
  1295. })
  1296. this.orderList = this.orderList.concat(orderList)
  1297. }
  1298. this.closeOrderDialog()
  1299. },
  1300. // 删除产品 - 被置换订单
  1301. deleteOrderList(index) {
  1302. this.orderList.splice(index, 1)
  1303. },
  1304. // 判断是否存在被置换订单
  1305. checkOrder() {
  1306. if (this.orderList.length > 0) {
  1307. return this.$errorMsg('已选择订单不可更改产品')
  1308. }
  1309. return true
  1310. },
  1311. // 提交
  1312. submitForm() {
  1313. for (let i = 0; i < this.orderList.length; i++) {
  1314. if (!this.orderList[i].ke_refundableQty || this.orderList[i].ke_refundableQty < 1) {
  1315. this.$errorMsg('置换数量需大于0')
  1316. return
  1317. }
  1318. }
  1319. const params = {
  1320. type: this.type,
  1321. newDiscAmount: this.keGoodsList[0].discAmount,
  1322. newPrice: this.keGoodsList[0].price,
  1323. saleTypeId: this.keGoodsList[0].saleTypeId,
  1324. walletId2: this.keGoodsList[0].walletRebateId,
  1325. newMaterialIds: this.keGoodsList.map(item => {
  1326. return item.id
  1327. }),
  1328. orderItems: this.orderList.map(item => {
  1329. return {
  1330. orderId: item.id,
  1331. orderItemId: item.orderItemId,
  1332. displaceQty: item.ke_refundableQty
  1333. }
  1334. })
  1335. }
  1336. console.log(params, 999)
  1337. addDisplace(params).then(res => {
  1338. this.$successMsg('提交成功')
  1339. this.resetForm()
  1340. })
  1341. },
  1342. // 重置
  1343. resetForm() {
  1344. this.beiGoodsList = []
  1345. this.keGoodsList = []
  1346. this.orderList = []
  1347. }
  1348. }
  1349. }
  1350. </script>
  1351. <style lang="scss" scoped>
  1352. .main-top {
  1353. display: flex;
  1354. align-items: center;
  1355. height: 60px;
  1356. border-bottom: 1px solid #dcdfe6;
  1357. margin-bottom: 20px;
  1358. .title {
  1359. font-size: 16px;
  1360. padding-left: 10px;
  1361. font-weight: 600;
  1362. }
  1363. }
  1364. .el-radio-group {
  1365. margin: 0 30px;
  1366. }
  1367. </style>