orderRefundDialog.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. <template>
  2. <div v-loading.fullscreen.lock="detailLoading">
  3. <div class="head">
  4. <!-- <span>销售单详情</span>
  5. <span>返回</span>
  6. -->
  7. </div>
  8. <div class="main">
  9. <!-- <div class="box" style="margin-top: 15px;">
  10. <div class="item_title">
  11. <span>基本信息</span>
  12. </div>
  13. <div class="ptitle">
  14. <baseInfoTab :orderInfo="orderInfo"></baseInfoTab>
  15. </div>
  16. </div> -->
  17. <div class="box" style="margin-top: 15px;">
  18. <div class="item_title">
  19. <span>{{ $t("view.shippingInfo") }}</span>
  20. </div>
  21. <div class="ptitle">
  22. <!-- <receivingInfoTab :addressInfo="addressInfo" :orderInfo="orderInfo"></receivingInfoTab> -->
  23. <el-descriptions
  24. class="margin-top"
  25. :title="$t('title.addressInfo')"
  26. :column="4"
  27. direction="horizontal"
  28. >
  29. <el-descriptions-item :label="$t('country')">{{
  30. addressInfo.receiverCountryCode
  31. }}</el-descriptions-item>
  32. <el-descriptions-item :label="$t('label.postalCode')">{{
  33. addressInfo.receiverZip
  34. }}</el-descriptions-item>
  35. <el-descriptions-item :label="$t('state')">{{
  36. addressInfo.receiverState
  37. }}</el-descriptions-item>
  38. <el-descriptions-item :label="$t('city')">{{
  39. addressInfo.receiverCity
  40. }}</el-descriptions-item>
  41. <el-descriptions-item :label="$t('suburb')">{{
  42. addressInfo.receiverDistrict
  43. }}</el-descriptions-item>
  44. <el-descriptions-item :label="$t('street')">{{
  45. addressInfo.receiverStreet
  46. }}</el-descriptions-item>
  47. <el-descriptions-item :label="$t('address')">{{
  48. addressInfo.receiverAddress
  49. }}</el-descriptions-item>
  50. <el-descriptions-item :label="$t('dooeNo')">{{
  51. addressInfo.receiverAddress2
  52. }}</el-descriptions-item>
  53. <el-descriptions-item :label="$t('recipient')">{{
  54. addressInfo.receiverName
  55. }}</el-descriptions-item>
  56. <el-descriptions-item :label="$t('telephone')">{{
  57. addressInfo.receiverPhone
  58. }}</el-descriptions-item>
  59. <el-descriptions-item :label="$t('moPhone')">{{
  60. addressInfo.receiverMobile
  61. }}</el-descriptions-item>
  62. <el-descriptions-item :label="$t('post')">{{
  63. addressInfo.email
  64. }}</el-descriptions-item>
  65. <el-descriptions-item :label="$t('label.shippingFee')">{{
  66. addressInfo.freight
  67. }}</el-descriptions-item>
  68. </el-descriptions>
  69. </div>
  70. </div>
  71. <div
  72. class="box"
  73. style="margin-top: 15px;padding-bottom: 10px;"
  74. v-if="invoiceInfo != null"
  75. >
  76. <div class="item_title">
  77. <span>{{ $t("view.invoiceDetails") }}</span>
  78. </div>
  79. <div class="ptitle">
  80. <invoiceInfoTab :invoiceInfo="invoiceInfo"></invoiceInfoTab>
  81. </div>
  82. </div>
  83. <div
  84. class="box"
  85. style="margin-top: 15px;padding-bottom: 10px;"
  86. v-loading="fromLoading"
  87. >
  88. <div class="item_title">
  89. <span>{{ $t("view.refundInfo") }}</span>
  90. </div>
  91. <div class="ptitle">
  92. <el-form
  93. ref="addRefundForm"
  94. :model="addRefundForm"
  95. label-width="auto"
  96. >
  97. <el-form-item :label="$t('currency')">
  98. <el-input
  99. disabled
  100. v-model="addRefundForm.currency"
  101. placeholder
  102. class="normal-input"
  103. ></el-input>
  104. </el-form-item>
  105. <el-form-item :label="$t('label.afterSalesType')" required>
  106. <el-select
  107. :disabled="editIs"
  108. :placeholder="$t('place.pleaseSelect')"
  109. clearable
  110. style="width: 200px;"
  111. class="filter-item"
  112. v-model="addRefundForm.refundType"
  113. >
  114. <el-option
  115. v-for="afterSaleType in afterSaleTypes"
  116. disabled
  117. :key="afterSaleType.value"
  118. :label="$t(afterSaleType.label)"
  119. :value="afterSaleType.value"
  120. >
  121. </el-option>
  122. </el-select>
  123. </el-form-item>
  124. <el-form-item :label="$t('label.expectedRefundAmount')" required>
  125. <el-input
  126. v-model="addRefundForm.refundTotalAmount"
  127. :disabled="true"
  128. />
  129. </el-form-item>
  130. <el-form-item :label="$t('label.refundMethod')" required>
  131. <!-- <el-input v-model="addRefundForm.refundMethod" :placeholder="$t('place.pleaseFillIn')" class="normal-input"></el-input> -->
  132. <el-radio-group v-model="addRefundForm.refundMethod">
  133. <el-radio label="system">{{
  134. $t("view.systemRefund")
  135. }}</el-radio>
  136. <el-radio label="manual">{{
  137. $t("view.manualRefund")
  138. }}</el-radio>
  139. </el-radio-group>
  140. </el-form-item>
  141. <el-form-item
  142. v-if="addRefundForm.refundMethod == 'manual'"
  143. :label="$t('label.accountType')"
  144. required=""
  145. >
  146. <el-radio-group v-model="addRefundForm.refundAccountType">
  147. <el-radio label="PayPal">PayPal</el-radio>
  148. <!-- 银行卡暂时隐藏 -->
  149. <!-- <el-radio label="bankCard">银行卡</el-radio> -->
  150. <!-- <el-radio label="Gift Card">Gift Card</el-radio> -->
  151. </el-radio-group>
  152. </el-form-item>
  153. <el-form-item
  154. :label="$t('label.receivingAccount')"
  155. v-if="
  156. addRefundForm.refundMethod == 'manual' &&
  157. addRefundForm.refundAccountType == 'PayPal'
  158. "
  159. required
  160. >
  161. <el-input
  162. v-model="addRefundForm.refundAccount"
  163. :placeholder="$t('place.pleaseFillIn')"
  164. class="normal-input"
  165. ></el-input>
  166. </el-form-item>
  167. <!-- 选择是否退税-->
  168. <el-form-item
  169. v-if="addRefundForm.refundType"
  170. :label="$t('label.taxRefund')"
  171. >
  172. <el-radio-group
  173. v-model="addRefundForm.refundTaxAble"
  174. @change="calculateRefundAmount"
  175. >
  176. <el-radio label="0">{{ $t("view.noTaxRefund") }}</el-radio>
  177. <el-radio label="1">{{ $t("view.taxRefund") }}</el-radio>
  178. </el-radio-group>
  179. </el-form-item>
  180. <el-form-item
  181. v-if="addRefundForm.refundTaxAble == 1"
  182. :label="$t('label.taxRefundAmount')"
  183. >
  184. <el-input-number
  185. v-model="addRefundForm.refundTaxAmount"
  186. :min="0.0"
  187. :step="0.01"
  188. step-strictly
  189. @change="calculateRefundAmount"
  190. ></el-input-number>
  191. </el-form-item>
  192. <!-- 选择是否退运费-->
  193. <el-form-item
  194. v-if="addRefundForm.refundType"
  195. :label="$t('label.shippingFee')"
  196. >
  197. <el-radio-group
  198. v-model="addRefundForm.refundPostage"
  199. @change="calculateRefundAmount"
  200. >
  201. <el-radio label="0">{{ $t("view.noRefund") }}</el-radio>
  202. <el-radio label="1">{{
  203. $t("view.refundShippingFee")
  204. }}</el-radio>
  205. </el-radio-group>
  206. </el-form-item>
  207. <el-form-item
  208. v-if="addRefundForm.refundPostage == 1"
  209. :label="$t('label.returnShippingFeeAmount')"
  210. >
  211. <el-input-number
  212. v-model="addRefundForm.refundPostageAmount"
  213. :min="0.0"
  214. :step="0.01"
  215. step-strictly
  216. @change="calculateRefundAmount"
  217. ></el-input-number>
  218. </el-form-item>
  219. <el-form-item
  220. v-if="addRefundForm.refundType == 3"
  221. :label="$t('label.receivingReturnWarehouse')"
  222. >
  223. <el-select
  224. :placeholder="$t('place.pleaseSelect')"
  225. clearable
  226. style="width: 200px;"
  227. class="filter-item"
  228. v-model="addRefundForm.warehouseCode"
  229. @change="ShippingLabelOption"
  230. >
  231. <el-option
  232. v-for="item in warehouseItems"
  233. :key="item.key"
  234. :label="item.key"
  235. :value="item.value"
  236. ></el-option>
  237. </el-select>
  238. </el-form-item>
  239. <!-- TODO 暂时关闭SL -->
  240. <el-form-item
  241. v-if="addRefundForm.warehouseCode"
  242. label="ShippingLabel" hidden
  243. >
  244. <el-radio-group v-model="addRefundForm.slUseable">
  245. <el-radio label="0" value="0">{{
  246. $t("view.notEnabled")
  247. }}</el-radio>
  248. <el-radio label="1" value="1">{{
  249. $t("view.enabled")
  250. }}</el-radio>
  251. </el-radio-group>
  252. </el-form-item>
  253. <el-form-item
  254. v-if="
  255. addRefundForm.refundType == 3 && addRefundForm.slUseable == '1'
  256. "
  257. :label="$t('label.returnLogisticsCompanyCode')"
  258. >
  259. <el-input
  260. v-model="addRefundForm.shipmodeId"
  261. disabled
  262. :placeholder="$t('place.pleaseFillIn')"
  263. class="normal-input"
  264. ></el-input>
  265. </el-form-item>
  266. <el-form-item
  267. v-if="
  268. addRefundForm.refundType == 3 && addRefundForm.slUseable == '1'
  269. "
  270. :label="$t('label.returnLogisticsNumber')"
  271. >
  272. <el-input
  273. v-model="addRefundForm.shippingNo"
  274. disabled
  275. :placeholder="$t('place.pleaseFillIn')"
  276. class="normal-input"
  277. ></el-input>
  278. </el-form-item>
  279. <el-form-item
  280. v-if="
  281. addRefundForm.refundType == 3 && addRefundForm.slUseable == '0'
  282. "
  283. :label="$t('label.returnLogisticsCompanyCode')"
  284. >
  285. <el-input
  286. v-model="addRefundForm.shipmodeId"
  287. :placeholder="$t('place.pleaseFillIn')"
  288. class="normal-input"
  289. ></el-input>
  290. </el-form-item>
  291. <el-form-item
  292. v-if="
  293. addRefundForm.refundType == 3 && addRefundForm.slUseable == '0'
  294. "
  295. :label="$t('label.returnLogisticsNumber')"
  296. >
  297. <el-input
  298. v-model="addRefundForm.shippingNo"
  299. :placeholder="$t('place.pleaseFillIn')"
  300. class="normal-input"
  301. ></el-input>
  302. </el-form-item>
  303. <!-- <el-form-item v-if="addRefundForm.refundType==1" clearable :label="$t('label.refundReason')">
  304. <el-select :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item" @change="refundChange(allReason,addRefundForm.refundReason)">
  305. <el-option v-for="status in allReason"
  306. v-if="status.reasonType=='1'"
  307. :key="status.id"
  308. :label="status.reasonContentChinese"
  309. :value="status.id">
  310. </el-option>
  311. </el-select>
  312. </el-form-item> -->
  313. <!-- <el-form-item v-if="addRefundForm.refundType==2" clearable :label="$t('label.refundReason')" >
  314. <el-select :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item" @change="refundChange(allReason,addRefundForm.refundReason)">
  315. <el-option v-for="status in allReason"
  316. v-if="status.reasonType=='2'"
  317. :key="status.id"
  318. :label="status.reasonContentChinese"
  319. :value="status.id">
  320. </el-option>
  321. </el-select>
  322. </el-form-item> -->
  323. <!-- <el-form-item v-if="addRefundForm.refundType==3" clearable :label="$t('label.refundReason')">
  324. <el-select :placeholder="$t('place.pleaseSelect')" clearable v-model="addRefundForm.refundReason" class="filter-item" @change="refundChange(allReason,addRefundForm.refundReason)">
  325. <el-option v-for="status in allReason"
  326. v-if="status.reasonType=='3'"
  327. :key="status.id"
  328. :label="status.reasonContentChinese"
  329. :value="status.id">
  330. </el-option>
  331. </el-select>
  332. </el-form-item> -->
  333. <!-- <el-form-item v-if="customOpen=='1'" :label="$t('label.reasonExplanation')">
  334. <el-input type="textarea" :placeholder="$t('place.enterReason')" v-model="addRefundForm.otherReason" style="width: 200px;" :rows="3"></el-input>
  335. </el-form-item> -->
  336. <el-form-item :label="$t('label.afterSalesInstructions')">
  337. <el-input
  338. type="textarea"
  339. :placeholder="$t('place.enterContent')"
  340. v-model="addRefundForm.notes"
  341. maxlength="150"
  342. show-word-limit
  343. >
  344. </el-input>
  345. </el-form-item>
  346. <el-form-item :label="$t('label.uploadVoucher')">
  347. <el-upload
  348. class="avatar-uploader"
  349. :action="uploadPhotos"
  350. :show-file-list="false"
  351. :on-success="handleAvatarSuccess"
  352. :before-upload="beforeAvatarUpload"
  353. :headers="headers"
  354. >
  355. <img v-if="imageUrl" :src="imageUrl" class="avatar" />
  356. <i v-else class="el-icon-plus avatar-uploader-icon"></i>
  357. </el-upload>
  358. </el-form-item>
  359. </el-form>
  360. </div>
  361. </div>
  362. <div class="box" style="margin-top: 15px;" v-if="refundType">
  363. <div class="item_title">
  364. <span>{{ $t("view.selectItems") }}</span>
  365. </div>
  366. <div class="ptitle">
  367. <!-- <orderRefundItemListTab v-if="refundType" :addRefundForm="addRefundForm" :refundType="addRefundForm.refundType" :orderDeatils="orderDeatils" :orderInfo="orderInfo"></orderRefundItemListTab> -->
  368. <orderRefundItemListTab
  369. v-if="refundType"
  370. :addRefundForm="addRefundForm"
  371. :refundType="addRefundForm.refundType"
  372. ></orderRefundItemListTab>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. </template>
  378. <script>
  379. import {
  380. getById,
  381. queryOrderDetails,
  382. getAllReason
  383. } from "@/api/oms/order/order";
  384. import { queryByOrdersId as getAddress } from "@/api/oms/order/address";
  385. import { getById as getInvoice } from "@/api/oms/order/invoice";
  386. import global from "@/views/oms/global";
  387. import baseInfoTab from "@/views/oms/order/components/baseInfoTab";
  388. import invoiceInfoTab from "@/views/oms/order/components/invoiceInfoTab";
  389. import optLogTab from "@/views/oms/order/components/optLogTab";
  390. import orderRefundItemListTab from "./orderRefundItemListTab";
  391. import receivingInfoTab from "@/views/oms/order/components/receivingInfoTab";
  392. import {
  393. warehouseList,
  394. getRefundInfo,
  395. getDetailListByRefundId
  396. } from "@/api/oms/refund/refund";
  397. import { getToken } from "@/utils/auth";
  398. import { dcmAdd, dcmSub, accDiv, accMul } from "@/utils/toolUtil";
  399. import { BigNumber } from "bignumber.js";
  400. export default {
  401. name: "orderRefundDialog",
  402. props: ["refundId"],
  403. components: {
  404. baseInfoTab,
  405. invoiceInfoTab,
  406. optLogTab,
  407. orderRefundItemListTab,
  408. receivingInfoTab
  409. },
  410. data() {
  411. return {
  412. orderInfo: {},
  413. addressInfo: {},
  414. orderDeatils: [],
  415. invoiceInfo: null,
  416. detailLoading: false,
  417. imageUrl: "",
  418. allReason: {},
  419. customOpen: "",
  420. addRefundForm: {
  421. refundMethod: "system",
  422. refundPostage: "0",
  423. refundAmount: 0.0, //商品退款金额
  424. refundPostageAmount: 0.0,
  425. warehouseCode: "",
  426. annexPath: "",
  427. items: [],
  428. oldQuantity: 0,
  429. refundTaxAble: "0", //是否退税
  430. refundTaxAmount: 0.0, //退税金额
  431. refundTotalAmount: 0.0, //总计退款金额 = 商品退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
  432. refundReason: "", // 退款原因
  433. otherReason: "", // 其他退款理由
  434. refundAccount: "",
  435. refundAccountType: "",
  436. ormorder: "",
  437. slUseable: "0" //是否开启ShippingLabel选项
  438. },
  439. afterSaleTypes: "",
  440. warehouseItems: [],
  441. fromLoading: false,
  442. uploadPhotos: process.env.VUE_APP_OMS_API + "ordersRefund/uploadPhotos",
  443. editIs: true,
  444. refundType: false
  445. };
  446. },
  447. created() {
  448. // if(!this.refundId) {
  449. // this.editIs = false;
  450. // }
  451. // this.getOrderInfo();
  452. //这里只考虑编辑的情况
  453. this.getDetailListByRefundId(this.refundId);
  454. },
  455. computed: {
  456. // 计算属性的 getter
  457. headers: function() {
  458. return {
  459. "X-Token": getToken()
  460. };
  461. }
  462. },
  463. methods: {
  464. //计算退款总额 商品退款金额 + 退运费金额 +退税金额
  465. calculateRefundAmount() {
  466. //如果没选择退税
  467. if (this.addRefundForm.refundTaxAble != "1") {
  468. this.addRefundForm.refundTaxAmount = BigNumber(0)
  469. .toNumber()
  470. .toFixed(2);
  471. }
  472. //如果没选择退运费
  473. if (this.addRefundForm.refundPostage != "1") {
  474. this.addRefundForm.refundPostageAmount = BigNumber(0)
  475. .toNumber()
  476. .toFixed(2);
  477. }
  478. var taxAndShippingAmount = BigNumber(this.addRefundForm.refundTaxAmount)
  479. .plus(BigNumber(this.addRefundForm.refundPostageAmount))
  480. .toNumber()
  481. .toFixed(2);
  482. console.log(taxAndShippingAmount, this.addRefundForm.refundAmount);
  483. this.addRefundForm.refundTotalAmount = BigNumber(taxAndShippingAmount)
  484. .plus(BigNumber(this.addRefundForm.refundAmount))
  485. .toNumber()
  486. .toFixed(2);
  487. },
  488. getDetailListByRefundId(refundId) {
  489. //初始化数据
  490. this.addRefundForm.refundAmount = 0.0;
  491. this.addRefundForm.refundPostage = "0";
  492. this.addRefundForm.refundPostageAmount = 0.0;
  493. this.addRefundForm.warehouseCode = "";
  494. this.addRefundForm.annexPath = "";
  495. this.addRefundForm.items = [];
  496. this.addRefundForm.oldQuantity = 0.0;
  497. this.addRefundForm.refundTaxAble = "0"; //是否退税
  498. this.addRefundForm.refundTaxAmount = 0.0; //退税金额
  499. this.addRefundForm.refundTotalAmount = 0.0;
  500. this.addRefundForm.shipmodeId = "";
  501. this.addRefundForm.shippingNo = "";
  502. this.addRefundForm.refundMethod = "system";
  503. this.addRefundForm.refundAccountType = "PayPal";
  504. this.addRefundForm.refundAccount = "";
  505. this.addRefundForm.notes = "";
  506. this.addressInfo = [];
  507. this.reasonListAll = [];
  508. this.refundReasonAss = "";
  509. this.refundOtherReasonAss = "";
  510. this.otherReasonFlag = "";
  511. //查询该退款单的数据
  512. this.detailLoading = true;
  513. let _this = this;
  514. getDetailListByRefundId(refundId).then(res => {
  515. if (200 == res.code) {
  516. this.addRefundForm = res.data;
  517. this.addressInfo = res.data.address;
  518. this.afterSaleTypes = global.afterSaleType; //售后类型
  519. //循环订单项信息
  520. let refundGoodsAmount = BigNumber(0);
  521. if (this.addRefundForm.items) {
  522. for (let ind in this.addRefundForm.items) {
  523. refundGoodsAmount = refundGoodsAmount.plus(
  524. BigNumber(this.addRefundForm.items[ind].refundAmount)
  525. );
  526. }
  527. }
  528. _this.$set(
  529. this.addRefundForm,
  530. "refundAmount",
  531. BigNumber(refundGoodsAmount.toFixed(2))
  532. ); //this.addRefundForm.refundAmount= refundGoodsAmount.toFixed(2);
  533. //原单的退税金额 = 原单的退款总金额 - 退商品金额 - 退运费金额
  534. let oldRefundTaxAmount = BigNumber(
  535. this.addRefundForm.refundTotalAmount
  536. )
  537. .plus(BigNumber(-this.addRefundForm.refundPostageAmount))
  538. .plus(BigNumber(-this.addRefundForm.refundAmount))
  539. .toFixed(2);
  540. if (oldRefundTaxAmount > 0) {
  541. _this.$set(this.addRefundForm, "refundTaxAble", "1"); //是否退税
  542. } else {
  543. oldRefundTaxAmount = 0;
  544. _this.$set(this.addRefundForm, "refundTaxAble", "0"); //是否退税
  545. }
  546. _this.$set(this.addRefundForm, "refundTaxAmount", oldRefundTaxAmount); //是否退税 this.addRefundForm.refundTaxAmount=oldRefundTaxAmount;
  547. this.refundType = true;
  548. this.detailLoading = false;
  549. //退货退款场景
  550. if (this.addRefundForm.refundType == 3) {
  551. warehouseList().then(res => {
  552. if (200 == res.code) {
  553. this.warehouseItems = res.data;
  554. }
  555. });
  556. }
  557. } else {
  558. this.$message.error(res.msg);
  559. }
  560. });
  561. },
  562. handleAvatarSuccess(res, file) {
  563. console.log("图片上传结果", res);
  564. this.imageUrl = res.accessUrl;
  565. if (this.imageUrl) {
  566. this.addRefundForm.annexPath = this.imageUrl;
  567. }
  568. },
  569. beforeAvatarUpload(file) {
  570. const isJPG = file.type === "image/jpeg" || file.type === "image/png";
  571. const isLt2M = file.size / 1024 / 1024 < 2;
  572. if (!isJPG) {
  573. this.$message.error("上传图片只能是 JPG 格式或者PNG格式!");
  574. }
  575. if (!isLt2M) {
  576. this.$message.error("上传头像图片大小不能超过 2MB!");
  577. }
  578. return isJPG && isLt2M;
  579. },
  580. refundChange(arr, id) {
  581. console.log(arr, id);
  582. arr.forEach(item => {
  583. if (item.id == id) {
  584. this.customOpen = item.custom;
  585. }
  586. });
  587. },
  588. // changeRefund() {
  589. // this.fromLoading = true;
  590. // this.refundType=false;
  591. // this.orderDeatils = [];
  592. // this.addRefundForm.refundAmount = 0.00;
  593. // this.addRefundForm.refundPostage = '0';
  594. // this.addRefundForm.refundPostageAmount = 0.00;
  595. // this.addRefundForm.refundTaxAble='0';//是否退税
  596. // this.addRefundForm.refundTaxAmount=0.00;//退税金额
  597. // this.addRefundForm.refundTotalAmount=0.00; //总计退款金额 = 退款金额 + 退运费金额 + 退税金额 。 实际执行时,refundAmount=商品退款金额 + 退税金额;退运费金额单独计算
  598. // this.addRefundForm.warehouseCode = '';
  599. // this.addRefundForm.annexPath = '';
  600. // this.addRefundForm.items = [];
  601. // this.addRefundForm.oldQuantity = 0;
  602. // this.warehouseItems = [];
  603. // this.addRefundForm.refundReason='';
  604. // this.addRefundForm.otherReason='';
  605. // //退货退款场景
  606. // if(this.addRefundForm.refundType == 3) {
  607. // warehouseList().then(res => {
  608. // if(200 == res.code) {
  609. // this.warehouseItems = res.data;
  610. // }
  611. // })
  612. // }
  613. // queryOrderDetails(this.orderInfo.ordersId).then(res => {
  614. // if(200 == res.code) {
  615. // this.orderDeatils = res.data;
  616. // if(this.orderDeatils) {
  617. // for(let ind in this.orderDeatils) {
  618. // this.orderDeatils[ind].oldQuantity = this.orderDeatils[ind].quantity;
  619. // if(this.addRefundForm.refundType==1){
  620. // this.orderDeatils[ind].quantity=0;
  621. // }
  622. // var fee=this.orderDeatils[ind].totalFee;
  623. // if(fee==null||fee==""){
  624. // fee=0.00;
  625. // }
  626. // this.$set(this.orderDeatils[ind], "refundAmount", fee)
  627. // if(this.orderDeatils[ind].refundQuantity == null) {
  628. // this.orderDeatils[ind].refundQuantity = 0;
  629. // }
  630. // }
  631. // this.refundType=true;
  632. // }
  633. // }
  634. // this.fromLoading = false;
  635. // console.log("this.orderDeatils",this.orderDeatils)
  636. // })
  637. // },
  638. ShippingLabelOption() {
  639. // if (
  640. // this.addRefundForm.refundType == 3 &&
  641. // this.addressInfo.receiverCountryCode == "US" &&
  642. // this.addRefundForm.warehouseCode == "USNY-C1"
  643. // ) {
  644. // this.addRefundForm.slUseable = "1";
  645. // } else {
  646. // this.addRefundForm.slUseable = "0";
  647. // }
  648. //暂时关闭SL
  649. this.addRefundForm.slUseable = "0";
  650. }
  651. }
  652. };
  653. </script>
  654. <style lang="scss" scoped>
  655. .head {
  656. padding: 0 20px;
  657. height: 25px;
  658. box-shadow: 0px 7px 6px -6px #f8eeee;
  659. display: flex;
  660. justify-content: space-between;
  661. span:nth-child(1) {
  662. font-size: 15px;
  663. line-height: 25px;
  664. color: #909399;
  665. font-weight: 600;
  666. }
  667. span:nth-child(2) {
  668. line-height: 25px;
  669. cursor: pointer;
  670. color: #ae8878;
  671. font-size: 13px;
  672. }
  673. }
  674. .avatar-uploader .el-upload {
  675. border: 1px dashed #d9d9d9;
  676. border-radius: 6px;
  677. cursor: pointer;
  678. position: relative;
  679. overflow: hidden;
  680. }
  681. .avatar-uploader .el-upload:hover {
  682. border-color: #409eff;
  683. }
  684. .avatar-uploader-icon {
  685. font-size: 28px;
  686. color: #8c939d;
  687. width: 178px;
  688. height: 178px;
  689. line-height: 178px;
  690. text-align: center;
  691. }
  692. .avatar {
  693. width: 178px;
  694. height: 178px;
  695. display: block;
  696. }
  697. .big_box {
  698. min-width: 650px;
  699. border: 1px solid #e4e7ed;
  700. border-bottom: none;
  701. }
  702. .big_box div {
  703. border-bottom: 1px solid #e4e7ed;
  704. display: flex;
  705. }
  706. .big_box p {
  707. margin: 0;
  708. height: 30px;
  709. line-height: 30px;
  710. font-size: 13px;
  711. font-weight: bold;
  712. border-right: 1px solid #e4e7ed;
  713. padding: 0 5px;
  714. text-align: center;
  715. color: #909399;
  716. min-width: 100px;
  717. }
  718. .w {
  719. font-weight: 500 !important;
  720. color: #606266 !important;
  721. text-align: left !important;
  722. padding-left: 20px !important;
  723. }
  724. .main {
  725. margin-top: 15px;
  726. .box {
  727. text-align: center;
  728. position: relative;
  729. .box_item {
  730. padding: 0 20px;
  731. display: flex;
  732. .item_title {
  733. line-height: 40px;
  734. font-size: 18px;
  735. text-align: left;
  736. font-weight: 600;
  737. }
  738. .item_list {
  739. text-align: left;
  740. font-size: 14px;
  741. color: #606266;
  742. display: flex;
  743. p {
  744. margin: 10px 0;
  745. }
  746. div:nth-child(2) {
  747. margin-left: 30px;
  748. }
  749. }
  750. }
  751. .item_title {
  752. padding-left: 20px;
  753. line-height: 40px;
  754. font-size: 18px;
  755. text-align: left;
  756. font-weight: 600;
  757. }
  758. }
  759. }
  760. .ptitle {
  761. display: flex;
  762. justify-content: space-between;
  763. margin: 20px;
  764. color: #1f2d3d;
  765. text-align: left;
  766. font-weight: bold;
  767. }
  768. .pcode {
  769. color: #8f5842;
  770. font-weight: 500;
  771. }
  772. .demo-table-expand {
  773. font-size: 0;
  774. }
  775. .demo-table-expand label {
  776. width: 90px;
  777. color: #99a9bf;
  778. }
  779. .demo-table-expand .el-form-item {
  780. margin-right: 0;
  781. margin-bottom: 0;
  782. width: 50%;
  783. }
  784. </style>