result.vue 7.1 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 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. 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. this.number = ''
  165. } else if (res.data.code == 500) {
  166. this.empty = true
  167. this.show_s = true
  168. this.text = res.data.msg
  169. uni.showToast({
  170. icon: 'none',
  171. title: res.data.msg,
  172. position: "bottom"
  173. })
  174. }
  175. this.text = res.data.msg
  176. }).catch(err => {
  177. console.log(err)
  178. uni.showToast({
  179. icon: 'none',
  180. title: '出错了请联系管理员~',
  181. position: "bottom"
  182. })
  183. }).finally(() => {
  184. // Loading.close()
  185. })
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. .roll>view:nth-child(1)>view:nth-child(1) {
  192. width: 200rpx;
  193. color: #0094FE;
  194. position: relative;
  195. top: -40rpx;
  196. left: 400rpx;
  197. font-size: 32rpx;
  198. text-align: center;
  199. }
  200. .lnput>input {
  201. background-color: none;
  202. width: 50%;
  203. font-size: 42rpx;
  204. float: left;
  205. margin-top: 10rpx;
  206. margin-left: 20rpx;
  207. margin-right: 20rpx;
  208. font-weight: bold;
  209. color: #0192FD;
  210. }
  211. .lnput>u-button {
  212. margin-left: 10rpx;
  213. }
  214. .button {
  215. width: 90%;
  216. margin-top: 200rpx;
  217. }
  218. .roll_s {
  219. font-size: 42rpx;
  220. font-weight: bold;
  221. color: #0192FD;
  222. margin-bottom: 50rpx;
  223. text-align: center;
  224. }
  225. .head {
  226. width: 750rpx;
  227. height: 650rpx;
  228. background-color: #0095FF;
  229. .stripe {
  230. width: 650rpx;
  231. height: 30rpx;
  232. background: rgba(0, 0, 0, 0.2);
  233. border-radius: 12rpx;
  234. margin: 0 auto;
  235. margin-top: 40rpx;
  236. }
  237. .roll {
  238. width: 600rpx;
  239. height: auto;
  240. background: #FFFFFF;
  241. margin: 0 auto;
  242. margin-top: -15rpx;
  243. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(101, 176, 249, 0.3);
  244. border-bottom-left-radius: 10rpx;
  245. border-bottom-right-radius: 10rpx;
  246. padding-top: 50rpx;
  247. padding-bottom: 40rpx;
  248. view:nth-child(2) {
  249. width: 100%;
  250. height: auto;
  251. .left {
  252. width: 50rpx;
  253. height: 50rpx;
  254. background-color: #F4F4F4;
  255. border-radius: 100%;
  256. float: left;
  257. margin-left: -30rpx;
  258. }
  259. .right {
  260. width: 50rpx;
  261. height: 50rpx;
  262. background-color: #F4F4F4;
  263. border-radius: 100%;
  264. float: right;
  265. margin-right: -30rpx;
  266. }
  267. }
  268. }
  269. .tips {
  270. text-align: center;
  271. height: 500rpx;
  272. view {
  273. width: 500rpx;
  274. height: 500rpx;
  275. background-color: rgba(255, 255, 255, 0.1);
  276. border-radius: 20rpx;
  277. margin: 0 auto;
  278. color: #FFFFFF;
  279. font-size: 32rpx;
  280. font-weight: bold;
  281. padding-top: 2%;
  282. view {
  283. width: 92%;
  284. height: 96%;
  285. background-color: #000000;
  286. padding-top: 41%;
  287. text {
  288. font-size: 42rpx;
  289. }
  290. }
  291. }
  292. }
  293. }
  294. .Exhibition {
  295. width: 94%;
  296. margin: 0 auto;
  297. margin-top: 25rpx;
  298. }
  299. .Exhibition>view {
  300. margin-bottom: 10rpx;
  301. }
  302. .Exhibition>view>text:nth-child(2) {
  303. float: right;
  304. }
  305. </style>