|
|
@@ -6,29 +6,29 @@
|
|
|
|
|
|
<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="flex-row input">
|
|
|
<text class="key">分组名称:</text>
|
|
|
- <u--input disabled v-model="form.groupName" placeholder="请输入分组名称" border="none"></u--input>
|
|
|
+ <u--input disabled v-model="form.name" placeholder="请输入分组名称" border="none"></u--input>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-form-item>
|
|
|
|
|
|
- <u-form-item prop="userInfo.sex" borderBottom>
|
|
|
+ <u-form-item prop="userName" borderBottom>
|
|
|
<view class="item">
|
|
|
<view class="flex-row input">
|
|
|
<text class="key">负责人:</text>
|
|
|
- <u--input disabled placeholder="请选择负责人" border="none"></u--input>
|
|
|
+ <u--input v-model="form.userName" disabled placeholder="请选择负责人" border="none"></u--input>
|
|
|
</view>
|
|
|
</view>
|
|
|
</u-form-item>
|
|
|
|
|
|
- <u-form-item prop="userInfo.sex" borderBottom>
|
|
|
+ <u-form-item borderBottom>
|
|
|
<view class="item">
|
|
|
- <view class="flex-row input" @click="openSelectMember">
|
|
|
- <text class="key">分组成员:</text>
|
|
|
- <u--input disabled placeholder="请选择分组成员" border="none"></u--input>
|
|
|
+ <view class="flex-row justify-between input" @click="openSelectMember">
|
|
|
+ <text class="key">选择分组成员</text>
|
|
|
+<!-- <u--input disabled placeholder="请选择分组成员" border="none"></u--input>-->
|
|
|
<u-icon name="arrow-right"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -41,13 +41,14 @@
|
|
|
<text>已选择的分组成员</text>
|
|
|
</view>
|
|
|
<scroll-view scroll-y class="scroll-y" >
|
|
|
- <view class="flex-row justify-between member" v-for="item in 10">
|
|
|
+ <view class="flex-row justify-between member" v-for="(item,index) in groupUserList">
|
|
|
<view class="flex-row">
|
|
|
<u-icon name="account-fill" size="24"></u-icon>
|
|
|
- <text class="name">张三</text>
|
|
|
+ <text class="name">{{item.userName}}</text>
|
|
|
+ <text class="name">{{item.userPhone}}</text>
|
|
|
</view>
|
|
|
<view>
|
|
|
- <u-icon name="trash" size="24"></u-icon>
|
|
|
+ <u-icon name="trash" size="24" @click="delItem(item,index)"></u-icon>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
@@ -55,7 +56,7 @@
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
- <view class="addGroup">
|
|
|
+ <view class="addGroup" @click="updateGroupUser">
|
|
|
<text>提交</text>
|
|
|
</view>
|
|
|
|
|
|
@@ -64,20 +65,23 @@
|
|
|
<view class="flex-row justify-around popupTitle">
|
|
|
<text @click="closePopup">取消</text>
|
|
|
<text>选择分组成员</text>
|
|
|
- <text>确定</text>
|
|
|
+ <text @click="getSelectPerson">确定</text>
|
|
|
</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 class="scroll-y-view" v-if="noGroupUserList.length>0">
|
|
|
+ <view class="flex-row justify-between member" v-for="(item,index) in noGroupUserList" :key="index" @click="selectItem(item,index)">
|
|
|
+ <view class="flex-row">
|
|
|
+ <text class="name">{{item.userName}}</text>
|
|
|
+ <text class="name">{{item.userPhone}}</text>
|
|
|
</view>
|
|
|
- </scroll-view>
|
|
|
+ <u-icon name="checkbox-mark" color="#FFE05C" size="24" v-if="item.select"></u-icon>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="dataNull" v-else>
|
|
|
+ <view>
|
|
|
+ <image :src="'/static/dataNull.png'"></image>
|
|
|
+ </view>
|
|
|
+ <text>暂无可选人员</text>
|
|
|
</view>
|
|
|
-
|
|
|
</view>
|
|
|
</uni-popup>
|
|
|
|
|
|
@@ -87,13 +91,18 @@
|
|
|
<script>
|
|
|
export default {
|
|
|
components: {
|
|
|
-
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ groupUserList:[],
|
|
|
+ noGroupUserList:[],
|
|
|
+
|
|
|
height: '',
|
|
|
form:{
|
|
|
- groupName:''
|
|
|
+ id:'',
|
|
|
+ name:'',
|
|
|
+ userId:'',
|
|
|
+ userName:''
|
|
|
},
|
|
|
rules: {
|
|
|
'groupName': {
|
|
|
@@ -107,10 +116,79 @@
|
|
|
}
|
|
|
},
|
|
|
onLoad(e) {
|
|
|
+
|
|
|
+ let item = JSON.parse(e.item)
|
|
|
+ this.form.id = item.id
|
|
|
+ this.form.name = item.name
|
|
|
+ this.form.userId = item.userId
|
|
|
+ this.form.userName = item.userName
|
|
|
+
|
|
|
+ this.getGroupUserList(item.id)
|
|
|
+ this.getNoGroupUserList()
|
|
|
+
|
|
|
let sysInfo = uni.getSystemInfoSync()
|
|
|
this.height = sysInfo.windowHeight - 120 + 'px' //除标题栏栏外的屏幕可用高度
|
|
|
},
|
|
|
methods: {
|
|
|
+
|
|
|
+ updateGroupUser(){
|
|
|
+ this.$api.service.updateGroupUser({
|
|
|
+ groupId:this.form.id,
|
|
|
+ list:this.groupUserList
|
|
|
+ }).then(res=>{
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'success',
|
|
|
+ title: '修改成功',
|
|
|
+ duration: 2000
|
|
|
+ });
|
|
|
+ setTimeout(()=>{{
|
|
|
+ this.back()
|
|
|
+ }},2000)
|
|
|
+ console.log('+++++updateGroupUser+++++++',res)
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ delItem(item,index){
|
|
|
+ item.select=false
|
|
|
+ this.noGroupUserList.push(item)
|
|
|
+ this.groupUserList.splice(index,1)
|
|
|
+ },
|
|
|
+
|
|
|
+ getSelectPerson(){
|
|
|
+ this.closePopup()
|
|
|
+ this.noGroupUserList = this.noGroupUserList.filter(item=>{
|
|
|
+ if (item.select){
|
|
|
+ this.groupUserList.push(item)
|
|
|
+ }
|
|
|
+ return !item.select
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ selectItem(item,index){
|
|
|
+ item.select = !item.select
|
|
|
+ this.$set(this.noGroupUserList,index,item)
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getNoGroupUserList(){
|
|
|
+ this.$api.service.getNoGroupUserList().then(res=>{
|
|
|
+ console.log(res.data)
|
|
|
+ this.noGroupUserList = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ getGroupUserList(id){
|
|
|
+ this.$api.service.getGroupUserList({
|
|
|
+ groupId:id
|
|
|
+ }).then(res=>{
|
|
|
+ console.log(res.data)
|
|
|
+ this.groupUserList = res.data.data
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
back() {
|
|
|
uni.navigateBack({
|
|
|
delta: 1
|