|
|
|
@ -222,6 +222,14 @@ |
|
|
|
|
<el-dialog v-if="visibleCoupon" title="优惠券列表" :visible.sync="visibleCoupon" width="1000px"> |
|
|
|
|
<coupon-List v-if="visibleCoupon" ref="couponList" :couponForm="couponForm" :checkedIds="checkedIds" :allCheck="allCheck" :userFrom="userFrom" @sendSuccess="sendSuccess" /> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog title="设置区域代理" :visible.sync="areaDialogVisible" width="30%"> |
|
|
|
|
<el-cascader @change="getAreaText" ref="tree" v-model="selectedValue" :props="props"></el-cascader> |
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="areaDialogVisible = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" @click="submitArea">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -250,7 +258,9 @@ import { |
|
|
|
|
modifyUserPassword, |
|
|
|
|
changeMemberApi, |
|
|
|
|
createUserApi, |
|
|
|
|
giveMemberApi |
|
|
|
|
giveMemberApi, |
|
|
|
|
getArea, |
|
|
|
|
setAreaApi |
|
|
|
|
} from '@/api/user' |
|
|
|
|
import newsCategory from '@/components/newsCategory/index.vue' |
|
|
|
|
import userDetails from './userDetails' |
|
|
|
@ -265,6 +275,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
areaDialogVisible:false, |
|
|
|
|
moren: require("@/assets/images/f.png"), |
|
|
|
|
pickerOptions: { |
|
|
|
|
shortcuts: [{ |
|
|
|
@ -406,7 +417,59 @@ export default { |
|
|
|
|
昵称: '' |
|
|
|
|
}, |
|
|
|
|
allCheck: false, |
|
|
|
|
cancel_time: null |
|
|
|
|
cancel_time: null, |
|
|
|
|
props: { |
|
|
|
|
lazy: true, |
|
|
|
|
lazyLoad (node, resolve) { |
|
|
|
|
console.log(node) |
|
|
|
|
const { level } = node; |
|
|
|
|
if(level==0){ |
|
|
|
|
getArea(0).then(res=>{ |
|
|
|
|
|
|
|
|
|
let nodes=res.data.map(item=>{ |
|
|
|
|
return{ |
|
|
|
|
value:item.id, |
|
|
|
|
label:item.name, |
|
|
|
|
leaf:false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
resolve(nodes); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}else if(level==1){ |
|
|
|
|
getArea(node.value).then(res=>{ |
|
|
|
|
|
|
|
|
|
let nodes=res.data.map(item=>{ |
|
|
|
|
return{ |
|
|
|
|
value:item.id, |
|
|
|
|
label:item.name, |
|
|
|
|
leaf:false |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
resolve(nodes); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
}else if(level==2){ |
|
|
|
|
getArea(node.value).then(res=>{ |
|
|
|
|
|
|
|
|
|
let nodes=res.data.map(item=>{ |
|
|
|
|
return{ |
|
|
|
|
value:item.id, |
|
|
|
|
label:item.name, |
|
|
|
|
leaf:true |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
resolve(nodes); |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
selectedUser:{}, |
|
|
|
|
selectedValue:null, |
|
|
|
|
regionText:'' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -416,6 +479,25 @@ export default { |
|
|
|
|
this.getList('') |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
submitArea(){ |
|
|
|
|
if(!this.selectedValue){ |
|
|
|
|
this.$message.warning('请选择区域'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
setAreaApi(this.selectedUser.uid,{agent_district_id:this.selectedValue[this.selectedValue.length-1],agent_district:this.regionText}).then((res) => { |
|
|
|
|
this.getList('') |
|
|
|
|
this.areaDialogVisible = false; |
|
|
|
|
}).catch(({ message }) => { |
|
|
|
|
this.$message.error(message); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
getAreaText(val){ |
|
|
|
|
|
|
|
|
|
let data = this.$refs.tree.getCheckedNodes()[0].pathLabels.toString() |
|
|
|
|
|
|
|
|
|
this.regionText = data |
|
|
|
|
}, |
|
|
|
|
// 用户 |
|
|
|
|
onHandle(name) { |
|
|
|
|
this.chkName = this.chkName === name ? '' : name |
|
|
|
@ -646,7 +728,11 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 修改标签 |
|
|
|
|
setLabel(row) { |
|
|
|
|
this.$modalForm(changelabelApi(row.uid)).then(() => this.getList('')) |
|
|
|
|
this.selectedValue = null; |
|
|
|
|
this.selectedUser = row; |
|
|
|
|
|
|
|
|
|
this.areaDialogVisible = true; |
|
|
|
|
// this.$modalForm(changelabelApi(row.uid)).then(() => this.getList('')) |
|
|
|
|
}, |
|
|
|
|
// 编辑会员等级 |
|
|
|
|
setMember(row) { |
|
|
|
|