|
@@ -4,6 +4,7 @@
|
|
|
<view class="contentWrapper">
|
|
|
<view class="title">成员管理</view>
|
|
|
<view class="list">
|
|
|
+ <uni-segmented-control :current="currentStatus" :values="status.map(item => item.label)" @clickItem="onClickItem" styleType="text" activeColor="#dd524d"></uni-segmented-control>
|
|
|
<uni-collapse>
|
|
|
<uni-collapse-item
|
|
|
v-for="member in memberList"
|
|
@@ -56,6 +57,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
memberList: [],
|
|
|
+ currentStatus: 0,
|
|
|
formData: {
|
|
|
member: "",
|
|
|
},
|
|
@@ -68,16 +70,33 @@ export default {
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState(["currentProject", "depUserTree"]),
|
|
|
+ status() {
|
|
|
+ let list= [
|
|
|
+ { value: 1, label: '售前' },
|
|
|
+ { value: 2, label: '执行' },
|
|
|
+ { value: 4, label: '研发' },
|
|
|
+ { value: 5, label: '运营' },
|
|
|
+ { value: 6, label: '质保' },
|
|
|
+ ]
|
|
|
+ return list.filter(item => this.currentProject.flow_id >= item.value)
|
|
|
+ }
|
|
|
},
|
|
|
onLoad() {
|
|
|
this.init();
|
|
|
},
|
|
|
methods: {
|
|
|
async init() {
|
|
|
- let res;
|
|
|
- res = await queryMember({ project_code_id: this.currentProject.id });
|
|
|
+ let flowId = this.status[this.currentStatus].value
|
|
|
+ let res = await queryMember({ project_code_id: this.currentProject.id, flow_id: flowId });
|
|
|
this.memberList = res.data;
|
|
|
},
|
|
|
+ async onClickItem(e){
|
|
|
+ if (this.currentStatus !== e.currentIndex) {
|
|
|
+ this.currentStatus = e.currentIndex
|
|
|
+ }
|
|
|
+ console.log(e.currentIndex)
|
|
|
+ this.init()
|
|
|
+ },
|
|
|
notManager(member) {
|
|
|
return (
|
|
|
member.user_id != this.currentProject.author &&
|
|
@@ -94,9 +113,11 @@ export default {
|
|
|
confirmColor: "#ff7875",
|
|
|
success: async (res) => {
|
|
|
if (res.confirm) {
|
|
|
+ let flowId = this.status[this.currentStatus].value
|
|
|
await deleteMember({
|
|
|
project_code_id: this.currentProject.id,
|
|
|
user_id: member.user_id,
|
|
|
+ flow_id: flowId
|
|
|
});
|
|
|
uni.showToast({
|
|
|
title: "删除成功",
|
|
@@ -118,9 +139,11 @@ export default {
|
|
|
this.$refs.form.validate(async (err) => {
|
|
|
if (!err) {
|
|
|
const member_id = this.formData.member.split("-")[1];
|
|
|
+ let flowId = this.status[this.currentStatus].value
|
|
|
let payload = {
|
|
|
project_code_id: this.currentProject.id,
|
|
|
user_id: Number(member_id),
|
|
|
+ flow_id: flowId
|
|
|
};
|
|
|
await addMember(payload);
|
|
|
uni.showToast({
|
|
@@ -195,5 +218,8 @@ export default {
|
|
|
.uni-collapse-item__title-text {
|
|
|
font-size: 16px;
|
|
|
}
|
|
|
+ .segmented-control {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|