particulars.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. <template>
  2. <view class="particulars">
  3. <view class="top">
  4. <text class="text" @click="$goBack(2,'/pages/bazaar/VaseYard/reported?bottleId='+id)">窜货上报</text>
  5. </view>
  6. <view class="main">
  7. <view class="commodity">
  8. <view class="img">
  9. <img :src="data.url" mode=""></image>
  10. </view>
  11. <view class="right">
  12. <view class="list">
  13. <view class="left">
  14. 名称
  15. </view>
  16. <view class="right">
  17. {{data.fullName || ''}}
  18. </view>
  19. </view>
  20. <view class="list">
  21. <view class="left">
  22. 保质期
  23. </view>
  24. <view class="right">
  25. {{data.keepDate || ''}}
  26. </view>
  27. </view>
  28. <view class="list">
  29. <view class="left">
  30. 是否转基因
  31. </view>
  32. <view class="right">
  33. {{data.gene == 0 ? '转基因' : data.gene == 1 ? '非转基因' : '未说明'}}
  34. </view>
  35. </view>
  36. <view class="list">
  37. <view class="left">
  38. 产品标准号
  39. </view>
  40. <view class="right">
  41. {{data.productStandard || ''}}
  42. </view>
  43. </view>
  44. <view class="list">
  45. <view class="left">
  46. 许可证编码
  47. </view>
  48. <view class="right">
  49. {{data.foodLicense || ''}}
  50. </view>
  51. </view>
  52. <view class="list">
  53. <view class="left">
  54. 配料
  55. </view>
  56. <view class="right">
  57. {{data.ingredients || ''}}
  58. </view>
  59. </view>
  60. <view class="list">
  61. <view class="left">
  62. 原料
  63. </view>
  64. <view class="right">
  65. {{data.sources || ''}}
  66. </view>
  67. </view>
  68. <view class="list">
  69. <view class="left">
  70. 制作工艺
  71. </view>
  72. <view class="right">
  73. {{data.technology || ''}}
  74. </view>
  75. </view>
  76. <view class="list">
  77. <view class="left">
  78. 厂名
  79. </view>
  80. <view class="right">
  81. {{data.factory || ''}}
  82. </view>
  83. </view>
  84. </view>
  85. </view>
  86. <view class="record" v-if="details">
  87. <view class="details" v-for="(v,i) in details" :key="i">
  88. <view class="th">
  89. <view class="td">
  90. <uni-icons type="contact" size="20"></uni-icons>
  91. <text>{{v.opPerson}}</text>
  92. /
  93. <text class="text">{{v.location}}</text>
  94. </view>
  95. <view class="time">
  96. {{getTime(v.opTime)}}
  97. </view>
  98. </view>
  99. <view class="r2" v-if="v.rcvCorp">
  100. 经销商: {{v.rcvCorp}},{{v.opSendNum}}
  101. </view>
  102. <view class="r2" v-if="v.rcvPlace">
  103. 收货地址: {{v.rcvPlace}}
  104. </view>
  105. </view>
  106. </view>
  107. </view>
  108. </view>
  109. </template>
  110. <script>
  111. import {
  112. check,
  113. origin
  114. } from '../../../api/bazaar.js'
  115. import store from '../../../store/index.js'
  116. export default {
  117. data() {
  118. return {
  119. id: '',
  120. data: '',
  121. details: []
  122. };
  123. },
  124. onLoad(options) {
  125. this.id = options.id
  126. this.getData()
  127. this.getDetails()
  128. },
  129. created() {
  130. },
  131. mounted() {},
  132. methods: {
  133. async getData() {
  134. uni.showLoading({
  135. title: '加载中'
  136. });
  137. const res = await check({
  138. bottleId: this.id,
  139. accessToken: uni.getStorageSync('tokenInfo'),
  140. account: uni.getStorageSync('account')
  141. })
  142. console.log(res);
  143. uni.hideLoading();
  144. this.data = res.data.data
  145. store.dispatch('addAppear',res.data.data)
  146. },
  147. async getDetails() {
  148. const res = await origin({
  149. bottleId: this.id,
  150. accessToken: uni.getStorageSync('tokenInfo'),
  151. account: uni.getStorageSync('account')
  152. })
  153. this.details = res.data.op
  154. },
  155. // 获取时间
  156. getTime(time = new Date()) {
  157. let date = new Date(time);
  158. let year = date.getFullYear();
  159. let month = date.getMonth() + 1;
  160. let day = date.getDate();
  161. month >= 1 && month <= 9 ? (month = "0" + month) : "";
  162. day >= 0 && day <= 9 ? (day = "0" + day) : "";
  163. let timer = year + '-' + month + '-' + day;
  164. return timer;
  165. }
  166. }
  167. }
  168. </script>
  169. <style lang="scss">
  170. .particulars {
  171. .top {
  172. height: 100rpx;
  173. line-height: 100rpx;
  174. background-color: #e40315;
  175. text-align: right;
  176. .text {
  177. padding: 30rpx;
  178. color: #fff;
  179. }
  180. }
  181. .main {
  182. padding: 20rpx;
  183. .commodity {
  184. display: flex;
  185. align-items: center;
  186. border-bottom: 2px solid #cacaca;
  187. .img {
  188. width: 220rpx;
  189. height: 360rpx;
  190. img {
  191. width: 100%;
  192. height: 100%;
  193. }
  194. }
  195. .right {
  196. flex: 1;
  197. .list {
  198. display: flex;
  199. justify-content: space-between;
  200. border-bottom: 1rpx solid #dfdfdf;
  201. padding: 15rpx 0;
  202. &:last-child {
  203. border-bottom: 0;
  204. }
  205. .left {
  206. width: 160rpx;
  207. }
  208. .right {
  209. flex: 1;
  210. text-align: right;
  211. color: #8f8f8f;
  212. }
  213. }
  214. }
  215. }
  216. .record {
  217. .details {
  218. padding: 20rpx 0;
  219. border-bottom: 1rpx solid #cacaca;
  220. .th{
  221. display: flex;
  222. align-items: center;
  223. justify-content: space-between;
  224. }
  225. .td {
  226. .text {
  227. color: #49bf5e;
  228. }
  229. }
  230. }
  231. .r2 {
  232. margin: 20rpx 0;
  233. }
  234. }
  235. }
  236. }
  237. </style>