区域代理清空

main
fengxinyhyl 8 months ago
parent ebd00fc8e7
commit 1f827846fb
  1. 13
      app/controller/admin/user/User.php
  2. 2
      public/system.html
  3. 9
      view/admin/src/views/user/list/index.vue

@ -466,12 +466,15 @@ class User extends BaseController
if (!$this->repository->exists($id)) if (!$this->repository->exists($id))
return app('json')->fail('数据不存在'); return app('json')->fail('数据不存在');
$where = array(); $where = array();
$where[] = array('agent_district_id' , '=', $agent_district_id); if($agent_district_id){
$where[] = array('uid' , '<>', $id); $where[] = array('agent_district_id' , '=', $agent_district_id);
$exist = $this->repository->getWhere($where); $where[] = array('uid' , '<>', $id);
if($exist){ $exist = $this->repository->getWhere($where);
return app('json')->fail('该代理已存在'); if($exist){
return app('json')->fail('该代理已存在');
}
} }
$this->repository->update($id, array('agent_district_id' => $agent_district_id, 'agent_district' => $agent_district)); $this->repository->update($id, array('agent_district_id' => $agent_district_id, 'agent_district' => $agent_district));
return \app('json')->success('修改成功'); return \app('json')->success('修改成功');
} }

File diff suppressed because one or more lines are too long

@ -481,11 +481,14 @@ export default {
methods: { methods: {
submitArea(){ submitArea(){
if(!this.selectedValue){ if(!this.selectedValue){
this.$message.warning('请选择区域'); var agent_district_id = 0;
return; var agent_district = '';
}else{
var agent_district_id = this.selectedValue[this.selectedValue.length-1];
var agent_district = this.regionText;
} }
setAreaApi(this.selectedUser.uid,{agent_district_id:this.selectedValue[this.selectedValue.length-1],agent_district:this.regionText}).then((res) => { setAreaApi(this.selectedUser.uid,{agent_district_id:agent_district_id,agent_district:agent_district}).then((res) => {
this.getList('') this.getList('')
this.areaDialogVisible = false; this.areaDialogVisible = false;
}).catch(({ message }) => { }).catch(({ message }) => {

Loading…
Cancel
Save