编辑客户,学校列表接口更换

dev
yujialong 3 years ago
parent 8f9faed1cc
commit b29874e06d
  1. 2
      src/utils/api.js
  2. 22
      src/views/customer/AddCustomer.vue
  3. 11
      src/views/customer/Dashboard.vue
  4. 2
      src/views/setting/Person.vue
  5. 2
      src/views/user/AddUser.vue

@ -38,7 +38,7 @@ export default {
queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`, queryCustomerIndustryClass: `${host}/liuwanr/customer/queryCustomerIndustryClass`,
queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`, queryCustomerIndustry: `${host}/liuwanr/customer/queryCustomerIndustry`,
queryPhone: `${host}/liuwanr/user/queryPhone`, queryPhone: `${host}/liuwanr/user/queryPhone`,
querySchoolData: `${host}/liuwanr/customer/querySchool`, querySchoolData: `${host3}/nakadai/school/querySchool`,
queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`, queryPlatform: `${host}/liuwanr/userInfo/queryPlatform`,
// 用户管理 // 用户管理

@ -71,8 +71,8 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="customerId" label="客户名称"> <el-form-item prop="schoolId" label="客户名称">
<el-select v-model="form.customerId" filterable clearable placeholder="请选择学校" @change="SchoolChange" @clear="clearSchool()"> <el-select v-model="form.schoolId" filterable clearable placeholder="请选择学校" @change="SchoolChange" @clear="clearSchool">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option> <el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -260,7 +260,6 @@ export default {
isDetail : Boolean(this.$route.query.show), isDetail : Boolean(this.$route.query.show),
customerData: [], customerData: [],
form: { form: {
customerId: '',
customerName: '', customerName: '',
countries: '中国', countries: '中国',
industryClassId: '', industryClassId: '',
@ -274,6 +273,7 @@ export default {
customerType: '', customerType: '',
expireDate: '', expireDate: '',
email: '', email: '',
schoolId: ''
}, },
rules: { rules: {
countries: [ countries: [
@ -302,7 +302,7 @@ export default {
trigger: 'blur' trigger: 'blur'
} }
], ],
customerId: [ schoolId: [
{ required: true, message: '请选择客户名称', trigger: 'change' } { required: true, message: '请选择客户名称', trigger: 'change' }
], ],
email: [ email: [
@ -376,7 +376,7 @@ export default {
}).then((res) => { }).then((res) => {
let customer = res.result.customer let customer = res.result.customer
this.form = { this.form = {
customerId: Number(this.customerId), schoolId: customer.schoolId,
countries: customer.countries, countries: customer.countries,
industryClassId: customer.industryClassId, industryClassId: customer.industryClassId,
industryId: customer.industryId, industryId: customer.industryId,
@ -423,8 +423,8 @@ export default {
provinceId: '', provinceId: '',
cityId: '' cityId: ''
} }
this.$get(this.api.querySchoolData,data).then(res => { this.$get(this.api.querySchoolData).then(res => {
this.schoolList = res.message this.schoolList = res.list
}).catch(res => {}); }).catch(res => {});
}, },
// //
@ -441,7 +441,7 @@ export default {
this.form.cityId = obj.cityId this.form.cityId = obj.cityId
this.$get(this.api.queryCustomerIsExists,{ this.$get(this.api.queryCustomerIsExists,{
schoolId: this.form.customerId schoolId: this.form.schoolId
}).then(res => { }).then(res => {
this.NoAdd = true this.NoAdd = true
}).catch(res => { }).catch(res => {
@ -479,7 +479,7 @@ export default {
if(this.NoAdd){ if(this.NoAdd){
let obj = {}; let obj = {};
obj = this.schoolList.find((item)=>{ obj = this.schoolList.find((item)=>{
return item.schoolId == this.form.customerId; return item.schoolId == this.form.schoolId;
}); });
this.form.customerName = obj.schoolName this.form.customerName = obj.schoolName
this.form.provinceId = obj.provinceId this.form.provinceId = obj.provinceId
@ -487,8 +487,8 @@ export default {
this.form.cityId = obj.cityId this.form.cityId = obj.cityId
let data = { let data = {
customerName: this.form.customerName, customerName: this.form.customerName,
customerId: this.form.customerId, customerId: this.customerId,
schoolId: this.form.customerId, schoolId: this.form.schoolId,
countries: this.form.countries, countries: this.form.countries,
industryClassId: this.form.industryClassId, industryClassId: this.form.industryClassId,
industryId: this.form.industryId, industryId: this.form.industryId,

@ -137,18 +137,17 @@ export default {
}, },
methods: { methods: {
getData() { getData() {
let data = { this.$post(this.api.queryCustomer,{
countries: this.form.countries, countries: this.form.countries,
provinceId: this.form.provinces, provinceId: this.form.provinces,
cityId: this.form.city, cityId: this.form.city,
searchContent: this.form.keyword, searchContent: this.form.keyword,
page: this.page, page: this.page,
size: this.pageSize size: this.pageSize
} }).then(res => {
this.$post(this.api.queryCustomer,data).then(res => {
this.listData = res.message.list this.listData = res.message.list
this.total = res.message.totalCount this.total = res.message.totalCount
}).catch(res => {}); }).catch(res => {})
}, },
initData(){ initData(){
this.page = 1 this.page = 1
@ -157,8 +156,8 @@ export default {
getProvince(){ getProvince(){
this.$get(this.api.queryProvince).then(res => { this.$get(this.api.queryProvince).then(res => {
this.provinceList = res.message this.provinceList = res.message
this.$store.commit("provinceData", { provinceList : this.provinceList}); this.$store.commit("provinceData", { provinceList : this.provinceList})
}).catch(res => {}); }).catch(res => {})
}, },
clearprovince(){ clearprovince(){
this.form.city = '' this.form.city = ''

@ -528,7 +528,7 @@ export default {
// //
getSchoolData(){ getSchoolData(){
this.$get(this.api.querySchoolData,{schoolName: '',provinceId: '',cityId: ''}).then(res => { this.$get(this.api.querySchoolData,{schoolName: '',provinceId: '',cityId: ''}).then(res => {
this.schoolList = res.message this.schoolList = res.list
}).catch(res => {}); }).catch(res => {});
}, },
async accountChange(){ async accountChange(){

@ -669,7 +669,7 @@ export default {
provinceId: '', provinceId: '',
cityId: '' cityId: ''
}).then(res => { }).then(res => {
this.schoolList = res.message this.schoolList = res.list
}).catch(res => {}); }).catch(res => {});
}, },
goback(){ goback(){

Loading…
Cancel
Save