result.vue 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <!-- 胎号查询成功页面 -->
  2. <template>
  3. <view>
  4. <view class="head">
  5. <view class="tips" @click="scanning">
  6. <view>
  7. <view><text>点击扫码</text></view>
  8. </view>
  9. </view>
  10. <view class="stripe"></view>
  11. <view class="roll">
  12. <view>
  13. <view @click="show =! show">
  14. <u-icon name="edit-pen"></u-icon>手动录入
  15. </view>
  16. <view class="lnput" v-if="show==false">
  17. <input type="text" v-model="number" placeholder="请输入胎号" clearable="true" focus="true" />
  18. <u-button type="primary" size="medium" @click="query">查询</u-button>
  19. </view>
  20. <view class="roll_s" v-else>
  21. <view>{{datalist}}</view>
  22. </view>
  23. </view>
  24. <view>
  25. <view class="left"></view>
  26. <view class="right"></view>
  27. <u-line color="#f4f4f4" border-style="dashed" :hair-line="true" length="94%" style="margin: 0 auto;padding-top: 30rpx;" />
  28. </view>
  29. <view class="Exhibition" v-if="show_s == false">
  30. <view><text>轮胎胎号</text><text>{{Information.tireNumber}}</text></view>
  31. <view><text>轮胎品牌</text><text>{{Information.brand}}</text></view>
  32. <view><text>轮胎规格</text><text>{{Information.specification}}</text></view>
  33. <view><text>操作类型</text><text>{{Information.mouldInType}}</text></view>
  34. <view><text>操作时间</text><text>{{Information.mouldInTime}}</text></view>
  35. <view><text>操作类型</text><text>{{Information.mouldOutType}}</text></view>
  36. <view><text>操作时间</text><text>{{Information.mouldOutTime}}</text></view>
  37. </view>
  38. <view v-else style="margin-top: 100rpx;margin-bottom: 100rpx;">
  39. <u-empty :text="text" mode="list"></u-empty>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. request
  48. } from '../../../common/request/request'
  49. require("promise.prototype.finally").shim()
  50. export default {
  51. data() {
  52. return {
  53. datalist: '请扫码查询或手动录入',
  54. number:'',
  55. empty: true,
  56. mouldOutTime: '',
  57. mouldOutType: '',
  58. mouldInTime: '',
  59. mouldInType: '',
  60. tireNumber: "",
  61. brand: '',
  62. specification: '',
  63. text: '请扫码或输入胎号',
  64. show: true,
  65. show_s:true,
  66. Information:[]
  67. }
  68. },
  69. onReady() {
  70. uni.getNetworkType({
  71. success: function(res) {
  72. let none = res.networkType
  73. console.log(res.networkType);
  74. if (none == 'none') {
  75. uni.showToast({
  76. icon: 'none',
  77. title: '无网络,请连接网络后再试~',
  78. position: "bottom"
  79. })
  80. }
  81. }
  82. });
  83. // uni.$on('update', data => {
  84. // this.datalist = data.materialList
  85. // })
  86. },
  87. methods: {
  88. rendering() {
  89. console.log(this.datalist)
  90. request({
  91. url: '/myapp/mouldSelect',
  92. method: 'Post',
  93. data: {
  94. storeId: this.$store.state.storeInfo.storeId,
  95. userId: this.$store.state.storeInfo.userId,
  96. tireNumber: this.datalist,
  97. }
  98. }).then(res => {
  99. this.Information = []
  100. console.log(res.data)
  101. if (res.data.code == 0) {
  102. uni.showToast({
  103. icon: 'none',
  104. title: '查询成功',
  105. position: "bottom"
  106. })
  107. this.empty = false
  108. this.show_s = false
  109. this.Information = res.data.data
  110. } else if (res.data.code == 500) {
  111. this.empty = true
  112. this.show_s = true
  113. uni.showToast({
  114. icon: 'none',
  115. title: res.data.msg,
  116. position: "bottom"
  117. })
  118. }
  119. this.text = res.data.msg
  120. }).catch(err => {
  121. console.log(err)
  122. uni.showToast({
  123. icon: 'none',
  124. title: '出错了请联系管理员~',
  125. position: "bottom"
  126. })
  127. }).finally(() => {
  128. // Loading.close()
  129. })
  130. },
  131. scanning() {
  132. let this_ = this
  133. uni.scanCode({
  134. success: function(res) {
  135. console.log('条码类型:' + res.scanType);
  136. console.log('条码内容:' + res.result);
  137. this_.datalist = res.result
  138. this_.rendering()
  139. }
  140. })
  141. },
  142. query() {
  143. console.log(this.datalist)
  144. request({
  145. url: '/myapp/mouldSelect',
  146. method: 'Post',
  147. data: {
  148. storeId: this.$store.state.storeInfo.storeId,
  149. userId: this.$store.state.storeInfo.userId,
  150. tireNumber: this.number,
  151. }
  152. }).then(res => {
  153. this.Information = []
  154. console.log(res.data)
  155. if (res.data.code == 0) {
  156. uni.showToast({
  157. icon: 'none',
  158. title: '查询成功',
  159. position: "bottom"
  160. })
  161. this.empty = false
  162. this.show_s = false
  163. this.Information = res.data.data
  164. } else if (res.data.code == 500) {
  165. this.empty = true
  166. this.show_s = true
  167. this.text = res.data.msg
  168. uni.showToast({
  169. icon: 'none',
  170. title: res.data.msg,
  171. position: "bottom"
  172. })
  173. }
  174. this.text = res.data.msg
  175. }).catch(err => {
  176. console.log(err)
  177. uni.showToast({
  178. icon: 'none',
  179. title: '出错了请联系管理员~',
  180. position: "bottom"
  181. })
  182. }).finally(() => {
  183. // Loading.close()
  184. })
  185. }
  186. }
  187. }
  188. </script>
  189. <style lang="scss" scoped>
  190. .roll>view:nth-child(1)>view:nth-child(1) {
  191. width: 200rpx;
  192. color: #0094FE;
  193. position: relative;
  194. top: -40rpx;
  195. left: 400rpx;
  196. font-size: 32rpx;
  197. text-align: center;
  198. }
  199. .lnput>input {
  200. background-color: none;
  201. width: 50%;
  202. font-size: 42rpx;
  203. float: left;
  204. margin-top: 10rpx;
  205. margin-left: 20rpx;
  206. margin-right: 20rpx;
  207. font-weight: bold;
  208. color: #0192FD;
  209. }
  210. .lnput>u-button {
  211. margin-left: 10rpx;
  212. }
  213. .button {
  214. width: 90%;
  215. margin-top: 200rpx;
  216. }
  217. .roll_s {
  218. font-size: 42rpx;
  219. font-weight: bold;
  220. color: #0192FD;
  221. margin-bottom: 50rpx;
  222. text-align: center;
  223. }
  224. .head {
  225. width: 750rpx;
  226. height: 650rpx;
  227. background-color: #0095FF;
  228. .stripe {
  229. width: 650rpx;
  230. height: 30rpx;
  231. background: rgba(0, 0, 0, 0.2);
  232. border-radius: 12rpx;
  233. margin: 0 auto;
  234. margin-top: 40rpx;
  235. }
  236. .roll {
  237. width: 600rpx;
  238. height: auto;
  239. background: #FFFFFF;
  240. margin: 0 auto;
  241. margin-top: -15rpx;
  242. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(101, 176, 249, 0.3);
  243. border-bottom-left-radius: 10rpx;
  244. border-bottom-right-radius: 10rpx;
  245. padding-top: 50rpx;
  246. padding-bottom: 40rpx;
  247. view:nth-child(2) {
  248. width: 100%;
  249. height: auto;
  250. .left {
  251. width: 50rpx;
  252. height: 50rpx;
  253. background-color: #F4F4F4;
  254. border-radius: 100%;
  255. float: left;
  256. margin-left: -30rpx;
  257. }
  258. .right {
  259. width: 50rpx;
  260. height: 50rpx;
  261. background-color: #F4F4F4;
  262. border-radius: 100%;
  263. float: right;
  264. margin-right: -30rpx;
  265. }
  266. }
  267. }
  268. .tips {
  269. text-align: center;
  270. height: 500rpx;
  271. view {
  272. width: 500rpx;
  273. height: 500rpx;
  274. background-color: rgba(255, 255, 255, 0.1);
  275. border-radius: 20rpx;
  276. margin: 0 auto;
  277. color: #FFFFFF;
  278. font-size: 32rpx;
  279. font-weight: bold;
  280. padding-top: 2%;
  281. view {
  282. width: 92%;
  283. height: 96%;
  284. background-color: #000000;
  285. padding-top: 41%;
  286. text {
  287. font-size: 42rpx;
  288. }
  289. }
  290. }
  291. }
  292. }
  293. .Exhibition {
  294. width: 94%;
  295. margin: 0 auto;
  296. margin-top: 25rpx;
  297. }
  298. .Exhibition>view {
  299. margin-bottom: 10rpx;
  300. }
  301. .Exhibition>view>text:nth-child(2) {
  302. float: right;
  303. }
  304. </style>