@@ -30,3 +30,165 @@ export function putObj(obj) { | |||
data: obj | |||
}) | |||
} | |||
// 代理商管理列表 | |||
export function getAgentList(query) { | |||
return request({ | |||
url: '/autoSR/zkagent/page', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//省市 | |||
export function getparentIdList(query) { | |||
return request({ | |||
url: '/autoSR/zksysarea/list', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//获取运营人员 | |||
export function getAllOperationsStaff(query) { | |||
return request({ | |||
url: '/admin/user/getAllOperationsStaff', | |||
method:'get' | |||
}) | |||
} | |||
//添加代理商 | |||
export function AddAgent(data) { | |||
return request({ | |||
url: '/autoSR/zkagent/save', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//删除代理商 | |||
export function delAgent(data) { | |||
return request({ | |||
url: '/autoSR/zkagent/del', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//更换管理账号 | |||
export function updateManagerPhone(data) { | |||
return request({ | |||
url: '/autoSR/zkagent/updateManagerPhone', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//编辑代理商 | |||
export function editorAgent(data) { | |||
return request({ | |||
url: '/autoSR/zkagent/update', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//公司管理列表 | |||
export function getcompanyList(query) { | |||
return request({ | |||
url: '/autoSR/zkorg/page', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//获取代理商 | |||
export function findMyAgent(query) { | |||
return request({ | |||
url: 'autoSR/zkagent/findMyAgent', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//获取运营人员列表 | |||
export function getAllOperationsStaffByAgent(query) { | |||
return request({ | |||
url: 'admin/user/getAllOperationsStaffByAgent', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//添加公司 | |||
export function AddaddOrg(data) { | |||
return request({ | |||
url: '/autoSR/zkorg/addOrg', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//删除公司 | |||
export function delOrg(data) { | |||
return request({ | |||
url: '/autoSR/zkorg/delOrg', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//公司更换运营人员 | |||
export function changeAccount(data) { | |||
return request({ | |||
url: '/autoSR/zkorg/updateManagerPhone', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//编辑公司获取公司信息 | |||
export function gitfindById(query) { | |||
return request({ | |||
url: '/autoSR/zkorg/findById', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//公司编辑 | |||
export function updateOrg(data) { | |||
return request({ | |||
url: '/autoSR/zkorg/updateOrg', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//设备批次列表 | |||
export function getequipmentbatch(query) { | |||
return request({ | |||
url: '/autoSR/zkequipmentbatch/page', | |||
method:'get', | |||
params:query | |||
}) | |||
} | |||
//绑定批次 | |||
export function insert(data) { | |||
return request({ | |||
url: '/autoSR/zkequipmentbatch/insert', | |||
method:'post', | |||
data | |||
}) | |||
} | |||
//修改批次 | |||
export function insertupdate(data) { | |||
return request({ | |||
url: '/autoSR/zkequipmentbatch/update', | |||
method:'post', | |||
data | |||
}) | |||
} |
@@ -7,16 +7,19 @@ | |||
<div class="label">合同结束日期:</div> | |||
<div> | |||
<el-date-picker | |||
v-model="value1" | |||
@change="confirmtime()" | |||
v-model="timelist" | |||
type="daterange" | |||
range-separator="至" | |||
range-separator="-" | |||
:default-time="['00:00:00', '23:59:59']" | |||
value-format="yyyy-MM-dd" | |||
start-placeholder="开始日期" | |||
end-placeholder="结束日期"> | |||
</el-date-picker> | |||
</div> | |||
<div class="label">服务状态:</div> | |||
<div> | |||
<el-select v-model="value" placeholder="请选择"> | |||
<el-select v-model="serviceStatus" placeholder="请选择"> | |||
<el-option | |||
v-for="item in options" | |||
:key="item.value" | |||
@@ -30,11 +33,11 @@ | |||
<div class="app-titel" style="margin-top: 15px"> | |||
<div class="label">代理商:</div> | |||
<div> | |||
<el-input v-model="value"></el-input> | |||
<el-input v-model="agentName"></el-input> | |||
</div> | |||
<div class="label">运营人员:</div> | |||
<div > | |||
<el-input v-model="value"></el-input> | |||
<el-input v-model="operationalName"></el-input> | |||
</div> | |||
</div> | |||
@@ -46,12 +49,11 @@ | |||
> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button style="background: #2671e2; color: #ffffff" | |||
>筛选</el-button | |||
<el-button @click="Screening()" style="background: #2671e2; color: #ffffff">筛选</el-button | |||
> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button>清空筛选条件</el-button> | |||
<el-button @click="Screeningofempty()">清空筛选条件</el-button> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -64,69 +66,72 @@ | |||
height="400" | |||
style="width: 100%"> | |||
<el-table-column | |||
prop="date" | |||
prop="agentName" | |||
label="代理商" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
prop="address" | |||
label="地址" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
prop="linkman" | |||
label="联系人信息" | |||
align="center"> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
prop="operationalName" | |||
label="运营人员" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
prop="managerPhone" | |||
label="管理员账号" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
prop="createTime" | |||
label="添加日期" | |||
align="center"> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
prop="contractStartDate" | |||
label="合同开始日期" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
prop="contractEndDate" | |||
label="合同结束日期" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
prop="residueTime" | |||
label="剩余天数" | |||
align="center"> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
label="服务状态" | |||
align="center"> | |||
<template slot-scope="scope"> | |||
<div v-if="scope.row.residueTime >0">在服务期内</div> | |||
<div v-if="scope.row.residueTime <0">过期</div> | |||
<div v-if="scope.row.residueTime ==0">过期</div> | |||
</template> | |||
</el-table-column> | |||
<!-- scope --> | |||
<el-table-column label="操作" align="center"> | |||
<template slot-scope=""> | |||
<div style="color: #2671E2;" @click="infoeditor()">编辑</div> | |||
<div style="color: #2671E2;" @click="inforeplace()">更换账号</div> | |||
<div style="color: #2671E2;" @click="toinifodelete()">删除</div> | |||
<template slot-scope="scope"> | |||
<div style="color: #2671E2;" @click="infoeditor(scope.row)">编辑</div> | |||
<div style="color: #2671E2;" @click="inforeplace(scope.row)">更换账号</div> | |||
<div style="color: #2671E2;" @click="toinifodelete(scope)">删除</div> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
@@ -135,48 +140,83 @@ | |||
@size-change="handleSizeChange" | |||
@current-change="handleCurrentChange" | |||
:current-page="currentPage4" | |||
:page-sizes="[100, 200, 300, 400]" | |||
:page-size="100" | |||
:page-sizes="[7, 14, 21, 28]" | |||
:page-size="7" | |||
layout="total, sizes, prev, pager, next, jumper" | |||
:total="400"> | |||
:total="total"> | |||
</el-pagination> | |||
</div> | |||
</div> | |||
<el-dialog title="新增代理" :visible.sync="dialogVisible" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form :model="addagentobj" label-position="labelPosition" :rules="rules" ref="addagentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="agentName"> | |||
<el-input v-model="addagentobj.agentName"></el-input> | |||
</el-form-item> | |||
<el-form-item label="合同起止日期:" prop="areaName"> | |||
<el-form-item label="合同起止日期:" prop="rulestimelist"> | |||
<el-date-picker | |||
v-model="value1" | |||
type="daterange" | |||
range-separator="至" | |||
start-placeholder="开始日期" | |||
end-placeholder="结束日期"> | |||
v-model="addagentobj.rulestimelist" | |||
@change="confirmtime2()" | |||
type="daterange" | |||
range-separator="-" | |||
:default-time="['00:00:00', '23:59:59']" | |||
:clearable="false" | |||
value-format="yyyy-MM-dd" | |||
start-placeholder="开始日期" | |||
end-placeholder="结束日期"> | |||
</el-date-picker> | |||
</el-form-item> | |||
<el-form-item label="联系人:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系人:" prop="linkman"> | |||
<el-input v-model="addagentobj.linkman"></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系手机:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系手机:" prop="linkmanPhone"> | |||
<el-input v-model="addagentobj.linkmanPhone"></el-input> | |||
</el-form-item> | |||
<el-form-item label="地区:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="省:" prop="provinceId"> | |||
<el-select v-model="addagentobj.provinceId" placeholder="请选择" @change='clickprovinceId()'> | |||
<el-option | |||
v-for="item in optionsparentId" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.id" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="市:" prop="cityId"> | |||
<el-select v-model="addagentobj.cityId" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionscityId" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.id" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="详细地址:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="详细地址:" prop="address"> | |||
<el-input v-model="addagentobj.address"></el-input> | |||
</el-form-item> | |||
<el-form-item label="运营人员:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="运营人员:" prop="operationalPeople"> | |||
<el-select v-model="addagentobj.operationalPeople" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsoperationalPeople" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.accountId" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="管理员账号:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="管理员账号:" prop="managerPhone"> | |||
<el-input v-model="addagentobj.managerPhone"></el-input> | |||
</el-form-item> | |||
<el-form-item label="密码:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="密码:" prop="managerPassword"> | |||
<el-input v-model="addagentobj.managerPassword"></el-input> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -185,34 +225,64 @@ | |||
</div> | |||
</el-dialog> | |||
<el-dialog title="编辑" :visible.sync="dialogVisible2" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-dialog title="编辑" :visible.sync="dialogVisible2" > | |||
<el-form :model="editoragentobj" label-position="labelPosition" :rules="editorrules" ref="editoragentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="agentName"> | |||
<el-input v-model="editoragentobj.agentName"></el-input> | |||
</el-form-item> | |||
<el-form-item label="合同起止日期:" prop="areaName"> | |||
<el-form-item label="合同起止日期:" prop="rulestimelist"> | |||
<el-date-picker | |||
v-model="value1" | |||
type="daterange" | |||
range-separator="至" | |||
start-placeholder="开始日期" | |||
end-placeholder="结束日期"> | |||
v-model="editoragentobj.rulestimelist" | |||
@change="confirmtime3()" | |||
type="daterange" | |||
range-separator="-" | |||
:default-time="['00:00:00', '23:59:59']" | |||
:clearable="false" | |||
value-format="yyyy-MM-dd" | |||
start-placeholder="开始日期" | |||
end-placeholder="结束日期"> | |||
</el-date-picker> | |||
</el-form-item> | |||
<el-form-item label="联系人:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系人:" prop="linkman"> | |||
<el-input v-model="editoragentobj.linkman"></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系手机:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系手机:" prop="linkmanPhone"> | |||
<el-input v-model="editoragentobj.linkmanPhone"></el-input> | |||
</el-form-item> | |||
<el-form-item label="省:" prop="provinceId"> | |||
<el-select v-model="editoragentobj.provinceId" placeholder="请选择" @change='clickprovinceId3()'> | |||
<el-option | |||
v-for="item in optionsparentId" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.id" > | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="地区:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="市:" prop="cityId"> | |||
<el-select v-model="editoragentobj.cityId" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionscityId" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.id" > | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="详细地址:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="详细地址:" prop="address"> | |||
<el-input v-model="editoragentobj.address"></el-input> | |||
</el-form-item> | |||
<el-form-item label="运营人员:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="运营人员:" prop="operationalPeople"> | |||
<el-select v-model="editoragentobj.operationalPeople" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsoperationalPeople" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.accountId" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -222,13 +292,14 @@ | |||
</el-dialog> | |||
<el-dialog title="更换账号" :visible.sync="dialogVisible3" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="管理员账号:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form :model="replaceagentobj" label-position="labelPosition" :rules="ruleser" ref="replaceagentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="管理员账号:" prop="managerPhone"> | |||
<el-input v-model="replaceagentobj.managerPhone"></el-input> | |||
</el-form-item> | |||
<el-form-item label="密码:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="密码:" prop="managerPassword"> | |||
<el-input v-model="replaceagentobj.managerPassword"></el-input> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -246,104 +317,305 @@ export default { | |||
return { | |||
options: [ | |||
{ | |||
value: "1", | |||
label: "全部", | |||
}, | |||
{ | |||
value: "2", | |||
value: "0", | |||
label: "服务器内", | |||
}, | |||
{ | |||
value: "3", | |||
label: "已失效", | |||
}, | |||
], | |||
currentPage4:4, | |||
value: "", | |||
input: "", | |||
tableData: [ | |||
{ | |||
date: "2016-05-03", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-02", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-04", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-01", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-08", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-06", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-07", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
value: "1", | |||
label: "已过期", | |||
}, | |||
], | |||
dialogVisible:false, | |||
dialogVisible2:false, | |||
dialogVisible3:false, | |||
ruleForm:{ | |||
areaName:'', | |||
provinceItem:[], | |||
}, | |||
timelist:'', | |||
tableData: [], | |||
currentPage4:1, | |||
total:0,//总条数 | |||
pageNum:1, | |||
pageSize:7, | |||
contractStartDate:'',//开始时间 | |||
contractEndDate:'',//结束时间 | |||
serviceStatus:'',//状态 | |||
agentName:'',//代理商名称 | |||
operationalName:'',//运营人员姓名 | |||
addagentobj:{ | |||
agentName:'',// 代理商名称 | |||
contractStartDate:'',// 合同开始时间 | |||
contractEndDate:'',// 合同结束时间 | |||
linkman:'',// 联系人 | |||
provinceId:'',// 省id | |||
cityId:'',// 市id | |||
address:'',// 详细地址 | |||
operationalPeople:'',// 运营人员id | |||
managerPhone:'',// 管理员账号 | |||
managerPassword:'',// 管理员账号密码 | |||
linkmanPhone:'',// 联系人手机号 | |||
rulestimelist:[] | |||
}, | |||
editoragentobj:{ | |||
id:'', | |||
agentName:'',// 代理商名称 | |||
contractStartDate:'',// 合同开始时间 | |||
contractEndDate:'',// 合同结束时间 | |||
linkman:'',// 联系人 | |||
provinceId:'',// 省id | |||
cityId:'',// 市id | |||
address:'',// 详细地址 | |||
operationalPeople:'',// 运营人员id | |||
linkmanPhone:'',// 联系人手机号 | |||
rulestimelist:[] | |||
}, | |||
rules:{ | |||
agentName: [ | |||
{ required: true, message: '请输入代理商名称', trigger: 'blur' }, | |||
], | |||
rulestimelist: [ | |||
{ required: true, message: '请选择时间', trigger: 'blur' }, | |||
], | |||
linkman: [ | |||
{ required: true, message: '请输入联系人名称', trigger: 'blur' }, | |||
], | |||
provinceId: [ | |||
{ required: true, message: '请输入选择省', trigger: 'blur' }, | |||
], | |||
cityId: [ | |||
{ required: true, message: '请输入选择市', trigger: 'blur' }, | |||
], | |||
address: [ | |||
{ required: true, message: '请输入详细地址', trigger: 'blur' }, | |||
], | |||
operationalPeople: [ | |||
{ required: true, message: '请选择运营人员', trigger: 'blur' }, | |||
], | |||
managerPhone: [ | |||
{ required: true, message: '请输入管理员账号', trigger: 'blur' }, | |||
], | |||
managerPassword: [ | |||
{ required: true, message: '请输入管理员账号密码', trigger: 'blur' }, | |||
], | |||
linkmanPhone: [ | |||
{ required: true, message: '请输入联系人手机号', trigger: 'blur' }, | |||
{ min: 11, max: 11, message: '请输入手机号', trigger: 'blur' } | |||
], | |||
}, | |||
editorrules:{ | |||
agentName: [ | |||
{ required: true, message: '请输入代理商名称', trigger: 'blur' }, | |||
], | |||
rulestimelist: [ | |||
{ required: true, message: '请选择时间', trigger: 'blur' }, | |||
], | |||
linkman: [ | |||
{ required: true, message: '请输入联系人名称', trigger: 'blur' }, | |||
], | |||
provinceId: [ | |||
{ required: true, message: '请输入选择省', trigger: 'blur' }, | |||
], | |||
cityId: [ | |||
{ required: true, message: '请输入选择市', trigger: 'blur' }, | |||
], | |||
address: [ | |||
{ required: true, message: '请输入详细地址', trigger: 'blur' }, | |||
], | |||
operationalPeople: [ | |||
{ required: true, message: '请选择运营人员', trigger: 'blur' }, | |||
], | |||
linkmanPhone: [ | |||
{ required: true, message: '请输入联系人手机号', trigger: 'blur' }, | |||
{ min: 11, max: 11, message: '请输入手机号', trigger: 'blur' } | |||
], | |||
}, | |||
optionsparentId:[],//省份列表 | |||
optionscityId:[],//市列表 | |||
optionsoperationalPeople:[],//运营人员列表 | |||
replaceagentobj:{ | |||
id:'', | |||
managerPhone:'', | |||
managerPassword:'' | |||
}, | |||
ruleser:{ | |||
managerPhone: [ | |||
{ required: true, message: '请输入管理员账号', trigger: 'blur' }, | |||
], | |||
managerPassword: [ | |||
{ required: true, message: '请输入管理员账号密码', trigger: 'blur' }, | |||
], | |||
} | |||
}; | |||
}, | |||
mounted() {}, | |||
mounted() { | |||
this.getAgentList() | |||
}, | |||
methods: { | |||
//更换 | |||
inforeplace(){ | |||
this.dialogVisible3=true | |||
}, | |||
//确认更换 | |||
replace(){ | |||
this.dialogVisible3=false | |||
confirmtime3(){ | |||
this.editoragentobj.contractStartDate=this.editoragentobj.rulestimelist[0]; | |||
this.editoragentobj.contractEndDate=this.editoragentobj.rulestimelist[1]; | |||
}, | |||
//编辑 | |||
infoeditor(){ | |||
this.dialogVisible2=true | |||
infoeditor(row){ | |||
this.getparentIdList() | |||
this.clickprovinceId2(row.provinceId) | |||
this.getAllOperationsStaff() | |||
this.editoragentobj.agentName=row.agentName;// 代理商名称 | |||
this.editoragentobj.contractStartDate=row.contractStartDate;// 合同开始时间 | |||
this.editoragentobj.contractEndDate=row.contractEndDate;// 合同结束时间 | |||
this.editoragentobj. linkman=row.linkman;// 联系人 | |||
this.editoragentobj. provinceId=row.provinceId;// 省id | |||
this.editoragentobj.cityId=row.cityId;// 市id | |||
this.editoragentobj.address=row.address;// 详细地址 | |||
this.editoragentobj. operationalPeople=row.operationalPeople;// 运营人员id | |||
this.editoragentobj.linkmanPhone=row.linkmanPhone;// 联系人手机号 | |||
this.editoragentobj.rulestimelist=[row.contractStartDate,row.contractEndDate]; | |||
this.editoragentobj.id=row.id; | |||
this.dialogVisible2=true; | |||
}, | |||
//获取市 | |||
clickprovinceId2(item){ | |||
this.$api.http.getparentIdList({ | |||
parentId: item | |||
}).then((res) => { | |||
this.optionscityId= res.data | |||
}); | |||
}, | |||
//选择省的时候请求市并清空市 | |||
clickprovinceId3(){ | |||
this.optionscityId=[]; | |||
this.editoragentobj.cityId=''; | |||
this.$api.http.getparentIdList({ | |||
parentId: this.editoragentobj.provinceId | |||
}).then((res) => { | |||
this.optionscityId= res.data | |||
}); | |||
}, | |||
//确认编辑 | |||
editor(){ | |||
this.dialogVisible2=false | |||
this.$refs.editoragentobj.validate((valid) => { | |||
if (valid) { | |||
this.$api.http.editorAgent(this.editoragentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible2=false; | |||
this.editoragentobj.contractStartDate=''; | |||
this.editoragentobj.contractEndDate=''; | |||
this.editoragentobj.id=''; | |||
this.$refs.editoragentobj.resetFields(); | |||
this.Screeningofempty() | |||
this.getAgentList() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
//获取运营人员 | |||
getAllOperationsStaff(){ | |||
this.optionsoperationalPeople=[]; | |||
this.$api.http.getAllOperationsStaff().then((res) => { | |||
this.optionsoperationalPeople= res.data | |||
}); | |||
}, | |||
//选择省的时候请求市并清空市 | |||
clickprovinceId(){ | |||
this.optionscityId=[]; | |||
this.addagentobj.cityId=''; | |||
this.$api.http.getparentIdList({ | |||
parentId: this.addagentobj.provinceId | |||
}).then((res) => { | |||
this.optionscityId= res.data | |||
}); | |||
}, | |||
//获取省 | |||
getparentIdList(){ | |||
this.optionsparentId=[]; | |||
this.$api.http.getparentIdList({ | |||
parentId: 0 | |||
}).then((res) => { | |||
this.optionsparentId= res.data | |||
}); | |||
}, | |||
//更换 | |||
inforeplace(row){ | |||
this.replaceagentobj.id=row.id; | |||
this.dialogVisible3=true; | |||
}, | |||
//确认更换 | |||
replace(){ | |||
this.$refs.replaceagentobj.validate((valid) => { | |||
if (valid) { | |||
this.$api.http.updateManagerPhone(this.replaceagentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible3=false; | |||
this.$refs.replaceagentobj.resetFields(); | |||
this.Screeningofempty() | |||
this.getAgentList() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
//新增 | |||
//新增 | |||
infoadd(){ | |||
this.dialogVisible=true | |||
this.dialogVisible=true; | |||
this.getparentIdList() | |||
this.getAllOperationsStaff() | |||
}, | |||
//新增时间选择 | |||
confirmtime2(){ | |||
this.addagentobj.contractStartDate=this.addagentobj.rulestimelist[0]; | |||
this.addagentobj.contractEndDate=this.addagentobj.rulestimelist[1]; | |||
}, | |||
//确认新增 | |||
add(){ | |||
this.dialogVisible=false | |||
this.$refs.addagentobj.validate((valid) => { | |||
if (valid) { | |||
this.$api.http.AddAgent(this.addagentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible=false; | |||
this.addagentobj.contractStartDate=''; | |||
this.addagentobj.contractEndDate=''; | |||
this.$refs.addagentobj.resetFields(); | |||
this.Screeningofempty() | |||
this.getAgentList() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
//删除 | |||
toinifodelete(){ | |||
toinifodelete(item){ | |||
this.$confirm('此操作将永久删除, 是否继续?', '提示', { | |||
confirmButtonText: '确定', | |||
cancelButtonText: '取消', | |||
type: 'warning' | |||
}).then(() => { | |||
this.$message({ | |||
type: 'success', | |||
message: '删除成功!' | |||
}); | |||
this.$api.http.delAgent({id:item.row.id}).then((res) => { | |||
if(res.code==0){ | |||
this.$message({ | |||
type: 'success', | |||
message: '删除成功!' | |||
}); | |||
this.Screeningofempty() | |||
this.getAgentList() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}) | |||
}).catch(() => { | |||
this.$message({ | |||
type: 'info', | |||
@@ -351,11 +623,51 @@ export default { | |||
}); | |||
}); | |||
}, | |||
//时间选择 | |||
confirmtime(){ | |||
console.log(this.timelist) | |||
this.contractStartDate=this.timelist[0]; | |||
this.contractEndDate=this.timelist[1]; | |||
}, | |||
//清空筛选 | |||
Screeningofempty(){ | |||
this.timelist=[]; | |||
this.contractStartDate=''; | |||
this.contractEndDate=''; | |||
this.serviceStatus=''; | |||
this.agentName=''; | |||
this.operationalName=''; | |||
this.getAgentList() | |||
}, | |||
//筛选 | |||
Screening(){ | |||
this.getAgentList() | |||
}, | |||
// 获取代理商 | |||
getAgentList() { | |||
this.tableData=[]; | |||
this.$api.http.getAgentList({ | |||
current: this.pageNum, | |||
size: this.pageSize, | |||
contractStartDate:this.contractStartDate, | |||
contractEndDate:this.contractEndDate, | |||
serviceStatus:this.serviceStatus, | |||
agentName:this.agentName, | |||
operationalName:this.operationalName | |||
}).then((res) => { | |||
console.log(res.data); | |||
this.tableData=res.data.records; | |||
this.total=res.data.total | |||
}); | |||
}, | |||
handleSizeChange(val) { | |||
console.log(`每页 ${val} 条`); | |||
this.pageSize=val; | |||
this.getAgentList() | |||
}, | |||
handleCurrentChange(val) { | |||
console.log(`当前页: ${val}`); | |||
this.pageNum=val; | |||
this.getAgentList() | |||
} | |||
}, | |||
}; | |||
@@ -4,17 +4,17 @@ | |||
<!-- 头 --> | |||
<div class="app-top"> | |||
<div class="app-titel" style="margin-top: 5px"> | |||
<div class="label">代理商:</div> | |||
<div> | |||
<el-input v-model="value"></el-input> | |||
<div v-if="orgType==0" class="label">代理商名称:</div> | |||
<div v-if="orgType==0"> | |||
<el-input v-model="operatorName"></el-input> | |||
</div> | |||
<div class="label">公司:</div> | |||
<div class="label">公司名称:</div> | |||
<div> | |||
<el-input v-model="value"></el-input> | |||
<el-input v-model="name"></el-input> | |||
</div> | |||
<div class="label">运营人员:</div> | |||
<div > | |||
<el-input v-model="value"></el-input> | |||
<div v-if="orgType==0" class="label">运营人员名称:</div> | |||
<div v-if="orgType==0"> | |||
<el-input v-model="operationStaffName"></el-input> | |||
</div> | |||
</div> | |||
@@ -26,12 +26,12 @@ | |||
> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button style="background: #2671e2; color: #ffffff" | |||
<el-button @click="Screening()" style="background: #2671e2; color: #ffffff" | |||
>筛选</el-button | |||
> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button>清空筛选条件</el-button> | |||
<el-button @click="Screeningofempty()">清空筛选条件</el-button> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -44,53 +44,56 @@ | |||
height="400" | |||
style="width: 100%"> | |||
<el-table-column | |||
prop="date" | |||
prop="name" | |||
label="公司名称" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
v-if="orgType==0" | |||
prop="operatorName" | |||
label="代理商" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
v-if="orgType==0" | |||
prop="operationStaffName" | |||
label="运营人员" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
prop="address" | |||
label="公司地址" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
label="管理员信息" | |||
label="联系人信息" | |||
align="center"> | |||
<template slot-scope="scope"> | |||
<p>{{scope.row.contactPerson}}:{{scope.row.contactNumber}}</p> | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
prop="managerPhone" | |||
label="管理员账号" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
prop="houseNum" | |||
label="服务期楼盘" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<!-- scope --> | |||
<el-table-column label="操作" align="center"> | |||
<template slot-scope=""> | |||
<div style="color: #2671E2;" @click="infoeditor()">编辑</div> | |||
<div style="color: #2671E2;" @click="inforeplace()">更换账号</div> | |||
<div style="color: #2671E2;" @click="toinifodelete()">删除</div> | |||
<template slot-scope="scope"> | |||
<div style="color: #2671E2;" @click="infoeditor(scope.row)">编辑</div> | |||
<div style="color: #2671E2;" @click="inforeplace(scope.row)">更换账号</div> | |||
<div style="color: #2671E2;" @click="toinifodelete(scope)">删除</div> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
@@ -99,42 +102,68 @@ | |||
@size-change="handleSizeChange" | |||
@current-change="handleCurrentChange" | |||
:current-page="currentPage4" | |||
:page-sizes="[100, 200, 300, 400]" | |||
:page-size="100" | |||
:page-sizes="[7, 14, 21, 28]" | |||
:page-size="7" | |||
layout="total, sizes, prev, pager, next, jumper" | |||
:total="400"> | |||
:total="total"> | |||
</el-pagination> | |||
</div> | |||
</div> | |||
<el-dialog title="新增代理" :visible.sync="dialogVisible" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-dialog title="新增公司" :visible.sync="dialogVisible" > | |||
<el-form :model="addagentobj" label-position="labelPosition" :rules="rules" ref="addagentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="agentId"> | |||
<el-select v-model="addagentobj.agentId" placeholder="请选择" @change='clickagentId()'> | |||
<el-option v-for="item in optionsagentId" :key="item.value" :label="item.agentName" :value="item.id" ></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="公司名称:" prop="name"> | |||
<el-input v-model="addagentobj.name"></el-input> | |||
</el-form-item> | |||
<el-form-item label="公司名称:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系人:" prop="contactPerson"> | |||
<el-input v-model="addagentobj.contactPerson"></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系人:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系手机:" prop="contactNumber"> | |||
<el-input v-model="addagentobj.contactNumber"></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系手机:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="省:" prop="provinceId"> | |||
<el-select v-model="addagentobj.provinceId" placeholder="请选择" @change='clickprovinceId()'> | |||
<el-option v-for="item in optionsparentId" :key="item.value" :label="item.name" :value="item.id" > </el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="地区:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="市:" prop="cityId"> | |||
<el-select v-model="addagentobj.cityId" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionscityId" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.id" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="详细地址:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="详细地址:" prop="address"> | |||
<el-input v-model="addagentobj.address"></el-input> | |||
</el-form-item> | |||
<el-form-item label="运营人员:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="运营人员:" prop="operationStaff"> | |||
<el-select v-model="addagentobj.operationStaff" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsoperationStaff" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.accountId" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="管理员账号:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="管理员账号:" prop="managerPhone"> | |||
<el-input v-model="addagentobj.managerPhone"></el-input> | |||
</el-form-item> | |||
<el-form-item label="密码:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="密码:" prop="managerPassword"> | |||
<el-input v-model="addagentobj.managerPassword"></el-input> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -143,28 +172,52 @@ | |||
</div> | |||
</el-dialog> | |||
<el-dialog title="编辑" :visible.sync="dialogVisible2" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form :model="editoragentobj" label-position="labelPosition" :rules="editorrules" ref="editoragentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="代理商名称:" prop="operator"> | |||
<el-select v-model="editoragentobj.operator" placeholder="请选择" @change='clickagentId22()'> | |||
<el-option v-for="item in optionsagentId" :key="item.value" :label="item.agentName" :value="item.id" ></el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="公司名称:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="公司名称:" prop="name"> | |||
<el-input v-model="editoragentobj.name"></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系人:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系人:" prop="contactPerson"> | |||
<el-input v-model="editoragentobj.contactPerson"></el-input> | |||
</el-form-item> | |||
<el-form-item label="联系手机:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="联系手机:" prop="contactNumber"> | |||
<el-input v-model="editoragentobj.contactNumber"></el-input> | |||
</el-form-item> | |||
<el-form-item label="地区:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="省:" prop="provinceId"> | |||
<el-select v-model="editoragentobj.provinceId" placeholder="请选择" @change='clickprovinceId3()'> | |||
<el-option v-for="item in optionsparentId" :key="item.value" :label="item.name" :value="item.id" > </el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="详细地址:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="市:" prop="cityId"> | |||
<el-select v-model="editoragentobj.cityId" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionscityId" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.id" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="运营人员:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="详细地址:" prop="address"> | |||
<el-input v-model="editoragentobj.address"></el-input> | |||
</el-form-item> | |||
<el-form-item label="运营人员:" prop="operationStaff"> | |||
<el-select v-model="editoragentobj.operationStaff" placeholder="请选择"> | |||
<el-option | |||
v-for="item in optionsoperationStaff" | |||
:key="item.value" | |||
:label="item.name" | |||
:value="item.accountId" | |||
> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -174,13 +227,13 @@ | |||
</el-dialog> | |||
<el-dialog title="更换账号" :visible.sync="dialogVisible3" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="管理员账号:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-dialog title="更换账号" :visible.sync="dialogVisible3" > | |||
<el-form :model="replaceagentobj" label-position="labelPosition" :rules="ruleser" ref="replaceagentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="管理员账号:" prop="managerPhone"> | |||
<el-input v-model="replaceagentobj.managerPhone"></el-input> | |||
</el-form-item> | |||
<el-form-item label="密码:" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="密码:" prop="managerPassword"> | |||
<el-input v-model="replaceagentobj.managerPassword"></el-input> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -196,106 +249,239 @@ | |||
export default { | |||
data() { | |||
return { | |||
options: [ | |||
{ | |||
value: "1", | |||
label: "全部", | |||
}, | |||
{ | |||
value: "2", | |||
label: "服务器内", | |||
}, | |||
{ | |||
value: "3", | |||
label: "已失效", | |||
}, | |||
], | |||
currentPage4:4, | |||
value: "", | |||
input: "", | |||
tableData: [ | |||
{ | |||
date: "2016-05-03", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-02", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-04", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-01", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-08", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-06", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-07", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
], | |||
addagentobj:{ | |||
agentId:'',// 代理商名称 | |||
name:'',// 公司名称 | |||
contactPerson:'',// 联系人 | |||
contactNumber:'',// 联系人手机号 | |||
provinceId:'',// 省id | |||
cityId:'',// 市id | |||
address:'',// 详细地址 | |||
operationStaff:'',// 运营人员id | |||
managerPhone:'',// 管理员账号 | |||
managerPassword:'',// 管理员账号密码 | |||
}, | |||
rules:{ | |||
agentId: [ | |||
{ required: true, message: '请选择代理商', trigger: 'blur' }, | |||
], | |||
name: [ | |||
{ required: true, message: '请输入公司名称', trigger: 'blur' }, | |||
], | |||
contactPerson: [ | |||
{ required: true, message: '请输入联系人名称', trigger: 'blur' }, | |||
], | |||
contactNumber: [ | |||
{ required: true, message: '请输入联系人手机号', trigger: 'blur' }, | |||
{ min: 11, max: 11, message: '请输入手机号', trigger: 'blur' } | |||
], | |||
provinceId: [ | |||
{ required: true, message: '请输入选择省', trigger: 'blur' }, | |||
], | |||
cityId: [ | |||
{ required: true, message: '请输入选择市', trigger: 'blur' }, | |||
], | |||
address: [ | |||
{ required: true, message: '请输入详细地址', trigger: 'blur' }, | |||
], | |||
operationStaff: [ | |||
{ required: true, message: '请选择运营人员', trigger: 'blur' }, | |||
], | |||
managerPhone: [ | |||
{ required: true, message: '请输入管理员账号', trigger: 'blur' }, | |||
], | |||
managerPassword: [ | |||
{ required: true, message: '请输入管理员账号密码', trigger: 'blur' }, | |||
], | |||
}, | |||
optionsparentId:[],//省份列表 | |||
optionscityId:[],//市列表 | |||
optionsagentId:[],//代理商列表 | |||
optionsoperationStaff:[],//运营人员列表 | |||
currentPage4:1, | |||
tableData: [], | |||
dialogVisible:false, | |||
dialogVisible2:false, | |||
dialogVisible3:false, | |||
ruleForm:{ | |||
areaName:'', | |||
provinceItem:[], | |||
}, | |||
currentPage4:1, | |||
operatorName:'',//代理商名称 | |||
operationStaffName:'',//运营人员名称 | |||
name:'',//公司名称 | |||
total:0,//总条数 | |||
pageNum:1, | |||
pageSize:7, | |||
orgType:'', | |||
replaceagentobj:{ | |||
id:'', | |||
managerPhone:'', | |||
managerPassword:'' | |||
}, | |||
ruleser:{ | |||
managerPhone: [ | |||
{ required: true, message: '请输入管理员账号', trigger: 'blur' }, | |||
], | |||
managerPassword: [ | |||
{ required: true, message: '请输入管理员账号密码', trigger: 'blur' }, | |||
], | |||
}, | |||
editoragentobj:{ | |||
id:'', | |||
operator:'',// 代理商名称 | |||
name:'',// 公司名称 | |||
contactPerson:'',// 联系人 | |||
contactNumber:'',// 联系人手机号 | |||
provinceId:'',// 省id | |||
cityId:'',// 市id | |||
address:'',// 详细地址 | |||
operationStaff:'',// 运营人员id | |||
}, | |||
editorrules:{ | |||
operator: [ | |||
{ required: true, message: '请选择代理商', trigger: 'blur' }, | |||
], | |||
name: [ | |||
{ required: true, message: '请输入公司名称', trigger: 'blur' }, | |||
], | |||
contactPerson: [ | |||
{ required: true, message: '请输入联系人名称', trigger: 'blur' }, | |||
], | |||
contactNumber: [ | |||
{ required: true, message: '请输入联系人手机号', trigger: 'blur' }, | |||
{ min: 11, max: 11, message: '请输入手机号', trigger: 'blur' } | |||
], | |||
provinceId: [ | |||
{ required: true, message: '请输入选择省', trigger: 'blur' }, | |||
], | |||
cityId: [ | |||
{ required: true, message: '请输入选择市', trigger: 'blur' }, | |||
], | |||
address: [ | |||
{ required: true, message: '请输入详细地址', trigger: 'blur' }, | |||
], | |||
operationStaff: [ | |||
{ required: true, message: '请选择运营人员', trigger: 'blur' }, | |||
], | |||
} | |||
}; | |||
}, | |||
mounted() {}, | |||
mounted() { | |||
this.orgType=localStorage.getItem('orgType') | |||
this.getcompanyList() | |||
}, | |||
methods: { | |||
//更换 | |||
inforeplace(){ | |||
this.dialogVisible3=true | |||
//编辑 | |||
infoeditor(row){ | |||
this.editoragentobj.id=row.id; | |||
this.$api.http.gitfindById({id:row.id}).then((res) => { | |||
this.editoragentobj.operator=res.data.operator; | |||
this.editoragentobj.name=res.data.name; | |||
this.editoragentobj.contactPerson=res.data.contactPerson; | |||
this.editoragentobj.contactNumber=res.data.contactNumber; | |||
this.editoragentobj.provinceId=res.data.provinceId; | |||
this.editoragentobj.cityId=res.data.cityId; | |||
this.editoragentobj.address=res.data.address; | |||
this.editoragentobj.operationStaff=res.data.operationStaff; | |||
}); | |||
this.findMyAgent() | |||
this.getparentIdList() | |||
this.clickprovinceId2(this.editoragentobj.provinceId) | |||
this.dialogVisible2=true; | |||
}, | |||
//确认更换 | |||
replace(){ | |||
this.dialogVisible3=false | |||
//获取市 | |||
clickprovinceId2(item){ | |||
this.$api.http.getparentIdList({ | |||
parentId: item | |||
}).then((res) => { | |||
this.optionscityId= res.data | |||
}); | |||
}, | |||
//编辑 | |||
infoeditor(){ | |||
this.dialogVisible2=true | |||
//选择省的时候请求市并清空市 | |||
clickprovinceId3(){ | |||
this.optionscityId=[]; | |||
this.editoragentobj.cityId=''; | |||
this.$api.http.getparentIdList({ | |||
parentId: this.editoragentobj.provinceId | |||
}).then((res) => { | |||
this.optionscityId= res.data | |||
}); | |||
}, | |||
//选择代理商获取运营人员列表并清空运营人员选择 | |||
clickagentId22(){ | |||
this.optionsoperationStaff=[]; | |||
this.editoragentobj.operationStaff=''; | |||
this.$api.http.getAllOperationsStaffByAgent({ | |||
agentId: this.editoragentobj.operator | |||
}).then((res) => { | |||
this.optionsoperationStaff= res.data | |||
}); | |||
}, | |||
//确认编辑 | |||
editor(){ | |||
this.dialogVisible2=false | |||
this.$refs.editoragentobj.validate((valid) => { | |||
if (valid) { | |||
this.$api.http.updateOrg(this.editoragentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible2=false; | |||
this.editoragentobj.id=''; | |||
this.$refs.editoragentobj.resetFields(); | |||
this.Screeningofempty() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
//新增 | |||
infoadd(){ | |||
this.dialogVisible=true | |||
//更换 | |||
inforeplace(row){ | |||
this.replaceagentobj.id=row.id; | |||
this.dialogVisible3=true; | |||
}, | |||
//确认新增 | |||
add(){ | |||
this.dialogVisible=false | |||
//确认更换 | |||
replace(){ | |||
this.$refs.replaceagentobj.validate((valid) => { | |||
if (valid) { | |||
this.$api.http.changeAccount(this.replaceagentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible3=false; | |||
this.$refs.replaceagentobj.resetFields(); | |||
this.Screeningofempty() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
//删除 | |||
toinifodelete(){ | |||
//删除 | |||
toinifodelete(item){ | |||
this.$confirm('此操作将永久删除, 是否继续?', '提示', { | |||
confirmButtonText: '确定', | |||
cancelButtonText: '取消', | |||
type: 'warning' | |||
}).then(() => { | |||
this.$message({ | |||
type: 'success', | |||
message: '删除成功!' | |||
}); | |||
this.$api.http.delOrg({id:item.row.id}).then((res) => { | |||
if(res.code==0){ | |||
this.$message({ | |||
type: 'success', | |||
message: '删除成功!' | |||
}); | |||
this.Screeningofempty() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}) | |||
}).catch(() => { | |||
this.$message({ | |||
type: 'info', | |||
@@ -303,12 +489,108 @@ export default { | |||
}); | |||
}); | |||
}, | |||
handleSizeChange(val) { | |||
console.log(`每页 ${val} 条`); | |||
}, | |||
handleCurrentChange(val) { | |||
console.log(`当前页: ${val}`); | |||
//新增 | |||
infoadd(){ | |||
this.findMyAgent() | |||
this.getparentIdList() | |||
this.dialogVisible=true; | |||
}, | |||
//选择代理商获取运营人员列表并清空运营人员选择 | |||
clickagentId(){ | |||
this.optionsoperationStaff=[]; | |||
this.addagentobj.operationStaff=''; | |||
this.$api.http.getAllOperationsStaffByAgent({ | |||
agentId: this.addagentobj.agentId | |||
}).then((res) => { | |||
this.optionsoperationStaff= res.data | |||
}); | |||
}, | |||
//获取代理商 | |||
findMyAgent(){ | |||
this.$api.http.findMyAgent({orgType:this.orgType}).then((res) => { | |||
console.log(res.data) | |||
this.optionsagentId= res.data | |||
}); | |||
}, | |||
//选择省的时候请求市并清空市 | |||
clickprovinceId(){ | |||
this.optionscityId=[]; | |||
this.addagentobj.cityId=''; | |||
this.$api.http.getparentIdList({ | |||
parentId: this.addagentobj.provinceId | |||
}).then((res) => { | |||
this.optionscityId= res.data | |||
}); | |||
}, | |||
//获取省 | |||
getparentIdList(){ | |||
this.optionsparentId=[]; | |||
this.$api.http.getparentIdList({ | |||
parentId: 0 | |||
}).then((res) => { | |||
this.optionsparentId= res.data | |||
}); | |||
}, | |||
//确认新增 | |||
add(){ | |||
this.$refs.addagentobj.validate((valid) => { | |||
if (valid) { | |||
this.addagentobj.pid=0; | |||
this.$api.http.AddaddOrg(this.addagentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible=false; | |||
this.$refs.addagentobj.resetFields(); | |||
this.Screeningofempty() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
//清空筛选 | |||
Screeningofempty(){ | |||
this.operatorName=''; | |||
this.operationStaffName=''; | |||
this.name=''; | |||
this.getcompanyList() | |||
}, | |||
//筛选 | |||
Screening(){ | |||
this.getcompanyList() | |||
}, | |||
// 获取列表 | |||
getcompanyList() { | |||
this.tableData=[]; | |||
let parmest={ | |||
current: this.pageNum, | |||
size: this.pageSize, | |||
operatorName:this.operatorName, | |||
operationStaffName:this.operationStaffName, | |||
name:this.name, | |||
} | |||
this.$api.http.getcompanyList(parmest).then((res) => { | |||
console.log(res.data); | |||
this.tableData=res.data.records; | |||
this.total=res.data.total | |||
}); | |||
}, | |||
handleSizeChange(val) { | |||
this.pageSize=val; | |||
this.getcompanyList() | |||
}, | |||
handleCurrentChange(val) { | |||
this.pageNum=val; | |||
this.getcompanyList() | |||
}, | |||
}, | |||
}; | |||
</script> | |||
@@ -6,15 +6,14 @@ | |||
<div class="app-titel" style="margin-top: 5px"> | |||
<div class="label">批次号:</div> | |||
<div> | |||
<el-input v-model="value"></el-input> | |||
<el-input v-model="batchId"></el-input> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button style="background: #2671e2; color: #ffffff" | |||
>筛选</el-button | |||
<el-button style="background: #2671e2; color: #ffffff" @click="Screening()">筛选</el-button | |||
> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button>清空筛选条件</el-button> | |||
<el-button @click="Screeningofempty()">清空筛选条件</el-button> | |||
</div> | |||
<div style="margin-left: 20px"> | |||
<el-button @click="editorinfo()" style="background: #2671e2; color: #ffffff" | |||
@@ -29,15 +28,10 @@ | |||
<el-table | |||
:data="tableData" | |||
stripe | |||
height="400" | |||
@selection-change="handleSelectionChange" | |||
height="500" | |||
style="width: 100%"> | |||
<el-table-column | |||
type="selection" | |||
width="55"> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
prop="batchId" | |||
label="批次号" | |||
align="center" | |||
> | |||
@@ -47,41 +41,43 @@ | |||
label="设备号" | |||
align="center" | |||
> | |||
<template slot-scope="scope"> | |||
<p>{{scope.row.deviceNoStart}}:{{scope.row.deviceNoEnd}}</p> | |||
</template> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
prop="realityEquipmentCount" | |||
label="应收设备数量" | |||
align="center"> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
prop="receivableEquipmentCount" | |||
label="实收设备数量" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="name" | |||
prop="acceptanceNum" | |||
label="已验收设备数量" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<el-table-column | |||
prop="address" | |||
prop="createTime" | |||
label="创建时间" | |||
align="center"> | |||
</el-table-column> | |||
<el-table-column | |||
prop="date" | |||
prop="remark" | |||
label="备注" | |||
align="center" | |||
> | |||
</el-table-column> | |||
<!-- scope --> | |||
<el-table-column label="操作" align="center"> | |||
<template slot-scope=""> | |||
<div style="color: #2671E2;">修改</div> | |||
<template slot-scope="scope"> | |||
<div style="color: #2671E2;" @click="clickbianji(scope.row)">修改</div> | |||
</template> | |||
</el-table-column> | |||
</el-table> | |||
@@ -90,30 +86,35 @@ | |||
@size-change="handleSizeChange" | |||
@current-change="handleCurrentChange" | |||
:current-page="currentPage4" | |||
:page-sizes="[100, 200, 300, 400]" | |||
:page-size="100" | |||
:page-sizes="[8, 16, 24, 32]" | |||
:page-size="4" | |||
layout="total, sizes, prev, pager, next, jumper" | |||
:total="400"> | |||
:total="total"> | |||
</el-pagination> | |||
</div> | |||
</div> | |||
<el-dialog title="绑定" :visible.sync="dialogVisible" > | |||
<el-form :model="ruleForm" label-position="labelPosition" ref="ruleForm" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="应收设备数量" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-dialog :title='isshow' :visible.sync="dialogVisible" > | |||
<el-form :model="addagentobj" label-position="labelPosition" :rules="rules" ref="addagentobj" label-width="140px" style="width:60%; margin: 0 auto;"> | |||
<el-form-item label="批次号" prop="batchId"> | |||
<el-input v-model="addagentobj.batchId"></el-input> | |||
</el-form-item> | |||
<el-form-item label="实收设备数量" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="应收设备数量" prop="realityEquipmentCount"> | |||
<el-input v-model="addagentobj.realityEquipmentCount"></el-input> | |||
</el-form-item> | |||
<el-form-item label="设备号开头" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="实收设备数量" prop="receivableEquipmentCount"> | |||
<el-input v-model="addagentobj.receivableEquipmentCount"></el-input> | |||
</el-form-item> | |||
<el-form-item label="设备号结尾" prop="areaName"> | |||
<el-input v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="设备号开头" prop="deviceNoStart"> | |||
<el-input v-model="addagentobj.deviceNoStart"></el-input> | |||
</el-form-item> | |||
<el-form-item label="备注:" prop="areaName"> | |||
<el-input type="textarea" v-model="ruleForm.areaName"></el-input> | |||
<el-form-item label="设备号结尾" prop="deviceNoEnd"> | |||
<el-input v-model="addagentobj.deviceNoEnd"></el-input> | |||
</el-form-item> | |||
<el-form-item label="备注:"> | |||
<el-input type="textarea" v-model="addagentobj.remark"></el-input> | |||
</el-form-item> | |||
</el-form> | |||
<div slot="footer" class="dialog-footer"> | |||
@@ -128,71 +129,133 @@ | |||
export default { | |||
data() { | |||
return { | |||
currentPage4:4, | |||
value: "", | |||
input: "", | |||
tableData: [ | |||
{ | |||
date: "2016-05-03", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-02", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-04", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-01", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-08", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-06", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
{ | |||
date: "2016-05-07", | |||
name: "王小虎", | |||
address: " 1518 弄", | |||
}, | |||
], | |||
multipleSelection:[], | |||
dialogVisible:false, | |||
ruleForm:{ | |||
areaName:'', | |||
provinceItem:[], | |||
}, | |||
batchId:'', | |||
tableData: [], | |||
currentPage4:1, | |||
addagentobj:{ | |||
id:'', | |||
batchId:'',// 批次号 | |||
realityEquipmentCount:'',// 应收数 | |||
receivableEquipmentCount:'',// 实收数 | |||
deviceNoStart:'',// 开头 | |||
deviceNoEnd:'',// 结尾 | |||
remark:''//备注 | |||
}, | |||
rules:{ | |||
batchId: [ | |||
{ required: true, message: '请输入批次号', trigger: 'blur' }, | |||
], | |||
realityEquipmentCount: [ | |||
{ required: true, message: '请输入应收设备数量', trigger: 'blur' }, | |||
], | |||
receivableEquipmentCount: [ | |||
{ required: true, message: '请输入实收设备数量', trigger: 'blur' }, | |||
], | |||
deviceNoStart: [ | |||
{ required: true, message: '请输入设备号开头', trigger: 'blur' }, | |||
], | |||
deviceNoEnd: [ | |||
{ required: true, message: '请输入设备号结尾', trigger: 'blur' }, | |||
], | |||
}, | |||
total:0,//总条数 | |||
pageNum:1, | |||
pageSize:8, | |||
isshow:'绑定' | |||
}; | |||
}, | |||
mounted() {}, | |||
mounted() { | |||
this.getcompanyList() | |||
}, | |||
methods: { | |||
//編輯 | |||
clickbianji(row){ | |||
this.addagentobj.id=row.id; | |||
this.addagentobj.batchId=row.batchId; | |||
this.addagentobj.realityEquipmentCount=row.realityEquipmentCount; | |||
this.addagentobj.receivableEquipmentCount=row.receivableEquipmentCount; | |||
this.addagentobj.deviceNoStart=row.deviceNoStart; | |||
this.addagentobj.deviceNoEnd=row.deviceNoEnd; | |||
this.addagentobj.remark=row.remark; | |||
this.isshow='编辑'; | |||
this.dialogVisible=true; | |||
}, | |||
//添加 | |||
editorinfo(){ | |||
this.isshow='绑定'; | |||
this.addagentobj.id=''; | |||
this.addagentobj.batchId=''; | |||
this.addagentobj.realityEquipmentCount=''; | |||
this.addagentobj.receivableEquipmentCount=''; | |||
this.addagentobj.deviceNoStart=''; | |||
this.addagentobj.deviceNoEnd=''; | |||
this.addagentobj.remark=''; | |||
this.dialogVisible=true; | |||
}, | |||
editor(){ | |||
this.dialogVisible=false; | |||
//确认添加 | |||
editor(){ | |||
this.$refs.addagentobj.validate((valid) => { | |||
if (valid) { | |||
if(this.isshow=='绑定'){ | |||
this.$api.http.insert(this.addagentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible=false; | |||
this.$refs.addagentobj.resetFields(); | |||
this.Screeningofempty() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
}else{ | |||
this.$api.http.insertupdate(this.addagentobj).then((res) => { | |||
if(res.code==0){ | |||
this.dialogVisible=false; | |||
this.$refs.addagentobj.resetFields(); | |||
this.Screeningofempty() | |||
}else{ | |||
this.$message.error(res.message); | |||
} | |||
}); | |||
} | |||
} else { | |||
return false; | |||
} | |||
}); | |||
}, | |||
handleSelectionChange(val) { | |||
this.multipleSelection = val; | |||
}, | |||
handleSizeChange(val) { | |||
console.log(`每页 ${val} 条`); | |||
//清空筛选 | |||
Screeningofempty(){ | |||
this.batchId=''; | |||
this.getcompanyList() | |||
}, | |||
//筛选 | |||
Screening(){ | |||
this.getcompanyList() | |||
}, | |||
// 获取列表 | |||
getcompanyList() { | |||
this.tableData=[]; | |||
let parmest={ | |||
current: this.pageNum, | |||
size: this.pageSize, | |||
batchId:this.batchId | |||
} | |||
this.$api.http.getequipmentbatch(parmest).then((res) => { | |||
console.log(res.data); | |||
this.tableData=res.data.records; | |||
this.total=res.data.total | |||
}); | |||
}, | |||
handleSizeChange(val) { | |||
this.pageSize=val; | |||
this.getcompanyList() | |||
}, | |||
handleCurrentChange(val) { | |||
console.log(`当前页: ${val}`); | |||
} | |||
this.pageNum=val; | |||
this.getcompanyList() | |||
}, | |||
}, | |||
}; | |||
</script> | |||
@@ -202,7 +265,7 @@ export default { | |||
width: 100%; | |||
padding: 15px; | |||
min-width: 1200px; | |||
padding-bottom: 100px; | |||
padding-bottom: 40px; | |||
} | |||
.cen-tab{ | |||
width: 100%; | |||
@@ -3,6 +3,7 @@ | |||
* https://cli.vuejs.org/zh/config/ | |||
*/ | |||
// const url = 'http://pigx-gateway' | |||
const url = 'http://39.97.167.65:9999' //测试 | |||
// const url = 'http://192.168.31.160:9999' //长龙/ | |||
// const url = 'http://192.168.31.128:9999' //嘉豪 | |||