mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-24 05:46:09 +08:00
优化代码
This commit is contained in:
parent
3b88d6faad
commit
58bd01f1e4
@ -82,4 +82,23 @@ export function saveRoomOwner(_that,_data){
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteOwner(_that,_data) {
|
||||||
|
return new Promise(function(reslove,reject){
|
||||||
|
_that.context.post({
|
||||||
|
url: url.deleteOwner,
|
||||||
|
data:_data,
|
||||||
|
success: function(res) {
|
||||||
|
reslove(res.data);
|
||||||
|
},
|
||||||
|
fail: function(e) {
|
||||||
|
wx.showToast({
|
||||||
|
title: "服务器异常了",
|
||||||
|
icon: 'none',
|
||||||
|
duration: 2000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@ -194,6 +194,7 @@ export default {
|
|||||||
queryOwners: baseUrl+"app/owner.queryOwners",
|
queryOwners: baseUrl+"app/owner.queryOwners",
|
||||||
queryOwnerAndMembers: baseUrl+"app/owner.queryOwnerAndMembers",
|
queryOwnerAndMembers: baseUrl+"app/owner.queryOwnerAndMembers",
|
||||||
saveRoomOwner: baseUrl+"app/owner.saveRoomOwner",
|
saveRoomOwner: baseUrl+"app/owner.saveRoomOwner",
|
||||||
|
deleteOwner: baseUrl + "app/owner.deleteOwner",
|
||||||
|
|
||||||
queryOwnerAccount: baseUrl+"app/account/queryOwnerAccount",
|
queryOwnerAccount: baseUrl+"app/account/queryOwnerAccount",
|
||||||
useIntegral: baseUrl+"app/integral.useIntegral",
|
useIntegral: baseUrl+"app/integral.useIntegral",
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
<view class="block__title">基本信息</view>
|
<view class="block__title">基本信息</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">姓名</view>
|
<view class="title">姓名</view>
|
||||||
<input v-model="name" placeholder="请输入成员名称"></input>
|
<input v-model="name" placeholder="必填,请输入成员名称"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">身份证</view>
|
<view class="title">身份证</view>
|
||||||
<input v-model="idCard" placeholder="请输入身份证"></input>
|
<input v-model="idCard" placeholder="选填,请输入身份证"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">性别</view>
|
<view class="title">性别</view>
|
||||||
@ -21,13 +21,13 @@
|
|||||||
<view class="title">人员类型</view>
|
<view class="title">人员类型</view>
|
||||||
<picker :value="typeCdIndex" :range="typeCds" range-key="name" @change="_changeTypeCd">
|
<picker :value="typeCdIndex" :range="typeCds" range-key="name" @change="_changeTypeCd">
|
||||||
<view class="picker">
|
<view class="picker">
|
||||||
{{typeCds[typeCdIndex].name}}
|
{{typeCdIndex == -1 ?'请选择':typeCds[typeCdIndex].name}}
|
||||||
</view>
|
</view>
|
||||||
</picker>
|
</picker>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">房屋</view>
|
<view class="title">房屋</view>
|
||||||
<input v-model="roomName" placeholder="请输入房屋楼栋-单元-房屋"></input>
|
<input v-model="roomName" placeholder="必填,请输入房屋楼栋-单元-房屋"></input>
|
||||||
</view>
|
</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">家庭住址</view>
|
<view class="title">家庭住址</view>
|
||||||
@ -37,7 +37,7 @@
|
|||||||
<view class="block__title">联系信息</view>
|
<view class="block__title">联系信息</view>
|
||||||
<view class="cu-form-group">
|
<view class="cu-form-group">
|
||||||
<view class="title">手机号</view>
|
<view class="title">手机号</view>
|
||||||
<input v-model="link" placeholder="请输入手机号(没有手机号随便写一个)"></input>
|
<input v-model="link" placeholder="必填,请输入手机号(没有手机号随便写一个)"></input>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="block__title">相关图片</view>
|
<view class="block__title">相关图片</view>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<view class="cu-form-group margin-top">
|
<view class="cu-form-group margin-top">
|
||||||
<textarea v-model="remark" placeholder="请输入备注"></textarea>
|
<textarea v-model="remark" placeholder="选填,请输入备注"></textarea>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="flex flex-direction margin-top margin-bottom">
|
<view class="flex flex-direction margin-top margin-bottom">
|
||||||
@ -92,8 +92,8 @@
|
|||||||
name: '其他'
|
name: '其他'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
typeCdIndex: 0,
|
typeCdIndex: -1,
|
||||||
ownerTypeCd: "1002",
|
ownerTypeCd: "",
|
||||||
idCard: "",
|
idCard: "",
|
||||||
address: "",
|
address: "",
|
||||||
roomName: "",
|
roomName: "",
|
||||||
@ -165,35 +165,6 @@
|
|||||||
}
|
}
|
||||||
uni.navigateBack()
|
uni.navigateBack()
|
||||||
})
|
})
|
||||||
// context.request({
|
|
||||||
// url: constant.url.saveOwner,
|
|
||||||
// header: context.getHeaders(),
|
|
||||||
// method: "POST",
|
|
||||||
// data: obj,
|
|
||||||
// success: function(res) {
|
|
||||||
// if (res.statusCode == 200 && res.data.code == 0) {
|
|
||||||
// uni.hideLoading();
|
|
||||||
// uni.navigateBack();
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// uni.hideLoading();
|
|
||||||
// uni.showToast({
|
|
||||||
// title: res.data.msg,
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// fail: function(e) {
|
|
||||||
// uni.hideLoading();
|
|
||||||
// uni.showToast({
|
|
||||||
// title: "服务器异常了",
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
},
|
},
|
||||||
_changeTypeCd: function(e) {
|
_changeTypeCd: function(e) {
|
||||||
this.typeCdIndex = e.detail.value;
|
this.typeCdIndex = e.detail.value;
|
||||||
|
|||||||
@ -21,10 +21,10 @@
|
|||||||
:key="index">
|
:key="index">
|
||||||
<view class="apply-title flex justify-between">
|
<view class="apply-title flex justify-between">
|
||||||
<view>
|
<view>
|
||||||
<text class="text-bold">{{item.name}}</text>
|
<text class="text-bold">{{item.name}}({{item.ownerTypeName}})</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="flex justify-start">
|
<view class="flex justify-start">
|
||||||
{{item.ownerTypeName}}
|
<button class="cu-btn sm bg-red " @click="_deleteOwnerMember(item)">删除</button>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="apply-content flex justify-start">
|
<view class="apply-content flex justify-start">
|
||||||
@ -56,12 +56,30 @@
|
|||||||
<view v-else>
|
<view v-else>
|
||||||
<no-data-page></no-data-page>
|
<no-data-page></no-data-page>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<view class="cu-modal" :class="delOwnerMemberFlag==true?'show':''">
|
||||||
|
<view class="cu-dialog">
|
||||||
|
<view class="cu-bar bg-white justify-end">
|
||||||
|
<view class="content">温馨提示</view>
|
||||||
|
<view class="action" @tap="_cancleCall()">
|
||||||
|
<text class="cuIcon-close text-red"></text>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="padding-xl">
|
||||||
|
您确认删除该成员?
|
||||||
|
</view>
|
||||||
|
<view class="cu-bar bg-white justify-end">
|
||||||
|
<view class="action margin-0 flex-sub solid-left" @tap="_cancleDeleteOwnerMember()">取消</view>
|
||||||
|
<view class="action margin-0 flex-sub text-green solid-left" @tap="_doDeleteOwnerMember()">确认</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import noDataPage from '../../components/no-data-page/no-data-page.vue';
|
import noDataPage from '../../components/no-data-page/no-data-page.vue';
|
||||||
import {queryOwnerAndMembers} from '../../api/owner/owner.js';
|
import {queryOwnerAndMembers,deleteOwner} from '../../api/owner/owner.js';
|
||||||
import conf from '../../conf/config.js';
|
import conf from '../../conf/config.js';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
@ -70,7 +88,9 @@
|
|||||||
ownerName:'',
|
ownerName:'',
|
||||||
link:'',
|
link:'',
|
||||||
owners:[],
|
owners:[],
|
||||||
noFace:''
|
noFace:'',
|
||||||
|
delOwnerMemberFlag:false,
|
||||||
|
curOwnerMember:{}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -95,6 +115,35 @@
|
|||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url:'/pages/owner/addOwner'
|
url:'/pages/owner/addOwner'
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
_deleteOwnerMember:function(item){
|
||||||
|
this.delOwnerMemberFlag = true;
|
||||||
|
this.curOwnerMember = item;
|
||||||
|
},
|
||||||
|
_cancleDeleteOwnerMember:function(item){
|
||||||
|
this.delOwnerMemberFlag = false;
|
||||||
|
},
|
||||||
|
_doDeleteOwnerMember:function(){
|
||||||
|
let that = this;
|
||||||
|
this.curOwnerMember.communityId = this.getCommunityId();
|
||||||
|
deleteOwner(this,this.curOwnerMember)
|
||||||
|
.then((_data)=>{
|
||||||
|
uni.showToast({
|
||||||
|
icon:'none',
|
||||||
|
title:_data.msg
|
||||||
|
});
|
||||||
|
if(_data.code != 0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
that._cancleDeleteOwnerMember();
|
||||||
|
that._queryOwner();
|
||||||
|
},(err)=>{
|
||||||
|
uni.showToast({
|
||||||
|
icon:'none',
|
||||||
|
title:err
|
||||||
|
});
|
||||||
|
that._cancleDeleteOwnerMember();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user