detail.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="app-container">
  3. <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
  4. <el-menu-item index="1" @click="backToList">订单列表</el-menu-item>
  5. <el-menu-item index="2">订单详情</el-menu-item>
  6. </el-menu>
  7. <el-card v-if="order" class="box-card">
  8. <div class="refund-item">
  9. <el-row :gutter="24" class="box-row">
  10. <el-col :span="6"><b>订单编号(ID):</b> {{ order.orderNo + '(' + order.orderID + ')' }}</el-col>
  11. <el-col :span="6"><b>下单时间:</b> {{ order.orderTime | parseTime('{y}-{m}-{d} {h}:{i}:{s}') }}</el-col>
  12. <el-col :span="6"><b>订单状态:</b>
  13. <template v-if="['11','12','13','21','22','23','31','32','33'].indexOf(order.status)>=0">
  14. <el-tag type="success" size="small">{{ '交易中('+statusObj[order.status]+')' }}</el-tag>
  15. </template>
  16. <template v-else>
  17. <el-tag :type="order.status*1===6?'info':''" size="small">{{ statusObj[order.status] }}</el-tag>
  18. </template>
  19. </el-col>
  20. <el-col v-if="order.bpOrderUserinfo" :span="6"><b>买家:</b> {{ order.bpOrderUserinfo.name }}</el-col>
  21. </el-row>
  22. <el-row :gutter="24" class="box-row">
  23. <el-col :span="6"><b>收款状态:</b>
  24. <el-tag v-if="order.receiptStatus*1===1" type="danger" size="small">待收款</el-tag>
  25. <el-tag v-if="order.receiptStatus*1===2" type="warning" size="small">部分收款</el-tag>
  26. <el-tag v-if="order.receiptStatus*1===3" type="success" size="small">已收款</el-tag>
  27. </el-col>
  28. <el-col :span="6"><b>退款状态:</b>
  29. <el-tag v-if="order.refundType*1===1" type="warning" size="small">部分退款</el-tag>
  30. <el-tag v-else-if="order.refundType*1===2" type="danger" size="small">已退款</el-tag>
  31. <el-tag v-else type="info" size="small">无退款</el-tag>
  32. </el-col>
  33. <el-col :span="6"><b>发货状态:</b>
  34. <el-tag v-if="order.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
  35. <el-tag v-if="order.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
  36. <el-tag v-if="order.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
  37. </el-col>
  38. <el-col :span="6">
  39. <el-dropdown class="dropdown">
  40. <el-button type="primary">
  41. 功能<i class="el-icon-arrow-down el-icon--right" />
  42. </el-button>
  43. <el-dropdown-menu slot="dropdown">
  44. <el-dropdown-item><div @click="RemarksOrder(order.orderID)">备注</div></el-dropdown-item>
  45. <el-dropdown-item v-if="['0','11','21','6','4'].indexOf(order.status)<0"><router-link :to="'/order/logistics/' + order.orderID ">发货记录</router-link></el-dropdown-item>
  46. <el-dropdown-item v-if="['0','11','6'].indexOf(order.status)<0"><router-link :to="'/order/refund-record/' + order.orderID ">收退款记录</router-link></el-dropdown-item>
  47. <el-dropdown-item v-if="['0','11','6'].indexOf(order.status)<0"><router-link :to="'/order/refund-return/' + order.orderID ">退款(退货)记录</router-link></el-dropdown-item>
  48. </el-dropdown-menu>
  49. </el-dropdown>
  50. </el-col>
  51. </el-row>
  52. </div>
  53. <div class="refund-item">
  54. <el-row v-if="order.bpOrderUserinfo" :gutter="24" class="box-row">
  55. <el-col :span="6"><b>收货人:</b> {{ order.bpOrderUserinfo.shouHuoRen }}</el-col>
  56. <el-col :span="6"><b>手机:</b> {{ order.bpOrderUserinfo.mobile }}</el-col>
  57. <el-col :span="12"><b>地址:</b> {{ order.bpOrderUserinfo.province +' '+ order.bpOrderUserinfo.city +' '+ order.bpOrderUserinfo.town +' '+ order.bpOrderUserinfo.address }}</el-col>
  58. </el-row>
  59. <el-row :gutter="24" class="box-row">
  60. <el-col :span="6"><b>订单金额:</b> ¥{{ order.payTotalFee | toThousandFloatFilter }}</el-col>
  61. <el-col :span="6"><b>应收金额:</b> ¥{{ order.payableAmount | toThousandFloatFilter }}<span style="color:red;"> (账户余额抵扣:¥{{ order.balancePayFee | toThousandFloatFilter }})</span></el-col>
  62. <el-col :span="6"><b>已收金额:</b>
  63. <template v-if="order.receiptStatus*1===1">¥0.00</template>
  64. <template v-else>¥{{ receiptAmount | toThousandFloatFilter }}</template>
  65. </el-col>
  66. <el-col :span="6"><b>退款金额(已完成):</b> ¥{{ returnValue | toThousandFloatFilter }}
  67. <span style="color:red;">({{ '原:¥' + returnedPurchaseFee + ',折扣取消:¥' + (order.discountFee>returnedPurchaseFee ? returnedPurchaseFee : order.discountFee) }})</span>
  68. </el-col>
  69. </el-row>
  70. <el-row :gutter="24" class="box-row">
  71. <el-col :span="6"><b>经理折扣:</b>
  72. <template v-if="order.discountFee<0">¥0.00</template>
  73. <template v-else>
  74. ¥{{ order.discountFee>returnedPurchaseFee ? (order.discountFee - returnedPurchaseFee) : '0' }}
  75. <span style="color:red;">({{ '原:¥' + order.discountFee + ',折扣取消:¥' + (order.discountFee>returnedPurchaseFee ? returnedPurchaseFee : order.discountFee) }})</span>
  76. </template>
  77. </el-col>
  78. <el-col :span="6"><b>运费:</b>
  79. <template v-if="order.freight*1===0">包邮</template>
  80. <template v-else-if="order.freight*1===-1">到付</template>
  81. <template v-else-if="order.freight*1===-2">仪器到付-产品包邮</template>
  82. <template v-else>¥{{ order.freight }}</template>
  83. </el-col>
  84. </el-row>
  85. </div>
  86. <div class="refund-item">
  87. <div v-for="shopOrder in order.newShopOrders" :key="shopOrder.shopOrderID" class="order-item">
  88. <el-row :gutter="22" class="box-row">
  89. <el-col :span="9"><b>子订单号(ID):</b> {{ shopOrder.shopOrderNo + '(' + shopOrder.shopOrderID + ')' }}</el-col>
  90. <el-col :span="5"><b>下单时间:</b> {{ shopOrder.orderTime }}</el-col>
  91. <el-col :span="5"><b>子订单金额:</b> ¥{{ shopOrder.needPayAmount | toThousandFloatFilter }}</el-col>
  92. <el-col :span="5"><b>发货状态:</b>
  93. <el-tag v-if="shopOrder.sendOutStatus*1===1" type="danger" size="small">待发货</el-tag>
  94. <el-tag v-if="shopOrder.sendOutStatus*1===2" type="warning" size="small">部分发货</el-tag>
  95. <el-tag v-if="shopOrder.sendOutStatus*1===3" type="success" size="small">已发货</el-tag>
  96. </el-col>
  97. </el-row>
  98. <el-row :gutter="22" class="box-row">
  99. <el-col :span="22"><b>留言:</b> {{ shopOrder.note ? shopOrder.note : '无' }}</el-col>
  100. </el-row>
  101. <el-row :gutter="22" class="box-row">
  102. <el-col :span="22"><b>供应商:</b> {{ shopOrder.shopName }}</el-col>
  103. </el-row>
  104. <el-row v-for="op in shopOrder.newOrderProducts" :key="op.orderProductID" :gutter="22" class="product-row">
  105. <el-col :span="2">
  106. <img :src="op.productImage" width="60" alt="">
  107. </el-col>
  108. <el-col :span="7">{{ op.name }}</el-col>
  109. <el-col :span="5">
  110. <div class="op-item"><b>数量</b>{{ op.productID*1!==999 ? ('(赠品数): x'+op.num+'('+op.presentNum+')') : (': x'+op.num) }}</div>
  111. <div v-if="op.productID*1!==999" class="op-item">规格: {{ op.unit }}</div>
  112. </el-col>
  113. <el-col v-if="op.productID*1!==999" :span="5">
  114. <div class="op-item"><b>单价:</b> ¥{{ op.price | toThousandFloatFilter }}</div>
  115. <div class="op-item"><b>总额:</b> ¥{{ op.totalFee | toThousandFloatFilter }}</div>
  116. </el-col>
  117. <el-col v-if="op.productID*1!==999" :span="5">
  118. <div v-if="order.sendOutStatus*1 === 2 || order.sendOutStatus*1 === 3" class="op-item"><b>已发/已收:</b> {{ ((op.num ? op.num : 0) - (op.notOutStore ? op.notOutStore : 0)) + '/' + op.receivedNum }}</div>
  119. <div v-if="['12','13','21','22','23','31','32','33','4','5'].indexOf(order.status)>=0" class="op-item"><b>退款(退货)中/已完成:</b> {{ op.returningNum }} / {{ op.returnedNum }}</div>
  120. </el-col>
  121. </el-row>
  122. </div>
  123. </div>
  124. </el-card>
  125. <Remarks dialog-title="订单备注信息" :is-visible.sync="dialogRemarksVisible" :order-id="dialogRemarksOrderId" :remark-list="dialogRemarkList" />
  126. <template>
  127. <el-backtop style="right: 40px; bottom: 40px;">
  128. <i class="el-icon-upload2" />
  129. </el-backtop>
  130. </template>
  131. </div>
  132. </template>
  133. <script>
  134. import { getDetail, getRemarks } from '@/api/order'
  135. import Remarks from './components/remarks'
  136. export default {
  137. components: { Remarks },
  138. data() {
  139. return {
  140. activeIndex: '2',
  141. order: null,
  142. receiptAmount: 0,
  143. returnValue: 0,
  144. returnedPurchaseFee: 0,
  145. bpClauses: null,
  146. dialogRemarkList: [],
  147. dialogRemarksVisible: false,
  148. dialogRemarksOrderId: 0,
  149. statusObj: {
  150. '0': '待确认',
  151. '4': '交易完成',
  152. '5': '订单完成',
  153. '6': '已关闭',
  154. '7': '交易全退',
  155. '11': '待收款、待发货',
  156. '12': '待收款、部分发货',
  157. '13': '待收款、全部发货',
  158. '21': '部分收款、待发货',
  159. '22': '部分收款、部分发货',
  160. '23': '部分收款、全部发货',
  161. '31': '全部收款、待发货',
  162. '32': '全部收款、部分发货',
  163. '33': '全部收款、全部发货'
  164. }
  165. }
  166. },
  167. computed: {
  168. orderID: function() {
  169. return window.location.href.split('/').reverse()[0] * 1
  170. }
  171. },
  172. created() {
  173. this.fetchData()
  174. },
  175. methods: {
  176. fetchData() {
  177. this.listLoading = true
  178. getDetail({ id: this.orderID }).then(response => {
  179. this.order = response.data.order
  180. this.bpClauses = response.data.bpClauses
  181. this.receiptAmount = response.data.receiptAmount
  182. this.returnValue = response.data.returnValue
  183. this.returnedPurchaseFee = response.data.returnedPurchaseFee
  184. this.listLoading = false
  185. }).catch(() => {
  186. this.listLoading = false
  187. })
  188. },
  189. RemarksOrder: function(id) {
  190. getRemarks({ orderID: id }).then(response => {
  191. this.dialogRemarkList = response.data
  192. })
  193. this.dialogRemarksOrderId = id
  194. this.dialogRemarksVisible = true
  195. },
  196. backToList() {
  197. this.$store.dispatch('tagsView/delView', this.$route).then(() => {
  198. this.$nextTick(() => {
  199. this.$router.replace({
  200. path: '/order/list'
  201. })
  202. })
  203. })
  204. }
  205. }
  206. }
  207. </script>
  208. <style scoped>
  209. .box-card{
  210. margin-top: 20px;
  211. font-size: 14px;
  212. }
  213. .box-row{
  214. padding: 10px 0;
  215. }
  216. .box-row .dropdown{
  217. margin-top: -10px;
  218. }
  219. .refund-item{
  220. border-bottom:1px dashed #E4E7ED;
  221. margin-bottom: 20px;
  222. }
  223. .order-item{
  224. border-bottom: 1px solid #DCDFE6;
  225. background:#F2F6FC;
  226. margin-top: 20px;
  227. padding: 5px 15px 0;
  228. border-radius: 5px;
  229. }
  230. .product-row{
  231. padding: 10px 0;
  232. background: #EBEEF5;
  233. border-top: 1px dashed #DCDFE6;
  234. }
  235. .op-item{
  236. padding: 5px 0;
  237. }
  238. </style>