order-menu.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067
  1. <template>
  2. <view>
  3. <view class="dir-right-nowrap">
  4. <!-- 换货确认收货 -->
  5. <view @click.stop="toConfirm(item)" v-if="item.action_status.is_show_confirm == 1" class="handle-btn other">确认收货</view>
  6. <!-- 退货确认退款 -->
  7. <view @click.stop="toRefund(item)" v-if="item.action_status.is_show_refund == 1" class="handle-btn other">退款</view>
  8. <view @click.stop="refundHandle(2,item,1)" v-if="item.action_status.is_show_cancel_refund" :class="['handle-btn', `${_num == 1 || _num == -1?'other':''}`]">取消售后</view>
  9. <!-- 换货发货 -->
  10. <view @click.stop="toSend(item)" data-send="1" v-if="item.is_confirm == 0 && status == 2 && item.is_send == 1 && item.type == 2 && item.order.send_type == 0" class="handle-btn other">发货</view>
  11. <!-- 买家申请售后 -->
  12. <view @click.stop="refundHandle(1,item)" v-if="item.action_status.is_show_apply == 1" class="handle-btn other">同意</view>
  13. <view @click.stop="refundHandle(2,item)" v-if="item.action_status.is_show_apply == 1" class="handle-btn">拒绝</view>
  14. <view @click.stop="lookAbout(item)" v-if=" status == 2" class="handle-btn">售后理由</view>
  15. <!-- 取消订单操作 -->
  16. <view v-if="item.cancel_status == 2" @click.stop="toAgreeCancel(item)" class="handle-btn other">同意</view>
  17. <view v-if="item.cancel_status == 2" @click.stop="beNotRefund(item)" class="handle-btn">拒绝</view>
  18. <view v-if="item.cancel_status == 0 && item.is_pay == 0 && item.is_send == 0" @click.stop="toChange(item)" class="handle-btn other">修改价格</view>
  19. <view v-if="item.action_status.is_confirm_order == 1" @click.stop="toConfirm(item)" class="handle-btn other">确认收货</view>
  20. <view v-if="item.cancel_status == 0 && item.is_send == 1 && item.is_confirm == 0 && item.express_no" @click.stop="toExpress(item,2)" class="handle-btn other">修改物流信息</view>
  21. <view @click="toExpressInfo(item)" v-if="item.cancel_status == 0 && item.is_send == 1 && item.is_confirm == 0 && item.detailExpress.length > 0" class="handle-btn other">查看物流</view>
  22. <view @click.stop="toSend(item)" v-if="item.action_status.is_express_send == 1 || item.action_status.is_store_send == 1 || item.action_status.is_city_send == 1" class="handle-btn other">发货</view>
  23. <view @click="toChangeAddress(item)" v-if="item.action_status.is_edit_address == 1" class="handle-btn">修改地址</view>
  24. <view @click.stop="toRefundOrder(item.order_no)" v-if="item.have_refund == 1 && status == 1 && item.is_sale == 0" class="handle-btn">售后中</view>
  25. <view @click.stop="toCancelorder(item)" v-if="item.sign != 'gift' && item.action_status.is_coerce_cancel == 1" class="handle-btn">取消订单</view>
  26. <view @click="toExpressInfo(item)" v-if="status == 2 && item.detailExpress.length > 0 && item.status == 2" class="handle-btn">物流详情</view>
  27. <view v-if="status == 1 && !hiddenRemark" @click.stop="makeRemark(item)" class="handle-btn">备注</view>
  28. </view>
  29. <view class="bg cross-center" v-if="isRefund || noRefund || changePrice || cancelOrder || item.showMobile || notRefund || isReason || openAddress || noAddress || beRemark || confirmOrder || refundOnly || cityRefund || beToSend">
  30. <!-- 退款 -->
  31. <view class="dialog" v-if="isRefund">
  32. <view class="dialog-title">退款</view>
  33. <view class="main-center cross-center refund-pay">¥
  34. <input class="refund-price" type='digit' v-model="refund_price" />
  35. </view>
  36. <view class="main-center refund-tip">是否确认退款给买家</view>
  37. <view class="main-center btn-area">
  38. <view class="submit-btn" @click='cancel'>取消</view>
  39. <view class="line"></view>
  40. <view class="submit-btn be-submit" v-if="status == 2" @click='agree'>确认</view>
  41. </view>
  42. </view>
  43. <view class="dialog-bg" :style="{'display': `${notRefund ? 'block' : 'none'}`}"></view>
  44. <!-- 拒绝退款 -->
  45. <view class="dialog" v-if="notRefund">
  46. <view class="dialog-title">拒绝售后</view>
  47. <textarea fixed class="textarea" v-model="about" placeholder="请输入拒绝理由" placeholder-style="color:#999999;font-size:14px" auto-focus />
  48. <view class="main-center btn-area">
  49. <view class="submit-btn" @click='cancel'>取消</view>
  50. <view class="line"></view>
  51. <view v-if="notRefund" class="submit-btn be-submit" @click='decline(0)'>确认</view>
  52. </view>
  53. </view>
  54. <!-- 到店自提未填发货地址的提示 -->
  55. <view class="dialog" v-if="beToSend">
  56. <view class="dialog-title">提示</view>
  57. <view class="main-center dir-top-nowrap cancel-tip" style="text-align: center">
  58. <view>是否将配送方式改为快递配送</view>
  59. </view>
  60. <view class="main-center btn-area">
  61. <view class="submit-btn" @click='cancel'>取消</view>
  62. <view class="line"></view>
  63. <view class="submit-btn be-submit" @click='toChangeAddress'>确认</view>
  64. </view>
  65. </view>
  66. <!-- 备注 -->
  67. <view class="dialog" v-if="beRemark">
  68. <view class="dialog-title">备注</view>
  69. <view class="remark-input">
  70. <input maxlength="15" v-model="remark" placeholder="请输入备注内容(限15个字符)">
  71. </view>
  72. <view class="main-center btn-area">
  73. <view class="submit-btn" @click='cancel'>取消</view>
  74. <view class="line"></view>
  75. <view class="submit-btn be-submit" @click='toRemark'>确认</view>
  76. </view>
  77. </view>
  78. <!-- 改价 -->
  79. <view class="dialog" v-if="changePrice">
  80. <view v-if="changePrice" class="dialog-title">修改价格</view>
  81. <view v-if="changePrice" class="dir-left-nowrap change-price-item">
  82. <view class="label">商品总价</view>
  83. <view class="money">¥</view>
  84. <view class="price-input" v-if="detail.sign == 'gift'">{{price}}</view>
  85. <input v-else fixed type="digit" class="price-input" @input="priceInput" :focus="changePrice?true:false" v-model='price'/>
  86. </view>
  87. <view v-if="changePrice" class="dir-left-nowrap change-price-item">
  88. <view class="label">运费</view>
  89. <view class="money">¥</view>
  90. <input fixed type="digit" class="price-input" @input="expressInput" focus v-model='express'/>
  91. </view>
  92. <view v-if="changePrice" class="dir-left-nowrap change-price-item">
  93. <view class="label">合计</view>
  94. <view class="total-money">{{total}}</view>
  95. </view>
  96. <view v-if="changePrice" class="main-center btn-area">
  97. <view class="submit-btn" @click='cancel'>取消</view>
  98. <view class="line"></view>
  99. <view class="submit-btn be-submit" @click='submitChange'>确认</view>
  100. </view>
  101. </view>
  102. <!-- 取消订单 -->
  103. <view class="dialog" v-if="cancelOrder">
  104. <view class="main-center cancel-tip">确定取消该订单?</view>
  105. <view class="main-center btn-area">
  106. <view class="submit-btn" @click='cancel'>取消</view>
  107. <view class="line"></view>
  108. <view class="submit-btn be-submit" @click='cancelSubmit'>确认</view>
  109. </view>
  110. </view>
  111. <!-- 仅退款订单 -->
  112. <view class="dialog" v-if="refundOnly">
  113. <view class="main-center cancel-tip">是否同意用户仅退款(无需退货)申请?</view>
  114. <view class="main-center btn-area">
  115. <view class="submit-btn" @click='cancel'>取消</view>
  116. <view class="line"></view>
  117. <view class="submit-btn be-submit" @click='decline(3)'>确认</view>
  118. </view>
  119. </view>
  120. <!-- 非快递订单 -->
  121. <view class="dialog" v-if="cityRefund">
  122. <view class="dir-top-nowrap cross-center main-center cancel-tip dialog-refund-tip" v-if="detail.order.send_type == 1">
  123. <view>该订单为到店自提订单</view>
  124. <view>需买家到店退换货</view>
  125. </view>
  126. <view class="dir-top-nowrap cross-center main-center cancel-tip dialog-refund-tip" v-if="detail.order.send_type == 2" >
  127. <view>该订单为同城配送订单</view>
  128. <view>需商家上门取货</view>
  129. </view>
  130. <view class="main-center btn-area">
  131. <view class="submit-btn" @click='cancel'>取消</view>
  132. <view class="line"></view>
  133. <view class="submit-btn be-submit" @click='decline(4)'>确认</view>
  134. </view>
  135. </view>
  136. <!-- 售后确认收货 -->
  137. <view class="dialog" v-if="confirmOrder">
  138. <view class="main-center cancel-tip">是否确认收货?</view>
  139. <view class="main-center btn-area">
  140. <view class="submit-btn" @click='cancel'>取消</view>
  141. <view class="line"></view>
  142. <view class="submit-btn be-submit" v-if="status == 1" @click='beOrderConfirm'>确认</view>
  143. <view class="submit-btn be-submit" v-else @click='beConfirm'>确认</view>
  144. </view>
  145. </view>
  146. <!-- 打电话 -->
  147. <view class="dialog" v-if="item.showMobile">
  148. <view class="main-center cancel-tip">{{item.mobile}}</view>
  149. <view class="main-center btn-area">
  150. <view class="submit-btn" @click='cancel'>取消</view>
  151. <view class="line"></view>
  152. <view class="submit-btn be-submit" @click='call'>确认</view>
  153. </view>
  154. </view>
  155. <!-- 提示 -->
  156. <view class="dialog" v-if="noAddress">
  157. <view class="main-center dir-top-nowrap cancel-tip" style="text-align: center">
  158. <view>您还没有退货地址</view>
  159. <view>请先设置</view>
  160. </view>
  161. <view class="main-center btn-area">
  162. <view class="submit-btn" @click='noAddress=false'>取消</view>
  163. <view class="line"></view>
  164. <view class="submit-btn be-submit" @click='toRefundAdd'>去设置</view>
  165. </view>
  166. </view>
  167. <!-- 理由 -->
  168. <view class="dialog get-top" v-if="isReason">
  169. <view v-if="status == 2" class="dialog-title">售后理由</view>
  170. <view v-if="status == 1 && !noRefund" class="dialog-title">同意取消</view>
  171. <view v-if="status == 1 && noRefund" class="dialog-title">拒绝取消</view>
  172. <view class="reason">
  173. <template v-if="detail.refund_data.cause || detail.cancel_data.cause">
  174. <view class="reason-title">{{detail.type == 2 && status == 2 ? '换货原因' : '退款原因'}}</view>
  175. <view class="reason-content">{{status == 1 ? detail.cancel_data.cause : detail.refund_data.cause}}</view>
  176. </template>
  177. <template v-if="detail.type != 2">
  178. <view class="reason-title">退款金额</view>
  179. <view class="reason-content">¥{{status == 1 ? detail.total_pay_price : detail.refund_price}}</view>
  180. </template>
  181. <template v-if="(status == 2 &&detail.remark) || detail.cancel_data.remark">
  182. <view class="reason-title">备注信息</view>
  183. <view class="reason-content" :class="{'two-line':!showRemark}">{{status == 1 ? detail.cancel_data.remark : detail.remark}}</view>
  184. <view v-if="(status == 2 &&detail.remark.length > 40) || detail.cancel_data.remark.length > 40" class="main-center cross-center show-remark">
  185. <view @click="showRemark=!showRemark">{{showRemark ? '点击收起' : '点击展开'}}</view>
  186. <image v-if="!showRemark" src="/static/image/icon/icon-down.png"></image>
  187. <image v-else src="/static/image/icon/icon-up.png"></image>
  188. </view>
  189. </template>
  190. <template v-if="(status == 2 && detail.mobile) || detail.cancel_data.mobile">
  191. <view class="reason-title">联系方式</view>
  192. <view class="reason-content">{{status == 1 ? detail.cancel_data.mobile : detail.mobile}}</view>
  193. </template>
  194. <view v-if="detail.pic_list.length > 0" class="reason-title">图片</view>
  195. <view class="dir-left-wrap reason-img" v-if="detail.pic_list.length > 0">
  196. <image mode="aspectFill" @click='look(item)' v-for="item in detail.pic_list" :key="item" :src="item"></image>
  197. </view>
  198. <view v-if="detail.cancel_data.image_list.length > 0" class="reason-title">图片凭证</view>
  199. <view class="dir-left-wrap reason-img" v-if="detail.cancel_data.image_list.length > 0">
  200. <image mode="aspectFill" @click='look(item)' v-for="item in detail.cancel_data.image_list" :key="item" :src="item"></image>
  201. </view>
  202. </view>
  203. <textarea v-if="status == 1 && noRefund" fixed class="textarea" v-model="about" placeholder="请输入拒绝理由" placeholder-style="color:#999999;font-size:14px" auto-focus />
  204. <textarea v-if="status == 1 && !noRefund" fixed class="textarea" v-model="about" placeholder="请输入同意理由" placeholder-style="color:#999999;font-size:14px" auto-focus />
  205. <view v-if="status == 1" class="main-center btn-area">
  206. <view class="submit-btn" @click='cancel'>取消</view>
  207. <view class="line"></view>
  208. <view class="submit-btn be-submit" @click='cancelSubmit'>确认</view>
  209. </view>
  210. <view v-else class="main-center btn-area other-btn-area">
  211. <view class="submit-btn be-submit" @click='cancel'>确认</view>
  212. </view>
  213. </view>
  214. <!-- 选地址 -->
  215. <view class="dialog" v-if="openAddress">
  216. <view class="dialog-title">选择退货地址</view>
  217. <view class="add-list">
  218. <view class="add-item" v-for="item in address" :key="item.id">
  219. <image v-if="item.id == addressId" @click='chooseAddress(item.id)' src="./../image/active.png"></image>
  220. <image v-else @click='chooseAddress(item.id)' src="/static/image/icon/form-er.png"></image>
  221. <view @click='chooseAddress(item.id)' class="add-info">
  222. <view class="main-between">
  223. <view class="add-name">{{item.name}}</view>
  224. <view>{{item.mobile}}</view>
  225. </view>
  226. <view>{{item.address}}{{item.address_detail}}</view>
  227. </view>
  228. </view>
  229. </view>
  230. <view class="main-center btn-area other-btn-area">
  231. <view class="submit-btn" @click='cancel'>取消</view>
  232. <view class="line"></view>
  233. <view class="submit-btn be-submit" @click='decline(1)'>确认</view>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. </template>
  239. <script>
  240. export default {
  241. name: "order-menu",
  242. props: {
  243. item: {
  244. type: Object
  245. },
  246. address: {
  247. type: Array
  248. },
  249. mobile: {
  250. type: String
  251. },
  252. hiddenRemark: {
  253. type: Boolean,
  254. default() {
  255. return false
  256. }
  257. },
  258. status: {
  259. type: String
  260. }
  261. },
  262. data() {
  263. return {
  264. detail: {},
  265. isRefund: false,
  266. noRefund: false,
  267. changePrice: false,
  268. cancelOrder: false,
  269. callPhone: false,
  270. notRefund: false,
  271. isReason: false,
  272. openAddress: false,
  273. noAddress: false,
  274. beRemark: false,
  275. confirmOrder: false,
  276. refundOnly: false,
  277. cityRefund: false,
  278. beToSend: false,
  279. price: 0,
  280. express: 0,
  281. total: 0,
  282. refund_price: 0,
  283. addressId: '0',
  284. remark: '',
  285. about: '',
  286. }
  287. },
  288. methods: {
  289. // 取消
  290. cancel() {
  291. if(this.item.showMobile) {
  292. this.item.showMobile = false;
  293. this.$emit('change', this.item);
  294. }else {
  295. this.about = '';
  296. this.isRefund = false;
  297. this.beToSend = false;
  298. this.noRefund = false;
  299. this.changePrice = false;
  300. this.cancelOrder = false;
  301. this.custom = false;
  302. this.refundOnly = false;
  303. this.cityRefund = false;
  304. this.notRefund = false;
  305. this.openAddress = false;
  306. this.isReason = false;
  307. this.confirmOrder = false;
  308. this.addressId = 0;
  309. this.beRemark = false;
  310. this.confirmOrder = false;
  311. this.remark = null;
  312. }
  313. },
  314. // 去售后订单查看
  315. toRefundOrder(e) {
  316. this.$emit('to', e);
  317. },
  318. // 备注
  319. makeRemark(data) {
  320. this.beRemark = true;
  321. this.detail = data;
  322. data.seller_remark ? this.remark = data.seller_remark : null;
  323. },
  324. // 提交备注
  325. toRemark() {
  326. let that = this;
  327. that.$request({
  328. url: that.$api.app_admin.sellerRemark,
  329. method: 'post',
  330. data: {
  331. order_id: that.detail.id,
  332. seller_remark: that.remark
  333. }
  334. }).then(response=>{
  335. if(response.code === 0) {
  336. that.detail.seller_remark = that.remark;
  337. that.cancel();
  338. that.$emit('update', that.detail);
  339. }else {
  340. uni.showToast({
  341. title: response.msg,
  342. icon: 'none',
  343. duration: 1000
  344. });
  345. }
  346. });
  347. },
  348. // 设置退货地址
  349. toRefundAdd() {
  350. this.noAddress = false;
  351. uni.navigateTo({
  352. url: `/pages/address/address?manual_btn_bg=admin&is_hide_default_btn=1&is_refund_address=1`,
  353. })
  354. },
  355. // 改地址
  356. toChangeAddress(item) {
  357. this.beToSend = false;
  358. let order_no = item.order_no ? item.order_no : this.detail.order_no
  359. uni.navigateTo({
  360. url: '/pages/app_admin/change-add/change-add?order_no='+order_no
  361. })
  362. },
  363. // 查看物流
  364. toExpressInfo(item) {
  365. if(item.detail.length === 1 && item.detailExpress[0].express_no) {
  366. uni.navigateTo({
  367. url: '/pages/app_admin/express/express?id='+item.id+'&express='+item.detailExpress[0].express+'&express_no='+item.detailExpress[0].express_no+'&customer_name='+item.detailExpress[0].customer_name
  368. });
  369. }else {
  370. uni.navigateTo({
  371. url: '/pages/order/express-list/express-list?order_id='+item.id
  372. });
  373. }
  374. },
  375. // 拨打电话
  376. call() {
  377. uni.makePhoneCall({
  378. phoneNumber: this.item.mobile
  379. })
  380. this.$emit('change', '');
  381. },
  382. // 确认收货提示
  383. toConfirm(e) {
  384. this.detail = e;
  385. this.confirmOrder = !this.confirmOrder;
  386. },
  387. // 确认收货
  388. beOrderConfirm() {
  389. let that = this;
  390. that.$request({
  391. url: that.$api.app_admin.confirm,
  392. data: {
  393. order_id: that.detail.id
  394. },
  395. method: 'post'
  396. }).then(response=>{
  397. that.$hideLoading();
  398. if(response.code === 0) {
  399. uni.showToast({
  400. title: response.msg,
  401. duration: 1000,
  402. type: 'success',
  403. mask: false
  404. });
  405. that.cancel();
  406. setTimeout(v=>{
  407. that.$emit('update', 0);
  408. },1000)
  409. }else {
  410. uni.showToast({
  411. title: response.msg,
  412. icon: 'none',
  413. duration: 1000
  414. });
  415. }
  416. }).catch(() => {
  417. that.$hideLoading();
  418. });
  419. },
  420. // 同意取消订单
  421. toAgreeCancel(e) {
  422. this.detail = e;
  423. this.isReason = !this.isReason;
  424. this.noRefund = false;
  425. },
  426. // 取消订单提示
  427. toCancelorder(e) {
  428. this.detail = e;
  429. this.cancelOrder = !this.cancelOrder;
  430. },
  431. // 取消订单
  432. cancelSubmit() {
  433. let that = this;
  434. uni.showLoading({
  435. title: '加载中...'
  436. });
  437. that.$request({
  438. url: that.$api.app_admin.cancel,
  439. data: {
  440. status: that.noRefund ? 2 : 1,
  441. remark: that.about,
  442. order_id: that.detail.id
  443. },
  444. method: 'post'
  445. }).then(response => {
  446. uni.hideLoading();
  447. if (response.code === 0) {
  448. uni.showToast({
  449. title: that.noRefund ? '拒绝成功':'取消成功',
  450. duration: 1000,
  451. type: 'success',
  452. mask: false
  453. });
  454. that.cancel();
  455. setTimeout(v=>{
  456. that.$emit('update', 0);
  457. },1000)
  458. } else {
  459. uni.showToast({
  460. title: response.msg,
  461. icon: 'none',
  462. duration: 1000
  463. });
  464. }
  465. }).catch(response => {
  466. uni.hideLoading();
  467. uni.showToast({
  468. title: response,
  469. icon: 'none',
  470. duration: 1000
  471. });
  472. });
  473. },
  474. // 修改价格
  475. toChange(e) {
  476. this.detail = e;
  477. this.changePrice = !this.changePrice;
  478. this.price = e.total_goods_price;
  479. this.express = e.express_price;
  480. this.total = '¥' + e.total_pay_price;
  481. },
  482. // 价格输入验证
  483. priceInput: function(e) {
  484. if (e.detail.value > -0.01) {
  485. this.total = '¥' + (+e.detail.value + +this.express).toFixed(2);
  486. } else {
  487. this.total = '数据有误';
  488. }
  489. },
  490. // 邮费输入验证
  491. expressInput: function(e) {
  492. if (e.detail.value > -0.01) {
  493. this.total = '¥' + (+e.detail.value + +this.price).toFixed(2);
  494. } else {
  495. this.total = '数据有误';
  496. }
  497. },
  498. // 确认修改价格
  499. submitChange() {
  500. let that = this;
  501. uni.showLoading({
  502. title: '加载中...'
  503. });
  504. if (this.price > -0.01 && this.express > -0.01) {
  505. this.$request({
  506. url: this.$api.app_admin.update_price,
  507. data: {
  508. order_id: this.detail.id,
  509. total_price: this.price ? this.price : 0,
  510. express_price: this.express ? this.express : 0
  511. },
  512. method: 'post'
  513. }).then(response => {
  514. uni.hideLoading();
  515. if (response.code === 0) {
  516. uni.showToast({
  517. title: response.msg,
  518. duration: 1000,
  519. type: 'success',
  520. mask: false
  521. });
  522. that.changePrice = false;
  523. that.$emit('update', 0);
  524. } else {
  525. uni.showToast({
  526. title: response.msg,
  527. icon: 'none',
  528. duration: 1000
  529. });
  530. }
  531. }).catch(response => {
  532. uni.hideLoading();
  533. uni.showToast({
  534. title: response,
  535. icon: 'none',
  536. duration: 1000
  537. });
  538. });
  539. } else {
  540. if (!that.price || typeof(that.price) != 'number') {
  541. uni.showToast({
  542. title: '商品总价必须大于等于0',
  543. icon: 'none',
  544. duration: 1000
  545. });
  546. } else if (!that.express || typeof(that.express) != 'number') {
  547. uni.showToast({
  548. title: '运费必须大于等于0',
  549. icon: 'none',
  550. duration: 1000
  551. });
  552. }
  553. }
  554. },
  555. // 发货
  556. toSend(e) {
  557. let that = this;
  558. that.detail = e;
  559. if (that.detail.status_cn) {
  560. uni.navigateTo({
  561. url: '/pages/app_admin/send/send?order_refund_id=' + that.detail.id + '&id=' + that.detail.order_id + '&send_type=' + that.detail.send_type
  562. })
  563. } else {
  564. if(that.detail.send_type == 1 && !that.detail.address) {
  565. this.beToSend = true;
  566. }else {
  567. uni.navigateTo({
  568. url: '/pages/app_admin/send/send?id=' + that.detail.id + '&send_type=' + that.detail.send_type
  569. })
  570. }
  571. }
  572. },
  573. // 查看物流
  574. toExpress(e,is_send) {
  575. let id = e.id;
  576. let order_refund_id = e.refund;
  577. if (id > 0) {
  578. uni.navigateTo({
  579. url: '/pages/app_admin/send/send?id=' + id + '&is_send=' + is_send
  580. })
  581. } else if (order_refund_id) {
  582. uni.navigateTo({
  583. url: '/pages/app_admin/send/send?order_refund_id=' + order_refund_id + '&is_send=' + is_send
  584. })
  585. }
  586. },
  587. // 售后操作
  588. // 选择退款地址
  589. chooseAddress(e) {
  590. if (this.addressId == e) {
  591. this.addressId = ''
  592. }else {
  593. this.addressId = e
  594. }
  595. },
  596. // 售后处理
  597. decline(type) {
  598. let that = this;
  599. let para = {
  600. order_refund_id: that.detail.id,
  601. type: that.detail.type,
  602. is_agree: type != 0 ? 1 : 0,
  603. refund_price: that.detail.refund_price,
  604. merchant_remark: that.about
  605. }
  606. if (type == 1) {
  607. if (that.addressId < 1) {
  608. uni.showToast({
  609. title: '请选择地址',
  610. icon: 'none',
  611. duration: 1000
  612. });
  613. return false;
  614. }else {
  615. para.address_id = that.addressId
  616. }
  617. }
  618. if(type == 4) {
  619. para.refund = 1
  620. }
  621. if (that.cancelRefund) {
  622. type = 2;
  623. para.is_agree = 2
  624. }
  625. uni.showLoading({
  626. title: '处理中...'
  627. });
  628. that.$request({
  629. url: that.$api.app_admin.refund_handle,
  630. data: para,
  631. method: 'post'
  632. }).then(response => {
  633. uni.hideLoading();
  634. if (response.code === 0) {
  635. uni.showModal({
  636. title: '提示',
  637. content: response.msg,
  638. showCancel: false,
  639. success: function (res) {
  640. if (res.confirm) {
  641. that.cancel();
  642. setTimeout(v=>{
  643. that.$emit('update', 0);
  644. },1000)
  645. }
  646. }
  647. });
  648. } else {
  649. uni.showToast({
  650. title: response.msg,
  651. icon: 'none',
  652. duration: 1000
  653. });
  654. }
  655. }).catch(response => {
  656. uni.hideLoading();
  657. uni.showToast({
  658. title: response,
  659. icon: 'none',
  660. duration: 1000
  661. });
  662. });
  663. },
  664. // 同意售后
  665. agree() {
  666. let that = this;
  667. uni.showLoading({
  668. title: '处理中...'
  669. });
  670. if (that.detail.refund_price > 0) {
  671. that.$request({
  672. url: that.$api.app_admin.refund_handle,
  673. data: {
  674. order_refund_id: that.detail.id,
  675. type: that.detail.type,
  676. is_agree: 1,
  677. refund_price: that.refund_price,
  678. merchant_remark: that.about
  679. },
  680. method: 'post'
  681. }).then(response => {
  682. uni.hideLoading();
  683. if (response.code === 0) {
  684. uni.showModal({
  685. title: '提示',
  686. content: response.msg,
  687. showCancel: false,
  688. success: function (res) {
  689. if (res.confirm) {
  690. that.cancel();
  691. setTimeout(v=>{
  692. that.$emit('update', 0);
  693. },1000)
  694. }
  695. }
  696. });
  697. } else {
  698. uni.showToast({
  699. title: response.msg,
  700. icon: 'none',
  701. duration: 1000
  702. });
  703. }
  704. }).catch(response => {
  705. uni.hideLoading();
  706. uni.showToast({
  707. title: response,
  708. icon: 'none',
  709. duration: 1000
  710. });
  711. });
  712. } else {
  713. uni.showToast({
  714. title: '退款金额需大于零',
  715. icon: 'none',
  716. duration: 1000
  717. });
  718. }
  719. },
  720. // 拒绝售后
  721. beNotRefund(e) {
  722. this.detail = e;
  723. this.isReason = !this.isReason
  724. this.noRefund = !this.noRefund;
  725. },
  726. // 售后操作
  727. refundHandle(type,detail,cancel) {
  728. if (cancel == 1) {
  729. this.cancelRefund = true;
  730. }
  731. if (type == 1) {
  732. if(detail.type == 3) {
  733. this.refundOnly = true;
  734. this.detail = detail;
  735. }else if(detail.order.send_type != 0){
  736. this.cityRefund = true;
  737. this.detail = detail;
  738. }else {
  739. if (this.address.length == 0) {
  740. this.noAddress = true;
  741. } else {
  742. this.detail = detail;
  743. this.openAddress = true;
  744. }
  745. }
  746. } else if (type == 2) {
  747. this.detail = detail;
  748. this.notRefund = true;
  749. }
  750. },
  751. // 退款提示
  752. toRefund(e) {
  753. this.detail = e;
  754. this.refund_price = e.refund_price;
  755. this.isRefund = !this.isRefund;
  756. },
  757. // 查看图片
  758. look(e) {
  759. uni.previewImage({
  760. current: e, // 当前显示图片的http链接
  761. urls: [e] // 需要预览的图片http链接列表
  762. })
  763. },
  764. // 查看售后理由
  765. lookAbout(e) {
  766. this.detail = e;
  767. this.isReason = true;
  768. },
  769. // 售后确认收货
  770. beConfirm() {
  771. let that = this;
  772. that.$request({
  773. url: that.$api.app_admin.shou_huo,
  774. data: {
  775. refund_order_id: that.detail.id
  776. },
  777. method: 'post'
  778. }).then(response=>{
  779. that.$hideLoading();
  780. if(response.code === 0) {
  781. that.cancel();
  782. that.page = 1;
  783. uni.showLoading({
  784. title: '加载中...'
  785. });
  786. that.$emit('update', 0);
  787. }else {
  788. uni.showToast({
  789. title: response.msg,
  790. icon: 'none',
  791. duration: 1000
  792. });
  793. }
  794. }).catch(() => {
  795. that.$hideLoading();
  796. });
  797. },
  798. }
  799. }
  800. </script>
  801. <style scoped lang="scss">
  802. .handle-btn {
  803. height: #{48rpx};
  804. display: flex;
  805. align-items: center;
  806. padding: 0 #{16rpx};
  807. border-radius: #{24rpx};
  808. border: #{2rpx} solid #bbb;
  809. color: #353535;
  810. font-size: #{24rpx};
  811. margin-left: #{16rpx};
  812. &.other {
  813. border: #{2rpx} solid #446dfd;
  814. color: #446dfd;
  815. }
  816. }
  817. .bg {
  818. background-color: rgba(0, 0, 0, 0.3);
  819. position: fixed;
  820. top: 0;
  821. left: 0;
  822. height: 100%;
  823. width: 100%;
  824. z-index: 100;
  825. .dialog {
  826. width: #{620rpx};
  827. border-radius: #{16rpx};
  828. margin: 0 auto;
  829. background-color: #fff;
  830. z-index: 20;
  831. &.get-top {
  832. margin-top: #{-60rpx};
  833. }
  834. .dialog-title {
  835. font-size: #{32rpx};
  836. color: #353535;
  837. width: #{620rpx};
  838. margin: #{32rpx} auto #{40rpx};
  839. text-align: center;
  840. }
  841. .cancel-tip {
  842. font-size: #{32rpx};
  843. color: #353535;
  844. margin: #{74rpx} 0 #{60rpx};
  845. &.dialog-refund-tip {
  846. padding: 0 #{60rpx};
  847. text-align: center;
  848. }
  849. }
  850. .refund-pay {
  851. font-size: #{36rpx};
  852. color: #353535;
  853. font-weight: bold;
  854. }
  855. .refund-tip {
  856. font-size: #{32rpx};
  857. color: #353535;
  858. margin: #{4rpx} 0 #{45rpx};
  859. }
  860. .total-money {
  861. margin-left: #{56rpx};
  862. }
  863. .textarea {
  864. height: #{252rpx};
  865. width: #{492rpx};
  866. padding: #{24rpx} #{32rpx};
  867. font-size: #{28rpx};
  868. border-radius: #{16rpx};
  869. border: #{2rpx} solid #e2e2e2;
  870. text-align: left;
  871. margin: #{32rpx} auto;
  872. }
  873. .remark-input {
  874. padding: 0 #{32rpx};
  875. height: #{80rpx};
  876. margin-bottom: #{32rpx};
  877. color: #353535;
  878. input {
  879. border-radius: #{16rpx};
  880. background-color: #F7F7F7;
  881. height: #{80rpx};
  882. line-height: #{80rpx};
  883. padding: 0 #{24rpx};
  884. }
  885. }
  886. .change-price-item {
  887. position: relative;
  888. height: #{64rpx};
  889. line-height: #{64rpx};
  890. color: #353535;
  891. font-size: #{28rpx};
  892. margin-bottom: #{26rpx};
  893. &:first-of-type {
  894. margin-bottom: #{32rpx};
  895. }
  896. &:last-of-type {
  897. margin: #{24rpx} 0 #{34rpx};
  898. }
  899. }
  900. .label {
  901. height: #{64rpx};
  902. line-height: #{64rpx};
  903. text-align: right;
  904. width: #{178rpx};
  905. }
  906. .price-input {
  907. width: #{298rpx};
  908. height: #{64rpx};
  909. margin-left: #{24rpx};
  910. border-radius: #{32rpx};
  911. padding-left: #{62rpx};
  912. background-color: #f7f7f7;
  913. }
  914. .money {
  915. position: absolute;
  916. left: #{234rpx};
  917. }
  918. .reason {
  919. padding-left: #{32rpx};
  920. max-height: 600#{rpx};
  921. overflow: scroll;
  922. margin-bottom: 40#{rpx};
  923. &+textarea {
  924. height: #{186rpx};
  925. width: #{556rpx};
  926. }
  927. }
  928. .reason-title {
  929. font-size: #{28rpx};
  930. color: #999;
  931. margin-bottom: #{14rpx};
  932. }
  933. .reason-content {
  934. font-size: #{28rpx};
  935. color: #353535;
  936. width: #{556rpx};
  937. margin-bottom: #{20rpx};
  938. word-break: break-all;
  939. &.two-line {
  940. overflow: hidden;
  941. //#ifdef MP-ALIPAY
  942. height: #{64rpx};
  943. //#endif
  944. // #ifndef MP-ALIPAY
  945. height: #{76rpx};
  946. // #endif
  947. margin-bottom: #{10rpx};
  948. }
  949. }
  950. .reason-img {
  951. margin-bottom: #{14rpx};
  952. image {
  953. height: #{180rpx};
  954. width: #{180rpx};
  955. margin: 0 #{8rpx} #{8rpx} 0;
  956. }
  957. }
  958. .add-list {
  959. margin-top: #{50rpx};
  960. max-height: #{388rpx};
  961. overflow: auto;
  962. padding: 0 #{36rpx};
  963. }
  964. .add-item {
  965. padding: #{32rpx} 0;
  966. margin-left: #{64rpx};
  967. position: relative;
  968. font-size: #{28rpx};
  969. color: #353535;
  970. border-bottom: #{1rpx} solid #e2e2e2;
  971. &.delivery-item {
  972. padding-left: #{64rpx};
  973. margin-left: 0;
  974. .add-name {
  975. width: #{400rpx};
  976. }
  977. }
  978. &:last-of-type {
  979. border-bottom: 0;
  980. }
  981. image {
  982. height: #{36rpx};
  983. width: #{36rpx};
  984. position: absolute;
  985. left: #{-66rpx};
  986. top: 50%;
  987. margin-top: #{-18rpx};
  988. }
  989. .add-active {
  990. position: absolute;
  991. left: #{-64rpx};
  992. top: 50%;
  993. margin-top: #{-18rpx};
  994. }
  995. .add-name {
  996. width: #{220rpx};
  997. overflow: hidden;
  998. text-overflow: ellipsis;
  999. white-space: nowrap;
  1000. }
  1001. }
  1002. .dialog-bg {
  1003. width: 100%;
  1004. height: 100%;
  1005. position: fixed;
  1006. background-color: rgba(0, 0, 0, 0.5);
  1007. left: 0;
  1008. top: 0;
  1009. }
  1010. .show-remark {
  1011. color: #999;
  1012. margin-bottom: #{12rpx};
  1013. font-size: #{24rpx};
  1014. image {
  1015. width: #{22rpx};
  1016. height: #{12rpx};
  1017. margin-left: #{16rpx};
  1018. display: block;
  1019. }
  1020. }
  1021. .refund-price {
  1022. width: #{160rpx};
  1023. border: #{2rpx} solid #e2e2e2;
  1024. border-radius: #{5rpx};
  1025. font-size: #{32rpx};
  1026. padding: 0 #{5rpx};
  1027. }
  1028. .btn-area {
  1029. height: #{88rpx};
  1030. position: relative;
  1031. border-top: #{2rpx} solid #e2e2e2;
  1032. &.other-btn-area {
  1033. margin-top: #{10rpx};
  1034. }
  1035. .line {
  1036. height: #{32rpx};
  1037. width: #{1rpx};
  1038. background-color: #e2e2e2;
  1039. position: absolute;
  1040. top: #{28rpx};
  1041. left: 0;
  1042. right: 0;
  1043. margin: 0 auto;
  1044. }
  1045. .submit-btn {
  1046. height: #{88rpx};
  1047. line-height: #{88rpx};
  1048. font-size: #{32rpx};
  1049. color: #666;
  1050. width: #{310rpx};
  1051. text-align: center;
  1052. &.be-submit {
  1053. color: #446dfd;
  1054. }
  1055. }
  1056. }
  1057. }
  1058. }
  1059. </style>