detail.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. <template>
  2. <div class="app-container">
  3. <!-- 基本信息 -->
  4. <el-row :gutter="10">
  5. <el-col :span="22" :offset="1">
  6. <div class="info-title">基本信息</div>
  7. <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
  8. <div class="title">手机号码:{{ info.tel }}</div>
  9. </el-col>
  10. <el-col :span="8" :xs="{span: 24, offset: 0}">
  11. <div class="title">门店名称:{{ info.channelName }}</div>
  12. </el-col>
  13. </el-col>
  14. </el-row>
  15. <!-- 库存信息 -->
  16. <el-row :gutter="10" >
  17. <el-col :span="22" :offset="1">
  18. <div class="info-title">库存信息</div>
  19. <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
  20. <div class="title">总库存:{{ info.totalQuantity }}</div>
  21. </el-col>
  22. <el-col :span="7" :xs="{span: 24, offset: 0}">
  23. <div class="title">已核销:{{ info.totalVerifyQty }}</div>
  24. </el-col>
  25. <el-col :span="8" :xs="{span: 24, offset: 0}">
  26. <div class="title">剩余库存:{{ info.totalRemainQty }}</div>
  27. </el-col>
  28. <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}">
  29. <div class="title">采购成本:¥{{ $numberFormat(info.items && info.items[0].purchaseCost) }}</div>
  30. </el-col>
  31. <el-col :span="7" :xs="{span: 24, offset: 0}" v-if="(status && status.value == 2) || (status && status.value == 3)">
  32. <div class="title">结算库存:{{ info.totalSettleQty }}</div>
  33. </el-col>
  34. <el-col :span="8" :offset="1" :xs="{span: 24, offset: 0}" v-if="(status && status.value == 2) || (status && status.value == 3)">
  35. <div class="title">门店应付金额:¥{{ $numberFormat(info.totalPurchaseCost) }}</div>
  36. </el-col>
  37. <el-col :span="7" :xs="{span: 24, offset: 0}" v-if="(status && status.value == 2) || (status && status.value == 3)">
  38. <div class="title">实际结算金额:¥{{ $numberFormat(info.payAmount) }}</div>
  39. </el-col>
  40. </el-col>
  41. </el-row>
  42. <!-- 订单状态 -->
  43. <el-row :gutter="10">
  44. <el-col :span="22" :offset="1">
  45. <div class="info-title">状态</div>
  46. <el-col :span="24" :offset="1" :xs="{span: 24, offset: 0}">
  47. <div class="title">状态:{{ status.desc }}</div>
  48. </el-col>
  49. <el-col :span="24" :offset="1" :xs="{span: 24, offset: 0}" v-if="status && status.value == 2">
  50. <div class="title">支付金额:¥{{ $numberFormat(info.payAmount) }}</div>
  51. </el-col>
  52. <el-col :span="24" :offset="1" :xs="{span: 24, offset: 0}" v-if="(status && status.value == 2) || (status && status.value == 3)">
  53. <div class="title">发起结算时间:{{ parseTime(info.pushTime) }}</div>
  54. </el-col>
  55. <el-col :span="24" :offset="1" :xs="{span: 24, offset: 0}" v-if="status && status.value == 2">
  56. <div class="title">结算时间:{{ parseTime(info.settleTime) || '--' }}</div>
  57. </el-col>
  58. <el-col :span="24" :offset="1" :xs="{span: 24, offset: 0}" style="margin-bottom: 10px;">
  59. <el-button
  60. v-if="status && status.value == 1"
  61. v-hasPermi="['business:channelGoodsOrder:push']"
  62. type="primary"
  63. @click="toInventory()"
  64. >去结算</el-button>
  65. </el-col>
  66. </el-col>
  67. </el-row>
  68. <!-- 商品信息 -->
  69. <el-row :gutter="10">
  70. <el-col :span="22" :offset="1">
  71. <div class="info">
  72. <div class="info-title">商品信息</div>
  73. <div class="info-table">
  74. <el-table :data="list">
  75. <el-table-column label="商品信息" min-width="200">
  76. <div slot-scope="{ row }" class="flex">
  77. <el-image
  78. style="width: 100px; height: 100px"
  79. :src="row.picUrl"
  80. :preview-src-list="[row.picUrl]"
  81. />
  82. <div class="txt">{{ row.title }}</div>
  83. </div>
  84. </el-table-column>
  85. <el-table-column label="规格" min-width="100">
  86. <template slot-scope="{ row }">
  87. <div>{{ row.properties || "--" }}</div>
  88. </template>
  89. </el-table-column>
  90. <el-table-column label="采购成本(单价)" prop="purchaseCost" min-width="80">
  91. <template slot-scope="{ row }">
  92. <div>¥{{ $numberFormat(row.purchaseCost) }}</div>
  93. </template>
  94. </el-table-column>
  95. <el-table-column label="库存" prop="quantity" min-width="80"/>
  96. <el-table-column label="已核销" prop="verifyQty" min-width="80"/>
  97. <el-table-column label="剩余库存" prop="remainQty" min-width="80"/>
  98. </el-table>
  99. </div>
  100. </div>
  101. </el-col>
  102. </el-row>
  103. <!-- 结算 -->
  104. <inventory-goods :inventory-show="inventoryShow" :inventory-info="info" @close="close" v-if="inventoryShow"/>
  105. </div>
  106. </template>
  107. <script>
  108. import { getInventoryDetail } from "@/api/business/inventory";
  109. import { publicFileGetUrl } from "@/api/common";
  110. import InventoryGoods from "./components/InventoryGoods";
  111. export default {
  112. name: "InventoryDetail",
  113. components: {
  114. InventoryGoods,
  115. },
  116. data() {
  117. return {
  118. // 订单ID
  119. orderId: "",
  120. // 订单详情
  121. info: {},
  122. // 订单状态
  123. status: {},
  124. // 商品信息列表
  125. list: [],
  126. // 结算显示
  127. inventoryShow: false,
  128. };
  129. },
  130. created() {
  131. this.orderId = this.$route.query.id;
  132. this.getDetail();
  133. },
  134. activated() {
  135. const orderId = this.$route.query.id;
  136. if (orderId != null && orderId != this.orderId) {
  137. this.orderId = orderId;
  138. this.getDetail();
  139. }
  140. },
  141. methods: {
  142. // 订单详情
  143. getDetail() {
  144. getInventoryDetail(this.orderId).then((res) => {
  145. if (res.code == 0) {
  146. this.info = res.data;
  147. this.status = JSON.parse(res.data.status);
  148. res.data.items &&
  149. res.data.items.forEach((item) => {
  150. let picUrlArr = item.picUrl.split(",");
  151. item.picUrl = publicFileGetUrl + picUrlArr[0];
  152. });
  153. this.list = res.data.items;
  154. }
  155. });
  156. },
  157. // 点击发货
  158. toInventory() {
  159. this.inventoryShow = true;
  160. },
  161. // 发货关闭
  162. close() {
  163. this.inventoryShow = false;
  164. this.getDetail();
  165. },
  166. },
  167. };
  168. </script>
  169. <style lang="scss" scoped>
  170. .title {
  171. line-height: 30px;
  172. text-align: left;
  173. }
  174. .edit-express {
  175. color: #409eff;
  176. cursor: pointer;
  177. }
  178. .info {
  179. margin-bottom: 10px;
  180. &-title {
  181. font-size: 14px;
  182. margin-bottom: 20px;
  183. font-weight: bold;
  184. }
  185. &-item {
  186. padding-left: 50px;
  187. &-content {
  188. display: flex;
  189. &-one {
  190. display: flex;
  191. margin-bottom: 10px;
  192. .title {
  193. //width: 100px;
  194. }
  195. .txt {
  196. //width: 200px;
  197. }
  198. }
  199. }
  200. &-logistics {
  201. margin-bottom: 20px;
  202. .logistics-title {
  203. text-align: left;
  204. font-weight: bold;
  205. margin-bottom: 20px;
  206. }
  207. .info {
  208. display: flex;
  209. margin-bottom: 10px;
  210. &-one {
  211. display: flex;
  212. }
  213. .tit {
  214. line-height: 22px;
  215. //width: 100px;
  216. }
  217. .txt {
  218. line-height: 22px;
  219. //width: 200px;
  220. }
  221. .edit-express{
  222. color: #409eff;
  223. cursor: pointer;
  224. }
  225. }
  226. .goods {
  227. margin: 10px 0;
  228. &-item {
  229. display: flex;
  230. border-bottom: 1px solid #f3eeee;
  231. img {
  232. width: 100px;
  233. height: 100px;
  234. }
  235. .info {
  236. padding-left: 20px;
  237. display: flex;
  238. flex-direction: column;
  239. height: 100px;
  240. justify-content: space-between;
  241. }
  242. }
  243. }
  244. }
  245. }
  246. &-amt {
  247. margin-top: 10px;
  248. &-price {
  249. span {
  250. display: inline-block;
  251. width: 80px;
  252. margin-bottom: 20px;
  253. }
  254. }
  255. }
  256. }
  257. .flex {
  258. display: flex;
  259. align-items: center;
  260. .txt {
  261. margin-left: 20px;
  262. }
  263. }
  264. </style>