displace_list.vue 44 KB

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