|
@@ -6,20 +6,20 @@
|
|
|
|
|
|
|
|
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
|
|
<u--form labelPosition="left" :model="form" :rules="rules" ref="uForm">
|
|
|
|
|
|
|
|
- <u-form-item prop="groupName" borderBottom>
|
|
|
|
|
|
|
+ <u-form-item prop="name" borderBottom>
|
|
|
<view class="item">
|
|
<view class="item">
|
|
|
<text class="key">分组名称</text>
|
|
<text class="key">分组名称</text>
|
|
|
<view class="flex-row input">
|
|
<view class="flex-row input">
|
|
|
- <u--input v-model="form.groupName" placeholder="请输入分组名称" border="none"></u--input>
|
|
|
|
|
|
|
+ <u--input v-model="form.name" placeholder="请输入分组名称" border="none"></u--input>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</u-form-item>
|
|
</u-form-item>
|
|
|
|
|
|
|
|
- <u-form-item prop="userInfo.sex" borderBottom>
|
|
|
|
|
|
|
+ <u-form-item prop="userName" borderBottom>
|
|
|
<view class="item">
|
|
<view class="item">
|
|
|
<text class="key">负责人</text>
|
|
<text class="key">负责人</text>
|
|
|
<view class="flex-row input" @click="openSelectPerson">
|
|
<view class="flex-row input" @click="openSelectPerson">
|
|
|
- <u--input disabled placeholder="请选择负责人" border="none"></u--input>
|
|
|
|
|
|
|
+ <u--input v-model="form.userName" disabled placeholder="请选择负责人" border="none"></u--input>
|
|
|
<u-icon name="arrow-right"></u-icon>
|
|
<u-icon name="arrow-right"></u-icon>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -27,7 +27,7 @@
|
|
|
</u--form>
|
|
</u--form>
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="addGroup">
|
|
|
|
|
|
|
+ <view class="addGroup" @click="addGroup">
|
|
|
<text>新增</text>
|
|
<text>新增</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
@@ -37,20 +37,12 @@
|
|
|
<view class="flex-row justify-around popupTitle">
|
|
<view class="flex-row justify-around popupTitle">
|
|
|
<text @click="closePopup('selectPersonPopup')">取消</text>
|
|
<text @click="closePopup('selectPersonPopup')">取消</text>
|
|
|
<text>选择分组负责人</text>
|
|
<text>选择分组负责人</text>
|
|
|
- <text>确定</text>
|
|
|
|
|
|
|
+ <text @click="getSelectPerson">确定</text>
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="scroll-y-view">
|
|
|
|
|
- <scroll-view scroll-y class="scroll-y1" >
|
|
|
|
|
- <view class="flex-row justify-between member" v-for="item in 10">
|
|
|
|
|
- <view class="flex-row">
|
|
|
|
|
- <text class="name">张三</text>
|
|
|
|
|
- <text class="name">1736500000</text>
|
|
|
|
|
- </view>
|
|
|
|
|
- <u-icon name="checkbox-mark" color="#FFE05C" size="24"></u-icon>
|
|
|
|
|
- </view>
|
|
|
|
|
- </scroll-view>
|
|
|
|
|
|
|
+ <view class="scroll-y-view ">
|
|
|
|
|
+ <mescroll-item ref="MescrollItem" :i="0" :index="0" :height="height">
|
|
|
|
|
+ </mescroll-item>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</uni-popup>
|
|
</uni-popup>
|
|
|
|
|
|
|
@@ -58,30 +50,41 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
|
+ import MescrollItem from "./module/mescrollUni-item.vue";
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
-
|
|
|
|
|
|
|
+ MescrollItem
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
- height: '',
|
|
|
|
|
|
|
+ height: '650px',
|
|
|
form:{
|
|
form:{
|
|
|
- groupName:''
|
|
|
|
|
|
|
+ name:'',
|
|
|
|
|
+ userId:'',
|
|
|
|
|
+ userName:''
|
|
|
},
|
|
},
|
|
|
rules: {
|
|
rules: {
|
|
|
- 'groupName': {
|
|
|
|
|
|
|
+ 'name': {
|
|
|
type: 'string',
|
|
type: 'string',
|
|
|
required: true,
|
|
required: true,
|
|
|
min:1,
|
|
min:1,
|
|
|
message: '请输入分组名称',
|
|
message: '请输入分组名称',
|
|
|
trigger: ['blur', 'change']
|
|
trigger: ['blur', 'change']
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ 'userName': {
|
|
|
|
|
+ type: 'string',
|
|
|
|
|
+ required: true,
|
|
|
|
|
+ min:2,
|
|
|
|
|
+ message: '请选择分组负责人',
|
|
|
|
|
+ trigger: ['blur', 'change']
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onLoad(e) {
|
|
onLoad(e) {
|
|
|
let sysInfo = uni.getSystemInfoSync()
|
|
let sysInfo = uni.getSystemInfoSync()
|
|
|
- this.height = sysInfo.windowHeight - 120 + 'px' //除标题栏栏外的屏幕可用高度
|
|
|
|
|
|
|
+ this.height = sysInfo.screenWidth/750 * 650 + 'px' //除标题栏栏外的屏幕可用高度
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
back() {
|
|
back() {
|
|
@@ -94,8 +97,41 @@
|
|
|
openSelectPerson(){
|
|
openSelectPerson(){
|
|
|
this.$refs.selectPersonPopup.open()
|
|
this.$refs.selectPersonPopup.open()
|
|
|
},
|
|
},
|
|
|
- closePopup(name){
|
|
|
|
|
- this.$refs[name].close()
|
|
|
|
|
|
|
+ closePopup(){
|
|
|
|
|
+ this.$refs.selectPersonPopup.close()
|
|
|
|
|
+ },
|
|
|
|
|
+ getSelectPerson(){
|
|
|
|
|
+ let a = this.$refs.MescrollItem.getSelectPerson()
|
|
|
|
|
+ console.log('选择的负责人',a)
|
|
|
|
|
+ if (!a){
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'error',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '请选择负责人'
|
|
|
|
|
+ });
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.form.userId = a.id
|
|
|
|
|
+ this.form.username = a.name
|
|
|
|
|
+ this.$set(this.form,'userName', a.name)
|
|
|
|
|
+ this.closePopup()
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
|
|
+ addGroup(){
|
|
|
|
|
+ this.$refs.uForm.validate().then(res => {
|
|
|
|
|
+ this.$api.service.addGroup(this.form).then(res=>{
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ icon: 'success',
|
|
|
|
|
+ duration: 2000,
|
|
|
|
|
+ title: '新增成功'
|
|
|
|
|
+ });
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ this.back()
|
|
|
|
|
+ },2000)
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|