detail.vue 5.0 KB

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