Browse Source

添加员工

shish 4 years ago
parent
commit
cbd0c44f18

+ 1 - 0
ghsApp/src/admin/clear/showBill.vue

@@ -26,6 +26,7 @@ export default {
 	methods: {
 	methods: {
 		showBill() {
 		showBill() {
 			let that = this
 			let that = this
+			console.log('admin/clear/info?id='+that.option.id)
 			uni.navigateToMiniProgram({
 			uni.navigateToMiniProgram({
 				//姜枫-2021.04.13
 				//姜枫-2021.04.13
 				appId: that.getAppIdList.hd.miniAppId,
 				appId: that.getAppIdList.hd.miniAppId,

+ 102 - 0
ghsApp/src/admin/custom/addStaff.vue

@@ -0,0 +1,102 @@
+<template>
+  <div class="app-content">
+    <div>
+      <form @submit="formSubmit">
+        <div class="module-com input-line-wrap">
+
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title required">手机号</div>
+              <input v-model="form.mobile" @focus="form.mobile=''" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="mobile" placeholder="手机号" />
+          </tui-list-cell>
+
+          <tui-list-cell class="line-cell" :hover="false">
+              <div class="tui-title required">确认手机号</div>
+              <input v-model="form.confirmMobile" @focus="form.confirmMobile=''" type="number" placeholder-class="phcolor" placeholder-style="color:#CCCCCC" class="tui-input" name="confirmMobile" placeholder="手机号" />
+          </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 { addStaff} from "@/api/custom";
+export default {
+  name: "addStaff",
+  components: {
+    TuiListCell
+  },
+  data() {
+    return {
+      form: {
+        mobile:'',
+        confirmMobile:''
+      }
+    };
+  },
+  methods: {
+    formSubmit(e) {
+      let formData = e.detail.value;
+      let mobile = formData.mobile
+      let confirmMobile = formData.confirmMobile
+      if(this.$util.isEmpty(mobile)){
+        this.$msg('请填写手机号')
+        return false
+      }
+      if(mobile != confirmMobile){
+        this.$msg('二次手机号不一致')
+        return false
+      }
+      let that = this
+      uni.showLoading({mask:true})
+      addStaff({id:this.option.id,mobile:mobile}).then(res=>{
+        uni.hideLoading()
+        if(res.code == 1){
+          that.$msg(res.msg)
+          setTimeout(function(){ uni.navigateBack() },1500)
+        }
+      })
+    },
+    init() {
+
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.app-content {
+  min-height: calc(100vh - 20upx);
+  padding-top: 20upx;
+}
+.prompt-text {
+  color: $fontColor3;
+  padding-left: 30upx;
+  margin-bottom: 30upx;
+}
+.module-com {
+  margin-bottom: 20upx;
+  .member-wrap {
+    .member-det {
+      font-size: 24upx;
+      margin-left: 20upx;
+    }
+  }
+  .remark-wrap {
+    align-items: flex-start;
+    .remark {
+      height: 240upx;
+    }
+  }
+}
+.confirm-btn {
+  width: calc(100% - 60upx);
+  margin: 60upx 30upx 20upx;
+  .admin-button-com {
+    width: 100%;
+  }
+}
+</style>

+ 4 - 0
ghsApp/src/api/custom/index.js

@@ -1,5 +1,9 @@
 import https from '@/plugins/luch-request_0.0.7/request'
 import https from '@/plugins/luch-request_0.0.7/request'
 
 
+export const addStaff = data => {
+	return https.post('/custom/add-staff', data)
+}
+
 /** *
 /** *
  * 修改欠款额度
  * 修改欠款额度
  */
  */

+ 10 - 10
ghsApp/src/components/module/shopSelect.vue

@@ -65,16 +65,16 @@ export default {
 		...mapGetters(["getMyShopInfo"])
 		...mapGetters(["getMyShopInfo"])
     },
     },
     mounted(){
     mounted(){
-        // this.shopList = []
-        // shopAll().then(res=>{
-        //     if(res.code == 1){
-        //         if (!this.$util.isEmpty(res.data)){
-		// 			res.data.forEach((i) => {
-		// 				this.shopList.push({id:i.id,name:i.shopName})
-		// 			})
-        //         }
-        //     }
-        // })
+        this.shopList = []
+        shopAll().then(res=>{
+            if(res.code == 1){
+                if (!this.$util.isEmpty(res.data)){
+					res.data.forEach((i) => {
+						this.shopList.push({id:i.id,name:i.shopName})
+					})
+                }
+            }
+        })
     },
     },
     methods:{
     methods:{
         switchCut(){
         switchCut(){

+ 2 - 1
ghsApp/src/pages.json

@@ -42,7 +42,8 @@
 				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
 				{"path": "selectCustom","style": {"navigationBarTitleText": "选择客户"}},
 				{"path": "levelSet","style": {"navigationBarTitleText": "客户等级标准"}},
 				{"path": "levelSet","style": {"navigationBarTitleText": "客户等级标准"}},
 				{"path": "visit","style": {"navigationBarTitleText": "今日访客"}},
 				{"path": "visit","style": {"navigationBarTitleText": "今日访客"}},
-				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动明细"}}
+				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动明细"}},
+				{"path": "addStaff","style": {"navigationBarTitleText": "帮客户添加员工"}}
 			]
 			]
 		},
 		},
 		{
 		{

+ 5 - 5
ghsApp/src/pagesClient/member/detail.vue

@@ -119,7 +119,7 @@ import AppAvatarModule from "@/components/module/app-avatar";
 import TuiListCell from '@/components/plugin/list-cell'
 import TuiListCell from '@/components/plugin/list-cell'
 import { share } from "@/mixins";
 import { share } from "@/mixins";
 import { getUserDet,debt} from "@/api/member";
 import { getUserDet,debt} from "@/api/member";
-import { updateDebtLimit,updateCustomBlack,changeDiscount,changeLevel} from "@/api/custom";
+import { updateDebtLimit,updateCustomBlack,changeDiscount} from "@/api/custom";
 export default {
 export default {
   name: "member-detail",
   name: "member-detail",
   components: {
   components: {
@@ -147,10 +147,10 @@ export default {
           }
           }
         },
         },
         {
         {
-          name: "等级设置",
+          name: "添加员工",
           img: `${this.$constant.imgUrl}/retail/member/tab-icon-1.png`,
           img: `${this.$constant.imgUrl}/retail/member/tab-icon-1.png`,
           funtion: () => {
           funtion: () => {
-            this.changeLevel()
+            this.addStaff()
           }
           }
         },
         },
         {
         {
@@ -176,8 +176,8 @@ export default {
     createOrder(){
     createOrder(){
       this.$util.pageTo({url: '/admin/billing/index',type:2,query: {customId: this.userInfo.id,customName:this.userInfo.name}})
       this.$util.pageTo({url: '/admin/billing/index',type:2,query: {customId: this.userInfo.id,customName:this.userInfo.name}})
     },
     },
-    changeLevel(){
-      this.$msg('开发中')
+    addStaff(){
+      this.$util.pageTo({url: '/admin/custom/addStaff?id='+this.userInfo.id})
     },
     },
 		navigate(latitude, longitude, address) {   
 		navigate(latitude, longitude, address) {   
 			// 将经纬度转换成Number
 			// 将经纬度转换成Number

+ 43 - 5
hdApp/src/admin/clear/info.vue

@@ -40,7 +40,7 @@
 				<view class="commodity-view">
 				<view class="commodity-view">
 					<view class="commodity-list">
 					<view class="commodity-list">
 						<view v-for="(s, idx) in detailInfo.orderList" :key="idx" class="commodity-item" >
 						<view v-for="(s, idx) in detailInfo.orderList" :key="idx" class="commodity-item" >
-							<view class="item-info" @click="pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})" >
+							<view class="item-info" @click="getDetail(s)" >
 								<view class="info-line">
 								<view class="info-line">
 									<text class="item-name">{{ s.orderSn }} 时间 {{s.addTime.substr(5,11)}}</text>
 									<text class="item-name">{{ s.orderSn }} 时间 {{s.addTime.substr(5,11)}}</text>
 									<text class="item-price">
 									<text class="item-price">
@@ -103,6 +103,7 @@
 import { getDetail,detail,cancel } from "@/api/clear/index";
 import { getDetail,detail,cancel } from "@/api/clear/index";
 import productMins from "@/mixins/product";
 import productMins from "@/mixins/product";
 import TuiListCell from "@/components/plugin/list-cell";
 import TuiListCell from "@/components/plugin/list-cell";
+import { mapGetters } from "vuex";
 export default {
 export default {
 	name: "info",
 	name: "info",
 	components: {
 	components: {
@@ -118,11 +119,46 @@ export default {
 				name: ""
 				name: ""
 			},
 			},
 			detailInfo: {},
 			detailInfo: {},
-			loading: false
+			loading: false,
+			notLogin:true
 		};
 		};
 	},
 	},
+	computed: {
+		...mapGetters(["getLoginInfo"])
+	},
+	watch: {
+		getLoginInfo: {
+			handler(newValue) {
+				if(!this.$util.isEmpty(newValue.admin) && newValue.admin.currentShopId > 0){
+					this.notLogin = false
+				}				
+			}
+		}
+	},
+	onLoad() {
+		if(this.$util.isEmpty(this.getLoginInfo.admin) || this.getLoginInfo.admin.currentShopId == 0){
+			this.notLogin = true
+		}
+	},
 	methods: {
 	methods: {
+		remindLogin(){
+			let that = this
+			this.$util.confirmModal({content:'您还没有登录,请先登录',okText:'去登录'},() => {
+				that.pageTo({url:'/admin/home/login'})
+			})
+		},
+		getDetail(s){
+			if(this.notLogin){
+				this.remindLogin()
+				return false
+			}
+			this.pageTo({url: '/pagesPurchase/purDetails',query: {id: s.id,}})
+		},
 		cancelFn(info){
 		cancelFn(info){
+			if(this.notLogin){
+				this.remindLogin()
+				return false
+			}
 			let that = this
 			let that = this
 			that.$util.confirmModal({content:'确认取消?'},() => {
 			that.$util.confirmModal({content:'确认取消?'},() => {
 				cancel({id:info.id}).then(res=>{
 				cancel({id:info.id}).then(res=>{
@@ -134,6 +170,10 @@ export default {
 			})
 			})
 		},
 		},
 		toClear(info){
 		toClear(info){
+			if(this.notLogin){
+				this.remindLogin()
+				return false
+			}
 			let that = this
 			let that = this
 			detail({ id:info.id }).then(res => {
 			detail({ id:info.id }).then(res => {
 				if(res.code == 1) {
 				if(res.code == 1) {
@@ -151,9 +191,7 @@ export default {
 			});
 			});
 		},
 		},
 		callUp(mobile) {
 		callUp(mobile) {
-			uni.makePhoneCall({
-				phoneNumber: mobile
-			});
+			uni.makePhoneCall({ phoneNumber: mobile })
 		},
 		},
 		init() {
 		init() {
 			let id = 0
 			let id = 0

+ 3 - 3
hdApp/src/admin/home/login.vue

@@ -17,7 +17,7 @@
 				<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 				<button class="admin-button-com small blue buttonText" @click="loginFun">登陆</button>
 				</view>
 				</view>
 				<!-- #ifdef MP-WEIXIN -->
 				<!-- #ifdef MP-WEIXIN -->
-				<view style="margin-top:35upx;">
+				<view style="margin-top:55upx;">
 				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;" 
 				<button class="admin-button-com small buttonText" style="background-color:#2BA245;border-color:#2BA245;color:white;" 
 				open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin">微信手机号一键登录</button>
 				open-type="getPhoneNumber" @getphonenumber="wxPhoneLogin">微信手机号一键登录</button>
 				</view>
 				</view>
@@ -27,7 +27,7 @@
 				<button class="admin-button-com small blue buttonText" @click="mobileLogin">本机号码一键登录</button>
 				<button class="admin-button-com small blue buttonText" @click="mobileLogin">本机号码一键登录</button>
 				</view>
 				</view>
 				<!-- #endif -->
 				<!-- #endif -->
-				<view style="color:#999999;font-size:25upx;margin-top:30upx;">
+				<view style="color:#999999;font-size:25upx;margin-top:50upx;">
 					<radio-group @change="agreeItem">
 					<radio-group @change="agreeItem">
 						<label>
 						<label>
 							<radio value="1" style="width:6upx;transform:scale(0.8)" />
 							<radio value="1" style="width:6upx;transform:scale(0.8)" />
@@ -368,7 +368,7 @@ export default {
     font-size: 30upx;
     font-size: 30upx;
   }
   }
   &>.experFrame{
   &>.experFrame{
-      margin-top: 90upx;
+      margin-top: 80upx;
       height: 50upx;
       height: 50upx;
       .experInput{
       .experInput{
         height: 80upx;
         height: 80upx;