<template>
|
<view class="zhuanhuiApplication-wrap">
|
<!-- <view class="zhuanhuiApplication-main">
|
<view class="zhuanhuiApplication-main-inside">
|
<view>
|
<u-action-sheet :list="list" v-model="show"></u-action-sheet>
|
<u-button @click="show = true">打开ActionSheet</u-button>
|
</view>
|
<view class="liyou-box">
|
<view class="title">转会理由</view>
|
<textarea @blur="bindTextAreaBlur" auto-height placeholder="转会理由"/>
|
</view>
|
</view>
|
<button class="zhuanhuiButton" icon="success" type="warn">提交申请</button>
|
</view> -->
|
<view class="zhuanhuiApplication-main">
|
<view class="zhuanhuiApplication-main-inside">
|
<u-form :model="model" :rules="rules" ref="uForm">
|
<u-form-item :label-position="labelPosition" label="转入工会" prop="newName" label-width="150">
|
<u-input :border="border" type="select" :select-open="selectShow" v-model="model.newName"
|
placeholder="请选择工会" @click="selectShow = true"></u-input>
|
</u-form-item>
|
<u-form-item :label-position="labelPosition" label="简介" prop="content">
|
<u-input type="textarea" :border="border" placeholder="请填写转会理由" v-model="model.content" />
|
</u-form-item>
|
</u-form>
|
</view>
|
<view class="zhuanhui-btn-box">
|
<u-button plain hover-class="none" class="zhuanhuiButton" @click="submit">提交申请</u-button>
|
</view>
|
<u-select mode="single-column" value-name="id" label-name="name" :list="selectList" v-model="selectShow"
|
@confirm="selectConfirm"></u-select>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
model: {
|
newName: '',
|
newDeptId: '',
|
content: '',
|
},
|
rules: {
|
newName:[
|
{
|
required: true,
|
message: '请选择工会',
|
// 可以单个或者同时写两个触发验证方式
|
trigger: ['change','blur'],
|
},
|
],
|
content: [
|
{
|
required: true,
|
message: '请填写转会理由',
|
// 可以单个或者同时写两个触发验证方式
|
trigger: 'change',
|
},
|
]
|
},
|
border: false,
|
labelPosition: 'top',
|
selectList: [{
|
value: '电子产品',
|
label: '电子产品'
|
},
|
{
|
value: '服装',
|
label: '服装'
|
},
|
{
|
value: '工艺品',
|
label: '工艺品'
|
}
|
],
|
selectShow: false,
|
userInfo: '',
|
}
|
},
|
onReady() {
|
this.userInfo = this.getStore('userInfo')
|
console.log('this.userInfo----', this.userInfo)
|
this.findAll()
|
this.$refs.uForm.setRules(this.rules);
|
},
|
methods: {
|
findAll() {
|
this.$u.api.findAll().then(res => {
|
console.log(res)
|
this.selectList = res.obj
|
})
|
},
|
// actionSheetTap() {
|
// const that = this
|
// uni.showActionSheet({
|
// itemList: ['item1', 'item2', 'item3', 'item4'],
|
// success: (e) => {
|
// console.log(e.tapIndex);
|
// uni.showToast({
|
// title: "点击了第" + e.tapIndex + "个选项",
|
// icon: "none"
|
// })
|
// }
|
// })
|
// }
|
// 选择转入的工会
|
selectConfirm(e) {
|
console.log('e----====', e)
|
this.model.goodsType = '';
|
e.map((val, index) => {
|
this.model.newName += this.model.newName == '' ? val.label : '-' + val.label;
|
this.model.newDeptId += this.model.newDeptId == '' ? val.value : '-' + val.value;
|
console.log('this.model.newName---', this.model.newName)
|
})
|
},
|
submit() {
|
this.$u.toast('Hello uView!')
|
this.$refs.uForm.validate(valid => {
|
console.log(valid,'..........valid')
|
if(valid) {
|
let params = {
|
userId: this.userInfo.id,
|
deptId: this.userInfo.deptId,
|
newDeptId: this.model.newDeptId,
|
content: this.model.content
|
}
|
this.$u.api.save(params).then(res => {
|
console.log('res---',res.message)
|
uni.$emit('refeshList','测试一下')
|
this.$u.toast(res.message)
|
setTimeout(() => {
|
uni.navigateBack()
|
},1000)
|
|
// this.$u.toast('Hello uView!')
|
|
})
|
}
|
})
|
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
/deep/ .u-form{
|
padding: 40rpx;
|
}
|
/deep/ .u-hairline-border:after{
|
border:0px;
|
}
|
/deep/.uni-list,
|
.uni-list-item {
|
background-color: transparent;
|
}
|
|
/deep/ .uni-list--border-top {
|
background-color: transparent;
|
}
|
|
/deep/.uni-list-item__content-note {
|
margin-top: 12rpx;
|
}
|
/deep/ .u-btn--default{
|
border:0px!important;
|
color: #fff!important;
|
background-color: #ff3c2d!important;;
|
}
|
/deep/ .u-hairline-border::after{
|
border:0px!important;
|
}
|
/deep/ .u-size-default{
|
width: 100%;
|
border-radius: 120rpx;
|
}
|
page {
|
background-color: #f1f3f5;
|
}
|
|
.zhuanhuiApplication-main-inside {
|
display: flex;
|
flex-direction: column;
|
width: 92%;
|
margin: 30rpx auto;
|
background-color: #fff;
|
border-radius: 10rpx;
|
box-shadow: 0 0 20rpx rgba(72, 72, 72, 0.1);
|
}
|
|
.liyou-box {
|
padding: 20rpx 24rpx;
|
|
.title {
|
font-size: 22rpx;
|
color: #3b4144;
|
}
|
}
|
|
.textarea-placeholder {
|
margin-top: 12rpx;
|
color: #999;
|
font-size: 10px;
|
}
|
|
.zhuanhuiButton {
|
width: 314rpx;
|
height: 80rpx;
|
border-radius: 120rpx;
|
box-shadow: 0 0 10px rgba(255, 60, 45, 0.4);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
margin-top: 60rpx;
|
font-size: 30rpx;
|
background-color: #ff3c2d;
|
color: #fff;
|
}
|
.zhuanhui-btn-box{
|
width: 100%;
|
display: flex;
|
justify-content: center;
|
}
|
</style>
|