order-menu.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. <template>
  2. <view>
  3. <view class="dir-right-nowrap" v-if="item.action_status">
  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.detailExpress && item.detailExpress.length > 0" @click.stop="toSend(item,2)" class="handle-btn">{{item.send_type == 2 ? '修改配送员' : '修改物流信息'}}</view>
  21. <view @click="toExpressInfo(item)" v-if="item.cancel_status == 0 && item.is_send == 1 && item.is_confirm == 0 && item.detailExpress && 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 && item.address" 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 && 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(2)'>确认</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">{{status == 2 ? item.order.mobile : 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 && detail">
  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="(status == 2 && detail.refund_data.cause) || (status == 1 && 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 && detail.remark.length > 40) || (detail.cancel_data && detail.cancel_data.remark && 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 && detail.pic_list.length > 0" class="reason-title">图片</view>
  195. <view class="dir-left-wrap reason-img" v-if="detail.pic_list &&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 && detail.cancel_data.image_list && detail.cancel_data.image_list.length > 0" class="reason-title">图片凭证</view>
  199. <view class="dir-left-wrap reason-img" v-if="detail.cancel_data && detail.cancel_data.image_list && 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(1)'>确认</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: Number
  260. },
  261. num: {
  262. type: String
  263. }
  264. },
  265. data() {
  266. return {
  267. detail: {},
  268. isRefund: false,
  269. noRefund: false,
  270. changePrice: false,
  271. cancelOrder: false,
  272. callPhone: false,
  273. notRefund: false,
  274. isReason: false,
  275. openAddress: false,
  276. noAddress: false,
  277. beRemark: false,
  278. confirmOrder: false,
  279. refundOnly: false,
  280. cityRefund: false,
  281. beToSend: false,
  282. showRemark: false,
  283. price: 0,
  284. express: 0,
  285. total: 0,
  286. refund_price: 0,
  287. addressId: '0',
  288. remark: '',
  289. about: '',
  290. }
  291. },
  292. methods: {
  293. // 取消
  294. cancel() {
  295. if(this.item.showMobile) {
  296. this.item.showMobile = false;
  297. this.$emit('change', this.item);
  298. }else {
  299. this.about = '';
  300. this.isRefund = false;
  301. this.beToSend = false;
  302. this.noRefund = false;
  303. this.changePrice = false;
  304. this.cancelOrder = false;
  305. this.custom = false;
  306. this.refundOnly = false;
  307. this.cityRefund = false;
  308. this.notRefund = false;
  309. this.openAddress = false;
  310. this.isReason = false;
  311. this.confirmOrder = false;
  312. this.addressId = 0;
  313. this.beRemark = false;
  314. this.confirmOrder = false;
  315. this.remark = null;
  316. }
  317. },
  318. // 去售后订单查看
  319. toRefundOrder(e) {
  320. this.$emit('to', e);
  321. },
  322. // 备注
  323. makeRemark(data) {
  324. this.beRemark = true;
  325. this.detail = data;
  326. data.seller_remark ? this.remark = data.seller_remark : null;
  327. },
  328. // 提交备注
  329. toRemark() {
  330. let that = this;
  331. that.$request({
  332. url: that.$api.app_admin.sellerRemark,
  333. method: 'post',
  334. data: {
  335. order_id: that.detail.id,
  336. seller_remark: that.remark
  337. }
  338. }).then(response=>{
  339. if(response.code === 0) {
  340. that.detail.seller_remark = that.remark;
  341. that.cancel();
  342. that.$emit('update', that.detail);
  343. }else {
  344. uni.showToast({
  345. title: response.msg,
  346. icon: 'none',
  347. duration: 1000
  348. });
  349. }
  350. });
  351. },
  352. // 设置退货地址
  353. toRefundAdd() {
  354. this.noAddress = false;
  355. uni.navigateTo({
  356. url: `/pages/address/address?manual_btn_bg=admin&is_hide_default_btn=1&is_refund_address=1`,
  357. })
  358. },
  359. // 改地址
  360. toChangeAddress(item) {
  361. this.beToSend = false;
  362. let order_no = item.order_no ? item.order_no : this.detail.order_no
  363. uni.navigateTo({
  364. url: '/pages/app_admin/change-add/change-add?order_no='+order_no
  365. })
  366. },
  367. // 查看物流
  368. toExpressInfo(item) {
  369. if(item.detail.length === 1 && item.detailExpress[0].express_no) {
  370. uni.navigateTo({
  371. 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
  372. });
  373. }else {
  374. uni.navigateTo({
  375. url: '/pages/order/express-list/express-list?order_id='+item.id
  376. });
  377. }
  378. },
  379. // 拨打电话
  380. call() {
  381. uni.makePhoneCall({
  382. phoneNumber: this.status == 2 ? this.item.order.mobile : this.item.mobile
  383. })
  384. this.$emit('change', '');
  385. },
  386. // 确认收货提示
  387. toConfirm(e) {
  388. this.detail = e;
  389. this.confirmOrder = !this.confirmOrder;
  390. },
  391. // 确认收货
  392. beOrderConfirm() {
  393. let that = this;
  394. that.$request({
  395. url: that.$api.app_admin.confirm,
  396. data: {
  397. order_id: that.detail.id
  398. },
  399. method: 'post'
  400. }).then(response=>{
  401. that.$hideLoading();
  402. if(response.code === 0) {
  403. uni.showToast({
  404. title: response.msg,
  405. duration: 1000,
  406. type: 'success',
  407. mask: false
  408. });
  409. that.cancel();
  410. setTimeout(v=>{
  411. that.$emit('update', 0);
  412. },1000)
  413. }else {
  414. uni.showToast({
  415. title: response.msg,
  416. icon: 'none',
  417. duration: 1000
  418. });
  419. }
  420. }).catch(() => {
  421. that.$hideLoading();
  422. });
  423. },
  424. // 同意取消订单
  425. toAgreeCancel(e) {
  426. this.detail = e;
  427. this.isReason = !this.isReason;
  428. this.noRefund = false;
  429. },
  430. // 取消订单提示
  431. toCancelorder(e) {
  432. this.detail = e;
  433. this.cancelOrder = !this.cancelOrder;
  434. },
  435. // 取消订单
  436. cancelSubmit(type) {
  437. let that = this;
  438. uni.showLoading({
  439. mask: true,
  440. title: '加载中...'
  441. });
  442. let url = type == 1 ? that.$api.app_admin.cancel : that.$api.app_admin.force_cancel
  443. that.$request({
  444. url: url,
  445. data: {
  446. status: that.noRefund ? 2 : 1,
  447. remark: that.about,
  448. order_id: that.detail.id
  449. },
  450. method: 'post'
  451. }).then(response => {
  452. uni.hideLoading();
  453. if (response.code === 0) {
  454. uni.showToast({
  455. title: that.noRefund ? '拒绝成功':'取消成功',
  456. duration: 1000,
  457. type: 'success',
  458. mask: false
  459. });
  460. that.cancel();
  461. setTimeout(v=>{
  462. that.$emit('update', 0);
  463. },1000)
  464. } else {
  465. uni.showToast({
  466. title: response.msg,
  467. icon: 'none',
  468. duration: 1000
  469. });
  470. }
  471. }).catch(response => {
  472. uni.hideLoading();
  473. uni.showToast({
  474. title: response,
  475. icon: 'none',
  476. duration: 1000
  477. });
  478. });
  479. },
  480. // 修改价格
  481. toChange(e) {
  482. this.detail = e;
  483. this.changePrice = !this.changePrice;
  484. this.price = e.total_goods_price;
  485. this.express = e.express_price;
  486. this.total = '¥' + e.total_pay_price;
  487. },
  488. // 价格输入验证
  489. priceInput: function(e) {
  490. if (e.detail.value > -0.01) {
  491. this.total = '¥' + (+e.detail.value + +this.express).toFixed(2);
  492. } else {
  493. this.total = '数据有误';
  494. }
  495. },
  496. // 邮费输入验证
  497. expressInput: function(e) {
  498. if (e.detail.value > -0.01) {
  499. this.total = '¥' + (+e.detail.value + +this.price).toFixed(2);
  500. } else {
  501. this.total = '数据有误';
  502. }
  503. },
  504. // 确认修改价格
  505. submitChange() {
  506. let that = this;
  507. uni.showLoading({
  508. mask: true,
  509. title: '加载中...'
  510. });
  511. if (this.price > -0.01 && this.express > -0.01) {
  512. this.$request({
  513. url: this.$api.app_admin.update_price,
  514. data: {
  515. order_id: this.detail.id,
  516. total_price: this.price ? this.price : 0,
  517. express_price: this.express ? this.express : 0
  518. },
  519. method: 'post'
  520. }).then(response => {
  521. uni.hideLoading();
  522. if (response.code === 0) {
  523. uni.showToast({
  524. title: response.msg,
  525. duration: 1000,
  526. type: 'success',
  527. mask: false
  528. });
  529. that.changePrice = false;
  530. that.$emit('update', 0);
  531. } else {
  532. uni.showToast({
  533. title: response.msg,
  534. icon: 'none',
  535. duration: 1000
  536. });
  537. }
  538. }).catch(response => {
  539. uni.hideLoading();
  540. uni.showToast({
  541. title: response,
  542. icon: 'none',
  543. duration: 1000
  544. });
  545. });
  546. } else {
  547. if (!that.price || typeof(that.price) != 'number') {
  548. uni.showToast({
  549. title: '商品总价必须大于等于0',
  550. icon: 'none',
  551. duration: 1000
  552. });
  553. } else if (!that.express || typeof(that.express) != 'number') {
  554. uni.showToast({
  555. title: '运费必须大于等于0',
  556. icon: 'none',
  557. duration: 1000
  558. });
  559. }
  560. }
  561. },
  562. // 发货
  563. toSend(e,is_send) {
  564. let that = this;
  565. that.detail = e;
  566. if (that.detail.status_cn) {
  567. uni.navigateTo({
  568. url: '/pages/app_admin/send/send?order_refund_id=' + that.detail.id + '&id=' + that.detail.order_id + '&send_type=' + that.detail.send_type + '&is_send=' + is_send
  569. })
  570. } else {
  571. if(that.detail.send_type == 1 && !that.detail.address) {
  572. this.beToSend = true;
  573. }else {
  574. uni.navigateTo({
  575. url: '/pages/app_admin/send/send?id=' + that.detail.id + '&send_type=' + that.detail.send_type + '&is_send=' + is_send
  576. })
  577. }
  578. }
  579. },
  580. // 售后操作
  581. // 选择退款地址
  582. chooseAddress(e) {
  583. if (this.addressId == e) {
  584. this.addressId = ''
  585. }else {
  586. this.addressId = e
  587. }
  588. },
  589. // 售后处理
  590. decline(type) {
  591. let that = this;
  592. let para = {
  593. order_refund_id: that.detail.id,
  594. type: that.detail.type,
  595. is_agree: type != 0 ? 1 : 0,
  596. refund_price: that.detail.refund_price,
  597. merchant_remark: that.about
  598. }
  599. if (type == 1) {
  600. if (that.addressId < 1) {
  601. uni.showToast({
  602. title: '请选择地址',
  603. icon: 'none',
  604. duration: 1000
  605. });
  606. return false;
  607. }else {
  608. para.address_id = that.addressId
  609. }
  610. }
  611. if(type == 4) {
  612. para.refund = 1
  613. }
  614. if (that.cancelRefund) {
  615. type = 2;
  616. para.is_agree = 2
  617. }
  618. uni.showLoading({
  619. mask: true,
  620. title: '处理中...'
  621. });
  622. that.$request({
  623. url: that.$api.app_admin.refund_handle,
  624. data: para,
  625. method: 'post'
  626. }).then(response => {
  627. uni.hideLoading();
  628. if (response.code === 0) {
  629. uni.showModal({
  630. title: '提示',
  631. content: response.msg,
  632. showCancel: false,
  633. success: function (res) {
  634. if (res.confirm) {
  635. that.cancel();
  636. setTimeout(v=>{
  637. that.$emit('update', 0);
  638. },1000)
  639. }
  640. }
  641. });
  642. } else {
  643. uni.showToast({
  644. title: response.msg,
  645. icon: 'none',
  646. duration: 1000
  647. });
  648. }
  649. }).catch(response => {
  650. uni.hideLoading();
  651. uni.showToast({
  652. title: response,
  653. icon: 'none',
  654. duration: 1000
  655. });
  656. });
  657. },
  658. // 同意售后
  659. agree() {
  660. let that = this;
  661. uni.showLoading({
  662. mask: true,
  663. title: '处理中...'
  664. });
  665. if (that.detail.refund_price > 0) {
  666. that.$request({
  667. url: that.$api.app_admin.refund_handle,
  668. data: {
  669. order_refund_id: that.detail.id,
  670. type: that.detail.type,
  671. is_agree: 1,
  672. refund_price: that.refund_price,
  673. merchant_remark: that.about
  674. },
  675. method: 'post'
  676. }).then(response => {
  677. uni.hideLoading();
  678. if (response.code === 0) {
  679. uni.showModal({
  680. title: '提示',
  681. content: response.msg,
  682. showCancel: false,
  683. success: function (res) {
  684. if (res.confirm) {
  685. that.cancel();
  686. setTimeout(v=>{
  687. that.$emit('update', 0);
  688. },1000)
  689. }
  690. }
  691. });
  692. } else {
  693. uni.showToast({
  694. title: response.msg,
  695. icon: 'none',
  696. duration: 1000
  697. });
  698. }
  699. }).catch(response => {
  700. uni.hideLoading();
  701. uni.showToast({
  702. title: response,
  703. icon: 'none',
  704. duration: 1000
  705. });
  706. });
  707. } else {
  708. uni.showToast({
  709. title: '退款金额需大于零',
  710. icon: 'none',
  711. duration: 1000
  712. });
  713. }
  714. },
  715. // 拒绝售后
  716. beNotRefund(e) {
  717. this.detail = e;
  718. this.isReason = !this.isReason
  719. this.noRefund = !this.noRefund;
  720. },
  721. // 售后操作
  722. refundHandle(type,detail,cancel) {
  723. if (cancel == 1) {
  724. this.cancelRefund = true;
  725. }
  726. if (type == 1) {
  727. if(detail.type == 3) {
  728. this.refundOnly = true;
  729. this.detail = detail;
  730. }else if(detail.order.send_type != 0){
  731. this.cityRefund = true;
  732. this.detail = detail;
  733. }else {
  734. if (this.address.length == 0) {
  735. this.noAddress = true;
  736. } else {
  737. this.detail = detail;
  738. this.openAddress = true;
  739. }
  740. }
  741. } else if (type == 2) {
  742. this.detail = detail;
  743. this.notRefund = true;
  744. }
  745. },
  746. // 退款提示
  747. toRefund(e) {
  748. this.detail = e;
  749. this.refund_price = e.refund_price;
  750. this.isRefund = !this.isRefund;
  751. },
  752. // 查看图片
  753. look(e) {
  754. uni.previewImage({
  755. current: e, // 当前显示图片的http链接
  756. urls: [e] // 需要预览的图片http链接列表
  757. })
  758. },
  759. // 查看售后理由
  760. lookAbout(e) {
  761. this.detail = e;
  762. this.isReason = true;
  763. },
  764. // 售后确认收货
  765. beConfirm() {
  766. let that = this;
  767. that.$request({
  768. url: that.$api.app_admin.shou_huo,
  769. data: {
  770. refund_order_id: that.detail.id
  771. },
  772. method: 'post'
  773. }).then(response=>{
  774. that.$hideLoading();
  775. if(response.code === 0) {
  776. that.cancel();
  777. that.page = 1;
  778. uni.showLoading({
  779. mask: true,
  780. title: '加载中...'
  781. });
  782. that.$emit('update', 0);
  783. }else {
  784. uni.showToast({
  785. title: response.msg,
  786. icon: 'none',
  787. duration: 1000
  788. });
  789. }
  790. }).catch(() => {
  791. that.$hideLoading();
  792. });
  793. },
  794. }
  795. }
  796. </script>
  797. <style scoped lang="scss">
  798. .handle-btn {
  799. height: #{48rpx};
  800. display: flex;
  801. align-items: center;
  802. padding: 0 #{16rpx};
  803. border-radius: #{24rpx};
  804. border: #{2rpx} solid #bbb;
  805. color: #353535;
  806. font-size: #{24rpx};
  807. margin-left: #{16rpx};
  808. white-space: nowrap;
  809. &.other {
  810. border: #{2rpx} solid #446dfd;
  811. color: #446dfd;
  812. }
  813. }
  814. .bg {
  815. background-color: rgba(0, 0, 0, 0.3);
  816. position: fixed;
  817. top: 0;
  818. left: 0;
  819. height: 100%;
  820. width: 100%;
  821. z-index: 100;
  822. .dialog {
  823. width: #{620rpx};
  824. border-radius: #{16rpx};
  825. margin: 0 auto;
  826. background-color: #fff;
  827. z-index: 20;
  828. &.get-top {
  829. margin-top: #{-60rpx};
  830. }
  831. .dialog-title {
  832. font-size: #{32rpx};
  833. color: #353535;
  834. width: #{620rpx};
  835. margin: #{32rpx} auto #{40rpx};
  836. text-align: center;
  837. }
  838. .cancel-tip {
  839. font-size: #{32rpx};
  840. color: #353535;
  841. margin: #{74rpx} 0 #{60rpx};
  842. &.dialog-refund-tip {
  843. padding: 0 #{60rpx};
  844. text-align: center;
  845. }
  846. }
  847. .refund-pay {
  848. font-size: #{36rpx};
  849. color: #353535;
  850. font-weight: bold;
  851. }
  852. .refund-tip {
  853. font-size: #{32rpx};
  854. color: #353535;
  855. margin: #{4rpx} 0 #{45rpx};
  856. }
  857. .total-money {
  858. margin-left: #{56rpx};
  859. }
  860. .textarea {
  861. height: #{252rpx};
  862. width: #{492rpx};
  863. padding: #{24rpx} #{32rpx};
  864. font-size: #{28rpx};
  865. border-radius: #{16rpx};
  866. border: #{2rpx} solid #e2e2e2;
  867. text-align: left;
  868. margin: #{32rpx} auto;
  869. }
  870. .remark-input {
  871. padding: 0 #{32rpx};
  872. height: #{80rpx};
  873. margin-bottom: #{32rpx};
  874. color: #353535;
  875. input {
  876. border-radius: #{16rpx};
  877. background-color: #F7F7F7;
  878. height: #{80rpx};
  879. line-height: #{80rpx};
  880. padding: 0 #{24rpx};
  881. }
  882. }
  883. .change-price-item {
  884. position: relative;
  885. height: #{64rpx};
  886. line-height: #{64rpx};
  887. color: #353535;
  888. font-size: #{28rpx};
  889. margin-bottom: #{26rpx};
  890. &:first-of-type {
  891. margin-bottom: #{32rpx};
  892. }
  893. &:last-of-type {
  894. margin: #{24rpx} 0 #{34rpx};
  895. }
  896. }
  897. .label {
  898. height: #{64rpx};
  899. line-height: #{64rpx};
  900. text-align: right;
  901. width: #{178rpx};
  902. }
  903. .price-input {
  904. width: #{298rpx};
  905. height: #{64rpx};
  906. margin-left: #{24rpx};
  907. border-radius: #{32rpx};
  908. padding-left: #{62rpx};
  909. background-color: #f7f7f7;
  910. }
  911. .money {
  912. position: absolute;
  913. left: #{234rpx};
  914. }
  915. .reason {
  916. padding-left: #{32rpx};
  917. max-height: 600#{rpx};
  918. overflow: scroll;
  919. margin-bottom: 40#{rpx};
  920. &+textarea {
  921. height: #{186rpx};
  922. width: #{556rpx};
  923. }
  924. }
  925. .reason-title {
  926. font-size: #{28rpx};
  927. color: #999;
  928. margin-bottom: #{14rpx};
  929. }
  930. .reason-content {
  931. font-size: #{28rpx};
  932. color: #353535;
  933. width: #{556rpx};
  934. margin-bottom: #{20rpx};
  935. word-break: break-all;
  936. &.two-line {
  937. overflow: hidden;
  938. //#ifdef MP-ALIPAY
  939. height: #{64rpx};
  940. //#endif
  941. // #ifndef MP-ALIPAY
  942. height: #{76rpx};
  943. // #endif
  944. margin-bottom: #{10rpx};
  945. }
  946. }
  947. .reason-img {
  948. margin-bottom: #{14rpx};
  949. image {
  950. height: #{180rpx};
  951. width: #{180rpx};
  952. margin: 0 #{8rpx} #{8rpx} 0;
  953. }
  954. }
  955. .add-list {
  956. margin-top: #{50rpx};
  957. max-height: #{388rpx};
  958. overflow: auto;
  959. padding: 0 #{36rpx};
  960. }
  961. .add-item {
  962. padding: #{32rpx} 0;
  963. margin-left: #{64rpx};
  964. position: relative;
  965. font-size: #{28rpx};
  966. color: #353535;
  967. border-bottom: #{1rpx} solid #e2e2e2;
  968. &.delivery-item {
  969. padding-left: #{64rpx};
  970. margin-left: 0;
  971. .add-name {
  972. width: #{400rpx};
  973. }
  974. }
  975. &:last-of-type {
  976. border-bottom: 0;
  977. }
  978. image {
  979. height: #{36rpx};
  980. width: #{36rpx};
  981. position: absolute;
  982. left: #{-66rpx};
  983. top: 50%;
  984. margin-top: #{-18rpx};
  985. }
  986. .add-active {
  987. position: absolute;
  988. left: #{-64rpx};
  989. top: 50%;
  990. margin-top: #{-18rpx};
  991. }
  992. .add-name {
  993. width: #{220rpx};
  994. overflow: hidden;
  995. text-overflow: ellipsis;
  996. white-space: nowrap;
  997. }
  998. }
  999. .dialog-bg {
  1000. width: 100%;
  1001. height: 100%;
  1002. position: fixed;
  1003. background-color: rgba(0, 0, 0, 0.5);
  1004. left: 0;
  1005. top: 0;
  1006. }
  1007. .show-remark {
  1008. color: #999;
  1009. margin-bottom: #{12rpx};
  1010. font-size: #{24rpx};
  1011. image {
  1012. width: #{22rpx};
  1013. height: #{12rpx};
  1014. margin-left: #{16rpx};
  1015. display: block;
  1016. }
  1017. }
  1018. .refund-price {
  1019. width: #{160rpx};
  1020. border: #{2rpx} solid #e2e2e2;
  1021. border-radius: #{5rpx};
  1022. font-size: #{32rpx};
  1023. padding: 0 #{5rpx};
  1024. }
  1025. .btn-area {
  1026. height: #{88rpx};
  1027. position: relative;
  1028. border-top: #{2rpx} solid #e2e2e2;
  1029. &.other-btn-area {
  1030. margin-top: #{10rpx};
  1031. }
  1032. .line {
  1033. height: #{32rpx};
  1034. width: #{1rpx};
  1035. background-color: #e2e2e2;
  1036. position: absolute;
  1037. top: #{28rpx};
  1038. left: 0;
  1039. right: 0;
  1040. margin: 0 auto;
  1041. }
  1042. .submit-btn {
  1043. height: #{88rpx};
  1044. line-height: #{88rpx};
  1045. font-size: #{32rpx};
  1046. color: #666;
  1047. width: #{310rpx};
  1048. text-align: center;
  1049. &.be-submit {
  1050. color: #446dfd;
  1051. }
  1052. }
  1053. }
  1054. }
  1055. }
  1056. </style>