index.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <view class="content">
  3. <view class="text-area">
  4. <scan @getCode="getScanCode" />
  5. </view>
  6. <view class="stripe"></view>
  7. <view class="roll">
  8. <view>
  9. <view @click="show =! show">
  10. <u-icon name="edit-pen"></u-icon>手动录入
  11. </view>
  12. <view class="" v-if="show==true">
  13. <input type="text" value="wocao" style="background-color: #DD6161;width: 60%;font-size: 42rpx;border: 1rpx solid #000;" />
  14. </view>
  15. <view class="" v-else>
  16. <view>{{tips}}:{{number}}</view>
  17. </view>
  18. </view>
  19. <view>
  20. <view></view>
  21. <view></view>
  22. <view style="width: 94%;height: 20px;background-color: rgb(0,0,0,0);margin: 0 auto;margin-top: -1rpx;border-radius: 0;">
  23. <image src="../../../static/sailun/line.png" style="width: 100%;height: 1rpx;" mode=""></image>
  24. </view>
  25. </view>
  26. <view class="generate">
  27. <u-table font-size="24" border-color="#ffffff" bg-color="#fff">
  28. <u-tr class="u-tr">
  29. <u-th class="u-th" width="30%">胎号</u-th>
  30. <u-th class="u-th">规格</u-th>
  31. <u-th class="u-th" width="15%">操作</u-th>
  32. </u-tr>
  33. <u-tr class="u-tr" :key="index" v-for="(item, index) in lisi">
  34. <u-td class="u-td" width="30%">{{item.tireNumber}}</u-td>
  35. <u-td class="u-td">{{item.maktx}}</u-td>
  36. <u-td class="u-td" width="15%"><text @click="confirm(index)" style="color: #FA3534;">删除</text></u-td>
  37. </u-tr>
  38. </u-table>
  39. <u-divider color="rgb(144, 147, 153)" half-width="200" border-color="rgb(144, 147, 153)" margin-top="40">没有更多了</u-divider>
  40. </view>
  41. </view>
  42. <view class="determine">
  43. <u-button type="primary" shape="circle" @click="scancodein">扫码确认</u-button>
  44. </view>
  45. <view>
  46. </view>
  47. <u-toast ref="repeat" position="bottom" />
  48. </view>
  49. </template>
  50. <script>
  51. import {
  52. request
  53. } from '../../../common/request/request'
  54. require("promise.prototype.finally").shim()
  55. export default {
  56. data() {
  57. return {
  58. tips: '提示',
  59. number: '请扫码入库',
  60. nbTitle: '扫码标题',
  61. content: '东临碣石,以观沧海',
  62. number_s: '',
  63. lisi: [],
  64. background: {
  65. backgroundColor: '#0094fe',
  66. },
  67. show: true,
  68. zoom:18,//地图相关设置
  69. center:{lng:0,lat:0}
  70. }
  71. },
  72. created() {
  73. },
  74. methods: {
  75. //获取扫码控件
  76. getScanCode(val) {
  77. console.log(val)
  78. this.number = val
  79. this.number_s = val
  80. request({
  81. url: '/storeScan/storeScanGetTyre',
  82. method: 'Post',
  83. data: {
  84. storeId: '1000',
  85. userId: '123',
  86. tyreNum: this.number_s
  87. }
  88. }).then(res => {
  89. this.tips = "胎号"
  90. for (let i = 0; i < this.lisi.length; i++) {
  91. if (this.lisi[i].tireNumber == res.data.data[0].tirenumber) {
  92. this.$refs.repeat.show({
  93. title: '请勿重复扫码',
  94. type: 'default',
  95. position: 'bottom'
  96. })
  97. return
  98. } else if (res.data.data[0].flagRegular == 1) {
  99. this.$refs.repeat.show({
  100. title: '轮胎非正规',
  101. type: 'default',
  102. position: 'bottom'
  103. })
  104. return
  105. }
  106. }
  107. this.$refs.repeat.show({
  108. title: '扫码成功',
  109. type: 'success',
  110. position: 'bottom'
  111. })
  112. console.log("我成功啦")
  113. this.lisi.push({
  114. specs: res.data.data[0].specs,
  115. flagRegular: res.data.data[0].isRegular,
  116. diameter: res.data.data[0].diameter,
  117. maktx: res.data.data[0].maktx,
  118. pattern: res.data.data[0].pattern,
  119. soldToPartyKunnr: res.data.data[0].soldToPartyKunnr,
  120. matnr: res.data.data[0].matnr,
  121. tireNumber: res.data.data[0].tirenumber,
  122. brand: res.data.data[0].brand,
  123. shippedDate: res.data.data[0].shippedDate,
  124. scanWay: '1'
  125. })
  126. console.log(this.lisi)
  127. }).catch(err => {
  128. this.$refs.repeat.show({
  129. title: "请重新扫码",
  130. type: 'default',
  131. position: 'bottom'
  132. })
  133. console.log(err)
  134. })
  135. .finally(() => {
  136. // Loading.close()
  137. })
  138. },
  139. confirm(index) {
  140. console.log(index + "什么情况")
  141. this.lisi.splice(index, 1)
  142. },
  143. scancodein() {
  144. if (this.lisi == '') {
  145. this.$refs.repeat.show({
  146. title: '请扫码后再点击!',
  147. type: 'default',
  148. position: 'bottom'
  149. })
  150. } else { //解
  151. this.$u.route({
  152. url: 'pages/home/Scan-code-in/index'
  153. })
  154. uni.$emit('update', {
  155. materialList: this.lisi
  156. })
  157. }
  158. }
  159. }
  160. }
  161. </script>
  162. <style lang="scss" scoped>
  163. .generate {
  164. width: 98%;
  165. height: 300rpx;
  166. overflow: auto;
  167. margin: 0 auto;
  168. margin-top: 120rpx;
  169. }
  170. .determine {
  171. width: 690rpx;
  172. margin-top: 30rpx;
  173. }
  174. .content {
  175. display: flex;
  176. flex-direction: column;
  177. align-items: center;
  178. justify-content: center;
  179. padding-top: 100%;
  180. }
  181. .logo {
  182. height: 200rpx;
  183. width: 200rpx;
  184. margin-top: 200rpx;
  185. margin-left: auto;
  186. margin-right: auto;
  187. margin-bottom: 50rpx;
  188. }
  189. .stripe {
  190. width: 740rpx;
  191. height: 30rpx;
  192. background-color: #00A0EA;
  193. border-radius: 12rpx;
  194. margin: 0 auto;
  195. margin-top: -100rpx;
  196. }
  197. .text-area {
  198. width: 100%;
  199. background-color: #000;
  200. display: flex;
  201. position: static;
  202. justify-content: center;
  203. padding-top: 180rpx;
  204. }
  205. .title {
  206. font-size: 36rpx;
  207. color: #8f8f94;
  208. }
  209. page {
  210. /* background-color: #000; */
  211. }
  212. .roll {
  213. width: 710rpx;
  214. height: auto;
  215. background: #FFFFFF;
  216. margin: 0 auto;
  217. margin-top: -15rpx;
  218. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(101, 176, 249, 0.3);
  219. border-bottom-left-radius: 10rpx;
  220. border-bottom-right-radius: 10rpx;
  221. padding-top: 50rpx;
  222. padding-bottom: 50rpx;
  223. }
  224. .roll>view:nth-child(1)>view:nth-child(2) {
  225. font-size: 42rpx;
  226. font-weight: bold;
  227. color: #0192FD;
  228. text-align: center;
  229. margin-bottom: 50rpx;
  230. }
  231. .roll>view:nth-child(1)>view:nth-child(1) {
  232. width: 200rpx;
  233. color: #0094FE;
  234. position: relative;
  235. top: -40rpx;
  236. left: 500rpx;
  237. font-size: 32rpx;
  238. text-align: center;
  239. }
  240. .roll>view:nth-child(2)>view {
  241. width: 50rpx;
  242. height: 50rpx;
  243. background-color: #F4F4F4;
  244. border-radius: 100%;
  245. float: right;
  246. margin-right: -30rpx;
  247. }
  248. .roll>view:nth-child(2)>view:nth-child(1) {
  249. float: left;
  250. margin-left: -30rpx;
  251. }
  252. .status_bar {
  253. height: var(--status-bar-height);
  254. width: 100%;
  255. background-color: #0095FF;
  256. }
  257. </style>