dev_2022-05-11
yujialong 3 years ago
parent f4f63e54a6
commit be97ea823c
  1. 4
      src/setting.js
  2. 119
      src/utils/api.js
  3. 42
      src/views/course/AddCurriculum.vue
  4. 454
      src/views/customer/AddCustomer.vue
  5. 2
      src/views/customer/Order.vue
  6. 2
      src/views/join/index.vue
  7. 64
      src/views/order/AddOrder.vue
  8. 43
      src/views/parner/staff.vue

@ -9,9 +9,9 @@ let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}:9000/` let host = `${location.origin}:9000/`
if (isDev) { if (isDev) {
jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统 jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统
host = 'http://39.108.250.202:9000/' // host = 'http://39.108.250.202:9000/'
// host = 'http://192.168.31.151:9000/'// 榕 // host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.137:9000/'// 赓 host = 'http://192.168.31.137:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = "http://www.huorantech.cn/judgmentPoint/"; jumpPath = "http://www.huorantech.cn/judgmentPoint/";
} }

@ -2,14 +2,13 @@ import Setting from "@/setting";
const host = Setting.apiBaseURL const host = Setting.apiBaseURL
const uploadURL = Setting.uploadURL const uploadURL = Setting.uploadURL
const host1 = 'http://39.108.250.202:9000/'
export default { export default {
logins: `users/users/user/login`, //登录 logins: `users/users/user/login`, //登录
verification: `${host}users/users/user/captcha`,// 验证码图片 保留host verification: `${host}users/users/user/captcha`,// 验证码图片 保留host
bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机
sendPhoneOrEmailCode: `${host1}users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码
getUserRolesPermissionMenu: `users/user-role/getUserRolesPermissionMenu`, getUserRolesPermissionMenu: `users/user-role/getUserRolesPermissionMenu`,
staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板 staffTemplate: `http://www.huorantech.cn/template/%E6%89%B9%E9%87%8F%E5%AF%BC%E5%85%A5%E5%91%98%E5%B7%A5%E6%A8%A1%E6%9D%BF.xlsx`, // 后台账号模板
@ -18,14 +17,14 @@ export default {
checkWorkNumOrAccount: `occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号 checkWorkNumOrAccount: `occupationlab/architecture/checkWorkNumOrAccount`, // 新增/编辑学生前:校验学号或者学生账号
// 订单管理 // 订单管理
orderAdd: `${host1}nakadai/nakadai/order/add`,// 订单添加 orderAdd: `nakadai/nakadai/order/add`,// 订单添加
orderDelete: `${host1}nakadai/nakadai/order/delete`,// 删除定单 orderDelete: `nakadai/nakadai/order/delete`,// 删除定单
orderDetail: `${host1}nakadai/nakadai/order/get`,// 订单详情 orderDetail: `nakadai/nakadai/order/get`,// 订单详情
orderList: `${host1}nakadai/nakadai/order/list`,// 订单列表 orderList: `nakadai/nakadai/order/list`,// 订单列表
orderUpdate: `${host1}nakadai/nakadai/order/update`,// 订单更新 orderUpdate: `nakadai/nakadai/order/update`,// 订单更新
renew: `${host1}nakadai/nakadai/orderOther/renew`,// 续费信息管理-post renew: `nakadai/nakadai/orderOther/renew`,// 续费信息管理-post
ship: `${host1}nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
getOrderOtherTime: `${host1}nakadai/nakadai/orderOther/getOrderOtherTime`, getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`,
queryAccountIsExist: `liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在 queryAccountIsExist: `liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在
@ -35,7 +34,7 @@ export default {
addCustomer: `nakadai/nakadai/customer/addCustomer`, addCustomer: `nakadai/nakadai/customer/addCustomer`,
queryCustomer: `nakadai/nakadai/customer/queryCustomer`, queryCustomer: `nakadai/nakadai/customer/queryCustomer`,
queryCustomerDetails: `nakadai/nakadai/customer/queryCustomerDetails`, queryCustomerDetails: `nakadai/nakadai/customer/queryCustomerDetails`,
saveOrUpdate: `${host1}data/data/role/saveOrUpdate`, saveOrUpdate: `data/data/role/saveOrUpdate`,
doAssign: `data/data/permission/doAssign`, doAssign: `data/data/permission/doAssign`,
updateCustomerByRoleId: `nakadai/nakadai/customer/updateCustomerByRoleId`, updateCustomerByRoleId: `nakadai/nakadai/customer/updateCustomerByRoleId`,
checkEmailOrPhone: `nakadai/nakadai/customer/checkEmailOrPhone`, // 新增客户前:校验手机号或者邮箱 checkEmailOrPhone: `nakadai/nakadai/customer/checkEmailOrPhone`, // 新增客户前:校验手机号或者邮箱
@ -147,14 +146,14 @@ export default {
courseProfessionalClass: `nakadai/nakadai/subject/courseProfessionalClass`, //课程专业类 courseProfessionalClass: `nakadai/nakadai/subject/courseProfessionalClass`, //课程专业类
courseProfessional: `nakadai/nakadai/subject/courseProfessional`, //课程专业 courseProfessional: `nakadai/nakadai/subject/courseProfessional`, //课程专业
//课程管理 //课程管理
curriculumList: `${host1}nakadai/nakadai/curriculum/curriculumList`, //课程列表 curriculumList: `nakadai/nakadai/curriculum/curriculumList`, //课程列表
createCurriculum: `${host1}nakadai/nakadai/curriculum/createCurriculum`, //创建课程 createCurriculum: `nakadai/nakadai/curriculum/createCurriculum`, //创建课程
curriculumDetail: `${host1}nakadai/nakadai/curriculum/curriculumDetail`, //课程详情 curriculumDetail: `nakadai/nakadai/curriculum/curriculumDetail`, //课程详情
modifyCourse: `${host1}nakadai/nakadai/curriculum/modifyCourse`, //编辑课程 modifyCourse: `nakadai/nakadai/curriculum/modifyCourse`, //编辑课程
delCourse: `${host1}nakadai/nakadai/curriculum/delCourse`, //单个、批量删除课程 delCourse: `nakadai/nakadai/curriculum/delCourse`, //单个、批量删除课程
isShelves: `${host1}nakadai/nakadai/curriculum/isShelves`, //上下架课程 isShelves: `nakadai/nakadai/curriculum/isShelves`, //上下架课程
getInternalProjectBySystemId: `occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目 getInternalProjectBySystemId: `occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目
checkConfig: `${host1}nakadai/nakadai/curriculum/checkConfig`, checkConfig: `nakadai/nakadai/curriculum/checkConfig`,
// 课程章节管理 // 课程章节管理
addChapter: `nakadai/curriculum/chapter/addChapter`, //添加章节 addChapter: `nakadai/curriculum/chapter/addChapter`, //添加章节
editChapter: `nakadai/curriculum/chapter/editChapter`, //修改章节 editChapter: `nakadai/curriculum/chapter/editChapter`, //修改章节
@ -195,31 +194,31 @@ export default {
downloadFiles: `liuwanr/aliyun/downloadFiles`, //下载文件 downloadFiles: `liuwanr/aliyun/downloadFiles`, //下载文件
// 数据管理 // 数据管理
getIdQueryTable: `${host1}data/data/table/getIdQueryTable`, getIdQueryTable: `data/data/table/getIdQueryTable`,
getTableByClassification: `${host1}data/data/table/getTableByClassification`, getTableByClassification: `data/data/table/getTableByClassification`,
getTableByCondition: `${host1}data/data/table/getTableByCondition`, getTableByCondition: `data/data/table/getTableByCondition`,
originalList: `${host1}data/data/table/originalList`, originalList: `data/data/table/originalList`,
originalListById: `${host1}data/data/table/originalListById`, originalListById: `data/data/table/originalListById`,
saveCategory: `${host1}data/data/table/saveCategory`, saveCategory: `data/data/table/saveCategory`,
saveTable: `${host1}data/data/table/saveTable`, saveTable: `data/data/table/saveTable`,
updateCategory: `${host1}data/data/table/updateCategory`, updateCategory: `data/data/table/updateCategory`,
deleteCategory: `${host1}data/data/table/deleteCategory`, deleteCategory: `data/data/table/deleteCategory`,
deleteTable: `${host1}data/data/table/deleteTable`, deleteTable: `data/data/table/deleteTable`,
previewData: `${host1}data/data/preview`, previewData: `data/data/preview`,
staticPreview: `${host1}data/data/staticPreview`, staticPreview: `data/data/staticPreview`,
editTableName: `${host1}data/data/table/editTableName`, editTableName: `data/data/table/editTableName`,
updateTableCommit: `${host1}data/data/updateTableCommit`, updateTableCommit: `data/data/updateTableCommit`,
getLevel: `${host1}data/category/getLevel`, getLevel: `data/category/getLevel`,
getAllTableInfoByCategoryId: `${host1}data/data/product/getAllTableInfoByCategoryId`, getAllTableInfoByCategoryId: `data/data/product/getAllTableInfoByCategoryId`,
// 产品管理 // 产品管理
deleteProduct: `${host1}data/data/product/delete`, deleteProduct: `data/data/product/delete`,
findById: `${host1}data/data/product/findById`, findById: `data/data/product/findById`,
listByEntity: `${host1}data/data/product/listByEntity`, listByEntity: `data/data/product/listByEntity`,
saveProduct: `${host1}data/data/product/save`, saveProduct: `data/data/product/save`,
updateProduct: `${host1}data/data/product/update`, updateProduct: `data/data/product/update`,
saveRecord: `${host1}data/data/dataRecord/saveRecord`, saveRecord: `data/data/dataRecord/saveRecord`,
getAllTableIdBycategoryId: `${host1}data/data/product/getAllTableIdBycategoryId`, getAllTableIdBycategoryId: `data/data/product/getAllTableIdBycategoryId`,
// 关键词 // 关键词
addKeyword: `data/keyword/addKeyword`, addKeyword: `data/keyword/addKeyword`,
@ -240,13 +239,13 @@ export default {
exportFailure: `${host}nakadai/backstageStaff/exportFailure`, exportFailure: `${host}nakadai/backstageStaff/exportFailure`,
// 角色管理 // 角色管理
batchRemove: `${host1}users/role/batchRemove`, //批量删除角色 batchRemove: `users/role/batchRemove`, //批量删除角色
checkRoleIsExist: `${host1}users/role/checkRoleIsExist`, //判断该角色是否存在 checkRoleIsExist: `users/role/checkRoleIsExist`, //判断该角色是否存在
delRoleByAccountId: `${host1}users/role/delRoleByAccountId`, //删除某用户下的某个角色 delRoleByAccountId: `users/role/delRoleByAccountId`, //删除某用户下的某个角色
roleList: `${host1}users/role/list`, //角色分页列表查询 roleList: `users/role/list`, //角色分页列表查询
obtainDetails: `${host1}users/role/obtainDetails`, //获取角色详情 obtainDetails: `users/role/obtainDetails`, //获取角色详情
saveOrUpdate: `${host1}users/role/saveOrUpdate`, //新增或更新角色 saveOrUpdate: `users/role/saveOrUpdate`, //新增或更新角色
queryAllMenus: `${host1}users/users/permission/queryAllMenus`, //查询所有菜单 queryAllMenus: `users/users/permission/queryAllMenus`, //查询所有菜单
// 日志管理 // 日志管理
logAdd: `nakadai/log/add`, logAdd: `nakadai/log/add`,
@ -259,16 +258,16 @@ export default {
logWithdrawal: `nakadai/log/logWithdrawal`, logWithdrawal: `nakadai/log/logWithdrawal`,
// 合伙人 // 合伙人
deleteParner: `${host1}nakadai/partnerClassification/delete`, deleteParner: `nakadai/partnerClassification/delete`,
saveParner: `${host1}nakadai/partnerClassification/save`, saveParner: `nakadai/partnerClassification/save`,
listParner: `${host1}nakadai/partnerClassification/treeList`, listParner: `nakadai/partnerClassification/treeList`,
updateParner: `${host1}nakadai/partnerClassification/update`, updateParner: `nakadai/partnerClassification/update`,
delPartnerAccount: `${host1}nakadai/partnerAccount/delPartnerAccount`, delPartnerAccount: `nakadai/partnerAccount/delPartnerAccount`,
modifyPartnerAccount: `${host1}nakadai/partnerAccount/modifyPartnerAccount`, modifyPartnerAccount: `nakadai/partnerAccount/modifyPartnerAccount`,
partnerAccountDetail: `${host1}nakadai/partnerAccount/partnerAccountDetail`, partnerAccountDetail: `nakadai/partnerAccount/partnerAccountDetail`,
partnerAccountList: `${host1}nakadai/partnerAccount/partnerAccountList`, partnerAccountList: `nakadai/partnerAccount/partnerAccountList`,
savePartnerAccount: `${host1}nakadai/partnerAccount/savePartnerAccount`, savePartnerAccount: `nakadai/partnerAccount/savePartnerAccount`,
generateInvitationCode: `${host1}nakadai/partnerAccount/generateInvitationCode`, generateInvitationCode: `nakadai/partnerAccount/generateInvitationCode`,
generationQrCode: `${host1}nakadai/partnerAccount/generationQrCode `, generationQrCode: `nakadai/partnerAccount/generationQrCode `,
}; };

@ -127,6 +127,32 @@
</div> </div>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
<el-form-item label="小程序图标" prop="miniProgramPictureAddress">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-remove="handleRemoveMini"
:on-error="uploadError"
:on-success="uploadSuccessMini"
:before-remove="beforeRemove"
:limit="1"
:on-exceed="handleExceed"
:action="this.api.fileupload"
:headers="headers"
name="file"
>
<img v-if="form.miniProgramPictureAddress" :src="form.miniProgramPictureAddress" class="avatar">
<div class="uploader-default" v-else>
<i class="el-icon-plus"></i>
<p>上传封面</p>
</div>
<div slot="tip" class="el-upload__tip">
<p>只能上传jpg/png文件</p>
<p>课程封面图将按1:1显示最佳分辨率80*80</p>
</div>
</el-upload>
</el-form-item>
<el-form-item label="课程简介" prop="briefIntroduction"> <el-form-item label="课程简介" prop="briefIntroduction">
<el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入课程简介" <el-input type="textarea" :autosize="{ minRows: 4 }" placeholder="请输入课程简介"
v-model.trim="form.briefIntroduction"></el-input> v-model.trim="form.briefIntroduction"></el-input>
@ -302,6 +328,7 @@ export default {
professionalCategoryId: "", professionalCategoryId: "",
professionalId: "", professionalId: "",
coverUrl: "", coverUrl: "",
miniProgramPictureAddress: '',
expectedCourse: "", expectedCourse: "",
marketPrice: "", marketPrice: "",
briefIntroduction: "", briefIntroduction: "",
@ -453,6 +480,7 @@ export default {
} }
this.$nextTick(() => { this.$nextTick(() => {
this.form = data; this.form = data;
data.miniProgramPictureAddress || this.$set(this.form, 'miniProgramPictureAddress', '')
this.practiceData = data.practiceConfig; this.practiceData = data.practiceConfig;
this.assessmentData = data.assessmentConfig; this.assessmentData = data.assessmentConfig;
}); });
@ -525,13 +553,23 @@ export default {
return this.$confirm(`确定移除 ${file.name}`); return this.$confirm(`确定移除 ${file.name}`);
}, },
handleRemove(file, fileList) { // handleRemove(file, fileList) { //
let fileName = this.form.coverUrl.replace("https://liuwanr.oss-cn-shenzhen.aliyuncs.com/", ""); this.$del(`${this.api.fileDeletion}?keys=${this.form.coverUrl}`).then(res => {
this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
this.form.coverUrl = ""; this.form.coverUrl = "";
}).catch(err => { }).catch(err => {
}); });
}, },
uploadSuccessMini(res, file, fileList) { //
this.form.miniProgramPictureAddress = res.data.filesResult.fileUrl;
},
handleRemoveMini(file, fileList) { //
this.$del(`${this.api.fileDeletion}?keys=${this.form.miniProgramPictureAddress}`).then(res => {
this.form.miniProgramPictureAddress = "";
}).catch(err => {
});
},
handleConfig(type) { // handleConfig(type) { //
this.permissions = type; this.permissions = type;
this.configVisible = true; this.configVisible = true;

@ -2,7 +2,7 @@
<div> <div>
<el-card shadow="hover" class="mgb20"> <el-card shadow="hover" class="mgb20">
<div class="flex-between"> <div class="flex-between">
<div class="per_title" v-preventReClick @click="goback()"> <div class="per_title" v-preventReClick @click="goback(0)">
<i class="el-icon-arrow-left"></i> <i class="el-icon-arrow-left"></i>
<span class="per_back">返回</span> <span class="per_back">返回</span>
<span class="per_school" v-text="isDetail ? '查看客户信息' : (customerId ? '编辑客户信息' : '新增客户信息')"></span> <span class="per_school" v-text="isDetail ? '查看客户信息' : (customerId ? '编辑客户信息' : '新增客户信息')"></span>
@ -77,7 +77,7 @@
</el-col> </el-col>
</el-form> </el-form>
<div v-if="!isDetail" style="margin-top: 20px;text-align: center"> <div v-if="!isDetail" style="margin-top: 20px;text-align: center">
<el-button type="primary" v-preventReClick @click="saveAdd('form')">确定</el-button> <el-button type="primary" v-preventReClick @click="saveAdd">确定</el-button>
<el-button v-preventReClick @click="$router.back()">取消</el-button> <el-button v-preventReClick @click="$router.back()">取消</el-button>
</div> </div>
</div> </div>
@ -477,10 +477,18 @@ export default {
NoAdd: true, NoAdd: true,
phoneRepeat: false, phoneRepeat: false,
emailRepeat: false, emailRepeat: false,
submiting: false // submiting: false, //
updateTime: 0
}; };
}, },
watch: { watch: {
// ,
form: {
handler(){
this.updateTime++
},
deep:true
},
'form2.keyword': function(val) { 'form2.keyword': function(val) {
clearTimeout(this.searchTimer) clearTimeout(this.searchTimer)
this.searchTimer = setTimeout(() => { this.searchTimer = setTimeout(() => {
@ -739,226 +747,236 @@ export default {
this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}&userName=${row.userName}`) this.$router.push(`/bmOrder?businessManagerId=${row.businessManagerId}&customerId=${this.customerId}&customerName=${this.form.customerName}&userName=${row.userName}`)
}, },
tabChange(index) { // tab
this.curTab = index tabChange(index, to) {
this.$router.push(`addcustomer?id=${this.customerId}&type=${index}`) // tab
this.pageProduct = 1 if (this.curTab === 'tab1' && !to) {
this.pageOrder = 1 this.goback(index)
this.pageBm = 1 } else {
index === 'tab3' && this.handlePageOrder() this.curTab = index
}, this.$router.push(`addcustomer?id=${this.customerId}&type=${index}`)
// this.pageProduct = 1
getCityData(){ this.pageOrder = 1
let data = { this.pageBm = 1
provinceId: this.form.provinceId index === 'tab3' && this.handlePageOrder()
} this.updateTime = this.form.customerId ? 1 : 0
this.$get(this.api.queryCity,data).then(res => { }
this.cityList = res.list },
}).catch(res => {}); //
}, getCityData(){
// let data = {
clearSchool(){ provinceId: this.form.provinceId
this.form.provinceId = '', }
this.form.cityId = '', this.$get(this.api.queryCity,data).then(res => {
this.form.customerName = '' this.cityList = res.list
}, }).catch(res => {});
// / },
getSchoolData(){ //
let data = { clearSchool(){
schoolName: '', this.form.provinceId = '',
provinceId: '', this.form.cityId = '',
cityId: '' this.form.customerName = ''
} },
this.$get(this.api.querySchoolData).then(res => { // /
this.schoolList = res.list getSchoolData(){
}).catch(res => {}); let data = {
}, schoolName: '',
// provinceId: '',
SchoolChange(val){ cityId: ''
this.clearSchool() }
if(val){ this.$get(this.api.querySchoolData).then(res => {
let obj = {} this.schoolList = res.list
obj = this.schoolList.find((item)=>{ }).catch(res => {});
return item.schoolId === val },
}); //
this.form.customerName = obj.schoolName SchoolChange(val){
this.form.provinceId = obj.provinceId this.clearSchool()
this.getCityData() if(val){
this.form.cityId = obj.cityId let obj = {}
obj = this.schoolList.find((item)=>{
return item.schoolId === val
});
this.form.customerName = obj.schoolName
this.form.provinceId = obj.provinceId
this.getCityData()
this.form.cityId = obj.cityId
this.$get(this.api.queryCustomerIsExists,{ this.$get(this.api.queryCustomerIsExists,{
schoolId: this.form.schoolId schoolId: this.form.schoolId
}).then(res => { }).then(res => {
this.NoAdd = true this.NoAdd = true
}).catch(res => { }).catch(res => {
this.NoAdd = false this.NoAdd = false
}) })
} }
}, },
// //
getIndustryClass(){ getIndustryClass(){
this.$get(this.api.queryCustomerIndustryClass).then(res => { this.$get(this.api.queryCustomerIndustryClass).then(res => {
this.IndustryClassList = res.list this.IndustryClassList = res.list
}).catch(res => {}); }).catch(res => {});
}, },
// //
clearIndustry(){ clearIndustry(){
this.form.industryId = '' this.form.industryId = ''
}, },
// //
changIndustry(){ changIndustry(){
this.clearIndustry() this.clearIndustry()
this.changIndustryData() this.changIndustryData()
}, },
changIndustryData(){ changIndustryData(){
let data = { let data = {
industryClassId: this.form.industryClassId industryClassId: this.form.industryClassId
} }
this.$get(this.api.queryCustomerIndustry,data).then(res => { this.$get(this.api.queryCustomerIndustry,data).then(res => {
this.industryList = res.list this.industryList = res.list
}).catch(res => {}); }).catch(res => {});
}, },
switchOff(val, row) { switchOff(val, row) {
this.$post(`${this.api.orderBulkDisableEnable}?isOpen=${val}`, row.startAndEndTimeList.map(e => e.id)).then(res => { this.$post(`${this.api.orderBulkDisableEnable}?isOpen=${val}`, row.startAndEndTimeList.map(e => e.id)).then(res => {
this.$message.success(val ? '启用成功' : '禁用成功') this.$message.success(val ? '启用成功' : '禁用成功')
}).catch(res => {}) }).catch(res => {})
}, },
phoneChange() { // phoneChange() { //
let regex = /^1[3456789]\d{9}$/; let regex = /^1[3456789]\d{9}$/;
if (regex.test(this.form.phone)) { if (regex.test(this.form.phone)) {
let url = ""; let url = "";
if (!this.form.customerId) { if (!this.form.customerId) {
url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`; url = `${this.api.checkEmailOrPhone}?phone=${this.form.phone}&email=`;
} else { } else {
url = `${this.api.checkEmailOrPhone}?customerId=${this.form.customerId}&phone=${this.form.phone}&email=`; url = `${this.api.checkEmailOrPhone}?customerId=${this.form.customerId}&phone=${this.form.phone}&email=`;
} }
this.$post(url).then(res => { this.$post(url).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.phoneRepeat = false; this.phoneRepeat = false;
} }
}).catch(err => { }).catch(err => {
this.phoneRepeat = true; this.phoneRepeat = true;
}); });
} }
}, },
emailChange() { // emailChange() { //
let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/; let regex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/;
if (regex.test(this.form.email)) { if (regex.test(this.form.email)) {
let url = ""; let url = "";
if (!this.form.customerId) { if (!this.form.customerId) {
url = `${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`; url = `${this.api.checkEmailOrPhone}?email=${this.form.email}&phone=`;
} else { } else {
url = `${this.api.checkEmailOrPhone}?customerId=${this.form.customerId}&email=${this.form.email}&phone=`; url = `${this.api.checkEmailOrPhone}?customerId=${this.form.customerId}&email=${this.form.email}&phone=`;
} }
this.$post(url).then(res => { this.$post(url).then(res => {
if (res.status === 200) { if (res.status === 200) {
this.emailRepeat = false; this.emailRepeat = false;
} }
}).catch(err => { }).catch(err => {
this.emailRepeat = true; this.emailRepeat = true;
}); });
} }
}, },
saveAdd(formName){ saveAdd(tab){
this.$refs[formName].validate((valid) => { this.$refs.form.validate((valid) => {
if (valid) { if (valid) {
if (this.submiting) return false if (this.submiting) return false
if (this.phoneRepeat) { if (this.phoneRepeat) {
this.$message.warning("该手机号已存在"); this.$message.warning("该手机号已存在");
return; return;
} }
if (this.emailRepeat) { if (this.emailRepeat) {
this.$message.warning("该邮箱已存在"); this.$message.warning("该邮箱已存在");
return; return;
} }
this.submiting = true this.submiting = true
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.schoolId; 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
this.getCityData() this.getCityData()
this.form.cityId = obj.cityId this.form.cityId = obj.cityId
let data = { let data = {
customerName: this.form.customerName, customerName: this.form.customerName,
customerId: this.customerId, customerId: this.customerId,
schoolId: this.form.schoolId, 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,
provinceId: this.form.provinceId, provinceId: this.form.provinceId,
account: this.form.account, account: this.form.account,
phone: this.form.phone, phone: this.form.phone,
cityId: this.form.cityId, cityId: this.form.cityId,
customerType: this.form.customerType, customerType: this.form.customerType,
expireDate: this.form.expireDate, expireDate: this.form.expireDate,
email: this.form.email, email: this.form.email,
name: this.form.name, name: this.form.name,
position: this.form.position position: this.form.position
} }
if(this.customerId){ if(this.customerId){
this.$post(this.api.updateCustomer,data).then((res) => { this.$post(this.api.updateCustomer,data).then((res) => {
this.$message.success('编辑成功') setTimeout(() => {
this.goback()
}).catch((res) => {
this.submiting = false this.submiting = false
}) }, 1500)
}else{ this.$message.success('编辑成功')
this.$post(this.api.addCustomer,data).then((res) => { tab ? this.tabChange(tab, 1) : this.backPage()
let customerId = res.customerId }).catch((res) => {
this.$store.commit('schoolIdData',{schoolId: this.form.schoolId}) this.submiting = false
// this.$post(this.api.saveOrUpdate,{ })
// clientId: 0, }else{
// id: '', this.$post(this.api.addCustomer,data).then((res) => {
// roleName: '', setTimeout(() => {
// remark: '',
// isPort: 2
// }).then(res => {
// let roleId = res.roleId
// let perData = {
// roleId,
// permissionId: ["1408370117262635009","1409351488911056897","1409351867862228993","1408370186435096578","1409352518310699009","1409352550615228418","1409352584240963585","1409352623344459778","1409352647054860289","1409352682471563266","1409352720786530305","1409352742290726913","1408370244584927233","1409352872662278146","1409352903574298626","1409352923509825538","1409352940068937730","1409353018443702273"],
// isPort: 2
// }
// this.$post(this.api.doAssign,perData).then(res => {}).catch(res => {})
// this.$post(`${this.api.updateCustomerByRoleId}?customerId=${customerId}&roleId=${roleId}`).then(res => {}).catch(res => {})
// }).catch(res => {})
this.$message.success('添加成功')
this.goback()
}).catch((res) => {
this.submiting = false this.submiting = false
}) }, 1500)
} this.$store.commit('schoolIdData',{schoolId: this.form.schoolId})
}else{ this.$message.success('添加成功')
this.$message.warning('该客户已存在') tab ? this.tabChange(tab, 1) : this.backPage()
} }).catch((res) => {
} this.submiting = false
}) })
}, }
handleSelectionChange(val) { }else{
this.multipleSelection = val this.$message.warning('该客户已存在')
}, }
showContract(row){ }
if(!row.contractFile) return this.$message.warning('文件链接无效') })
let type = row.contractFile.split('.').pop() },
let img = ['jpg','gif','png','jepg'] handleSelectionChange(val) {
this.multipleSelection = val
this.fileSrc = row.contractFile },
if(img.includes(type)){ showContract(row){
this.showImg = true if(!row.contractFile) return this.$message.warning('文件链接无效')
}else if('pdf'.includes(type)){ let type = row.contractFile.split('.').pop()
this.pdfVisible = true let img = ['jpg','gif','png','jepg']
}else{
window.open(`https://view.officeapps.live.com/op/view.aspx?src=${this.fileSrc}`)
}
}, this.fileSrc = row.contractFile
goback(){ if(img.includes(type)){
this.$router.push(`customer?page=${this.$store.state.customerPage}`) this.showImg = true
}else if('pdf'.includes(type)){
this.pdfVisible = true
}else{
window.open(`https://view.officeapps.live.com/op/view.aspx?src=${this.fileSrc}`)
}
},
goback(i) {
const id = this.form.customerId
const updateTime = this.updateTime
//
if ((id && updateTime > 1) || (!id && updateTime)) {
this.$confirm(`编辑的内容未保存,是否保存?`, '提示', {
type: 'warning'
}).then(() => {
this.saveAdd(i)
}).catch(() => {
i ? this.tabChange(i, 1) : this.backPage()
})
} else {
this.tabChange(i, 1)
} }
},
backPage(){
this.$router.push(`customer?page=${this.$store.state.customerPage}`)
}
} }
}; };
</script> </script>

