订单、合伙人联调

dev_2022-05-11
yujialong 3 years ago
parent 49b65c20fc
commit 52f9049880
  1. 62
      src/utils/api.js
  2. 8
      src/views/Login.vue
  3. 14
      src/views/course/AddCurriculum.vue
  4. 129
      src/views/customer/AddCustomer.vue
  5. 78
      src/views/data/Product.vue
  6. 123
      src/views/order/AddOrder.vue
  7. 65
      src/views/parner/staff.vue

@ -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`,
};

@ -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('请输入手机号')

@ -46,13 +46,13 @@
</el-select>
</el-form-item>
<el-form-item label="市场单价格" prop="professionalId">
<el-form-item label="市场单价格" prop="marketPrice">
<el-input placeholder="请输入市场单价格" v-model.trim="form.marketPrice">
<template slot="append">/</template>
</el-input>
</el-form-item>
<el-form-item label="结算方式" prop="professionalId" style="width: 800px">
<el-form-item label="结算方式" prop="settlementMethod" style="width: 800px">
<div class="settlement">
<el-radio v-model="form.settlementMethod" label="0">结算单价</el-radio>
<el-input v-model.trim="form.settlementPrice">
@ -91,7 +91,7 @@
<el-option label="64课时" value="64课时"></el-option>
</el-select>
</el-form-item>
<el-form-item label="供应厂商" prop="expectedCourse">
<el-form-item label="供应厂商" prop="supplier">
<el-input placeholder="请输入供应厂商" v-model.trim="form.supplier"></el-input>
</el-form-item>
</el-col>
@ -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" }
],

@ -130,6 +130,9 @@
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChangeProduct" :current-page="pageProduct" :page-size="pageSizeProduct" :total="totalProduct"></el-pagination>
</div>
</div>
<div v-show="curTab === 'tab3'">
@ -137,19 +140,16 @@
<ul class="filter">
<li>
<label>订单类型</label>
<el-select v-model="form3.orderType" clearable placeholder="请选择订单类型">
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.id"></el-option>
<el-select v-model="form3.orderType" clearable placeholder="请选择订单类型" @change="getOrder">
<el-option v-for="(item,index) in orderTypeList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
<li>
<label>订单状态</label>
<el-select v-model="form3.orderStatus" clearable placeholder="请选择订单状态">
<el-select v-model="form3.orderStatus" clearable placeholder="请选择订单状态" @change="getOrder">
<el-option v-for="(item,index) in orderStatusList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select>
</li>
<li>
</li>
</ul>
<div>
<el-input style="width: 250px;" placeholder="请输入订单编号、内容" prefix-icon="el-icon-search" clearable v-model="form3.keyword"></el-input>
@ -179,10 +179,13 @@
<el-table-column prop="orderStatus" label="订单状态" align="center"></el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">订单详情</el-button>
<el-button type="text" @click="toOrderDetail(scope.row)">订单详情</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChangeOrder" :current-page="pageOrder" :page-size="pageSizeOrder" :total="totalOrder"></el-pagination>
</div>
</div>
<div v-show="curTab === 'tab4'">
@ -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,9 +517,11 @@ 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
if (list) {
let connect = true //
list.map((n, i) => {
//
@ -513,11 +531,11 @@ export default {
})
//
const now = Date.now()
if (now < list[0].startTime) {
if (now < new Date(list[0].startTime).getTime()) {
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) {
} else if (now > new Date(list[list.length - 1].endTime).getTime()) {
e.status = '已过期'
} else {
//
@ -527,7 +545,8 @@ export default {
e.status = '生效中'
e.orderEnable = list[0].isEnable
} else {
for (const i in list) {
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()) {
//
@ -535,8 +554,16 @@ export default {
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 += `<br>${j.startTime} ~ ${j.endTime}`
})
}
break
} else if (i && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) {
} 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
@ -551,29 +578,32 @@ export default {
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 += `<br>${j.startTime} ~ ${j.endTime}`
})
}
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
}
})
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;
}
</style>

@ -56,14 +56,37 @@
<el-form-item label="数据产品名称">
<el-input v-model="productName" placeholder="请输入数据产品名称"></el-input>
</el-form-item>
<el-form-item label="市场价格">
<el-input v-model="market" placeholder="请输入市场价格" type="number" :min="0">
<span slot="suffix">/账号</span>
<el-form-item label="市场价格">
<el-input v-model="market" placeholder="请输入市场价格" :min="0">
<span slot="suffix">/账号/</span>
</el-input>
</el-form-item>
<el-form-item label="供应厂商" prop="supplier">
<el-input placeholder="请输入供应厂商" v-model.trim="supplier"></el-input>
</el-form-item>
<el-form-item label="结算方式" prop="settlementMethod" style="width: 800px">
<div class="settlement" style="align-items: center">
<el-radio v-model="settlementMethod" label="0">结算单价</el-radio>
<el-input style="width: 244px" v-model.trim="settlementPrice">
<template slot="append">/账号/</template>
</el-input>
</div>
<div class="settlement">
<el-radio style="margin-top: 10px" v-model="settlementMethod" label="1">比例分成</el-radio>
<div class="settle-item">
<div style="margin-bottom: 10px">
<span class="label">商务经理占比</span>
<el-input v-model.trim="businessProportion"></el-input>
</div>
<div>
<span class="label">产品厂商占比</span>
<el-input v-model.trim="manufacturerProportion"></el-input>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="配置数据">
<el-button type="primary" @click="configData">配置数据权限</el-button>
</el-form-item>
<div class="type-wrap" ref="typeWrap" @scroll="loadType" v-show="checkedIds.length">
<el-tree ref="type" :data="typeList" show-checkbox accordion node-key="id" :default-expanded-keys="checkedIds" :default-checked-keys="checkedIds" :props="defaultProps" @node-expand="typeExpand">
@ -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;
}
}
</style>

@ -190,7 +190,7 @@
<el-input :class="scope.row.finalPrice === '' && whetherSubmit?'red':''"
:disabled="viewDisabled"
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[allAmount($event,scope.row),calculateDiscount($event,scope.row)]"
@change="[allAmount($event,scope.row),calculateDiscountCourse($event,scope.row)]"
v-model="scope.row.finalPrice"
type="text"></el-input>
<span style="margin-left:5px"></span>
@ -203,7 +203,6 @@
<el-input :class="scope.row.settlementPrice === '' && whetherSubmit?'red':''"
:disabled="viewDisabled"
@input="scope.row.settlementPrice = scope.row.settlementPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[allAmount($event,scope.row),calculateDiscount($event,scope.row)]"
v-model="scope.row.settlementPrice"
type="text"></el-input>
<span style="margin-left:5px"></span>
@ -324,7 +323,7 @@
<el-table-column label="市场单价" align="center" min-width="160">
<template slot-scope="scope">
<div class="small">
<el-input disabled v-model="scope.row.marketPrice" placeholder=""
<el-input disabled v-model="scope.row.marketValue" placeholder=""
type="text"></el-input>
<span style="margin-left:5px">&nbsp;/&nbsp;</span>
</div>
@ -333,11 +332,11 @@
<el-table-column label="成交单价" align="center" min-width="170">
<template slot-scope="scope">
<div class="small">
<el-input :class="scope.row.finalPrice === '' && whetherSubmit?'red':''"
<el-input :class="scope.row.finalValue === '' && whetherSubmit?'red':''"
:disabled="viewDisabled"
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[dealComputers($event,scope.row),calculateDiscount($event,scope.row),userAmount($event,scope.row)]"
v-model="scope.row.finalPrice"
@input="scope.row.finalValue = scope.row.finalValue.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[dealComputers($event,scope.row),calculateDiscount($event,scope.row)]"
v-model="scope.row.finalValue"
type="text"></el-input>
<span style="margin-left:5px">&nbsp;/&nbsp; </span>
</div>
@ -345,7 +344,6 @@
</el-table-column>
<el-table-column label="折扣率" align="center" min-width="140">
<template slot-scope="scope">
<!-- <div class="discountRate"> -->
<div class="small">
<el-input disabled v-model="scope.row.discountRate" placeholder=""
type="text"></el-input>
@ -359,7 +357,7 @@
:disabled="viewDisabled"
@input="scope.row.accountNum = scope.row.accountNum.replace(/[^0-9.]/g,'')"
v-model="scope.row.accountNum"
@change="[dealComputers($event,scope.row),dealBargain($event,scope.row),calculateDiscount($event,scope.row)]"
@change="[dealComputers($event,scope.row),dealBargain($event,scope.row)]"
type="text"></el-input>
</div>
</template>
@ -368,11 +366,11 @@
<el-table-column label="成交价" align="center" min-width="180">
<template slot-scope="scope">
<div class="small">
<el-input :class="scope.row.totalAmount === '' && whetherSubmit?'red':''"
<el-input :class="scope.row.finalPrice === '' && whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled"
@blur="[allAmount($event,scope.row),allAmountChange($event,scope.row),calculateDiscount($event,scope.row)]"
@input="scope.row.totalAmount = scope.row.totalAmount.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.totalAmount"
@blur="[allAmount($event,scope.row),dealFinalValue($event,scope.row)]"
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.finalPrice"
type="text"></el-input>
</div>
</template>
@ -383,7 +381,6 @@
<el-input :class="scope.row.settlementPrice === '' && whetherSubmit?'red':''"
:disabled="viewDisabled"
@input="scope.row.settlementPrice = scope.row.settlementPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
@change="[allAmount($event,scope.row),calculateDiscount($event,scope.row)]"
v-model="scope.row.settlementPrice"
type="text"></el-input>
<span style="margin-left:5px"></span>
@ -965,7 +962,7 @@ export default {
if (this.dataPlatformPermissions.length) {
let dataVerify =
this.dataPlatformPermissions.some(e => {
if (!e.periodOfUse || e.finalPrice === '' || !e.accountNum || e.totalAmount === '') {
if (!e.periodOfUse || e.finalPrice === '' || !e.accountNum || e.settlementPrice === '') {
return false;
} else {
return true;
@ -1122,9 +1119,10 @@ export default {
ship: 0,// 01
authority: 1, // 01
options: 1,
settlementPrice: '', //
settlementMethod: '', // 01
businessProportion: '', //
settlementPrice: '', //
settlementMethod: e.settlementMethod, // 01
settlementPriceUnit: e.settlementPrice, //
businessProportion: e.businessProportion, //
};
that.coursePermissions.push(obj);
};
@ -1230,7 +1228,9 @@ export default {
endTime: "", //
remainingPeriod: "",//
marketValue: e.market, //
marketValue: e.market, //
finalPrice: '',//
finalValue: '', //
discountRate: "",//
accountNum: "",//
totalAmount: orderType === 2 ? 0 : '',//
@ -1238,9 +1238,10 @@ export default {
ship: 0,// 01
authority: 0,//
options:1,
settlementPrice: '', //
settlementMethod: '', // 01
businessProportion: '', //
settlementPrice: '', //
settlementMethod: e.settlementMethod, // 01
settlementPriceUnit: e.settlementPrice, //
businessProportion: e.businessProportion, //
};
that.dataPlatformPermissions.push(obj);
};
@ -1315,16 +1316,16 @@ export default {
handleNaN(val) {
return isNaN(val) ? 0 : val
},
//
calculateDiscount(val, row) {
//
calculateDiscountCourse(val, row) {
if (row.finalPrice)
debugger
row.discountRate = (row.finalPrice / row.marketValue * 100).toFixed(2) + "%";
},
//
userAmount(val, row) {
if (val && row.totalAmount) {
// row.accountNum = this.handleNaN(Math.round(row.totalAmount / val))
}
//
calculateDiscount(val, row) {
if (row.finalValue)
row.discountRate = (row.finalValue / row.marketValue * 100).toFixed(2) + "%";
},
//
contractTimeChange(val) {
@ -1335,6 +1336,7 @@ export default {
},
//
allAmount($event, row) {
this.dealSettlePrice(row)
//
let courseArr = [];
this.coursePermissions.map(e => {
@ -1349,25 +1351,29 @@ export default {
let dataTotalPrice = dataArr.reduce((a, b) => a + b, 0);
this.form.orderAmount = courseTotalPrice * 10000 + dataTotalPrice;
},
// --
allAmountChange(val, row) {
if (row.totalAmount) {
let all = row.totalAmount;
if (row.accountNum) {//
row.finalPrice = this.handleNaN(Math.round(all / row.accountNum).toFixed(2))
}
if (row.finalPrice) {//
// row.accountNum = Math.floor(all / row.finalPrice);
row.accountNum = this.handleNaN(Math.round(all / row.finalPrice))
}
// ////
dealFinalValue(val, row) {
const { periodOfUse, options, accountNum, finalPrice } = row
if (periodOfUse && accountNum && finalPrice) {
debugger
row.finalValue = (finalPrice / accountNum / periodOfUse * (!options ?
365 :
options === 1 ?
12 :
1)).toFixed(2)
}
},
//
// **//
dealComputers(e, row) {
if (row.finalPrice && row.accountNum) {
row.totalAmount = this.handleNaN(Math.round((row.finalPrice) * (row.accountNum)).toFixed(2))
}
this.allAmount();
const { finalValue, accountNum, periodOfUse, options } = row
if (finalValue && accountNum) {
row.finalPrice = ((!options ?
finalValue / 365 * periodOfUse :
options === 1 ?
finalValue / 12 * periodOfUse :
finalValue * periodOfUse) * accountNum).toFixed(2)
}
this.allAmount(e, row)
},
//
dealBargain(e, row) {
@ -1375,9 +1381,31 @@ export default {
row.finalPrice = this.handleNaN(Math.round(row.totalAmount / row.accountNum).toFixed(2))
}
},
//
dealSettlePrice(row) {
debugger
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
let sPrice = ''
if (row.settlementMethod === '0') {
// **/**(1)
const priceUnit = row.settlementPriceUnit
sPrice = ((!unit ?
priceUnit / 365 * useUnit :
unit === 1 ?
priceUnit / 12 * useUnit :
priceUnit * useUnit) * (row.authority ?
1 :
row.accountNum)).toFixed(2)
} else {
// *
sPrice = row.finalPrice * row.businessProportion / 100
}
row.settlementPrice = this.handleNaN(sPrice)
},
// 使
deadLine(e,row,options, isDate) {
debugger
let optionsData = ''
if(e > 0){
if (options == 1){
@ -1399,10 +1427,10 @@ export default {
let endYear = timestamp - time
let endYears = endYear/1000/60/60/24
row.remainingPeriod = endYears
//
if (row.authority) {
const unit = row.options // 使
const useUnit = row.periodOfUse // 使
//
if (row.authority) {
const price = row.marketPrice //
// //365,/12)
row.marketValue = (!unit ?
@ -1411,6 +1439,7 @@ export default {
price / 12 * useUnit :
price * useUnit).toFixed(2)
}
this.dealSettlePrice(row)
// +1
if (isDate) {
const cId = row.dataOrCourseId

@ -17,7 +17,7 @@
highlight-current
:expand-on-click-node="false"
@node-click="handleNodeClick"
:props="{children: 'children', label: 'organizationName', isLeaf: 'leaf'}"
:props="{children: 'children', label: 'partnerClassificationName', isLeaf: 'leaf'}"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span class="org-name">{{ node.label }}</span>
@ -47,17 +47,17 @@
</div>
<el-dialog
:title="orgForm.id ? '编辑' : '新增' + '分类'"
:title="typeForm.id ? '编辑' : '新增' + '分类'"
:visible.sync="orgVisible"
:close-on-click-modal="false"
width="50%"
>
<el-form v-if="orgVisible" ref="orgForm" :model="orgForm" :rules="orgRules" label-width="100px">
<el-form-item label="分类名称" prop="organizationName">
<el-input v-model.trim="orgForm.organizationName" placeholder="请输入"></el-input>
<el-form v-if="orgVisible" ref="typeForm" :model="typeForm" :rules="orgRules" label-width="100px">
<el-form-item label="分类名称" prop="partnerClassificationName">
<el-input v-model.trim="typeForm.partnerClassificationName" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label="上级部门">
<span v-if="orgForm.parentName">{{ orgForm.parentName }}</span>
<span v-if="typeForm.parentName">{{ typeForm.parentName }}</span>
<el-cascader
v-else
:options="orgListDia"
@ -182,14 +182,14 @@ export default {
orgListDia: [],
studentType: 1, //:(1. 2.)
orgVisible: false, //
orgForm: {
typeForm: {
id: '',
organizationName: ''
partnerClassificationName: ''
},
cascaderValue: [], //
cascaderProps: {
checkStrictly: true,
label: "organizationName",
label: "partnerClassificationName",
value: "id"
},
treeVisible: true,
@ -210,7 +210,7 @@ export default {
staffArchitectureId: []
},
orgRules: {
organizationName: [
partnerClassificationName: [
{ required: true, message: "请输入部门名称", trigger: "blur" }
]
},
@ -250,7 +250,7 @@ export default {
casProps: {
multiple: true,
checkStrictly: true,
label: 'organizationName',
label: 'partnerClassificationName',
value: 'id',
isLeaf: 'leaf'
},
@ -269,17 +269,16 @@ export default {
watch: {
keyWord: function(val) {
clearTimeout(this.searchTimer);
this.searchTimer = setTimeout(this.getStaff, 500);
this.searchTimer = setTimeout(this.getList, 500);
}
},
mounted() {
this.getOrg()
this.getRole()
},
methods: {
//
async getOrg() {
const res = await this.$post(this.api.treeListArch)
const res = await this.$post(this.api.listParner)
const list = res.treeList
// children
const handleLeaf = list => {
@ -294,7 +293,7 @@ export default {
handleLeaf(list)
this.orgList = list
this.handleOrgId(list)
this.getStaff()
this.getList()
},
// id
handleOrgId(list, ids) {
@ -310,12 +309,11 @@ export default {
},
//
addOrg(node, data) {
this.orgForm = {
this.typeForm = {
id: '',
parentId: data ? data.id : 1,
level: data ? data.level + 1 : 1,
parentName: data ? data.organizationName : '',
organizationName: ''
partnerClassificationName: ''
}
this.orgListDia = this.orgList
this.orgVisible = true
@ -325,9 +323,9 @@ export default {
const list = JSON.parse(JSON.stringify(this.orgList))
this.handleOrg(list, data.id, 0)
this.orgListDia = list
this.orgForm = {
this.typeForm = {
id: data.id,
organizationName: data.organizationName
partnerClassificationName: data.partnerClassificationName
}
this.orgVisible = true
const ids = data.ids
@ -356,7 +354,7 @@ export default {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.deleteArch}?id=${data.id}`).then(res => {
this.$post(`${this.api.deleteParner}?id=${data.id}`).then(res => {
util.successMsg("删除成功")
this.getOrg()
}).catch(res => {})
@ -364,24 +362,24 @@ export default {
},
// /
orgSubmit() {
this.$refs.orgForm.validate((valid) => {
this.$refs.typeForm.validate((valid) => {
if (valid) {
const form = this.orgForm
const form = this.typeForm
const cas = this.cascaderValue
const len = cas.length
if (cas && len) {
this.orgForm.parentId = cas[len - 1]
this.orgForm.level = len + 1
this.typeForm.parentId = cas[len - 1]
this.typeForm.level = len + 1
}
if (!form.id) {
//
this.$post(this.api.saveArch, form).then(res => {
this.$post(this.api.saveParner, form).then(res => {
util.successMsg("新增成功!")
this.closeOrg()
}).catch(err => {})
} else {
//
this.$post(this.api.updateArch, form).then(res => {
this.$post(this.api.updateParner, form).then(res => {
util.successMsg("编辑成功!")
this.closeOrg()
}).catch(err => {})
@ -393,7 +391,7 @@ export default {
handleNodeClick(data) {
this.$refs.table.clearSelection()
this.studentType = null
this.getStaff()
this.getList()
},
//
closeOrg() {
@ -402,10 +400,9 @@ export default {
this.getOrg()
},
//
getStaff() {
this.$post(this.api.staffList, {
type: this.studentType || 1,
staffArchitectureId: this.$refs.orgTree.getCurrentKey() || '',
getList() {
this.$post(this.api.partnerAccountList, {
partnerClassificationId: this.$refs.orgTree.getCurrentKey() || '',
keyWord: this.keyWord,
pageNum: this.page,
pageSize: this.pageSize
@ -417,7 +414,7 @@ export default {
//
currentChange(val) {
this.page = val
this.getStaff()
this.getList()
},
handleSelectionChange(val) { //
this.multipleSelection = val
@ -425,7 +422,7 @@ export default {
initData() {
this.$refs.table.clearSelection()
this.page = 1
this.getStaff()
this.getList()
},
//
add() {

Loading…
Cancel
Save