deliver-record.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. <template>
  2. <view class="container record clearfix">
  3. <view class="record-content">
  4. <view class="record-list clearfix" v-for="(pros,index) in productsList" :key="index" >
  5. <view class="record-top clearfix">
  6. <view class="top-view">
  7. <view class="top-viewlabel">发货时间:</view>
  8. <view class="top-viewtext">2019-07-11 13:52:23</view>
  9. </view>
  10. <view class="top-view">
  11. <view class="top-viewlabel">申通快递:</view>
  12. <view class="top-viewtext">
  13. <text v-for="(item,idx) in lgisList" :key="idx">{{item}}</text>
  14. </view>
  15. </view>
  16. </view>
  17. <view class="goods-pros">
  18. <view class="goods-pros-t">
  19. <view class="pros-img"><image :src="pros.mainImage ? pros.mainImage:''" alt="" /></view>
  20. <view class="pros-product">
  21. <view class="producttitle">{{pros.name}}</view>
  22. <view class="productspec">规格:{{pros.productUnit ? pros.productUnit : ''}}</view>
  23. <view class="productspec">商品编码:{{pros.productCode ? pros.productCode : ''}}</view>
  24. <view class="product-view">
  25. <view class="view-num">数量:{{pros.num}}</view>
  26. </view>
  27. <view class="product-view">
  28. <view class="view-num">本次发货:{{pros.taxRate}}</view>
  29. <view class="view-num">已发货:{{pros.discount == null ? '0' : pros.discount}}</view>
  30. </view>
  31. <view class="product-view">
  32. <view class="view-num">未发货:{{pros.discountPrice}}</view>
  33. <view class="view-num">已退货:{{pros.discountPrice}}</view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="goods-pros-b clearfix">
  38. <view class="b-label">拍照备注</view>
  39. <view class="b-photo">
  40. <view class="b-imageView" v-for="(imgItem,imgIdx) in ramkesList" :key="imgIdx" >
  41. <image :src="imgItem" mode="widthFix" @click="previewImg(imgIdx)"></image>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="goods-pros-b clearfix">
  46. <view class="b-label">拍照备注</view>
  47. <view class="b-photo">
  48. <view class="text">{{pros.note ? pros.note : ''}}</view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 底部button -->
  53. <order-button ref="orderButton"
  54. :orderID="item.id"
  55. @buttonConfirm="handButtonConfirm">
  56. </order-button>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. import authorize from '@/common/config/authorize.js'
  63. import { mapState,mapMutations } from 'vuex';
  64. import orderButton from '@/components/cm-module/orderDetails/supplierRecorgButton.vue' //底部按钮
  65. import { queryShoppingCartList,shoppingCartUpdate,shoppingCartDelete } from "@/api/cart.js"
  66. var isPreviewImg;
  67. export default{
  68. components:{
  69. orderButton
  70. },
  71. data(){
  72. return{
  73. CustomBar:this.CustomBar,// 顶部导航栏高度
  74. isIphoneX:this.$store.state.isIphoneX,
  75. userID:'',
  76. alertType:'',
  77. isStock:'',
  78. lgisList:['ST465464646','SF656565656','YD12541545454'],
  79. ramkesList:[
  80. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  81. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  82. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  83. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  84. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  85. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  86. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  87. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  88. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  89. 'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg'
  90. ],
  91. productsList:[
  92. {
  93. mainImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  94. name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
  95. productUnit:'盒',
  96. productCode:'FXSW2131231231',
  97. num:20,
  98. id:233,
  99. taxRate:5,
  100. discount:5,
  101. discountPrice:3,
  102. productCount:6,
  103. price:'200.00',
  104. checked:false,
  105. note:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德'
  106. },{
  107. mainImage:'https://img14.360buyimg.com/n7/jfs/t1/114670/38/7458/171560/5ec3b80fE5c5f15f9/549ceeeca82f0d02.jpg',
  108. name:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德',
  109. productUnit:'盒',
  110. productCode:'FXSW2131231231',
  111. num:20,
  112. id:255,
  113. taxRate:5,
  114. discount:5,
  115. productCount:6,
  116. discountPrice:3,
  117. price:'200.00',
  118. checked:false,
  119. note:'华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德华西生物奥斯卡等级阿奥术大师大所打撒大啊萨达时代萨德'
  120. }
  121. ], //购物车的商品
  122. setGoodData:'', //确认订单的商品
  123. isCheckAll:false,//是否全选
  124. isModallayer:false,
  125. isDisabled: false, // 供应商/店铺全选是否禁用状态
  126. isNoConfim:false,
  127. }
  128. },
  129. onLoad(option){
  130. console.log(option)
  131. // this.initGetCartGoodsList();
  132. },
  133. computed: {
  134. ...mapState(['hasLogin','userInfo'])
  135. },
  136. methods:{
  137. initGetCartGoodsList(){//初始化购物车 index:1
  138. let params = {userID:this.userID}
  139. queryShoppingCartList(params).then(response =>{
  140. this.$store.commit('updateAllNum',response.data.cartQuantity)
  141. const responseData = response.data
  142. if(responseData.pageDate && responseData.pageDate.length > 0 ){
  143. this.productsList = responseData.pageDate;
  144. this.productsList.forEach((item,index) => {
  145. let productsListLength = item.productsList.length,
  146. invalidLength = 0;
  147. item.productsList.forEach(pros => {
  148. pros.shopID = item.shopID;
  149. if(pros.validFlag == '3' ) {invalidLength++;}
  150. })
  151. item.isDisabled = invalidLength === productsListLength;
  152. })
  153. } else {
  154. this.productsList = [];
  155. }
  156. }).catch(error =>{
  157. this.$util.msg(error.msg,2000);
  158. })
  159. },
  160. previewImg (index) {//顶部商品图片预览
  161. isPreviewImg = true
  162. let previewUrls = this.ramkesList
  163. uni.previewImage({
  164. current: index, //图片索引
  165. urls: previewUrls, //必须是http图片,本地图片无效
  166. longPressActions:''
  167. })
  168. },
  169. handButtonConfirm(data){//监听点击时间的按钮类型并执行...
  170. this.handShowAlert(data)
  171. },
  172. handShowAlert(data){//判断点击的按钮类型并执行...
  173. switch(data.type){
  174. case 'cancel':
  175. this.handCenceConfirm()
  176. break
  177. case 'add':
  178. this.$api.navigateTo('/supplier/pages/deliver/add-logistics?orderID='+this.orderID)
  179. break
  180. }
  181. },
  182. handCenceConfirm(){//取消订单
  183. this.$util.modal('提示','确定要撤销本次发货吗?撤销后需重新发货','确定','取消',true,() =>{
  184. cancelOrder({orderID:this.orderID}).then(response =>{
  185. this.$util.msg(response.msg,2000,true,'success');
  186. this.initOrderDetaileData()
  187. }).catch(error =>{
  188. this.$util.msg(error.msg,2000)
  189. })
  190. })
  191. },
  192. },
  193. onPullDownRefresh() {//下拉刷新
  194. // this.initGetCartGoodsList()
  195. // uni.stopPullDownRefresh()
  196. },
  197. onShow(){
  198. },
  199. }
  200. </script>
  201. <style lang="scss">
  202. page{
  203. background: #f7f7f7;
  204. height: auto;
  205. }
  206. .record-content{
  207. position: relative;
  208. border-top: 1px solid #EBEBEB;
  209. }
  210. .record-list{
  211. width: 100%;
  212. height: auto;
  213. background-color: #F7F7F7;
  214. margin-bottom: 24rpx;
  215. .record-top{
  216. width: 702rpx;
  217. padding: 20rpx 24rpx;
  218. height: auto;
  219. border-bottom: 2px solid #FF9100;
  220. background-color: #FFF;
  221. .top-view{
  222. width: 100%;
  223. height: auto;
  224. float: left;
  225. line-height: 50rpx;
  226. font-size: $font-size-28;
  227. color: #333333;
  228. display: flex;
  229. .top-viewlabel{
  230. width: 130rpx;
  231. margin-right: 10rpx;
  232. }
  233. .top-viewtext{
  234. width:562rpx;
  235. height: auto;
  236. text{
  237. display: inline-block;
  238. margin-right: 30rpx;
  239. }
  240. }
  241. }
  242. }
  243. .goods-pros{
  244. width: 702rpx;
  245. padding: 0 24rpx;
  246. background: #FFFFFF;
  247. }
  248. .goods-pros-t{
  249. display: flex;
  250. width: 100%;
  251. height: auto;
  252. padding:20rpx 0;
  253. .pros-img{
  254. width: 210rpx;
  255. height: 210rpx;
  256. border-radius: 10rpx;
  257. margin:0 20rpx;
  258. border:1px solid #f3f3f3;
  259. margin-left: 0;
  260. image{
  261. width: 100%;
  262. height: 100%;
  263. border-radius: 10rpx;
  264. }
  265. }
  266. .pros-product{
  267. width: 492rpx;
  268. height: 100%;
  269. line-height: 36rpx;
  270. font-size: $font-size-28;
  271. position: relative;
  272. .producttitle{
  273. width: 100%;
  274. display: inline-block;
  275. height: auto;
  276. text-overflow:ellipsis;
  277. display: -webkit-box;
  278. word-break: break-all;
  279. -webkit-box-orient: vertical;
  280. -webkit-line-clamp: 2;
  281. overflow: hidden;
  282. margin-bottom: 8rpx;
  283. }
  284. .productspec{
  285. height: 44rpx;
  286. color: #999999;
  287. line-height: 44rpx;
  288. font-size: $font-size-26;
  289. }
  290. .product-view{
  291. width: 100%;
  292. height: auto;
  293. display: flex;
  294. .view-num{
  295. flex: 1;
  296. text-align: left;
  297. font-size: $font-size-26;
  298. color: #666666;
  299. line-height: 44rpx;
  300. }
  301. }
  302. }
  303. }
  304. .goods-pros-b{
  305. width:100%;
  306. height: auto;
  307. padding: 10rpx 0;
  308. border-top: 1px solid #F7F7F7;
  309. border-bottom: 1px solid #F7F7F7;
  310. position: relative;
  311. .b-label{
  312. width: 100%;
  313. line-height: 70rpx;
  314. font-size: $font-size-28;
  315. color: $text-color;
  316. }
  317. .b-photo{
  318. width: 100%;
  319. height: auto;
  320. padding: 10rpx 0;
  321. .b-imageView{
  322. width: 112rpx;
  323. height: 112rpx;
  324. margin: 0 20rpx 20rpx 0;
  325. float: left;
  326. image{
  327. width: 112rpx;
  328. height: 112rpx;
  329. display: block;
  330. }
  331. }
  332. .text{
  333. line-height: 44rpx;
  334. font-size: $font-size-28;
  335. color: $text-color;
  336. }
  337. }
  338. .goods-pros-m{
  339. width: 100%;
  340. height: auto;
  341. line-height: 76rpx;
  342. font-size: $font-size-26;
  343. color: $text-color;
  344. float: left;
  345. padding: 10rpx 0;
  346. border-top: 1px solid #F7F7F7;
  347. border-bottom: 1px solid #F7F7F7;
  348. .m-text{
  349. width: 62rpx;
  350. float: left;
  351. padding-right: 20rpx;
  352. font-weight:bold;
  353. }
  354. .m-input{
  355. display: -webkit-box;
  356. display: -webkit-flex;
  357. display: flex;
  358. -webkit-box-align: center;
  359. -webkit-align-items: center;
  360. align-items: center;
  361. position: relative;
  362. width: 620rpx;
  363. height: auto;
  364. padding: 20rpx 0 10rpx 0;
  365. background: #FFFFFF;
  366. .text{
  367. width: 100%;
  368. height: 100%;
  369. font-size: $font-size-26;
  370. line-height: 36rpx;
  371. color: #333333;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. </style>