deliver-record.vue 11 KB

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