diff --git a/src/utils/api.js b/src/utils/api.js index 33f1314..3164520 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -7,9 +7,10 @@ const host1 = 'http://192.168.31.137:9000/' export default { logins: `users/users/user/login`, //登录 - verification: `${host}users/users/user/captcha`,// 验证码图片 + verification: `${host}users/users/user/captcha`,// 验证码图片 保留host bindPhoneOrEmail: `users/users/userAccount/bindPhoneOrEmail`,// 绑定手机 sendPhoneOrEmailCode: `users/users/userAccount/sendPhoneOrEmailCode`,// 手机验证码 + 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`, // 后台账号模板 @@ -192,31 +193,31 @@ export default { downloadFiles: `liuwanr/aliyun/downloadFiles`, //下载文件 // 数据管理 - getIdQueryTable: `data/data/table/getIdQueryTable`, - getTableByClassification: `data/data/table/getTableByClassification`, - getTableByCondition: `data/data/table/getTableByCondition`, - originalList: `data/data/table/originalList`, - originalListById: `data/data/table/originalListById`, - saveCategory: `data/data/table/saveCategory`, - saveTable: `data/data/table/saveTable`, - updateCategory: `data/data/table/updateCategory`, - deleteCategory: `data/data/table/deleteCategory`, - deleteTable: `data/data/table/deleteTable`, - previewData: `data/data/preview`, - staticPreview: `data/data/staticPreview`, - editTableName: `data/data/table/editTableName`, - updateTableCommit: `data/data/updateTableCommit`, - getLevel: `data/category/getLevel`, - getAllTableInfoByCategoryId: `data/data/product/getAllTableInfoByCategoryId`, + getIdQueryTable: `${host1}data/data/table/getIdQueryTable`, + getTableByClassification: `${host1}data/data/table/getTableByClassification`, + getTableByCondition: `${host1}data/data/table/getTableByCondition`, + originalList: `${host1}data/data/table/originalList`, + originalListById: `${host1}data/data/table/originalListById`, + saveCategory: `${host1}data/data/table/saveCategory`, + saveTable: `${host1}data/data/table/saveTable`, + updateCategory: `${host1}data/data/table/updateCategory`, + deleteCategory: `${host1}data/data/table/deleteCategory`, + deleteTable: `${host1}data/data/table/deleteTable`, + previewData: `${host1}data/data/preview`, + staticPreview: `${host1}data/data/staticPreview`, + editTableName: `${host1}data/data/table/editTableName`, + updateTableCommit: `${host1}data/data/updateTableCommit`, + getLevel: `${host1}data/category/getLevel`, + getAllTableInfoByCategoryId: `${host1}data/data/product/getAllTableInfoByCategoryId`, // 产品管理 - deleteProduct: `data/data/product/delete`, - findById: `data/data/product/findById`, - listByEntity: `data/data/product/listByEntity`, - saveProduct: `data/data/product/save`, - updateProduct: `data/data/product/update`, - saveRecord: `data/data/dataRecord/saveRecord`, - getAllTableIdBycategoryId: `data/data/product/getAllTableIdBycategoryId`, + deleteProduct: `${host1}data/data/product/delete`, + findById: `${host1}data/data/product/findById`, + listByEntity: `${host1}data/data/product/listByEntity`, + saveProduct: `${host1}data/data/product/save`, + updateProduct: `${host1}data/data/product/update`, + saveRecord: `${host1}data/data/dataRecord/saveRecord`, + getAllTableIdBycategoryId: `${host1}data/data/product/getAllTableIdBycategoryId`, // 关键词 addKeyword: `data/keyword/addKeyword`, @@ -244,7 +245,6 @@ export default { obtainDetails: `users/role/obtainDetails`, //获取角色详情 saveOrUpdate: `users/role/saveOrUpdate`, //新增或更新角色 queryAllMenus: `users/users/permission/queryAllMenus`, //查询所有菜单 - getUserRolesPermissionMenu: `users/user-role/getUserRolesPermissionMenu`, // 日志管理 logAdd: `nakadai/log/add`, @@ -254,4 +254,16 @@ export default { platformLogList: `nakadai/log/platformLogList`, listUpdate: `nakadai/log/update`, checkRepeat: `nakadai/log/checkRepeat`, + + // 合伙人 + deleteParner: `${host1}nakadai/partnerClassification/delete`, + saveParner: `${host1}nakadai/partnerClassification/save`, + listParner: `${host1}nakadai/partnerClassification/treeList`, + updateParner: `${host1}nakadai/partnerClassification/update`, + + delPartnerAccount: `${host1}nakadai/partnerAccount/delPartnerAccount`, + modifyPartnerAccount: `${host1}nakadai/partnerAccount/modifyPartnerAccount`, + partnerAccountDetail: `${host1}nakadai/partnerAccount/partnerAccountDetail`, + partnerAccountList: `${host1}nakadai/partnerAccount/partnerAccountList`, + savePartnerAccount: `${host1}nakadai/partnerAccount/savePartnerAccount`, }; \ No newline at end of file diff --git a/src/views/Login.vue b/src/views/Login.vue index 5e19fad..dd5dc6d 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -224,16 +224,10 @@ export default { }, blur(){ - // if(!this.param.account){ - // return this.verificationIMG = '' - // } this.param.random = Math.floor(Math.random()*999999999) this.verificationIMG = this.api.verification+'?random='+`${this.param.random}` }, phoneBlur(){ - // if(!this.phoneOrEmail.account){ - // return this.PhoneVerificationIMG = '' - // } this.phoneOrEmail.random = Math.floor(Math.random()*999999999) this.PhoneVerificationIMG = this.api.verification+'?random='+`${this.phoneOrEmail.random}` }, @@ -246,6 +240,8 @@ export default { this.phoneOrEmail.password = ""; this.phoneOrEmail.code = ""; this.$refs.phoneOrEmail.clearValidate() + // this.blur() + this.phoneBlur() }, sendPhoneCode(){ if(!this.phone) return this.$message.warning('请输入手机号') diff --git a/src/views/course/AddCurriculum.vue b/src/views/course/AddCurriculum.vue index 8281093..584c244 100644 --- a/src/views/course/AddCurriculum.vue +++ b/src/views/course/AddCurriculum.vue @@ -46,13 +46,13 @@ - + - +
结算单价 @@ -91,7 +91,7 @@ - + @@ -321,9 +321,15 @@ export default { { required: true, message: "请选择专业", trigger: "change" } ], marketPrice: [ - { required: true, message: "请输入市场价格", trigger: "blur" }, + { required: true, message: "请输入市场单价格", trigger: "blur" }, { pattern: /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/, message: "请输入正确金额格式,可保留两位小数" } ], + supplier: [ + { required: true, message: "请输入供应厂商", trigger: "blur" } + ], + settlementMethod: [ + { required: true, message: "请选择结算方式", trigger: "change" } + ], expectedCourse: [ { required: true, message: "请选择预计课时", trigger: "change" } ], diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue index b52bdcc..d741086 100644 --- a/src/views/customer/AddCustomer.vue +++ b/src/views/customer/AddCustomer.vue @@ -129,7 +129,10 @@ - + +
@@ -137,19 +140,16 @@
  • - - + +
  • - +
  • -
  • - -
@@ -179,10 +179,13 @@ +
@@ -269,8 +272,6 @@ export default { tab4: '合同信息', tab5: '商务经理', }, - products: [], - productAll: [], showFile:false, pdfVisible:false, showImg:false, @@ -398,6 +399,11 @@ export default { name: '待生效' } ], + products: [], + productAll: [], + pageProduct: 1, + pageSizeProduct: 10, + totalProduct: 0, form3: { orderType: '', @@ -406,10 +412,12 @@ export default { }, // 订单类型 orderTypeList: [{ + name: '全部', + value: '' + }, { name: '正式', value: 1 - }, - { + }, { name: '试用', value: 2 }], @@ -430,7 +438,9 @@ export default { ], pageOrder: 1, pageSizeOrder: 10, + totalOrder: 0, orders: [], + orderAll: [], countryList: [{ name:'中国' @@ -457,6 +467,12 @@ export default { this.filterForm2() },500) }, + 'form3.keyword': function(val) { + clearTimeout(this.searchTimer) + this.searchTimer = setTimeout(() => { + this.filterOrder() + },500) + }, }, mounted() { this.getIndustryClass() @@ -483,7 +499,7 @@ export default { name: customer.name, position: customer.position, } - // this.getOrder() + this.getOrder() this.contractInformations = res.result.contractInformations.filter(e => e.contractNumber || e.contractName); // 必须有合同编号或者名称,否则不展示 this.coursePermissionss = res.result.coursePermissionss this.dataPermissionss = res.result.dataPermissionss @@ -501,79 +517,93 @@ export default { this.$get(this.api.getProductsSubscribedByCustomers, { customeId: this.customerId }).then(({ data }) => { + data = data.filter(e => !e.productDel) // productDel=1的不显示 const { productTypeList } = this data.map(e => { const list = e.startAndEndTimeList - let connect = true // 每个订单的开始结束日期是否连续 - list.map((n, i) => { - // 第一个不用计算。用当前订单的开始日期跟上一个订单的结束日期做比较,只差一天,就表示是连续订单 - if (i) { - if (new Date(n.startTime).getTime() - 86400000 !== new Date(list[i - 1].endTime).getTime()) connect = false - } - }) - // 如果是连续订单,则取第一个订单的开始日期和最后一个订单的结束日期 - const now = Date.now() - if (now < list[0].startTime) { - e.startTime = list[0].startTime - e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime - e.status = '未生效' - } else if (now > list[list.length - 1].endTime) { - e.status = '已过期' - } else { - // 连续订单 - if (connect) { + if (list) { + let connect = true // 每个订单的开始结束日期是否连续 + list.map((n, i) => { + // 第一个不用计算。用当前订单的开始日期跟上一个订单的结束日期做比较,只差一天,就表示是连续订单 + if (i) { + if (new Date(n.startTime).getTime() - 86400000 !== new Date(list[i - 1].endTime).getTime()) connect = false + } + }) + // 如果是连续订单,则取第一个订单的开始日期和最后一个订单的结束日期 + const now = Date.now() + if (now < new Date(list[0].startTime).getTime()) { e.startTime = list[0].startTime - e.endTime = list[list.length - 1].endTime - e.status = '生效中' - e.orderEnable = list[0].isEnable + e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime + e.status = '未生效' + } else if (now > new Date(list[list.length - 1].endTime).getTime()) { + e.status = '已过期' } else { - for (const i in list) { - const n = list[i] - if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) { - // 生效中的订单,直接取该订单的开始结束日期 - e.startTime = n.startTime - e.endTime = n.endTime - e.status = '生效中' - e.orderEnable = n.isEnable - break - } else if (i && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) { - // 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效 - e.startTime = n.startTime - e.endTime = n.endTime - e.status = '未生效' - e.orderEnable = n.isEnable - break + // 连续订单 + if (connect) { + e.startTime = list[0].startTime + e.endTime = list[list.length - 1].endTime + e.status = '生效中' + e.orderEnable = list[0].isEnable + } else { + for (const j in list) { + const i = +j + const n = list[i] + if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) { + // 生效中的订单,直接取该订单的开始结束日期 + e.startTime = n.startTime + e.endTime = n.endTime + e.status = '生效中' + e.orderEnable = n.isEnable + // 如果还有未生效的订单,页面上要显示出来 + if (list[i + 1]) { + const notActive = list.slice(i + 1) // 取当前订单以后的所有订单 + e.other = '' + notActive.map(j => { + e.other += `
${j.startTime} ~ ${j.endTime}` + }) + } + break + } else if (i != 0 && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) { + // 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效 + e.startTime = n.startTime + e.endTime = n.endTime + e.status = '未生效' + e.orderEnable = n.isEnable + break + } } } } + const date = new Date() + date.setHours(0) + date.setMinutes(0) + date.setSeconds(0) + e.remain = e.status === '已过期' ? 0 : this.getRemain(date.getTime(), e.endTime) // 获取剩余期限 + e.startAndEndTime = e.status === '已过期' ? '' : e.startTime + ' ~ ' + e.endTime + e.productTypeName = productTypeList.find(n => n.id === e.productType).name + // 1开启 0禁用(已过期的订单,或者当前生效的订单为禁用,则显示为禁用,否则是启用) + e.isEnable = (e.status === '已过期' || !e.orderEnable) ? + 0 : + 1 } - const date = new Date() - date.setHours(0) - date.setMinutes(0) - date.setSeconds(0) - e.remain = this.getRemain(date.getTime(), e.endTime) // 获取剩余期限 - e.startAndEndTime = e.startTime + ' ~ ' + e.endTime - // 如果还有未生效的订单,页面上要显示出来 - if (e.notActiveList.length) { - e.other = '' - e.notActiveList.map(j => { - e.other += `
${j.startTime} ~ ${j.endTime}` - }) - } - e.productTypeName = productTypeList.find(n => n.id === e.productType).name - // 1开启 0禁用(已过期的订单,或者当前生效的订单为禁用,则显示为禁用,否则是启用) - e.isEnable = (e.status === '已过期' || !e.orderEnable) ? - 0 : - 1 }) - this.products = data this.productAll = data + this.totalProduct = data.length + this.handlePage() }).catch(res => {}) }, // 获取剩余日期 getRemain(startTime, endTime) { return parseInt(((new Date(endTime).getTime() - new Date(startTime).getTime()) / 86400000)) + 1 }, + // 分页 + handlePage() { + this.products = this.productAll.slice((this.pageProduct - 1) * this.pageSizeProduct, this.pageProduct * this.pageSizeProduct) + }, + handleCurrentChangeProduct(val) { + this.pageProduct = val + this.handlePage() + }, // 已订阅产品筛选 filterForm2() { const list = this.productAll @@ -607,25 +637,45 @@ export default { // 订单记录 getOrder() { - let data = { + const { orderStatus, orderType } = this.form3 + this.$post(this.api.orderList, { cityId: '', customerName: this.form.customerName, - orderStatus: '', - orderType: '', + orderStatus, + orderType, pageNo: this.pageOrder, - pageSize: this.pageSizeOrder, + pageSize: 10000, provinceId: '' - }; - this.$post(this.api.orderList, data).then(({ orderPage }) => { + }).then(({ orderPage }) => { orderPage.orders.forEach(e => { e.orderType = this.orderTypeFn(e.orderType) e.orderStatus = this.orderStatusFn(e.orderStatus) e.orderNature = this.orderNatureFn(e.orderNature) }); - this.orders = orderPage.orders - this.totals = orderPage.total + this.orderAll = orderPage.orders + this.totalOrder = orderPage.total + this.handlePageOrder() }).catch(res => {}) }, + // 订单模糊查询 + filterOrder() { + const { keyword } = this.form3 + const { orders } = this + this.orders = keyword ? orders.filter(e => e.orderNumber.includes(keyword) || e.orderContent.includes(keyword)) : this.orderAll + }, + // 分页 + handlePageOrder() { + this.orders = this.orderAll.slice((this.pageOrder - 1) * this.pageSizeOrder, this.pageOrder * this.pageSizeOrder) + this.filterOrder() + }, + handleCurrentChangeOrder(val) { + this.pageOrder = val + this.handlePageOrder() + }, + // 订单详情 + toOrderDetail(row) { + this.$router.push(`/AddOrder?val=watch&orderId=${row.orderId}&orderStatus=${row.orderStatus === '已完成' ? 1 : 0}`) + }, tabChange(index) { this.curTab = index @@ -867,4 +917,15 @@ export default { margin-left: 5px; color: #9278FF; } +.tags{ + border: none; + background: none;color: #000; + white-space:pre-wrap; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical; +} diff --git a/src/views/data/Product.vue b/src/views/data/Product.vue index 055a693..8f24f62 100644 --- a/src/views/data/Product.vue +++ b/src/views/data/Product.vue @@ -56,14 +56,37 @@ - - - 元/账号 + + + 元/账号/年 + + + + +
+ 结算单价 + + + +
+
+ 比例分成 +
+
+ 商务经理占比 + +
+
+ 产品厂商占比 + +
+
+
+
配置数据权限 -
@@ -165,6 +188,11 @@ export default { userId: '', productName: '', market: '', + supplier: '', + businessProportion: '', + manufacturerProportion: '', + settlementPrice: '', + settlementMethod: '0', typeList: [], loading: false, defaultProps: { @@ -371,6 +399,11 @@ export default { const data = res.product this.productName = data.productName this.market = data.market + this.businessProportion = data.businessProportion + this.manufacturerProportion = data.manufacturerProportion + this.settlementMethod = data.settlementMethod + this.settlementPrice = data.settlementPrice + this.supplier = data.supplier this.checkedIds = data.tableId.split(',') this.$refs.type.setCheckedKeys(this.checkedIds) // 选中已选的表 this.loading = false @@ -458,6 +491,11 @@ export default { closeProduct(){ this.productName = '' this.market = '' + this.businessProportion = '' + this.manufacturerProportion = '' + this.settlementMethod = '0' + this.settlementPrice = '' + this.supplier = '' this.isDetail = false this.typeList = [] this.configIds = [] @@ -490,17 +528,23 @@ export default { // 操作产品保存 confirm(){ if(this.submited) return false - if(!this.productName) return this.$message.warning('请输入数据产品名称') - if(!this.market) return this.$message.warning('请输入市场价格') - if(isNaN(this.market)) return this.$message.warning('市场价格请输入数字') + const { productName, market, businessProportion, manufacturerProportion, settlementMethod, settlementPrice, supplier } = this + if(!productName) return this.$message.warning('请输入数据产品名称') + if(!market) return this.$message.warning('请输入市场价格') + if(isNaN(market)) return this.$message.warning('市场价格请输入数字') if(!this.checkedIds.length) return this.$message.warning('请选择数据') this.submited = true // 提交状态 let tableId = this.checkedIds if(!tableId.length) return this.$message.warning('请选择数据') let data = { id: this.id, - productName: this.productName, - market: this.market, + productName, + market, + businessProportion, + manufacturerProportion, + settlementMethod, + settlementPrice, + supplier, tableId: tableId.join(), userId: this.userId, userName: this.userName, @@ -512,7 +556,7 @@ export default { } if(this.id){ this.$post(this.api.updateProduct,data).then(res => { - this.$message.success('新增成功') + this.$message.success('编辑成功') this.productVisible = false this.getData() this.submited = false @@ -636,4 +680,18 @@ export default { margin-left: 25px; overflow:auto; } +.settlement { + display: flex; + margin-bottom: 10px; + .label { + margin-right: 10px; + white-space: nowrap; + color: #606266; + font-size: 14px; + } + .el-input { + width: 150px; + margin-right: 30px; + } +} \ No newline at end of file diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 74ec586..40135a5 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -190,7 +190,7 @@ @@ -203,7 +203,6 @@ @@ -324,7 +323,7 @@