detail.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298
  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.buy_time||'暂无'}}</text>
  45. </view>
  46. <view class="two_1">
  47. <text>采购审批领导:</text>
  48. <text>{{info.leader_name||'暂无'}}</text>
  49. </view>
  50. <view class="two_1">
  51. <text>采购审批会计:</text>
  52. <text>{{info.accounting_name||'暂无'}}</text>
  53. </view>
  54. </view>
  55. <view class="thr">
  56. <view class="thr_1">
  57. <text>下单人员:</text>
  58. <text>{{info.user_name||'暂无'}}</text>
  59. </view>
  60. <view class="thr_1">
  61. <text>下单角色:</text>
  62. <text>{{info.zhRole||'暂无'}}</text>
  63. </view>
  64. <view class="thr_1">
  65. <text>下单人员电话:</text>
  66. <text>{{info.user_tel||'暂无'}}</text>
  67. </view>
  68. <view class="thr_1">
  69. <text>收货地址:</text>
  70. <text>{{info.address||'暂无'}}</text>
  71. </view>
  72. </view>
  73. <view class="four">
  74. <view class="left">
  75. <text>商品总价</text>
  76. </view>
  77. <view class="right">
  78. <text>¥{{info.total_money||'暂无'}}</text>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. id: '',
  88. user: {},
  89. info: {},
  90. // 字典表
  91. statusList: [],
  92. typeList: [],
  93. roleList: []
  94. }
  95. },
  96. onLoad: async function(e) {
  97. const that = this;
  98. that.$set(that, `id`, e && e.id || '');
  99. that.searchToken();
  100. await that.searchOther();
  101. await that.search();
  102. },
  103. methods: {
  104. searchToken() {
  105. const that = this;
  106. try {
  107. const res = uni.getStorageSync('token');
  108. if (res) that.$set(that, `user`, res);
  109. } catch (e) {
  110. uni.showToast({
  111. title: err.errmsg,
  112. icon: 'error',
  113. duration: 2000
  114. });
  115. }
  116. },
  117. async search() {
  118. const that = this;
  119. if (that.id) {
  120. const res = await that.$api(`/OrderDetail/detail/${that.id}`, 'GET', {})
  121. if (res.errcode == '0') {
  122. res.data.zhStatus = that.searchDict(res.data.status, 'status')
  123. res.data.zhType = that.searchDict(res.data.good_type, 'type')
  124. res.data.zhRole = that.searchDict(res.data.user_role, 'role')
  125. that.$set(that, `info`, res.data)
  126. } else {
  127. uni.showToast({
  128. title: res.errmsg,
  129. });
  130. }
  131. }
  132. },
  133. // 查询字典表
  134. searchDict(e, model) {
  135. const that = this;
  136. let data
  137. if (model == 'status') {
  138. data = that.statusList.find((i) => i.value == e);
  139. if (data) return data.label
  140. else return '暂无'
  141. } else if (model == 'type') {
  142. data = that.typeList.find((i) => i.value == e);
  143. if (data) return data.label
  144. else return '暂无'
  145. } else {
  146. data = that.roleList.find((i) => i.code == e);
  147. if (data) return data.name
  148. else return '暂无'
  149. }
  150. },
  151. // 查询其他信息
  152. async searchOther() {
  153. const that = this;
  154. let res;
  155. // 查询状态
  156. res = await that.$api(`/DictData`, 'GET', {
  157. type: 'order_status',
  158. is_use: '0',
  159. })
  160. if (res.errcode == '0') that.$set(that, `statusList`, res.data);
  161. // 查询类型
  162. res = await that.$api(`/DictData`, 'GET', {
  163. type: 'goods_type',
  164. is_use: '0',
  165. })
  166. if (res.errcode == '0') that.$set(that, `typeList`, res.data);
  167. // 查询角色
  168. res = await that.$api(`/Role`, 'GET', {
  169. is_use: '0',
  170. })
  171. if (res.errcode == '0') that.$set(that, `roleList`, res.data);
  172. },
  173. }
  174. }
  175. </script>
  176. <style lang="scss">
  177. .content {
  178. display: flex;
  179. flex-direction: column;
  180. width: 100vw;
  181. height: 100vh;
  182. background-color: var(--f9Color);
  183. .one {
  184. margin: 2vw 2vw 0 2vw;
  185. padding: 0 2vw;
  186. border-radius: 10px;
  187. background-color: var(--mainColor);
  188. .one_1 {
  189. display: flex;
  190. justify-content: space-between;
  191. padding: 2vw 0;
  192. font-size: var(--font16Size);
  193. border-bottom: 1px solid var(--f9Color);
  194. .status {
  195. font-size: var(--font14Size);
  196. color: var(--fF0Color);
  197. }
  198. }
  199. .one_2 {
  200. display: flex;
  201. padding: 2vw 0;
  202. .left {
  203. .image {
  204. width: 25vw;
  205. height: 25vw;
  206. border-radius: 5px;
  207. }
  208. }
  209. .right {
  210. width: 65vw;
  211. margin: 0 0 0 2vw;
  212. .name {
  213. padding: 1vw 0 0 0;
  214. font-size: var(--font14Size);
  215. text:first-child {
  216. font-size: var(--font12Size);
  217. color: var(--mainColor);
  218. background-color: var(--f3CColor);
  219. border-radius: 5px;
  220. padding: 2px 5px;
  221. }
  222. }
  223. .spec {
  224. font-size: var(--font12Size);
  225. }
  226. .num {
  227. font-size: var(--font12Size);
  228. color: var(--f85Color);
  229. }
  230. .money {
  231. font-size: var(--font14Size);
  232. font-weight: bold;
  233. }
  234. }
  235. }
  236. }
  237. .two {
  238. margin: 2vw 2vw 0 2vw;
  239. padding: 2vw;
  240. border-radius: 10px;
  241. background-color: var(--mainColor);
  242. .two_1 {
  243. padding: 2vw 0;
  244. font-size: var(--font14Size);
  245. text:first-child {
  246. color: var(--f85Color);
  247. }
  248. }
  249. }
  250. .thr {
  251. margin: 2vw 2vw 0 2vw;
  252. padding: 0 2vw;
  253. border-radius: 10px;
  254. background-color: var(--mainColor);
  255. .thr_1 {
  256. padding: 2vw 0;
  257. font-size: var(--font14Size);
  258. text:first-child {
  259. color: var(--f85Color);
  260. }
  261. }
  262. }
  263. .four {
  264. display: flex;
  265. justify-content: space-between;
  266. margin: 2vw 2vw 0 2vw;
  267. padding: 2vw;
  268. border-radius: 10px;
  269. background-color: var(--mainColor);
  270. font-size: var(--font14Size);
  271. .left {
  272. color: var(--f85Color);
  273. }
  274. }
  275. }
  276. </style>