shish 4 лет назад
Родитель
Сommit
42ca35c27c

+ 7 - 11
hdApp/src/admin/goods/plantCg.vue

@@ -18,13 +18,9 @@
 import AppTabs from "@/components/plugin/tabs";
 import plantCgItem from "./plantCgItem";
 import AppWrapperEmpty from "@/components/app-wrapper-empty";
-import { purchaseList } from "@/api/purchase/index";
+import { getPlantCg } from "@/api/goods/index";
 export default {
-  components: {
-    AppWrapperEmpty,
-    plantCgItem,
-    AppTabs
-  },
+  components: { AppWrapperEmpty, plantCgItem, AppTabs },
   data () {
     return {
        tabs: [
@@ -63,7 +59,7 @@ export default {
     }
   },
   onPullDownRefresh() {
-    this.getpurchaseList().then(res => {
+    this.getCgList().then(res => {
       uni.stopPullDownRefresh()
     })
   },
@@ -74,15 +70,15 @@ export default {
 			} else {
 				this.tabIndex = e.index;
         this.status = e.item.key
-        this.getpurchaseList()
+        this.getCgList()
 			}
 		},
     init() {
-      this.getpurchaseList()
+      this.getCgList()
     },
     // 获取采购记录列表
-    getpurchaseList () {
-      return purchaseList({ status: this.status }).then(res => {
+    getCgList () {
+      return getPlantCg({ status: this.status }).then(res => {
         this.list.data = res.data.list
         this.tabs[0].value = res.data.shop.totalPurchaseOrder // 全部
         this.tabs[1].value = res.data.shop.cgUnPay // 待付款

+ 15 - 194
hdApp/src/admin/goods/plantCgDetail.vue

@@ -1,21 +1,6 @@
 <template>
   <view class="app-content">
     <view class="info-content_box">
-      <view class="title">
-        供应商
-      </view>
-      <view class="address-des_bx content-box" @click="goToSettle(detailInfo)">
-        <view>
-          <view> {{ detailInfo.ghsName }} {{ detailInfo.ghsMobile }} </view>
-          <view>{{ detailInfo.ghsFullAddress}}</view>
-        </view>
-        <view>
-          <i @click.stop="callUp(detailInfo.ghsMobile)" class="iconfont icondianhua1"></i>
-        	<i @click.stop="navigate(detailInfo.lat,detailInfo.long,detailInfo.supplierName)"
-          class="iconfont icondianhua" style="font-size:53upx;margin-left:50upx;margin-right:9upx;color:#3385ff;"></i>
-        </view>
-      </view>
-
       <view class="bills-info_box content-box">
         <view class="order-info_box">
           <view>订单日期:</view>
@@ -32,106 +17,41 @@
           <view>过期时间:</view>
           <view>{{ detailInfo.deadline ? detailInfo.deadline.substring(0, 16) : '' }}</view>
         </view>
-        <view v-if="detailInfo.ghsShopAdminId != 0" class="order-info_box">
-          <view>商家开单:</view>
-          <view>
-            <i class="iconfont icondagou" style="font-size:35upx;"></i>
-          </view>
-        </view>
-        <view class="order-info_box" v-if="detailInfo.book == 1">
-          <view>订单类型:</view>
-          <view>
-            <text style="color:white;border:1px solid #657cac;border-radius:20upx;font-size:20upx;padding:5upx 12upx;background:#657cac;">预订单</text>
-          </view>
-        </view>
-        <view class="order-info_box">
-          <view>配送时间:</view>
-          <view>{{ detailInfo.sendTimeWant }}</view>
-        </view>
-        <view class="order-info_box">
-          <view>支付方式:</view>
-          <view>{{ detailInfo.payWay==0?'微信' :detailInfo.payWay==1?'支付宝' :detailInfo.payWay==2?'余额' :detailInfo.payWay==4?'现金' :detailInfo.payWay==5?'银行卡' :'--' }}</view>
-        </view>
         <view class="order-info_box">
           <view>采购人员:</view>
           <view>{{ detailInfo.adminName }}</view>
         </view>
         <view class="order-info_box">
           <view>订单状态:</view>
-          <view>{{ detailInfo.status==1?'待付款' :detailInfo.status==2?'待配送' :detailInfo.status==3?'配送中' :detailInfo.status==4?'已完成' :detailInfo.status==5?'已取消' :'已退款' }}</view>
-        </view>
-
-        <view v-if="detailInfo.refund == 2" class="order-info_box">
-          <view>累计退款:</view>
-          <view style="color:red;font-weight:bold;font-size:30upx;">¥{{parseFloat(detailInfo.tkPrice)}}</view>
-            <view class="price" v-if="detailInfo.refund == 2">
-              <button @click="pageTo({url: '/pagesPurchase/refundList',query: {id: detailInfo.id}})" class="admin-button-com">退款记录</button>
-            </view>
-        </view>
-        <view v-if="detailInfo.refund == 2" class="order-info_box">
-          <view>退款方式:</view>
-          <view style="color:red;font-weight:bold;font-size:30upx;">{{detailInfo.tkExplain||''}}</view>
-        </view>
-
-      </view>
-
-      <view v-if="detailInfo.debt == 1 || detailInfo.clearId > 0" class="bills-info_box content-box">
-        <view class="order-info_box" v-if="detailInfo.debt == 1">
-          <view>欠款状态:</view>
-            <view>是</view>
-            <view class="price">
-              <button @click="goToSettle(detailInfo)" class="admin-button-com">全部欠款单</button>
-            </view>
-        </view>
-        <view class="order-info_box" v-else>
-          <view>欠款状态:</view>
-						<view v-if="detailInfo.clearId > 0">已结帐</view>
-            <view class="price" v-if="detailInfo.clearId > 0">
-              <button @click="pageTo({url: '/admin/clear/info',query: {id: detailInfo.clearId}})" class="admin-button-com">查看帐单</button>
-            </view>
+          <view>{{ detailInfo.status==0?'待付款' :detailInfo.status==1?'待配送' :detailInfo.status==2?'配送中' :detailInfo.status==3?'已完成' :detailInfo.status==4?'已取消' :'待付款' }}</view>
         </view>
       </view>
 
-      <view class="module-com content-box proInfo distribution" v-if="detailInfo.sendProgress.title" >
-        <text>配送进展</text>
-        <text class="evolve">{{detailInfo.sendProgress.title}}</text>
-      </view>
       <view class="module-com content-box proInfo">
         <view class="commodity-view">
           <view class="infoAEdit">
             <text>商品信息</text>
           </view>
           <view class="commodity-list">
-            <view v-for="(s, idx) in detailInfo.product" :key="idx" class="commodity-item" >
-              <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/item/detail',query:{id: s.productId}})" />
+            <view v-for="(s, idx) in itemList" :key="idx" class="commodity-item" >
+              <image class="item-icon" :src="s.cover" @click="pageTo({url:'/admin/goods/detail',query:{id: s.goodsId}})" />
               <view class="item-info">
                 <view class="info-line">
                   <text class="item-name">{{ s.name }}</text>
                   <text class="item-price">
                     <text class="unit"></text>
                     <text class="price">
-                      <text v-if="detailInfo.stockChange == 1">{{parseFloat(s.xhNum)}}{{s.xhUnitName}}*¥{{parseFloat(s.xhUnitPrice)}}</text>
-                      <text v-else></text>
+                      <text>{{parseFloat(s.num)}}份*¥{{parseFloat(s.price)}}</text>
                     </text>
                   </text>
                 </view>
                 <view class="info-line">
-                  <text class="item-type" v-if="detailInfo.book == 1">
-                    <text>预订 {{parseFloat(s.preItemNum)}}{{s.xhUnitName}}*¥{{parseFloat(s.xhPreUnitPrice)}}</text>
-                    </text>
-                  <text class="item-type" v-else><text></text></text>
-                  <text class="item-count" v-if="detailInfo.stockChange == 1">¥{{ parseFloat(s.totalPrice)||0 }}</text>
-                  <text class="item-count" v-else></text>
+                  <text class="item-type"></text>
+                  <text class="item-count">¥{{ parseFloat(s.totalPrice)||0 }}</text>
                 </view>
               </view>
             </view>
           </view>
-          <view class="summary-bar">
-            <view class="operate-view"></view>
-            <view class="describe-view">
-              共{{ detailInfo.kindNum || 0 }}种 {{ detailInfo.bigNum }}扎<text v-if="detailInfo.smallNum>0">{{detailInfo.smallNum}}支</text>,合计 ¥<text class="price">{{ parseFloat(detailInfo.itemPrice)||0 }}</text>
-            </view>
-          </view>
         </view>
       </view>
       <view v-if="detailInfo.remark !=''" class="content-box price-detail">
@@ -142,7 +62,7 @@
           </tui-list-cell>
         </div>
       </view>
-      <view class="content-box price-detail" v-if="detailInfo.book == 0">
+      <view class="content-box price-detail">
         <div class="module-com input-line-wrap">
           <tui-list-cell class="line-cell" :hover="false" v-if="Number(detailInfo.sendCost)>0">
             <div class="tui-title">运费</div>
@@ -156,7 +76,7 @@
             <div class="tui-title"><text v-if="detailInfo.discountType == 4">红包优惠</text><text v-else>优惠</text></div>
             <div class="detail-price_box" style="font-size: 28upx;">-¥{{ parseFloat(detailInfo.discountAmount)||0}}</div>
           </tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.refundPrice > 0">
+          <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.orderPrice > 0">
             <div class="tui-title">订单金额</div>
             <div class="detail-price_box" style="font-size: 28upx;">¥{{ parseFloat(detailInfo.orderPrice)||0}}</div>
           </tui-list-cell>
@@ -171,53 +91,11 @@
         </div>
       </view>
 
-      <view class="content-box price-detail" v-else>
-        <div class="module-com input-line-wrap">
-          <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">重量(公斤)</div>
-            <div class="detail-price_box" style="font-size: 28upx;">
-              <text v-if="Number(detailInfo.miniKilo) > Number(detailInfo.weight)" style="color:#CCCCCC;margin-right:15upx;">未达{{parseFloat(detailInfo.miniKilo)}}公斤按{{parseFloat(detailInfo.miniKilo)}}公斤计算</text>
-              <text>{{ detailInfo.weight ? parseFloat(detailInfo.weight) : 0 }}</text>
-             </div>
-          </tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">服务费</div>
-            <div class="detail-price_box" style="font-size: 28upx;">
-              <text style="color:#CCCCCC;margin-right:15upx;">{{Number(detailInfo.miniKilo) > Number(detailInfo.weight) ? parseFloat(detailInfo.miniKilo) : parseFloat(detailInfo.weight)}}*¥{{ detailInfo.kiloFee ? parseFloat(detailInfo.kiloFee) : 0}}</text>
-              <text>¥{{ detailInfo.allKiloFee ? parseFloat(detailInfo.allKiloFee) : 0}}</text>
-            </div>
-          </tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">商品金额</div>
-            <div class="detail-price_box" style="font-size: 28upx;">¥{{ detailInfo.itemPrice ? parseFloat(detailInfo.itemPrice) : 0 }}</div>
-          </tui-list-cell>
-				<tui-list-cell class="line-cell" :hover="false">
-					<div class="tui-title">总计</div>
-					<div class="detail-price_box red" style="font-size: 28upx;">¥{{ detailInfo.orderPrice ? parseFloat(detailInfo.orderPrice) : 0 }}</div>
-				</tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false">
-            <div class="tui-title">预付金额</div>
-            <div class="detail-price_box red" style="font-size: 28upx;">¥{{ detailInfo.bookPrice ? parseFloat(detailInfo.bookPrice) : 0}}</div>
-          </tui-list-cell>
-          <tui-list-cell class="line-cell" :hover="false" v-if="detailInfo.stockChange == 1">
-              <view class="tui-title">结账</view>
-              <view class="detail-price_box" style="font-size: 28upx;color:green;" v-if="settlePrice > 0">退 ¥{{settlePrice}}</view>
-              <view class="detail-price_box" style="font-size: 28upx;color:red;" v-else-if="settlePrice < 0">欠 ¥{{Math.abs(settlePrice)}}</view>
-              <view class="detail-price_box" style="font-size: 28upx;" v-else>0</view>
-          </tui-list-cell>
-        </div>
-      </view>
-
-    </view>
-    <view class="footer_bar" v-if="detailInfo.status == 1">
-      <view @click="toPay">付款</view>
     </view>
   </view>
 </template>
-
 <script>
-
-import { purchaseDetail, purchaseDebtPay, purchaseClearCreateOrder } from "@/api/purchase/index";
+import { getPlantCgDetail} from "@/api/goods/index";
 import TuiListCell from "@/components/plugin/list-cell";
 export default {
   name: "plantCgDetail",
@@ -226,8 +104,6 @@ export default {
   },
   data () {
     return {
-      pageType: "order_change",
-      autoLoad: false,
       stepActive: 0,
       form: {
         name: ""
@@ -242,11 +118,8 @@ export default {
       },
       loading: false,
       id: '',
-      settlePrice:0
+      itemList:[]
     };
-  },
-  onShow () {
-
   },
   onPullDownRefresh() {
 			this.initData().then(res => {
@@ -254,25 +127,6 @@ export default {
 			})
 		},
   methods: {
-		navigate(latitude, longitude, address) {   
-			// 将经纬度转换成Number
-			let latituded = Number(latitude);
-			let longituded = Number(longitude);					
-			uni.openLocation({
-				latitude: latituded,
-				longitude: longituded,
-				address: address,
-				success: function() {
-					console.log('success');
-				}
-			});
-		},
-    //跳转到结账页
-    goToSettle (item) {
-      this.pageTo({
-        url: '/pagesPurchase/gathering?id='+item.supplierId
-      })
-    },
     copy (val) {
       const self = this;
       uni.setClipboardData({
@@ -282,50 +136,18 @@ export default {
         }
       });
     },
-    callUp (mobile) {
-      uni.makePhoneCall({
-        phoneNumber: mobile
-      });
-    },
     init() {
       this.initData()
     },
-    async initData () {
-      return purchaseDetail({ id: this.option.id }).then(res => {
-        this.detailInfo = res.data
-
-			this.settlePrice = Number(this.detailInfo.bookPrice) - Number(this.detailInfo.orderPrice)
-			this.settlePrice = parseFloat(this.settlePrice.toFixed(2))
-
-        this.$forceUpdate()
+    initData () {
+      getPlantCgDetail({ id: this.option.id }).then(res => {
+        this.detailInfo = res.data.info
+        this.itemList = res.data.itemList
       })
-      
-    },
-    // 修改花材
-    editFlr () {
-
-    },
-    toPay () {
-      uni.navigateTo({
-        url: `/pagesPurchase/wechatPay?orderSn=${this.detailInfo.orderSn}&realPrice=${this.detailInfo.realPrice}&id=${this.detailInfo.id}`
-      })
-    },
-    getError () {
-    },
-    getSuccess () {
-      uni.navigateTo({
-        url: '/pagesPurchase/particulars'
-      })
-    },
-    postponePay () {
-      purchaseDebtPay({ orderSn: this.detailInfo.orderSn }).then(res => {
-        console.log(res)
-      }).catch(err => { console.log(err) })
     }
   }
 };
 </script>
-
 <style lang="scss" scoped>
 .info-content_box {
   padding: 0 20upx 100upx;
@@ -365,7 +187,6 @@ export default {
   .bills-info_box {
     margin-top: 20upx;
     padding: 30upx 20upx 30upx;
-    // border-bottom: 1px solid #EEEEEE;
     & > .order-info_box {
       display: flex;
       align-items: center;
@@ -581,7 +402,7 @@ export default {
   & > view {
     float: right;
     height: 70upx;
-    display: inline-block;
+    display: block;
     padding: 0 50upx;
     background: #3385ff;
     margin-right: 20upx;

+ 10 - 16
hdApp/src/admin/goods/plantCgItem.vue

@@ -1,19 +1,10 @@
 <template>
   <view class="order-item-view" @click="clickItemEvent">
-    <view class="item-header">
-      <view class="title">
-        <image class="icon" :src="info.ghsAvatar" alt="" />
-        <text class="name">
-          <text>{{ info.ghsName}}</text>
-        </text>
-      </view>
-      <view class="status">{{ getStatusName }} </view>
-    </view>
     <view class="item-main" >
       <view class="item-info">
         <view class="info-row">
           <text class="info-label"> 日期:</text>
-          <text class="info-value">{{ info.addTime ? info.addTime.substring(0, 16) : '' }}</text>
+          <text class="info-value">{{ info.addTime ? info.addTime.substring(5, 11) : '' }}</text>
         </view>
         <view class="info-row">
           <text class="info-label"> 单号:</text>
@@ -28,6 +19,10 @@
           <text v-if="info.smallNum > 0" class="info-value">{{ info.bigNum }}/{{info.smallNum}}</text>
           <text class="info-value">{{info.bigNum}}</text>
         </view>
+        <view class="info-row">
+          <text class="info-label"> 状态:</text>
+          <text class="info-value">{{ getStatusName }}</text>
+        </view>
       </view>
       <view class="item-price">¥{{ parseFloat(info.actPrice)||0 }} <text class="iconfont iconxiangyou"></text>
       </view>
@@ -48,21 +43,20 @@ export default {
   computed: {
     getStatusName () {
       let statusName = "";
-
       switch (this.info.status) {
-        case '1':
+        case '0':
           statusName = "待付款";
           break;
-        case '2':
+        case '1':
           statusName = "待配送";
           break;
-        case '3':
+        case '2':
           statusName = "配送中";
           break;
-        case '4':
+        case '3':
           statusName = "已完成";
           break;
-        case '5':
+        case '4':
           statusName = "已取消";
           break;
         default:

+ 8 - 1
hdApp/src/api/goods/index.js

@@ -12,7 +12,14 @@ export const getDetail = data => {
 	return https.get('/goods/detail', data)
 }
 
-// =====================  B 端 ========================
+
+export const getPlantCg = async data => {
+	return https.get("/plant-cg/list", data);
+};
+
+export const getPlantCgDetail = async data => {
+	return https.get("/plant-cg/detail", data);
+};
 
 /** *
  * 获取分类的商品 b