result.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. <!-- 胎号查询成功页面 -->
  2. <template>
  3. <view>
  4. <view class="head">
  5. <view class="tips" @tap="$u.throttle(scanning, 500)">
  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 v-if="Information.mouldOutType != null "><text>操作类型</text><text>{{Information.mouldOutType}}</text></view>
  36. <view v-if="Information.mouldOutTime != null "><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. if (none == 'none') {
  74. uni.showToast({
  75. icon: 'none',
  76. title: '无网络,请连接网络后再试~',
  77. position: "bottom"
  78. })
  79. }
  80. }
  81. });
  82. // uni.$on('update', data => {
  83. // this.datalist = data.materialList
  84. // })
  85. },
  86. methods: {
  87. rendering() {
  88. request({
  89. url: '/myapp/mouldSelect',
  90. method: 'Post',
  91. data: {
  92. storeId: this.$store.state.storeInfo.storeId,
  93. userId: this.$store.state.storeInfo.userId,
  94. tireNumber: this.datalist,
  95. }
  96. }).then(res => {
  97. this.Information = []
  98. if (res.data.code == 0) {
  99. uni.showToast({
  100. icon: 'none',
  101. title: '查询成功',
  102. position: "bottom"
  103. })
  104. this.empty = false
  105. this.show_s = false
  106. this.Information = res.data.data
  107. } else if (res.data.code == 500) {
  108. this.empty = true
  109. this.show_s = true
  110. uni.showToast({
  111. icon: 'none',
  112. title: res.data.msg,
  113. position: "bottom"
  114. })
  115. }
  116. this.text = res.data.msg
  117. }).catch(err => {
  118. uni.showToast({
  119. icon: 'none',
  120. title: '出错了请联系管理员~',
  121. position: "bottom"
  122. })
  123. }).finally(() => {
  124. // Loading.close()
  125. })
  126. },
  127. scanning() {
  128. let this_ = this
  129. uni.scanCode({
  130. success: function(res) {
  131. this_.datalist = res.result
  132. this_.rendering()
  133. }
  134. })
  135. },
  136. query() {
  137. request({
  138. url: '/myapp/mouldSelect',
  139. method: 'Post',
  140. data: {
  141. storeId: this.$store.state.storeInfo.storeId,
  142. userId: this.$store.state.storeInfo.userId,
  143. tireNumber: this.number,
  144. }
  145. }).then(res => {
  146. this.Information = []
  147. if (res.data.code == 0) {
  148. uni.showToast({
  149. icon: 'none',
  150. title: '查询成功',
  151. position: "bottom"
  152. })
  153. this.empty = false
  154. this.show_s = false
  155. this.Information = res.data.data
  156. this.number = ''
  157. } else if (res.data.code == 500) {
  158. this.empty = true
  159. this.show_s = true
  160. this.text = res.data.msg
  161. uni.showToast({
  162. icon: 'none',
  163. title: res.data.msg,
  164. position: "bottom"
  165. })
  166. }
  167. this.text = res.data.msg
  168. }).catch(err => {
  169. uni.showToast({
  170. icon: 'none',
  171. title: '出错了请联系管理员~',
  172. position: "bottom"
  173. })
  174. }).finally(() => {
  175. // Loading.close()
  176. })
  177. }
  178. }
  179. }
  180. </script>
  181. <style lang="scss" scoped>
  182. .roll>view:nth-child(1)>view:nth-child(1) {
  183. width: 200rpx;
  184. color: #0094FE;
  185. position: relative;
  186. top: -40rpx;
  187. left: 400rpx;
  188. font-size: 32rpx;
  189. text-align: center;
  190. }
  191. .lnput>input {
  192. background-color: none;
  193. width: 50%;
  194. font-size: 42rpx;
  195. float: left;
  196. margin-top: 10rpx;
  197. margin-left: 20rpx;
  198. margin-right: 20rpx;
  199. font-weight: bold;
  200. color: #0192FD;
  201. }
  202. .lnput>u-button {
  203. margin-left: 10rpx;
  204. }
  205. .button {
  206. width: 90%;
  207. margin-top: 200rpx;
  208. }
  209. .roll_s {
  210. font-size: 42rpx;
  211. font-weight: bold;
  212. color: #0192FD;
  213. margin-bottom: 50rpx;
  214. text-align: center;
  215. }
  216. .head {
  217. width: 750rpx;
  218. height: 650rpx;
  219. background-color: #0095FF;
  220. .stripe {
  221. width: 650rpx;
  222. height: 30rpx;
  223. background: rgba(0, 0, 0, 0.2);
  224. border-radius: 12rpx;
  225. margin: 0 auto;
  226. margin-top: 40rpx;
  227. }
  228. .roll {
  229. width: 600rpx;
  230. height: auto;
  231. background: #FFFFFF;
  232. margin: 0 auto;
  233. margin-top: -15rpx;
  234. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(101, 176, 249, 0.3);
  235. border-bottom-left-radius: 10rpx;
  236. border-bottom-right-radius: 10rpx;
  237. padding-top: 50rpx;
  238. padding-bottom: 40rpx;
  239. view:nth-child(2) {
  240. width: 100%;
  241. height: auto;
  242. .left {
  243. width: 50rpx;
  244. height: 50rpx;
  245. background-color: #F4F4F4;
  246. border-radius: 100%;
  247. float: left;
  248. margin-left: -30rpx;
  249. }
  250. .right {
  251. width: 50rpx;
  252. height: 50rpx;
  253. background-color: #F4F4F4;
  254. border-radius: 100%;
  255. float: right;
  256. margin-right: -30rpx;
  257. }
  258. }
  259. }
  260. .tips {
  261. text-align: center;
  262. height: 500rpx;
  263. view {
  264. width: 500rpx;
  265. height: 500rpx;
  266. background-color: rgba(255, 255, 255, 0.1);
  267. border-radius: 20rpx;
  268. margin: 0 auto;
  269. color: #FFFFFF;
  270. font-size: 32rpx;
  271. font-weight: bold;
  272. padding-top: 2%;
  273. view {
  274. width: 92%;
  275. height: 96%;
  276. background-color: #000000;
  277. padding-top: 41%;
  278. text {
  279. font-size: 42rpx;
  280. }
  281. }
  282. }
  283. }
  284. }
  285. .Exhibition {
  286. width: 94%;
  287. margin: 0 auto;
  288. margin-top: 25rpx;
  289. }
  290. .Exhibition>view {
  291. margin-bottom: 10rpx;
  292. }
  293. .Exhibition>view>text:nth-child(2) {
  294. float: right;
  295. }
  296. </style>