detail.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <view class="content">
  3. <view class="one">
  4. <view class="one_1">
  5. <text>
  6. <text class="iconfont icon-changshangguanli"></text>
  7. {{info.supplier_name}}
  8. </text>
  9. <text class="status">{{info.zhStatus}}</text>
  10. </view>
  11. <view class="one_2">
  12. <view class="left">
  13. <image v-if="info.spec_file" class="image"
  14. :src="info.spec_file&&info.spec_file.length>0?info.spec_file[0].url:''" mode="">
  15. </image>
  16. <image v-else class="image" :src="info.good_file&&info.good_file.length>0?info.good_file[0].url:''"
  17. mode="">
  18. </image>
  19. </view>
  20. <view class="right">
  21. <view class="name textOver">
  22. <text>{{info.zhType||'暂无'}}</text>
  23. <text>{{info.good_name||'暂无'}}</text>
  24. </view>
  25. <view class="spec textOver">
  26. <text>规格:{{info.spec_name||'暂无'}}</text>
  27. </view>
  28. <view class="num">
  29. <text>数量:{{info.num||'暂无'}}</text>
  30. </view>
  31. <view class="money">
  32. <text>¥{{info.money||'暂无'}}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="two">
  38. <view class="two_1">
  39. <text>订单号:</text>
  40. <text>{{info.order_id||'暂无'}}</text>
  41. </view>
  42. <view class="two_1">
  43. <text>申请时间:</text>
  44. <text>{{info.apply_time||'暂无'}}</text>
  45. </view>
  46. </view>
  47. <view class="thr">
  48. <view class="thr_1">
  49. <text>下单人员:</text>
  50. <text>{{info.user_name||'暂无'}}</text>
  51. </view>
  52. <view class="thr_1">
  53. <text>下单人员电话:</text>
  54. <text>{{info.user_tel||'暂无'}}</text>
  55. </view>
  56. <view class="thr_1">
  57. <text>收货地址:</text>
  58. <text>{{info.address||'暂无'}}</text>
  59. </view>
  60. </view>
  61. </view>
  62. </template>
  63. <script>
  64. export default {
  65. data() {
  66. return {
  67. id: '',
  68. user: {},
  69. info: {},
  70. // 字典表
  71. statusList: [],
  72. typeList: [],
  73. roleList: []
  74. }
  75. },
  76. onLoad: async function(e) {
  77. const that = this;
  78. that.$set(that, `id`, e && e.id || '');
  79. that.searchToken();
  80. await that.searchOther();
  81. await that.search();
  82. },
  83. methods: {
  84. searchToken() {
  85. const that = this;
  86. try {
  87. const res = uni.getStorageSync('token');
  88. if (res) that.$set(that, `user`, res);
  89. } catch (e) {
  90. uni.showToast({
  91. title: err.errmsg,
  92. icon: 'error',
  93. duration: 2000
  94. });
  95. }
  96. },
  97. async search() {
  98. const that = this;
  99. if (that.id) {
  100. const res = await that.$api(`/Upkeep/${that.id}`, 'GET', {})
  101. if (res.errcode == '0') {
  102. res.data.zhStatus = that.searchDict(res.data.status, 'status')
  103. that.$set(that, `info`, res.data)
  104. } else {
  105. uni.showToast({
  106. title: res.errmsg,
  107. });
  108. }
  109. }
  110. },
  111. // 查询字典表
  112. searchDict(e, model) {
  113. const that = this;
  114. let data
  115. if (model == 'status') {
  116. data = that.statusList.find((i) => i.value == e);
  117. if (data) return data.label
  118. else return '暂无'
  119. }
  120. },
  121. // 查询其他信息
  122. async searchOther() {
  123. const that = this;
  124. let res;
  125. // 查询状态
  126. res = await that.$api(`/DictData`, 'GET', {
  127. type: 'order_status',
  128. is_use: '0',
  129. })
  130. if (res.errcode == '0') that.$set(that, `statusList`, res.data);
  131. },
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .content {
  137. display: flex;
  138. flex-direction: column;
  139. width: 100vw;
  140. height: 100vh;
  141. background-color: var(--f9Color);
  142. .one {
  143. margin: 2vw 2vw 0 2vw;
  144. padding: 0 2vw;
  145. border-radius: 10px;
  146. background-color: var(--mainColor);
  147. .one_1 {
  148. display: flex;
  149. justify-content: space-between;
  150. padding: 2vw 0;
  151. font-size: var(--font16Size);
  152. border-bottom: 1px solid var(--f9Color);
  153. .status {
  154. font-size: var(--font14Size);
  155. color: var(--fF0Color);
  156. }
  157. }
  158. .one_2 {
  159. display: flex;
  160. padding: 2vw 0;
  161. .left {
  162. .image {
  163. width: 25vw;
  164. height: 25vw;
  165. border-radius: 5px;
  166. border: 1px solid var(--f9Color);
  167. }
  168. }
  169. .right {
  170. display: flex;
  171. flex-direction: column;
  172. justify-content: space-around;
  173. width: 65vw;
  174. margin: 0 0 0 2vw;
  175. .name {
  176. padding: 1vw 0 0 0;
  177. font-size: var(--font14Size);
  178. text:first-child {
  179. font-size: var(--font12Size);
  180. color: var(--mainColor);
  181. background-color: var(--f3CColor);
  182. border-radius: 5px;
  183. padding: 2px 5px;
  184. }
  185. }
  186. .spec {
  187. font-size: var(--font12Size);
  188. }
  189. .num {
  190. font-size: var(--font12Size);
  191. color: var(--f85Color);
  192. }
  193. .money {
  194. font-size: var(--font14Size);
  195. font-weight: bold;
  196. color: var(--fF0Color);
  197. }
  198. }
  199. }
  200. }
  201. .two {
  202. margin: 2vw 2vw 0 2vw;
  203. padding: 2vw;
  204. border-radius: 10px;
  205. background-color: var(--mainColor);
  206. .two_1 {
  207. padding: 2vw 0;
  208. font-size: var(--font14Size);
  209. text:first-child {
  210. color: var(--f85Color);
  211. }
  212. }
  213. }
  214. .thr {
  215. margin: 2vw 2vw 0 2vw;
  216. padding: 0 2vw;
  217. border-radius: 10px;
  218. background-color: var(--mainColor);
  219. .thr_1 {
  220. padding: 2vw 0;
  221. font-size: var(--font14Size);
  222. text:first-child {
  223. color: var(--f85Color);
  224. }
  225. }
  226. }
  227. }
  228. </style>