You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

424 lines
12 KiB

6 months ago
  1. <template>
  2. <view class="list">
  3. <!-- 验收列表 -->
  4. <view class="sub-list goods" :class="subState">
  5. <!-- 空白页 -->
  6. <empty v-if="goodsList.length === 0" tip='无验收数据'></empty>
  7. <view v-else class="content">
  8. <view class="titleview">
  9. <view style="display: flex; width: 100%;height: auto;">
  10. <view style="flex: 1; text-align: left;">{{orderinfo.dh}}</view>
  11. <view style="flex: 1; text-align:right; display: block;">{{orderinfo.dhrq}}</view>
  12. </view>
  13. <view style="display: flex; width: 100%;height: auto;">
  14. <view style="flex: 1; text-align: left;">{{orderinfo.shortname}}</view>
  15. <view style="flex: 1; text-align:right; display: block; font-size: 35rpx; color: #f06c7a;">{{sumshisje}}</view>
  16. </view>
  17. </view>
  18. <view class="row" v-for="(row,index) in goodsList" :key="index" >
  19. <!-- content -->
  20. <view class="carrier" :class="[typeClass=='goods'?theIndex==index?'open':oldIndex==index?'close':'':'']">
  21. <view class="goods-info">
  22. <view class="img">
  23. <image :src="row.img"></image>
  24. </view>
  25. <view class="info">
  26. <view class="title">{{row.mc}}</view>
  27. <view class="price-number">
  28. <view class="keep-num">规格{{row.gg}}</view>
  29. <view class="price">{{row.price}}</view>
  30. </view>
  31. <view class="price-number">
  32. <view class="keep-num">订货量{{row.dinghl}}{{row.dw}}</view>
  33. <view class="price" style="color: #6C9850;">送货量{{row.songhl}}{{row.dw}}</view>
  34. </view>
  35. <view class="shisl-number">
  36. <view class="keep-num" style="color: #f06c7a;">验收金额{{row.je}}</view>
  37. <view class="price">
  38. 验收量
  39. <view class="input">
  40. <input type="digit" v-model="row.shisl==0?'':row.shisl" @input="inputchange($event,row.id,index,row.shisl,row.price)" />
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. <view style="width: 100%;color: grey; font-size: 22rpx; text-align: center;display: block;">没有更多了~~</view>
  49. <view class="pay" v-if="orderinfo.zt<3">
  50. <view class="btn" @tap="doDeposit">保存验收</view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. import empty from "@/components/empty";
  58. export default {
  59. components: {
  60. empty
  61. },
  62. data() {
  63. return {
  64. goodsList:[],
  65. headerTop:0,
  66. //控制滑动效果
  67. typeClass:'goods',
  68. subState:'',
  69. theIndex:null,
  70. oldIndex:null,
  71. isStop:false,
  72. uid:0,
  73. orderinfo:[],
  74. sumshisje:0,
  75. dhid:0,
  76. }
  77. },
  78. onPageScroll(e){
  79. },
  80. //下拉刷新,需要自己在page.json文件中配置开启页面下拉刷新 "enablePullDownRefresh": true
  81. onPullDownRefresh() {
  82. setTimeout(function () {
  83. uni.stopPullDownRefresh();
  84. }, 1000);
  85. },
  86. onLoad(e) {
  87. //兼容H5下排序栏位置
  88. // #ifdef H5
  89. //定时器方式循环获取高度为止,这么写的原因是onLoad中head未必已经渲染出来。
  90. let Timer = setInterval(()=>{
  91. let uniHead = document.getElementsByTagName('uni-page-head');
  92. if(uniHead.length>0){
  93. this.headerTop = uniHead[0].offsetHeight+'px';
  94. clearInterval(Timer);//清除定时器
  95. }
  96. },1);
  97. // #endif
  98. //获取当前用户信息
  99. let getuserinfo=uni.getStorageSync('userinfo');
  100. this.uid=getuserinfo.uid;
  101. uni.showLoading({title:'加载中'})
  102. this.dhid=e.dhid;
  103. this.getorderinfo(e.dhid)
  104. this.getfoodlist(e.dhid)
  105. },
  106. onShow(){
  107. // this.collectionlist()
  108. },
  109. methods: {
  110. //修改验收量
  111. inputchange(even,id,index,shisl,dj)
  112. {
  113. let inputnum=parseFloat(even.detail.value);
  114. if(inputnum>0 && dj>0)
  115. {
  116. let shisje=inputnum * dj;
  117. this.goodsList[index].je=parseFloat(shisje.toFixed(2))
  118. this.goodsList[index].shisl=parseFloat(inputnum)
  119. }else{
  120. this.goodsList[index].je=0;
  121. this.goodsList[index].shisl=parseFloat(inputnum)
  122. }
  123. this.getshisje();
  124. },
  125. //获取验收数据
  126. async getfoodlist(id) {
  127. // let userinfo=uni.getStorageSync('userinfo');
  128. let redata=await this.$api.orderdetail({action:'orderdetail',dhid:id});
  129. if(redata.code==1){
  130. this.goodsList = redata.data;
  131. }else{
  132. uni.showToast({
  133. title:'暂无数据',icon:'none'
  134. })
  135. }
  136. this.getshisje();
  137. uni.hideLoading()
  138. },//获取订单信息
  139. async getorderinfo(id) {
  140. // let userinfo=uni.getStorageSync('userinfo');
  141. let redata=await this.$api.orderinfo({action:'orderinfo',dhid:id});
  142. this.orderinfo = redata.data;
  143. },
  144. //汇总金额
  145. getshisje(){
  146. this.sumshisje=0;
  147. this.goodsList.map((item, index) => {
  148. this.sumshisje=this.sumshisje+item.je;
  149. });
  150. this.sumshisje=this.sumshisje.toFixed(2);
  151. },
  152. async doDeposit(){
  153. let userinfo=uni.getStorageSync('userinfo');
  154. //本地模拟订单提交UI效果
  155. uni.showLoading({
  156. title:'正在提交订单...'
  157. })
  158. let strsjid='';
  159. let strshisl='';
  160. this.goodsList.map((item, index) => {
  161. strsjid=strsjid+','+item.id;
  162. strshisl=strshisl+','+item.shisl;
  163. });
  164. let getsjid=strsjid.substr(1);
  165. let getshisl=strshisl.substr(1);
  166. let reinfo=await this.$api.postyans({action:'postyans',dhid:this.dhid,
  167. uid:userinfo.uid,aid:userinfo.aid,name:userinfo.name,strsjid:getsjid,strshisl:getshisl});
  168. if(reinfo.code==1)
  169. {
  170. uni.showToast({title:'保存成功',icon:'none'});
  171. setTimeout(function(){
  172. uni.hideToast();
  173. uni.redirectTo({
  174. url: '/pages/orderlist/orderlist?state=0'
  175. })
  176. },1500)
  177. }else
  178. {
  179. uni.showToast({title:reinfo.msg,icon:'none'});
  180. }
  181. uni.hideLoading();
  182. },
  183. discard() {
  184. //丢弃
  185. }
  186. }
  187. }
  188. </script>
  189. <style lang="scss">
  190. view{
  191. display: flex;
  192. flex-wrap: wrap;
  193. }
  194. page{position: relative;background-color: #f5f5f5;}
  195. @font-face {font-family:"H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ZerN9yKPhn2qSyvUJpejxubXMsXiSEjO2cgIoNk+sT6+oqXn8XwmTuLU+8NWgxNcWfffrtmTVTkmYuRdOVvesHGFd41N5doX5nxY/R85uF1f9ntv/dgPT5VFqsKSG2+cTo2O4BQcjdceeGMrFPDqzFNT5mtQ2d+XmttdDQyLCXFZ02hP8XO/3r5N35Tp1/i3+uvzf1Hr383bKjKobBsn3Es0K5j+wr/Mfh19p/c7nHRR5YK7XptuvF7QOvFX69hfpQ6srnigetMRz0rWDm1T2q8fa94jtnd66ybdVzz1LBxq05KW6YcWn07znwk6XVt/3aZ579c0C9R6X69ypu7NhkLTgT8i38db4t+V+B9o/ydc543/BHFkRMR/l33g7XQpbG4JycmBaVjYlou27bi3arLR0VrOSgl1B9y1Jggx2vQO/hKcFbmxc5mCmI61611R3x7ZmueuXdueyE6CR2/bO2cu5a+PmxrRp1L3JHT8o6/XIBCneoIDkQRII9yLpLvBKenqYu3JHobtpKAm5KaAX9q76sXoK+D99XnsCINpCVsB/+oHu/rvYjG+TOQ/62Nb86vnfh5kHD1Lmofs/A00KH24ZZN6vgEccMYbA1jlGa/e4Wq4j5YGAzxX/A9/y2Xcm8GAeeTKZ9yOTJ2egyEU2aDwKog2+JDj4VAQXjzpgKUH80T6JdCGBmABQnOEMhCgbQRHmHGiinEcb/H1wSOE9uERFg6WzJJ7Sp7AMsw3G08CiMZb3xroKVWFcg5WPC++JtaWBkRdE9GcyTD6Anm4e5cQlKWTMsUfXHuxmt24MVndRZYxjVyNJUrFTF1WgkbVa283Sdtzdq5vWtFrRIkOeBhgQAyyIMUg5PkgdI1QUmGC6Rb7y9fcQLDYSA4yOjjrnM4SBCT8/4okbHgT0pVQhddxLeVccWDbphmEGpFrMV5FB4tBMSE5UBenUvJEAMcJildoRYY0d3HFSNVW6ur5cfox5f8Gu9qkdUaLFiCMugWnDTI73+IGaGO6Lk55LyUwYCpERZwMAAA==') format('woff2');}
  196. .icon {
  197. font-family:"HMfont-home" !important;
  198. font-size:60upx;
  199. font-style:normal;
  200. color:#000000;
  201. &.jia {
  202. &:before{content:"\e641";}
  203. }
  204. &.jian {
  205. &:before{content:"\e643";}
  206. }
  207. &.shanchu {
  208. &:before{content:"\e6a4";}
  209. }
  210. &.shixiao {
  211. &:before{content:"\e669";}
  212. }
  213. }
  214. .hidden{
  215. display: none !important;
  216. }
  217. .list{
  218. width: 100%;
  219. display: block;
  220. position: relative;
  221. }
  222. @keyframes showGoods {
  223. 0% {transform: translateX(-100%);}100% {transform: translateX(0);}
  224. }
  225. .sub-list{
  226. &.showgoods{
  227. display: flex;
  228. // animation: showGoods 0.20s linear both;
  229. }
  230. width: 100%;
  231. padding: 20upx 0 120upx 0;
  232. .tis{
  233. width: 100%;
  234. height: 60upx;
  235. justify-content: center;
  236. align-items: center;
  237. font-size: 32upx;
  238. }
  239. .row{
  240. width: 100%;
  241. height: 30vw;
  242. align-items: center;
  243. position: relative;
  244. overflow: hidden;
  245. .menu{
  246. .icon{
  247. color: #fff;
  248. font-size:50upx;
  249. }
  250. position: absolute;
  251. width: 28%;
  252. height: 100%;
  253. right: 0;
  254. justify-content: center;
  255. align-items: center;
  256. background-color: red;
  257. color: #fff;
  258. z-index: 2;
  259. }
  260. .carrier{
  261. @keyframes showMenu {
  262. 0% {transform: translateX(0);}100% {transform: translateX(-28%);}
  263. }
  264. @keyframes closeMenu {
  265. 0% {transform: translateX(-28%);}100% {transform: translateX(0);}
  266. }
  267. &.open{
  268. animation: showMenu 0.25s linear both;
  269. }
  270. &.close{
  271. animation: closeMenu 0.15s linear both;
  272. }
  273. background-color: #fff;
  274. position: absolute;
  275. width: 100%;
  276. padding: 0 0;
  277. height: 100%;
  278. z-index: 3;
  279. flex-wrap: nowrap;
  280. .goods-info{
  281. width: calc(100% - 40upx);
  282. padding: 10upx;
  283. flex-wrap: nowrap;
  284. .img{
  285. width: calc(30vw - 50upx);
  286. height: calc(30vw - 50upx);
  287. border-radius: 10upx;
  288. overflow: hidden;
  289. flex-shrink: 0;
  290. margin-right: 20upx;
  291. image{
  292. width: calc(30vw - 50upx);
  293. height: calc(30vw - 50upx);
  294. }
  295. }
  296. .info{
  297. width: 100%;
  298. height: calc(30vw - 40upx);
  299. overflow: hidden;
  300. flex-wrap: wrap;
  301. align-content: space-between;
  302. position: relative;
  303. .title{
  304. width: 100%;
  305. font-size: 28upx;
  306. display: -webkit-box;
  307. -webkit-box-orient: vertical;
  308. -webkit-line-clamp: 2;
  309. overflow: hidden;
  310. }
  311. .gg{
  312. width: 100%;
  313. font-size: 25upx;
  314. display: -webkit-box;
  315. -webkit-box-orient: vertical;
  316. -webkit-line-clamp: 2;
  317. overflow: hidden;
  318. color: #999;
  319. }
  320. .price-number{
  321. width: 100%;
  322. justify-content: space-between;
  323. align-items: baseline;
  324. .keep-num{
  325. font-size: 25upx;
  326. color: #999;
  327. }
  328. .price{
  329. font-size: 25upx;
  330. color: #f06c7a;
  331. }
  332. }
  333. .shisl-number{
  334. width: 100%;
  335. justify-content: space-between;
  336. align-items: baseline;
  337. .keep-num{
  338. font-size: 25upx;
  339. color: #999;
  340. }
  341. .price{
  342. font-size: 25upx;
  343. color: #f06c7a;
  344. }
  345. }
  346. .input {
  347. width: 100upx;
  348. height: 45upx;
  349. margin: 0 10upx;
  350. // background-color: #f3f3f3;
  351. border-bottom: 1upx #ADADAD solid;
  352. input {
  353. width: 80upx;
  354. height: 40upx;
  355. display: flex;
  356. justify-content: center;
  357. align-items: center;
  358. text-align: center;
  359. font-size: 26upx;
  360. }
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. .titleview{
  368. position: fixed;
  369. top: 0;
  370. left: 0;
  371. z-index: 5;
  372. width: 100%;
  373. height: 120upx;
  374. background-color: #f5f5f5;
  375. border-bottom: 1upx solid #f0f0f0;
  376. padding: 20upx 40upx;
  377. font-size: 28rpx;
  378. // color: #999;
  379. background-color: white;
  380. }
  381. .content{
  382. width: 100%;
  383. height: auto;
  384. padding-top: 100upx;
  385. }
  386. .pay{
  387. position: fixed;
  388. bottom: 0;
  389. left: 0;
  390. z-index: 5;
  391. margin-top: 20upx;
  392. width: 100%;
  393. display: flex;
  394. justify-content: center;
  395. flex-wrap: wrap;
  396. background-color: white;
  397. padding: 20rpx;
  398. .btn{
  399. width: 70%;
  400. height: 70upx;
  401. border-radius: 80upx;
  402. display: flex;
  403. justify-content: center;
  404. align-items: center;
  405. color: #fff;
  406. background-color: #f06c7a;
  407. box-shadow: 0upx 5upx 10upx rgba(0,0,0,0.2);
  408. }
  409. }
  410. </style>