detail.vue 5.3 KB

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