index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <div class="logistics">
  3. <div style="margin: 20px 0">
  4. <el-radio-group v-model="curTarget" size="small">
  5. <template v-for="(item, index) in tabsList">
  6. <el-radio-button v-if="item.show" :key="index" :label="item.value">{{ item.label }}</el-radio-button>
  7. </template>
  8. </el-radio-group>
  9. </div>
  10. <el-card v-if="curTarget === 1 && tabsList[curTarget-1].show">
  11. <div slot="header">
  12. <span>物流信息</span>
  13. </div>
  14. <slot name="header" />
  15. <div>
  16. <el-timeline v-if="logisticsDetail.length" :reverse="false">
  17. <el-timeline-item
  18. v-for="(item, index) in logisticsDetail"
  19. :key="index"
  20. placement="top"
  21. type="success"
  22. :timestamp="item.time"
  23. >
  24. <el-row :gutter="20">
  25. <el-col class="logistics-title"> {{ item.status }} </el-col>
  26. <el-col>
  27. <div class="flex">
  28. <div>{{ item.context }}</div>
  29. <!-- <div>{{ item.createTime }}</div> -->
  30. </div>
  31. </el-col>
  32. </el-row>
  33. </el-timeline-item>
  34. </el-timeline>
  35. <div v-else class="tip">暂无物流信息</div>
  36. </div>
  37. </el-card>
  38. <el-card v-if="curTarget === 2 && tabsList[curTarget-1].show">
  39. <div slot="header">
  40. <span>物流费用</span>
  41. </div>
  42. <div>
  43. <zj-table
  44. :table-attributes="defaultTableAttributes"
  45. :is-drop="true"
  46. :columns="formLogistics"
  47. :table-data="logisticsData"
  48. />
  49. </div>
  50. </el-card>
  51. <el-card v-if="curTarget === 3 && tabsList[curTarget-1].show">
  52. <div slot="header">
  53. <span>出库条码</span>
  54. </div>
  55. <div>
  56. <zj-table
  57. :table-attributes="defaultTableAttributes"
  58. :is-drop="true"
  59. :columns="formOutbound"
  60. :table-data="outboundData"
  61. />
  62. </div>
  63. </el-card>
  64. </div>
  65. </template>
  66. <script>
  67. import { getListCostBillV2 } from '@/api/logisticsBill'
  68. import { getListOrderTrack } from '@/api/supply/pickup'
  69. import { getListCodeV2 } from '@/api/barcode'
  70. export default {
  71. props: {
  72. invoiceId: {
  73. type: String,
  74. default: null
  75. },
  76. detailsId: {
  77. type: String,
  78. default: null
  79. }
  80. },
  81. data() {
  82. return {
  83. tabsList: [
  84. {
  85. label: '物流状态',
  86. value: 1,
  87. show: true
  88. },
  89. {
  90. label: '物流费用',
  91. value: 2,
  92. show: true
  93. },
  94. {
  95. label: '出库条码',
  96. value: 3,
  97. show: true
  98. }
  99. ],
  100. curTarget: 1,
  101. defaultTableAttributes: {
  102. border: true,
  103. headerCellClassName: 'headerRowColor',
  104. size: 'mini',
  105. 'summary-method': this.$getSummaries,
  106. 'show-summary': true
  107. },
  108. logisticsData: [],
  109. outboundData: [],
  110. logisticsDetail: []
  111. }
  112. },
  113. computed: {
  114. formLogistics() {
  115. return [
  116. {
  117. columnAttributes: {
  118. label: '序号',
  119. type: 'index'
  120. }
  121. },
  122. {
  123. columnAttributes: {
  124. label: '结算状态',
  125. prop: 'materialName'
  126. }
  127. },
  128. {
  129. columnAttributes: {
  130. label: '调拨单号',
  131. prop: 'orderCode'
  132. }
  133. },
  134. {
  135. columnAttributes: {
  136. label: '嘉贤单据号',
  137. prop: 'materialName'
  138. }
  139. },
  140. {
  141. columnAttributes: {
  142. label: '存货编码',
  143. prop: 'materialName'
  144. }
  145. },
  146. {
  147. columnAttributes: {
  148. label: '物料代码',
  149. prop: 'materialName'
  150. }
  151. },
  152. {
  153. columnAttributes: {
  154. label: '产品名称',
  155. prop: 'materialName'
  156. }
  157. },
  158. {
  159. columnAttributes: {
  160. label: '规格型号',
  161. prop: 'materialSpecification'
  162. }
  163. },
  164. {
  165. columnAttributes: {
  166. label: '单价',
  167. prop: 'price'
  168. }
  169. },
  170. {
  171. columnAttributes: {
  172. label: '数量',
  173. prop: 'qty'
  174. }
  175. },
  176. {
  177. columnAttributes: {
  178. label: '物流费用',
  179. prop: 'totalCost'
  180. }
  181. },
  182. {
  183. columnAttributes: {
  184. label: '仓储费用',
  185. prop: 'materialName'
  186. }
  187. },
  188. {
  189. columnAttributes: {
  190. label: '合计费用',
  191. prop: 'materialName'
  192. }
  193. },
  194. {
  195. columnAttributes: {
  196. label: '对账人',
  197. prop: 'materialName'
  198. }
  199. },
  200. {
  201. columnAttributes: {
  202. label: '对账日期',
  203. prop: 'materialName'
  204. }
  205. },
  206. {
  207. columnAttributes: {
  208. label: '结算人',
  209. prop: 'materialName'
  210. }
  211. },
  212. {
  213. columnAttributes: {
  214. label: '结算日期',
  215. prop: 'materialName'
  216. }
  217. }
  218. ]
  219. },
  220. formOutbound() {
  221. return [
  222. {
  223. columnAttributes: {
  224. label: '序号',
  225. type: 'index'
  226. }
  227. },
  228. {
  229. columnAttributes: {
  230. label: '条码状态',
  231. prop: 'materialName'
  232. }
  233. },
  234. {
  235. columnAttributes: {
  236. label: '签收状态',
  237. prop: 'materialName'
  238. }
  239. },
  240. {
  241. columnAttributes: {
  242. label: '上墙状态',
  243. prop: 'materialName'
  244. }
  245. },
  246. {
  247. columnAttributes: {
  248. label: '物料代码',
  249. prop: 'materialName'
  250. }
  251. },
  252. {
  253. columnAttributes: {
  254. label: '产品名称',
  255. prop: 'materialName'
  256. }
  257. },
  258. {
  259. columnAttributes: {
  260. label: '规格型号',
  261. prop: 'materialName'
  262. }
  263. },
  264. {
  265. columnAttributes: {
  266. label: '内外机',
  267. prop: 'materialName'
  268. }
  269. },
  270. {
  271. columnAttributes: {
  272. label: '物料条码',
  273. prop: 'materialName'
  274. }
  275. },
  276. {
  277. columnAttributes: {
  278. label: '出库条形码',
  279. prop: 'materialName'
  280. }
  281. },
  282. {
  283. columnAttributes: {
  284. label: '签收日期',
  285. prop: 'materialName'
  286. }
  287. },
  288. {
  289. columnAttributes: {
  290. label: '上增日期',
  291. prop: 'materialName'
  292. }
  293. }
  294. ]
  295. }
  296. },
  297. mounted() {
  298. this.getListCodeV2()
  299. this.getListCostBillV2()
  300. },
  301. methods: {
  302. getListOrderTrack() {
  303. getListOrderTrack({ orderId: this.invoiceId }).then(res => {
  304. this.logisticsDetail = res.data
  305. })
  306. },
  307. getListCostBillV2() {
  308. getListCostBillV2({
  309. pageNum: 1,
  310. pageSize: -1,
  311. params: [
  312. {
  313. param: 'order_code',
  314. compare: '=',
  315. value: this.invoiceId
  316. }
  317. ]
  318. }).then(res => {
  319. res.data.records.forEach(item => {
  320. item.sums1 = ['orderHasSendQty', 'subsidyCoefficient', 'unloadUpstairsCoefficient', 'coefficient']
  321. item.sums2 = ['cost', 'unitPrice', 'totalCost', 'allowanceCost']
  322. })
  323. this.logisticsData = res.data.records
  324. })
  325. },
  326. getListCodeV2() {
  327. getListCodeV2({
  328. pageNum: 1,
  329. pageSize: -1,
  330. params: [
  331. {
  332. param: 'order_number',
  333. compare: '=',
  334. value: this.invoiceId
  335. }
  336. ]
  337. }).then(res => {
  338. this.outboundData = res.data.records
  339. })
  340. }
  341. }
  342. }
  343. </script>
  344. <style lang="scss" scoped>
  345. ::v-deep .el-timeline-item__tail {
  346. border-left: 2px solid #67c23a;
  347. }
  348. ::v-deep .el-form-item__content {
  349. line-height: 33px;
  350. }
  351. .logistics-title {
  352. padding: 10px;
  353. }
  354. .logistics {
  355. margin: 20px 0;
  356. }
  357. </style>