detail.vue 7.6 KB

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