detail.vue 7.2 KB

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