ソースを参照

散客门店切换等

shish 4 年 前
コミット
4c61546045

+ 2 - 1
ghsApp/src/admin/billing/index.vue

@@ -36,6 +36,7 @@
 							<view style="height: 160rpx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
 								<Commondity v-if="classItem.isActive"
 									:offVerifyRepertory="true"
+									:pageType="pageType"
 									:info="productItem"
 									:bigCount="getSelectItemById(productItem.id, classItem.classId).bigCount"
 									:smallCount="getSelectItemById(productItem.id, classItem.classId).smallCount"
@@ -97,7 +98,7 @@ import ModalModule from "@/components/plugin/modal";
 import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/product";
 export default {
-	name: "Billing",//开单
+	name: "Billing",
 	components: {
 		AppTabs,
 		AppSearchModule,

+ 1 - 1
ghsApp/src/admin/billing/priceChange.vue

@@ -36,7 +36,7 @@ import { COMMODITY_TYPE } from "@/utils/declare";
 import productMins from "@/mixins/productContrapose";
 
 export default {
-  name: "Billing", // 开单
+  name: "Billing",
   components: {
     AppTabs,
     AppSearchModule,

+ 1 - 1
ghsApp/src/admin/custom/selectCustom.vue

@@ -2,7 +2,7 @@
   <div class="app-main app-content">
     <view class="input-wrap_box">
       <view>
-        <AppSearchModule placeholder="输入字母搜索客户" @input="searchFn"/>
+        <AppSearchModule placeholder="输入字母搜索,如米加加输mjj" @input="searchFn"/>
       </view>
     </view>
     <block v-if="!$util.isEmpty(list.data)">

+ 4 - 0
ghsApp/src/admin/home/me.vue

@@ -130,6 +130,10 @@
               <div class="tui-title">新手教程</div>
             </tui-list-cell>
 
+            <tui-list-cell @click="pageTo({ url: '/admin/shop/sk' })" class="line-cell" :hover="false" :arrow="true">
+              <div class="tui-title">散客门店</div>
+            </tui-list-cell>
+
             <tui-list-cell @click="getCustomService()" class="line-cell" :hover="false" :arrow="true">
               <div class="tui-title">联系客服</div>
             </tui-list-cell>

+ 1 - 1
ghsApp/src/admin/home/member.vue

@@ -2,7 +2,7 @@
   <div class="app-main app-content">
     <view class="input-wrap_box">
       <view>
-        <AppSearchModule placeholder="输入字母搜索客户" @input="searchFn"/>
+        <AppSearchModule placeholder="输入字母搜索,如米加加输mjj" @input="searchFn"/>
       </view>
     </view>
 

+ 20 - 11
ghsApp/src/admin/home/workbench.vue

@@ -117,13 +117,12 @@ export default {
 		AppAvatarModule,
     noneHd
 	},
-	// mixins:[priceSocket],
 	data() {
 		return {
 			constant: this.$constant,
-			// 遮罩层
 			renewMask: false,
 			getappIdList: {},
+			skCustomId:0,
 			data: {
 				admin: {},
 				asset: {},
@@ -135,7 +134,6 @@ export default {
 					expend:0.00
 				}
 			},
-			// 订单总览
 			orderData: [
 				{
 					name: "待付款",
@@ -165,7 +163,6 @@ export default {
 					}
 				}
 			],
-			// tab按钮
 			tabsData: [
 				{
 					name: "商城",
@@ -290,14 +287,26 @@ export default {
 	},
 	methods: {
 		skKd(){
-			if(this.myShopInfo.skCustomId && this.myShopInfo.skCustomId > 0){
-				this.$util.pageTo({url: '/admin/billing/index',query: {customId: this.myShopInfo.skCustomId,customName:'散客开单'}})
+			if((this.myShopInfo.skCustomId && this.myShopInfo.skCustomId > 0) || this.skCustomId > 0){
+				let currentId = 0;
+				if(this.skCustomId > 0){
+					currentId = this.skCustomId
+				}else{
+					currentId = this.myShopInfo.skCustomId
+				}
+				this.$util.pageTo({url: '/admin/billing/index',query: {customId: currentId,customName:'散客开单'}})
 			}else{
-				uni.showToast({
-					title: "您还没有开通,请联系客服",
-					icon: 'none',
-					mask: true,
-					duration: 3000,
+				let that = this
+				uni.showModal({
+					title: '提示',
+					content: '请设置散客开单门店',
+					cancelText: "取消",
+					confirmText: "好的",
+					success: function (res) {
+						if (res.confirm) {
+							that.$util.pageTo({url: '/admin/shop/sk'})
+						}
+					}
 				});
 			}
 		},

+ 1 - 2
ghsApp/src/admin/item/components/ItemStock.vue

@@ -10,12 +10,11 @@
 			<view class="num-open_bx">
 				<template>
 					<view class="open-bx">
-						库存 <text style="margin-left: 10rpx;font-size: 23rpx">{{ parseFloat(info.stock) }}</text>
+						库存 <text style="margin-left: 10rpx;font-size: 23rpx">{{ parseFloat(info.stock) }}</text> <text v-if="info.status ==2" style="margin-left:20rpx;font-size:23rpx">已下架</text>
 					</view>
 				</template>
 			</view>
 		</view>
-
 	</view>
 	<text class="bottom-button" @click.stop="goToStockDetail(info.id)">库存明细</text>
 	<text class="bottom-button" @click.stop="goToProduct(info.id)">分享</text>

+ 112 - 0
ghsApp/src/admin/shop/sk.vue

@@ -0,0 +1,112 @@
+<template>
+  <div class="app-content">
+    <div>
+      <form @submit="formSubmit" @reset="formReset">
+        <div class="module-com input-line-wrap">
+          <tui-list-cell class="line-cell" :arrow="true" @click="selectCustom">
+            <div class="tui-title">散客门店:</div>
+            <view>{{form.customName}}</view>
+          </tui-list-cell>
+        </div>
+        <div class="confirm-btn">
+          <button class="admin-button-com big blue" formType="submit">保存</button>
+        </div>
+      </form>
+    </div>
+  </div>
+</template>
+<script>
+import TuiListCell from "@/components/plugin/list-cell";
+import { skCustom,skCustomSet } from "@/api/shop";
+export default {
+  name: "sk",
+  components: {TuiListCell},
+  data() {
+    return {
+      form:{
+        customName:'',
+        customId:0
+      },
+      hasLoad:false
+    };
+  },
+  onLoad() {
+  },
+  onShow() {
+
+  },
+  methods: {
+    init(){
+      if(this.hasLoad){
+        return false
+      }
+      skCustom().then(res=>{
+        if(res.code == 1){
+          this.hasLoad = true
+          this.form.customName = res.data.custom.name
+          this.form.customId = res.data.custom.id
+          this.$forceUpdate()
+        }
+      })
+    },
+    selectCustom(){
+      this.$util.pageTo({ url: '/admin/custom/selectCustom',query: {style:2}})
+    },
+    formSubmit() {
+      let that = this
+      if(that.form.customId == 0 || that.$util.isEmpty(that.form.customId)){
+        that.$msg('请选择门店')
+        return false
+      }
+      skCustomSet({id:that.form.customId}).then(res=>{
+          if(res.code == 1){
+            that.$msg(res.msg)
+            setTimeout(function(){
+
+              let pages = getCurrentPages()
+              let prevPage = pages[ pages.length - 2 ]
+              prevPage.$vm.skCustomId = that.form.customId
+              uni.navigateBack({})
+
+            },1500)
+          }
+      })
+    }
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20px);
+  padding-top: 20px;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30px;
+  margin-bottom: 30px;
+}
+.module-com {
+  margin-bottom: 20px;
+  .member-wrap {
+    .member-det {
+      font-size: 24px;
+      margin-left: 20px;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240px;
+    }
+  }
+}
+// 按钮
+.confirm-btn {
+  width: calc(100% - 60px);
+  margin: 60px 30px 20px;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 8 - 0
ghsApp/src/api/shop/index.js

@@ -62,4 +62,12 @@ export const getPtGhsShop = data => {
 
 export const switchGhsShop = data => {
 	return https.get('/shop/switch-ghs-shop', data)
+}
+
+export const skCustom = data => {
+	return https.get('/shop/sk-custom', data)
+}
+
+export const skCustomSet = data => {
+	return https.get('/shop/sk-custom-set', data)
 }

+ 8 - 3
ghsApp/src/components/module/app-commodity.vue

@@ -95,6 +95,10 @@ export default {
 			type: Boolean,
 			default: false
 		},
+		pageType:{
+			type: String,
+			default: ''
+		}
 	},
 	data() {
 		return {
@@ -151,7 +155,7 @@ export default {
 			}
 		},
 		addEvents(variety) {
-			if(variety == 0){
+			if(variety == 0 || this.pageType != 'bill'){
 				const ratio = Number(this.info.ratio);
 				if(this.offVerifyRepertory){
 					if(this.info.stock<=0){
@@ -171,7 +175,7 @@ export default {
 			}
 		},
 		delEvent(variety) {
-			if(variety == 0){
+			if(variety == 0 || this.pageType != 'bill'){
 				this.animationFun('del');
 				this.$emit("del", this.info);				
 			}else{
@@ -197,7 +201,8 @@ export default {
 			this.isAlterMoney = true;
 		},
 		customNum(variety) {
-			if(variety == 0){
+			//不是小菊或者是小菊但不是在开单
+			if(variety == 0 || this.pageType != 'bill'){
 				if(this.offVerifyRepertory){
 					if(this.info.stock<=0){
 						uni.showToast({title:'库存不足',icon:'none'})

+ 2 - 1
ghsApp/src/pages.json

@@ -131,7 +131,8 @@
 				{"path": "list","style": {"navigationBarTitleText": "店铺管理"}},
 				{"path": "add","style": {"navigationBarTitleText": ""}},
 				{"path": "print","style": {"navigationBarTitleText": "云打印"}},
-				{"path": "changeShop","style": {"navigationBarTitleText": "切换门店"}}
+				{"path": "changeShop","style": {"navigationBarTitleText": "切换门店"}},
+				{"path": "sk","style": {"navigationBarTitleText": "散客门店"}}
 			]
 		},
 		{

+ 4 - 0
ghsApp/src/pagesPurchase/components/CommodityPurchase.vue

@@ -163,6 +163,10 @@ export default {
       font-weight: 700;
       color: #333333;
       padding-top: 10px;
+			overflow: hidden;
+			white-space: nowrap;
+			text-overflow: ellipsis;
+			width:380rpx;
     }
     & .kc {
       color: #ff2842;

+ 1 - 2
ghsApp/src/pagesStorehouse/allot/exSelect.vue

@@ -3,7 +3,7 @@
 		<view class="input-wrap">
 			<app-search-module
 				v-model="py"
-				placeholder="输入关键词,支持拼音首字母搜索"
+				placeholder="输入字母搜索,如艾莎 as"
 				@input="searchFn"
 			/>
 		</view>
@@ -33,7 +33,6 @@
 						</view>
 						<template v-for="(productItem, productIndex) in classItem.child">
 							<view style="height: 160rpx" :id="`class_${classItem.classId}_${productItem.id}`" :key="productIndex">
-
 							<Commondity v-if="classItem.isActive"
 								:key="productIndex"
 								:info="productItem"

+ 11 - 3
hdApp/src/admin/ghsProduct/components/buy-foot.vue

@@ -11,8 +11,8 @@
             </div>
         </div>
         <div class="btn-right">
-            <button v-if="stock == 0" class="button-com default">已售完</button>
-            <button v-else class="button-com red" @click="$msg('开发中')">立即购买</button>
+            <button v-if="isShare" class="button-com red" @click="$msg('开发中')">立即购买</button>
+            <button v-else class="button-com red" @click="goBack">返回</button>
         </div>
     </div>
 </template>
@@ -20,13 +20,21 @@
 <script>
 export default {
     name: 'buy-foot',
-    props:['stock'],
+    props:{
+        isShare:{
+			type:Boolean,
+			default: false
+		},
+    },
 	methods: {
 		buy() {
 			this.$emit('buy')
 		},
         goShop(){
             this.$emit('goShop')
+        },
+        goBack() {
+            uni.navigateBack();
         }
 	}
 }

+ 44 - 30
hdApp/src/admin/ghsProduct/detail.vue

@@ -23,20 +23,17 @@
           </app-tag>
         </button>
       </div>
+
+    </div>
       <div class="shop-express app-color-3">
-        <div>品质保证</div>
-        <div>
-          <span class="prompt-text">已售</span>
-          <span>{{ productInfo.actualSold }}</span>
-        </div>
-        <div>
-          <template >
-            <span class="prompt-text">剩余</span>
-            <span>{{ productInfo.stock }}</span>
-          </template>
-        </div>
+
+        <text>普通 {{parseFloat(productInfo.price)||0}}</text>
+        <text>青铜 {{parseFloat(productInfo.qtPrice)||0}}</text>
+        <text>白银 {{parseFloat(productInfo.byPrice)||0}}</text>
+        <text>黄金 {{parseFloat(productInfo.hjPrice)||0}}</text>
+        <text>钻石 {{parseFloat(productInfo.zsPrice)||0}}</text>
+
       </div>
-    </div>
     <!-- 商品详情 -->
 
     <div class="module-wrap shop-detail">
@@ -54,7 +51,7 @@
       </div>
     </div>
 
-    <buy-foot />
+    <buy-foot :isShare="isShare" />
     <app-share-mask :show="showShare" text="分享商品" @click="hideShare" />
   </div>
 </template>
@@ -69,7 +66,7 @@ import AppShareMask from "@/components/module/app-share-mask";
 import { share } from "@/mixins";
 import { mapGetters } from "vuex";
 import { getGhsProductDetail } from "@/api/product";
-import { ghsInfo } from "@/api/ghs/index";
+import { ghsInfo,getGhsDataApi } from "@/api/ghs/index";
 export default {
   name: "product-detail",
   mixins: [share],
@@ -88,7 +85,8 @@ export default {
       buyNum: 1,
       popupShow: false,
       loginShow: false,
-      showShare: false
+      showShare: false,
+      isShare:true
     };
   },
   onLoad(option) {},
@@ -102,11 +100,29 @@ export default {
 
         let ghsShopAdminId = this.option.ghsShopAdminId ? this.option.ghsShopAdminId : 0
 
-				ghsInfo({shopId: this.option.shopId}).then(res => {
+        if(this.option.ghsId){
+          this.isShare = false
+          getGhsDataApi({id: this.option.ghsId}).then(res => {
+
+            let shopId = res.data.shopId
+            let ghsId = this.option.ghsId
+            that.productDetail(ghsId,ghsShopAdminId,shopId)
+
+          }).catch(err => {})
 
-					let ghsId = res.data.id;
+        }else{
 
+          ghsInfo({shopId: this.option.shopId}).then(res => {
+            let ghsId = res.data.id;
+            let shopId = this.option.shopId
+            that.productDetail(ghsId,ghsShopAdminId,shopId)
+          }).catch(err => {})
 
+        }
+
+    },
+    productDetail(ghsId,ghsShopAdminId,shopId){
+          let that = this
           getGhsProductDetail({ id: this.option.id,ghsId:ghsId }).then(res => {
             if (!this.$util.isEmpty(res.data)){
 
@@ -124,14 +140,12 @@ export default {
                 title: title,
                 desc: res.data.price,
                 imgUrl: res.data.bigCover,
-                pagePath: `pagesPurchase/ghsProduct?hdShopAdminId=${that.loginInfo.shopAdminId}&ghsShopAdminId=${ghsShopAdminId}&shopId=${that.option.shopId}&id=0`
+                pagePath: `pagesPurchase/ghsProduct?hdShopAdminId=${that.loginInfo.shopAdminId}&ghsShopAdminId=${ghsShopAdminId}&shopId=${shopId}&id=0`
               };
               that.jweixinFn(shareParams);
 
             }
           })
-
-				}).catch(err => {})
     },
     // 更换数量
     changeNum(e) {
@@ -176,10 +190,9 @@ export default {
       }
     }
   }
-  // 公共模块
   .shop-intro {
     background: #fff;
-    padding: 30px 0 30px 30px;
+    padding: 30px 0 10px 30px;
     .tui-pro-titbox {
       margin: 30px 0 20px;
       @include disFlex(center, space-between);
@@ -203,17 +216,18 @@ export default {
         margin-right: 6px;
       }
     }
-    .shop-express {
-      padding-right: 30px;
-      @include disFlex(center, space-between);
-      .prompt-text {
-        margin-right: 4px;
-      }
-    }
+  }
+  .shop-express {
+    display: -webkit-flex;
+    display: flex;
+    -webkit-justify-content: space-between;
+    justify-content: space-between;
+    background:white;
+    color:rgb(5, 116, 5);
+    padding:0 22rpx 20rpx 22rpx;
   }
   .shop-desc {
     .module-det {
-      // padding: 24px;
       line-height: 48px;
     }
   }

+ 3 - 2
hdApp/src/pagesPurchase/ghsProduct.vue

@@ -289,8 +289,9 @@ export default {
 	      this.popupShow = false;
 	    },
 		showBigCover(item){
-			this.popupShow=true
-			this.infoData = item
+            this.$util.pageTo({url: "/admin/ghsProduct/detail",query: {id: item.id,ghsId:this.option.id}})
+			//this.popupShow=true
+			//this.infoData = item
 		},
 		init(){