@ -30,7 +30,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="productName" label="产品内容" align="center"></el-table-column> <el-table-column prop="productName" label="产品内容" align="center"></el-table-column>
<el-table-column prop="totalAmount" label="订单金额(元)" align="center"> <el-table-column prop="orderAmount" label="订单金额(元)" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="createTime" label="订单日期" align="center"> <el-table-column prop="createTime" label="订单日期" align="center">
</el-table-column> </el-table-column>

@ -61,7 +61,7 @@ export default {
{ required: true, message: '请输入手机号', trigger: 'blur' } { required: true, message: '请输入手机号', trigger: 'blur' }
], ],
code: [ code: [
{ required: util.isMobile(), message: "请输入验证码", trigger: 'blur' } { required: true, message: "请输入验证码", trigger: 'blur' }
] ]
}, },
phoneDisabled: false, phoneDisabled: false,

@ -1058,7 +1058,6 @@ export default {
}, },
// //
backToOrder(val) { backToOrder(val) {
console.log(val)
this.showSelectClient = !this.showSelectClient; this.showSelectClient = !this.showSelectClient;
if (val.customerId) { if (val.customerId) {
this.form.customerName = val.customerName; this.form.customerName = val.customerName;
@ -1341,12 +1340,14 @@ export default {
// //
calculateDiscountCourse(val, row) { calculateDiscountCourse(val, row) {
const { finalPrice, marketValue } = row const { finalPrice, marketValue } = row
if (finalPrice) row.discountRate = marketValue == 0 ? '0%' : (finalPrice / marketValue * 100).toFixed(2) + "%"; // (-)÷ x100%
if (finalPrice) row.discountRate = marketValue == 0 ? '0%' : ((marketValue - finalPrice) / marketValue * 100).toFixed(2) + "%";
}, },
// //
calculateDiscount(val, row) { calculateDiscount(val, row) {
const { finalValue, marketValue } = row const { finalValue, marketValue } = row
if (finalValue) row.discountRate = marketValue == 0 ? '0%' : (finalValue / marketValue * 100).toFixed(2) + "%"; // (-)÷ x100%
if (finalValue) row.discountRate = marketValue == 0 ? '0%' : ((marketValue - finalValue) / marketValue * 100).toFixed(2) + "%";
}, },
// //
contractTimeChange(val) { contractTimeChange(val) {
@ -1367,19 +1368,27 @@ export default {
dealFinalValue(val, row) { dealFinalValue(val, row) {
const { periodOfUse, options, accountNum, finalPrice } = row const { periodOfUse, options, accountNum, finalPrice } = row
if (periodOfUse && accountNum && finalPrice) { if (periodOfUse && accountNum && finalPrice) {
row.finalValue = (finalPrice / accountNum / periodOfUse * (!options ? row.finalValue = (finalPrice / accountNum / periodOfUse).toFixed(2)
365 :
options === 1 ?
12 :
1)).toFixed(2)
this.calculateDiscount(val, row) this.calculateDiscount(val, row)
} }
}, },
// **// // **//
dealComputers(e, row) { dealComputers(e, row) {
const { finalValue, accountNum, periodOfUse, options } = row const { finalValue, accountNum, periodOfUse, finalPrice } = row
if (finalValue && accountNum) { if (periodOfUse) {
row.finalPrice = Math.round(finalValue * periodOfUse * accountNum) if (accountNum) {
// =**
if (finalValue) {
row.finalPrice = Math.round(finalValue * periodOfUse * accountNum)
} else if (!finalValue && finalPrice) {
// =//
row.finalValue = (finalPrice / periodOfUse / accountNum).toFixed(2)
this.calculateDiscount(e, row)
}
} else if (finalValue && finalValue) {
// =//
row.accountNum = Math.floor(finalPrice / periodOfUse / finalValue)
}
} }
this.dealSettlePrice(row) this.dealSettlePrice(row)
this.allAmount(e, row) this.allAmount(e, row)
@ -1388,22 +1397,24 @@ export default {
dealSettlePrice(row) { dealSettlePrice(row) {
const unit = row.options // 使 const unit = row.options // 使
const useUnit = row.periodOfUse // 使 const useUnit = row.periodOfUse // 使
let sPrice = '' if (this.form.orderType !== 2) {
if (row.settlementMethod == 0) { let sPrice = ''
// **/**(1) if (row.settlementMethod == 0) {
const priceUnit = row.settlementPriceUnit // **/**(1)
sPrice = ((!unit ? const priceUnit = row.settlementPriceUnit
priceUnit / 365 * useUnit : sPrice = ((!unit ?
unit === 1 ? priceUnit / 365 * useUnit :
priceUnit / 12 * useUnit : unit === 1 ?
priceUnit * useUnit) * (row.authority ? priceUnit / 12 * useUnit :
1 : priceUnit * useUnit) * (row.authority ?
row.accountNum)).toFixed(2) 1 :
} else { row.accountNum)).toFixed(2)
// * } else {
sPrice = (row.finalPrice * row.businessProportion / 100).toFixed(2) // *
sPrice = (row.finalPrice * row.businessProportion / 100).toFixed(2)
}
row.settlementPrice = this.handleNaN(sPrice)
} }
row.settlementPrice = this.handleNaN(sPrice)
}, },
// 使 // 使
deadLine(e,row,options, isDate) { deadLine(e,row,options, isDate) {
@ -1439,6 +1450,7 @@ export default {
price * useUnit)).toFixed(2) price * useUnit)).toFixed(2)
this.dealComputers(e, row) this.dealComputers(e, row)
row.authority ? this.calculateDiscountCourse(e, row) : this.calculateDiscount(e, row)
// +1 // +1
if (isDate) { if (isDate) {
const cId = row.dataOrCourseId const cId = row.dataOrCourseId

@ -408,32 +408,27 @@ export default {
}, },
// //
add() { add() {
const { orgList } = this const curNode = this.$refs.orgTree.getCurrentNode()
if (orgList.length) { if (curNode && curNode.isTeam) {
const curNode = this.$refs.orgTree.getCurrentNode() util.warningMsg('请选择分类添加城市合伙人!')
if (curNode && curNode.isTeam) { } else {
util.warningMsg('请选择分类添加城市合伙人!') const { accountId } = this
} else { //
const { accountId } = this this.$post(`${this.api.generateInvitationCode}?accountId=${accountId}`).then(({ expireTime, invitationCode }) => {
// const date = new Date(Date.now() + expireTime * 1000) // *1000
this.$post(`${this.api.generateInvitationCode}?accountId=${accountId}`).then(({ expireTime, invitationCode }) => { this.expireTime = `${date.getFullYear()}-${util.preZero(date.getMonth() + 1)}-${util.preZero(date.getDate())} ${util.preZero(date.getHours())}:${util.preZero(date.getMinutes())}:${util.preZero(date.getMinutes())}`
const date = new Date(Date.now() + expireTime * 1000) // *1000 this.parnerVisible = true
this.expireTime = `${date.getFullYear()}-${util.preZero(date.getMonth() + 1)}-${util.preZero(date.getDate())} ${util.preZero(date.getHours())}:${util.preZero(date.getMinutes())}:${util.preZero(date.getMinutes())}` const cur = this.$refs.orgTree.getCurrentKey()
this.parnerVisible = true const link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : '/nakadai'}/#/join?accountId=${accountId}&id=${cur || ''}`
const cur = this.$refs.orgTree.getCurrentKey()
const link = `${location.origin}${Setting.isDev || Setting.isPro ? '' : '/nakadai'}/#/join?accountId=${accountId}&id=${cur ? cur: this.orgList[0].id}`
// //
this.link = link this.link = link
axios.get(`${this.api.generationQrCode}?url=${encodeURIComponent(link)}`, { axios.get(`${this.api.generationQrCode}?url=${encodeURIComponent(link)}`, {
responseType: 'blob' responseType: 'blob'
}).then(({ data }) => { }).then(({ data }) => {
this.qrcode = window.URL.createObjectURL(data) this.qrcode = window.URL.createObjectURL(data)
}).catch(res => {})
}).catch(res => {}) }).catch(res => {})
} }).catch(res => {})
} else {
util.errorMsg('请添加分类!')
} }
}, },
// //

Loading…
Cancel
Save