Addcheckout.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. <template>
  2. <view class="content">
  3. <view class="top"></view>
  4. <!-- <view class="title">
  5. <view class="title-item flex">
  6. <view class="title-font">
  7. 提交人:
  8. </view>
  9. <view class="title-font">
  10. 全包员工
  11. </view>
  12. </view>
  13. <view class="xian">
  14. </view>
  15. <view class="title-item flex">
  16. <view class="title-font">
  17. 当前检验阶段:
  18. </view>
  19. <view class="title-font">
  20. 下料
  21. </view>
  22. </view>
  23. </view> -->
  24. <view v-for="(item,index) in list">
  25. <view class="main">
  26. <view class="main-top">
  27. <image class="main-icon" src="../../static/icon/order.png" mode=""></image>
  28. <view class="main-font">
  29. {{item.name}}
  30. </view>
  31. </view>
  32. <view class="main-bottom flex">
  33. <view class="num">
  34. 合格/不合格:
  35. </view>
  36. <view class="main-input">
  37. 合格
  38. </view>
  39. </view>
  40. <view class="xian"></view>
  41. <view class="main-bottom flex">
  42. <view class="num">
  43. 总数量:
  44. </view>
  45. <view class="main-input red">
  46. 363
  47. </view>
  48. </view>
  49. <view class="xian"></view>
  50. <view class="main-bottom flex">
  51. <view class="num">
  52. 合格数量:
  53. </view>
  54. <view class="main-input">
  55. <input type="number" v-model="item.hnumber" placeholder="请填写合格数量">
  56. </view>
  57. </view>
  58. <view class="xian"></view>
  59. <view class="main-bottom flex">
  60. <view class="num">
  61. 品质评级:
  62. </view>
  63. <view class="main-input">
  64. <picker :range="pjlist" @change="choosePj($event,item)">
  65. <view v-if="item.pj">{{item.pj}}</view>
  66. <view v-else>请选择评级</view>
  67. </picker>
  68. </view>
  69. </view>
  70. </view>
  71. <view class="main">
  72. <view class="main-top">
  73. <image class="main-icon" src="../../static/icon/order.png" mode=""></image>
  74. <view class="main-font">
  75. {{item.name}}
  76. </view>
  77. </view>
  78. <view class="main-bottom flex">
  79. <view class="num">
  80. 合格/不合格:
  81. </view>
  82. <view class="main-input">
  83. 不合格
  84. </view>
  85. </view>
  86. <view class="xian"></view>
  87. <view class="main-bottom flex">
  88. <view class="num">
  89. 总数量:
  90. </view>
  91. <view class="main-input red">
  92. 363
  93. </view>
  94. </view>
  95. <view class="xian"></view>
  96. <view class="main-bottom flex">
  97. <view class="num">
  98. 不合格数量:
  99. </view>
  100. <view class="main-input">
  101. <input type="number" v-model="item.bnumber" placeholder="请填写不合格数量">
  102. </view>
  103. </view>
  104. <view class="xian"></view>
  105. <view class="main-bottom">
  106. <view class="num">
  107. 图片:
  108. </view>
  109. <view class="banner-box">
  110. <view class="banner" v-for="(imgitem,imgindex) in item.images" :key="index">
  111. <view class="banner-main">
  112. <image :src="imgitem" mode=""></image>
  113. </view>
  114. <image class="cha" @click.stop="delImg(imgindex)" src="../../static/img/cha.png" mode="">
  115. </image>
  116. </view>
  117. <view class="banner" @click="imgsub(index)">
  118. <image src="../../static/img/addP.png" mode=""></image>
  119. </view>
  120. </view>
  121. </view>
  122. </view>
  123. </view>
  124. <view class="btn">
  125. 确认提交
  126. </view>
  127. <view class="" style="height: 80rpx;"></view>
  128. </view>
  129. </template>
  130. <script>
  131. import {
  132. upload
  133. } from '@/api/user.js'
  134. export default {
  135. data() {
  136. return {
  137. list: [{
  138. name: '规格1(黄色,37码)',
  139. hnumber: '',
  140. bnumber: '',
  141. pj: '',
  142. images: []
  143. }, {
  144. name: '规格2(黄色,37码)',
  145. hnumber: '',
  146. bnumber: '',
  147. pj: '',
  148. images: []
  149. }, {
  150. name: '规格3(黄色,37码)',
  151. hnumber: '',
  152. bnumber: '',
  153. pj: '',
  154. images: []
  155. }, {
  156. name: '规格4(黄色,37码)',
  157. hnumber: '',
  158. bnumber: '',
  159. pj: '',
  160. images: []
  161. }, {
  162. name: '规格5(黄色,37码)',
  163. hnumber: '',
  164. bnumber: '',
  165. pj: '',
  166. images: []
  167. }, {
  168. name: '规格6(黄色,37码)',
  169. hnumber: '',
  170. bnumber: '',
  171. pj: '',
  172. images: []
  173. }, {
  174. name: '规格7(黄色,37码)',
  175. hnumber: '',
  176. bnumber: '',
  177. pj: '',
  178. images: []
  179. }, {
  180. name: '规格8(黄色,37码)',
  181. hnumber: '',
  182. bnumber: '',
  183. pj: '',
  184. images: []
  185. }],
  186. type: 0,
  187. pjlist: ['优', '良', '及', '不及']
  188. };
  189. },
  190. onLoad(opt) {
  191. this.type = opt.type
  192. },
  193. onShow() {},
  194. onReachBottom() {},
  195. onReady() {},
  196. methods: {
  197. choosePj(e, opt) {
  198. console.log(e);
  199. opt.pj = this.pjlist[e.detail.value]
  200. },
  201. delImg(i) {
  202. uni.showModal({
  203. content: '确定删除这张吗',
  204. success: res => {
  205. if (res.confirm) {
  206. this.imageList.splice(i, 1);
  207. } else if (res.cancel) {}
  208. }
  209. });
  210. },
  211. imgsub(index) {
  212. let obj = this;
  213. console.log('上传头像');
  214. upload({
  215. filename: ''
  216. }).then(res => {
  217. console.log(res[0].url);
  218. obj.list[index].images.push(res[0].url)
  219. });
  220. },
  221. }
  222. };
  223. </script>
  224. <style lang="scss">
  225. page,
  226. .content {
  227. min-height: 100%;
  228. height: auto;
  229. background: #ffffff;
  230. }
  231. .top {
  232. width: 100%;
  233. height: 20rpx;
  234. background: #f8f8f8;
  235. }
  236. .xian {
  237. width: 100%;
  238. height: 2rpx;
  239. background: #EAECED;
  240. }
  241. .title {
  242. width: 700rpx;
  243. background: #FFFFFF;
  244. border: 2px solid #EAECED;
  245. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  246. border-radius: 20rpx;
  247. margin: 20rpx auto 0;
  248. padding: 0 24rpx;
  249. .title-item {
  250. padding: 24rpx 6rpx;
  251. .title-font {
  252. font-size: 32rpx;
  253. font-family: PingFang SC;
  254. font-weight: bold;
  255. color: #323333;
  256. }
  257. }
  258. }
  259. .main {
  260. margin: 20rpx auto 0;
  261. padding: 0 20rpx;
  262. width: 700rpx;
  263. background: #FFFFFF;
  264. border: 2px solid #EAECED;
  265. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50, 50, 52, 0.06);
  266. border-radius: 20rpx;
  267. .main-top {
  268. display: flex;
  269. align-items: center;
  270. padding: 16rpx 0;
  271. border-bottom: 1px solid #EAECED;
  272. .main-icon {
  273. width: 32rpx;
  274. height: 37rpx;
  275. }
  276. .main-font {
  277. margin-left: 10rpx;
  278. font-size: 30rpx;
  279. font-family: PingFang SC;
  280. font-weight: bold;
  281. color: #333333;
  282. }
  283. }
  284. .main-bottom {
  285. padding: 20rpx 0;
  286. .num {
  287. font-size: 28rpx;
  288. font-family: PingFang SC;
  289. font-weight: 500;
  290. color: #666666;
  291. }
  292. .main-input {
  293. text-align: right;
  294. font-size: 28rpx;
  295. font-family: PingFang SC;
  296. font-weight: 500;
  297. color: #999999;
  298. }
  299. .red {
  300. color: #FF4C4C;
  301. }
  302. }
  303. }
  304. .btn {
  305. text-align: center;
  306. margin: 100rpx auto 0;
  307. width: 622rpx;
  308. height: 85rpx;
  309. background: #069CFA;
  310. border-radius: 15rpx;
  311. line-height: 85rpx;
  312. font-size: 32rpx;
  313. font-family: PingFang SC;
  314. font-weight: bold;
  315. color: #FFFFFF;
  316. }
  317. .banner-box {
  318. background: #ffffff;
  319. padding: 20rpx;
  320. display: flex;
  321. align-items: center;
  322. flex-wrap: wrap;
  323. image {
  324. width: 100%;
  325. height: 100%;
  326. }
  327. .banner {
  328. position: relative;
  329. width: 110rpx;
  330. height: 110rpx;
  331. margin-right: 10rpx;
  332. .banner-main {
  333. position: absolute;
  334. top: 0;
  335. left: 0;
  336. right: 0;
  337. width: 160rpx;
  338. height: 160rpx;
  339. border-radius: 20rpx;
  340. image {
  341. border-radius: 20rpx;
  342. }
  343. }
  344. .cha {
  345. position: absolute;
  346. top: 0;
  347. right: 0;
  348. width: 40rpx;
  349. height: 40rpx;
  350. }
  351. }
  352. }
  353. </style>