addcommiss.vue 2 KB
<template>
	<view class="container">
	<image src="../../static/beijing.png" class="background" mode=""></image>
		<view class="content">
			<!-- 内容 -->
			<view style="padding:15px;color:white;font-size:18px;font-weight:600;width:100%;background-color:#1F1F1F;">添加专员</view>
			<view style="width:100%;display: flex;padding: 10px;">
				<text style="color: white;font-weight: 600;">专员ID:</text>
				<view style="margin-left: 10px;">
					<input type="text" placeholder="请输入专员ID" style="color: white;" v-model="model.CommissionerUserId"/>
				</view>
			</view>
			<view style="width: 100%; margin-top: 20px;   font-weight: bold; color: #f8e2aa !important;display: flex;justify-content: space-between;">
				<text style="padding: 5px 0px 5px 20px;" @click="Exsit">取消</text>
				<text style="padding: 5px 20px 5px 0px;" @click="Submit">确定</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				model:{
					// 销售专员ID
					CommissionerUserId:0,
					// 销售经理ID
					ManagerUserId:0
				}
			}
		},
		onShow() {
		},
		methods:{
			// 取消返回上一级
			Exsit(){
				uni.navigateBack({
				})
			},
			// 提交
			Submit(){
				let jsonstorage=uni.getStorageSync('userinfo').data
				this.model.ManagerUserId=jsonstorage.id
				if(this.model.CommissionerUserId==0){
					uni.showToast({
						title:'请输入销售专员ID',
						icon:'none'
					})
				}else{
					this.API.BindingSpecialist(this.model).then(res=>{
						console.log('返回数据',res)
						if(res.data.code==200){
							uni.showToast({
								title:'添加专员成功',
								icon:'success'
							})
							uni.navigateBack({
							})
						}else {
							uni.showToast({
								title:res.data.message,
								icon:'none'
							})
						}
					})
				}
				
			}
		}
	}
</script>

<style>
	/* 背景图片 */
	.background {
		width: 100%;
		height: 100%;
		position: fixed;
		/* border-radius:50% 50% 0 0 ; */
		background-size: 100% 100%;
		z-index: -1;
	}
</style>