Commit df799594 by 前端

Merge branch 'SAAS+V4.51.0-0331' of http://192.168.3.233:8090/saas_plus/dj-car-l…

…ife-system into SAAS+V4.51.0-0331
2 parents d5494254 90edaefb
Showing 34 changed files with 918 additions and 127 deletions
......@@ -145,3 +145,33 @@ export function exportGrantRecord(data) {
data.method = 'dj.api.smartcarlife.resident.coupon.grant.record.export'
return request(data, RequestMethods.POST)
}
// 月度统计列表
export function monthlyStatistisc(data) {
data.method = 'dj.api.smartcarlife.resident.point.monthly.statistics'
return request(data, RequestMethods.POST)
}
// 月度统计导出
export function monthlyStatistiscExport(data) {
data.method = 'dj.api.smartcarlife.resident.point.monthly.statistics.export'
return request(data, RequestMethods.POST)
}
// 门店品牌
export function brandList(data = {}) {
data.method = 'dj.api.smartcarlife.common.car.brand.list'
return request(data, RequestMethods.POST)
}
// 归属商户
export function yqMerchantList(data = {}) {
data.method = 'dj.smartcarlife.api.yqMerchant.list'
return request(data, RequestMethods.POST)
}
// 服务门店
export function query4SRefByYqShop(data = {}) {
data.method = 'dj.api.scenemerchantref.query4SRefByYqShop'
return request(data, RequestMethods.POST)
}
......@@ -217,3 +217,14 @@ export function deliverTargeConfigImport(data) {
return request(data, "post", ["file"])
}
/** 主机厂交付数 end */
// 新增或者修改预警设置
export function saveOrUpdateWarningConfig(data) {
data.method = `dj.api.smartcarlife.warningmsg.WarningThreshold.saveOrUpdateEarlyWarningThresholdConfig`
return request(data)
}
// 根据商户号查询预警
export function findWarningConfig(data) {
data.method = `dj.api.smartcarlife.warningmsg.WarningThreshold.findByMerchantNo`
return request(data)
}
......@@ -827,7 +827,8 @@ export const downloadReportManage_reportType = [
{ confId: "selleruseruserdipadanalysis", confValue: "驻店人员平板使用分析" },
{ confId: "dailybehaviorsummary", confValue: "日行为汇总表" },
{ confId: "weeklybehaviorsummary", confValue: "周行为汇总表" },
{ confId: "businessDataSummary", confValue: "业务数据汇总" }
{ confId: "businessDataSummary", confValue: "业务数据汇总" },
{ confId: "yanbaoMerAndPerRanking", confValue: "门店产值及个人成交排名" }
]
// 下载报表 业务类型
......@@ -982,7 +983,10 @@ export const filterOpt = [
{ confId: 2, confValue: "待我处理的" },
{ confId: 3, confValue: "我处理过的" }
]
export const supervisorStatuOpt=[
{ confId: 1, confValue: "已跟进" },
{ confId: 0, confValue: "未跟进" }
]
// 驻店积分管理 状态
export const pointStatusOpt = [
{ confId: 1, confValue: "启用" },
......
......@@ -890,6 +890,12 @@ export const routerName = {
parentId: "90619",
label: "删除",
handle: "handleDelete"
},
{
authId: "9061927",
parentId: "90619",
label: "预警设置",
handle: "warningHandle"
}
],
// component: _import("systemConfig/ShopConfig/index")
......
......@@ -98,7 +98,8 @@ import {
warnStageyOpt,
statusOpt,
priorityShowText,
filterOpt
filterOpt,
supervisorStatuOpt
} from "@/common/constants.js"
export default {
name: "Details",
......@@ -123,6 +124,7 @@ export default {
salespersonId: "",
createTime: [dayjs().subtract(30, "day").toDate(), dayjs().toDate()],
bussinessType: "",
supervisorCompletionFlag:'',
statusList: [],
storePersonId: "",
searchType: ""
......@@ -285,7 +287,17 @@ export default {
optionId: "confId",
optionLabel: "confValue",
optionsName: "businessOpt"
}
},
{
label: "督导跟进",
name: "supervisorCompletionFlag",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "supervisorStatuOpt"
},
],
getListApi: warningMsgDetailListWithPage,
// 表格参数
......@@ -316,6 +328,11 @@ export default {
width: "150"
},
{
label: "指标说明",
prop: "msgDetail",
width: "150"
},
{
label: "预警周期",
prop: "updatedDate",
width: "180",
......@@ -396,6 +413,22 @@ export default {
}
},
{
label: "督导跟进",
prop: "statusName",
width: "100",
formatter: (cellValue) => {
return cellValue.supervisorCompletionFlag==1 ? '已跟进' :cellValue.supervisorCompletionFlag===0?'未跟进': "--"
},
className: (cellValue) => {
return {
1: "yellowSpot",
2: "greenSpot",
3: "ashSpot",
0: "ashSpot"
}[cellValue.supervisorCompletionFlag]
}
},
{
label: "下次跟进人",
prop: "followerName",
width: "150"
......@@ -421,6 +454,7 @@ export default {
warnStageyOpt: deepClone(warnStageyOpt),
statusOpt: deepClone(statusOpt),
filterOpt: deepClone(filterOpt),
supervisorStatuOpt:deepClone(supervisorStatuOpt),
supervisorOpt: [],
saleOpt: [],
categoryList: [],
......@@ -464,6 +498,7 @@ export default {
this.searchForm.staffName = this.params_obj.staffName
this.searchForm.merchantName = this.params_obj.merchantName
this.searchForm.bussinessType = this.params_obj.bussinessType
this.searchForm.supervisorCompletionFlag=this.params_obj.supervisorCompletionFlag
this.searchForm.statusList = this.params_obj.statusList
}
this.getBaseData()
......@@ -489,7 +524,7 @@ export default {
beforeSearchFn() {
return new Promise((resolve) => {
console.log("this.searchForm.warnCycle", this.searchForm.warnCycle)
console.log("this.searchForm", this.searchForm)
if (this.searchForm.warnCycle) {
this.searchForm.warningStartDate = Util.dateFormate(
this.searchForm.warnCycle[0],
......@@ -538,6 +573,7 @@ export default {
salespersonId: "",
createTime: [dayjs().subtract(30, "day").toDate(), dayjs().toDate()],
bussinessType: "",
supervisorCompletionFlag:'',
statusList: [],
storePersonId: "",
searchType: ""
......
......@@ -184,7 +184,19 @@ export default {
label: '跟进内容',
prop: 'followNotes',
width: '250px'
}, {
},
{
label: "执行完成时间",
prop: "completionTime",
width: "150",
formatter: (cellValue) => {
return Util.dateFormate(
cellValue.completionTime,
"YYYY-MM-DD HH:mm:ss"
)
}
},
{
label: '跟进人',
prop: 'followerName'
}, {
......
......@@ -161,7 +161,19 @@ export default {
label: '跟进内容',
prop: 'followNotes',
width: '250px'
}, {
},
{
label: "执行完成时间",
prop: "completionTime",
width: "150",
formatter: (cellValue) => {
return Util.dateFormate(
cellValue.completionTime,
"YYYY-MM-DD"
)
}
},
{
label: '跟进人',
prop: 'followerName'
}, {
......
......@@ -118,7 +118,7 @@ import { Util, deepClone, downLoadFile } from '@/common/util'
import detailDialog from './components/detailDialog'
import handleDialog from './components/handleDialog'
import { findAllData, findAllPersonRelations, warningMsgDetailListWithPage, warningMsgDetailListWithPageExport } from '@api/earlyWarningManager'
import { businessOpt, priorityOpt, warnStageyOpt, statusOpt, priorityShowText, filterOpt } from '@/common/constants.js'
import { businessOpt, priorityOpt, warnStageyOpt, statusOpt, priorityShowText, filterOpt ,supervisorStatuOpt} from '@/common/constants.js'
export default {
name: 'Details',
props: {
......@@ -140,6 +140,7 @@ export default {
salespersonId: '',
createTime: '',
bussinessType: '',
supervisorCompletionFlag:'',
statusList: [],
storePersonId: '',
searchType: ''
......@@ -269,7 +270,17 @@ export default {
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'businessOpt'
}],
},
{
label: "督导跟进",
name: "supervisorCompletionFlag",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "supervisorStatuOpt"
}],
getListApi: warningMsgDetailListWithPage,
// 表格参数
tableParams: {
......@@ -295,7 +306,13 @@ export default {
label: '预警事项',
prop: 'rule',
width: '150'
}, {
},
{
label: "指标说明",
prop: "msgDetail",
width: "150"
},
{
label: '预警周期',
prop: 'updatedDate',
width: '180',
......@@ -357,7 +374,23 @@ export default {
0: 'ashSpot'
}[cellValue.status]
}
}, {
}, {
label: "督导跟进",
prop: "statusName",
width: "100",
formatter: (cellValue) => {
return cellValue.supervisorCompletionFlag==1 ? '已跟进' :cellValue.supervisorCompletionFlag===0?'未跟进': "--"
},
className: (cellValue) => {
return {
1: "yellowSpot",
2: "greenSpot",
3: "ashSpot",
0: "ashSpot"
}[cellValue.supervisorCompletionFlag]
}
},
{
label: '下次跟进人',
prop: 'followerName',
width: '150'
......@@ -379,6 +412,7 @@ export default {
warnStageyOpt: deepClone(warnStageyOpt),
statusOpt: deepClone(statusOpt),
filterOpt: deepClone(filterOpt),
supervisorStatuOpt:deepClone(supervisorStatuOpt),
supervisorOpt: [],
saleOpt: [],
categoryList: [],
......@@ -419,6 +453,7 @@ export default {
this.searchForm.merchantName = this.params_obj.merchantName
this.searchForm.bussinessType = this.params_obj.bussinessType
this.searchForm.statusList = this.params_obj.statusList
this.searchForm.supervisorCompletionFlag=this.params_obj.supervisorCompletionFlag
}
this.getBaseData()
},
......@@ -470,6 +505,7 @@ export default {
salespersonId: '',
createTime: '',
bussinessType: '',
supervisorCompletionFlag:'',
statusList: [],
storePersonId: '',
searchType: ''
......
......@@ -23,3 +23,14 @@ export function filterSpecsStr(data) {
return "-"
}
}
export function convertYuanToWan(yuan) {
// 将元转换为万元
const wan = yuan / 10000
// 判断小数部分是否为零
if (wan % 1 === 0) {
return wan.toFixed(0) // 如果是整数,保留0位小数
} else {
return wan.toFixed(2) // 否则保留2位小数
}
}
......@@ -270,7 +270,7 @@ import relateStoreTable from './relateStoreTable.vue'
import { getList, getAccountMerchantList } from '@/api/merchant'
import selectGoodsDialog from '../../components/selectGoodsDialog.vue'
import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption'
import { filterSpecsStr, convertYuanToWan } from '../../filterOption'
export default {
name: 'GroundingForm',
components: {
......@@ -610,7 +610,9 @@ export default {
..._valueObj,
goodsName: _valueObj.goodsInfo.goodsName,
tempGoodsTypeName: result,
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(_valueObj),
djCost: _valueObj?.djCost,
......
......@@ -16,7 +16,7 @@ import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { baseConfig } from '@/main'
import { filterSpecsStr } from "../filterOption"
import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default {
name: 'EditGrounding',
components: {
......@@ -307,7 +307,9 @@ export default {
...res?.upgradeGoods,
goodsName: res.goodsInfo.goodsName,
tempGoodsTypeName: result,
serviceItemNames: res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
serviceItemNames: res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......
......@@ -16,7 +16,7 @@ import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
import { baseConfig } from "@/main"
import { filterSpecsStr } from '../filterOption'
import { filterSpecsStr, convertYuanToWan } from '../filterOption'
export default {
name: 'GroundingDetail',
components: {
......@@ -226,7 +226,9 @@ export default {
...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName,
tempGoodsTypeName: result,
serviceItemNames: res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
serviceItemNames: res?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......
......@@ -269,7 +269,7 @@ import { getList, getAccountMerchantList } from '@/api/merchant'
import { upgradeSupplyModeList, crowdUpgradeSupplyModeList, packageGoodsForm } from "../../grounding/constants/data"
import selectGoodsDialog from '../../components/selectGoodsDialog.vue'
import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption'
import { filterSpecsStr, convertYuanToWan } from '../../filterOption'
export default {
name: 'GroundingForm',
components: {
......@@ -462,7 +462,11 @@ export default {
..._valueObj,
goodsName: _valueObj.goodsInfo.goodsName,
tempGoodsTypeName: result,
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList?.map(item => { return this.extendedPosiType.includes(_valueObj?.goodsInfo?.goodsType) ? item.serviceName : `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList?.map(item => {
return this.extendedPosiType.includes(_valueObj?.goodsInfo?.goodsType) ?
item.serviceName :
`${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(_valueObj),
djCost: _valueObj?.djCost,
......@@ -541,7 +545,7 @@ export default {
this.$set(this.formData.groundingGoodsList[index], 'upgradeProductCost', '')
}
// 当商品信息自带嘀加成本时,将输入框置灰
if (!this.filterEmpty(this.formData.groundingGoodsList[index]?.upgradeGoods?.djCost)) {
if (!this.filterEmpty(this.formData.groundingGoodsList[index]?.upgradeGoods?.djCost) && _formBlock[_formBlock.findIndex(subItem => subItem.name == 'djCost')]) {
this.$set(_formBlock[_formBlock.findIndex(subItem => subItem.name == 'djCost')], 'isDisabled', true)
}
this.show = true
......
......@@ -16,7 +16,7 @@ import { packageGoodsForm } from '../grounding/constants/data'
import { mapActions } from 'vuex'
import { deepClone } from '@/common/util'
import { baseConfig } from '@/main'
import { filterSpecsStr } from "../filterOption"
import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default {
name: 'EditPackage',
components: {
......@@ -251,7 +251,9 @@ export default {
goodsName: val.goodsName,
upgradeGoodsName: val?.upgradeGoodsName,
tempGoodsTypeName: result,
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......@@ -351,6 +353,12 @@ export default {
this.editData = data
// 判断套餐的所有子商品适用车型是否存在交集
let seriesIdFlag = false
// let copyGroundingGoodsList = deepClone(data?.groundingGoodsList)
// const seriesIdsSet = copyGroundingGoodsList?.filter(v => {
// return v?.upgradeGoods?.carTypeConfigList?.length
// })?.map(item => {
// return new Set(item.upgradeGoods.carTypeConfigList.map(bItem => bItem.seriesId))
// })
const seriesIdsSet = data?.groundingGoodsList?.map(item =>
new Set(item?.upgradeGoods?.carTypeConfigList?.map(bItem => bItem.seriesId))
)
......@@ -368,28 +376,35 @@ export default {
break
}
}
const confirmSave = () => {
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
this.checkEvent(params)
}).catch(err => {
console.log(err)
})
}
if (seriesIdFlag) {
this.$confirm('<p>当前套餐商品的适用车型不一致,</p>是否确认继续使用?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
if ((num == 1)) {
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
this.checkEvent(params)
}).catch(err => {
console.log(err)
})
if (num === 1) {
confirmSave()
} else {
this.checkEvent(params)
}
})
} else {
this.checkEvent(params)
if (num === 1) {
confirmSave()
} else {
this.checkEvent(params)
}
}
},
checkEvent(params) {
......
......@@ -16,7 +16,7 @@ import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util'
import { baseConfig } from "@/main"
import { packageGoodsDetail, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '../grounding/constants/data'
import { filterSpecsStr } from "../filterOption"
import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default {
name: 'PackageDetail',
components: {
......@@ -183,7 +183,9 @@ export default {
upgradeGoodsName: val?.upgradeGoodsName,
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result,
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => { return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}` })?.join(','), // 服务项目
serviceItemNames: val?.upgradeGoods?.upgradeGoodsServiceItemsList?.map(item => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})?.join(','), // 服务项目
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......
......@@ -121,7 +121,7 @@ import { getGoodsInfoById } from '@/api/commodity'
import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main'
import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption'
import { filterSpecsStr, convertYuanToWan } from '../../filterOption'
export default {
name: 'DrawerDetail',
components: {ellipsisPopover},
......@@ -178,7 +178,9 @@ export default {
}
const positionNamesArr = deepClone(this.positionTypeList).filter(val => item.position?.split(',')?.includes(val.position + '')) || []
item.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : ''
item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}` })?.join(',')
item.serviceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => {
return `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${convertYuanToWan(v.minPrice)}-${convertYuanToWan(v.maxPrice)}万` : ''}`
})?.join(',')
item.extendServiceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}` })?.join(',')
item.specificationName = this.filterSpecsStr(obj)
item.carSeriesName = item?.carTypeConfigList?.map(v => { return v.seriesName })?.join('/')
......
......@@ -227,7 +227,7 @@
size="small"
v-model="subItem.djCost"
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }"
:disabled="goodsInfoData.scrmFlag == 'Y'"
:disabled="true"
@input="handlePrice($event, subIndex, 'djCost')">
<el-popover v-if="filterEmpty(subItem.djCost) && subItem.djCostEmpty"
slot="suffix"
......@@ -567,6 +567,9 @@ export default {
specsInputVal: '',
specsStartInputVal: '',
specsEndInputVal: '',
oldspecsInputVal: '',
oldspecsStartInputVal: '',
oldspecsEndInputVal: '',
reg: {
priceReg: /^\d[\d\.]*$/
},
......@@ -804,15 +807,37 @@ export default {
this.serviceSelectIndex = index
this.serviceItemsVisible = true
},
// 防止精度丢失
highPrecisionAdd(arr) {
// 转换为字符串处理小数,避免浮点数精度问题
let total = 0
arr.forEach((item) => {
const num = parseFloat(item)
if (!isNaN(num)) {
total = this.addPrecise(total, num)
}
})
return total
},
addPrecise(a, b) {
const aStr = a.toString()
const bStr = b.toString()
const aDecimalLen = (aStr.split(".")[1] || "").length
const bDecimalLen = (bStr.split(".")[1] || "").length
const maxDecimalLen = Math.max(aDecimalLen, bDecimalLen)
const multiplier = Math.pow(10, maxDecimalLen)
const aInt = Math.round(a * multiplier)
const bInt = Math.round(b * multiplier)
const result = (aInt + bInt) / multiplier
return result
},
handleRelateServiceConfirm(data) {
// 批量操作服务项目
if (this.filterEmpty(this.serviceSelectIndex)) {
this.goodsInfoData?.goodsSpecificationList.map(v => {
if (v.checked) {
v.serviceItemArr = data
v.djCost = data.reduce((v, i) => {
return v + i.standardSalesCost
}, 0)
v.djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
}
return v
})
......@@ -820,13 +845,11 @@ export default {
}
const index = this.serviceSelectIndex
let djCost = 0
data.forEach(v => { // 嘀加成本通过已选服务项目的销售成本自动累计
djCost += v.standardSalesCost
})
// 嘀加成本通过已选服务项目的销售成本自动累计
djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'serviceItemArr', data)
// 暂时放开嘀加成本与服务项目联动累加
// this.$set(this.goodsInfoData.goodsSpecificationList[index], 'djCost', djCost)
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'djCost', djCost)
this.serviceSelectIndex = null
this.serviceSelected = []
this.serviceItemsVisible = false
......@@ -984,7 +1007,11 @@ export default {
handleSpecsInput(e, key) {
if (this.selectTypeSequence > 0) {
let newValue = e.replace(/[^\d.]/g, '')
let oldValue = this[key]
let oldValue = this[`old${key}`]
// let intergerDigit = this.selectTypeSequence == 3 ? 3 : 2 // 整数位数
// let pointDigit = this.selectTypeSequence == 3 ? 2 : 0 // 小数位数
// let maxValue = this.selectTypeSequence == 3 ? 200 : 99 // 最大值
// this.$set(this, key, limitPrice(newValue, oldValue, intergerDigit, pointDigit, 0, maxValue))
this.$set(this, key, limitPrice(newValue, oldValue, 2, this.selectTypeSequence == 3 ? 2 : 0, 0))
this.$set(this, `old${key}`, this[key])
}
......@@ -1033,8 +1060,11 @@ export default {
if (this.selectTypeSequence == 3) {
this.specsStartInputVal = tag.specificationValue?.split('-')[0]
this.specsEndInputVal = tag.specificationValue?.split('-')[1]
this.oldspecsStartInputVal = tag.specificationValue?.split('-')[0]
this.oldspecsEndInputVal = tag.specificationValue?.split('-')[1]
} else {
this.specsInputVal = tag.specificationValue
this.oldspecsInputVal = tag.specificationValue
}
this.tempTag = tag.specificationValue
this.isChange = true
......@@ -1139,7 +1169,7 @@ export default {
for (let i = 0; i < ranges.length; i++) {
const [rangeStart, rangeEnd] = ranges[i].map(Number)
// 判断是否存在冲突
if (start <= rangeEnd && end >= rangeStart) {
if (start < rangeEnd && end > rangeStart) {
return true
}
}
......
......@@ -40,10 +40,18 @@
label="年限"
align="center">
</el-table-column>
<el-table-column prop="standardSalesCost"
label="销售成本/元"
<el-table-column prop="price"
label="适用车价/万元"
width="140"
align="center">
<template slot-scope="scope">
<span>{{ `${convertYuanToWan(scope.row.minPrice)}-${convertYuanToWan(scope.row.maxPrice)}`}}</span>
</template>
</el-table-column>
<el-table-column prop="djCost"
label="嘀加成本/元"
width="100"
align="center">
</el-table-column>
<el-table-column prop="serviceOverview"
width="210"
......@@ -81,6 +89,7 @@
<script>
import { deepClone } from '@/common/util'
import { convertYuanToWan } from '../../filterOption'
export default {
name: 'RelateServiceDialog',
data() {
......@@ -90,7 +99,8 @@ export default {
// 分页
total: 0,
currentPage: 1,
pageSize: 20
pageSize: 20,
convertYuanToWan
}
},
......@@ -115,10 +125,15 @@ export default {
mounted() {
this.selectedData = deepClone(this.serviceSelected)
// 若是历史服务项目数据不回显(历史已选服务项目没有适用车价)
this.selectedData = this.selectedData?.filter(val => !this.filterEmpty(val.serviceItemId))
this.getSelectingList()
},
methods: {
filterEmpty(data) {
return data instanceof Array ? data.length <= 0 : (data ?? '') === ''
},
selectable(row) {
const { selectedData } = this
// 每个服务项目code只能选中一个 按等级和年限区分
......@@ -143,8 +158,8 @@ export default {
pageSize: this.pageSize
}).then(res => {
res?.list?.forEach(val => {
val.uniqueValue = `${val.serviceName}-${val.serviceGrade}/${val.servicePeriod}`
val.uniqueCode = `${val.serviceCode}-${val.serviceGrade}/${val.servicePeriod}`
val.uniqueValue = `${val.serviceName}-${val.serviceGrade}/${val.servicePeriod}${(val.serviceItemId) ? `/${this.convertYuanToWan(val.minPrice)}-${this.convertYuanToWan(val.maxPrice)}万` : ''}`
val.uniqueCode = `${val.serviceCode}-${val.serviceGrade}/${val.servicePeriod}${(val.serviceItemId) ? `/${val.serviceItemId}` : ''}`
})
this.selectingData = res.list
this.total = res.total
......
......@@ -226,7 +226,7 @@
<td v-if="(extendedPosiType.includes(goodsInfoData.goodsType) || equitySceneType.includes(goodsInfoData.goodsType)) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-input placeholder="请输入"
size="small"
:disabled="goodsInfoData.scrmFlag == 'Y'"
:disabled="true"
v-model="subItem.djCost"
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }"
@input="handlePrice($event, subIndex, 'djCost')">
......@@ -650,15 +650,37 @@ export default {
this.serviceSelectIndex = index
this.serviceItemsVisible = true
},
// 防止精度丢失
highPrecisionAdd(arr) {
// 转换为字符串处理小数,避免浮点数精度问题
let total = 0
arr.forEach((item) => {
const num = parseFloat(item)
if (!isNaN(num)) {
total = this.addPrecise(total, num)
}
})
return total
},
addPrecise(a, b) {
const aStr = a.toString()
const bStr = b.toString()
const aDecimalLen = (aStr.split(".")[1] || "").length
const bDecimalLen = (bStr.split(".")[1] || "").length
const maxDecimalLen = Math.max(aDecimalLen, bDecimalLen)
const multiplier = Math.pow(10, maxDecimalLen)
const aInt = Math.round(a * multiplier)
const bInt = Math.round(b * multiplier)
const result = (aInt + bInt) / multiplier
return result
},
handleRelateServiceConfirm(data) {
// 批量操作权益服务项目
if (this.filterEmpty(this.serviceSelectIndex)) {
this.goodsInfoData?.goodsSpecificationSingleList.map(v => {
if (v.checked) {
v.serviceItemArr = data
v.djCost = data.reduce((v, i) => {
return v + i.standardSalesCost
}, 0)
v.djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
}
return v
})
......@@ -666,13 +688,11 @@ export default {
}
const index = this.serviceSelectIndex
let djCost = 0
data.forEach(v => { // 嘀加成本通过已选服务项目的销售成本自动累计
djCost += v.standardSalesCost
})
// 嘀加成本通过已选服务项目的销售成本自动累计
djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'serviceItemArr', data)
// 暂时放开嘀加成本与服务项目联动累加
// this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'djCost', djCost)
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'djCost', djCost)
this.serviceSelectIndex = null
this.serviceSelected = []
this.serviceItemsVisible = false
......
......@@ -34,6 +34,7 @@ import { addProductManage, UpdateProductManage } from '@api/productManage'
import { BaseData, applicableModelTypeList } from '@/common/constants.js'
import { getGoodsInfoById } from '@api/commodity'
import { baseConfig } from '@/main'
import { convertYuanToWan } from '../filterOption'
export default {
name: 'EditProductManage',
components: {
......@@ -129,8 +130,8 @@ export default {
let objData = {}
this.copyUpgradeGoodsList = deepClone(res.upgradeGoodsList).map((val, index) => {
val?.upgradeGoodsServiceItemsList?.forEach(v => {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}`
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${convertYuanToWan(v.minPrice)}-${convertYuanToWan(v.maxPrice)}万` : ''}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${v.serviceItemId}` : ''}`
})
return {
id: val.id,
......@@ -192,8 +193,8 @@ export default {
goodsSpecificationSingleList: deepClone(this.copyUpgradeGoodsList),
upgradeGoodsList: res.upgradeGoodsList?.map(val => {
val?.upgradeGoodsServiceItemsList?.map(v => {
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}`
v.uniqueValue = `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${convertYuanToWan(v.minPrice)}-${convertYuanToWan(v.maxPrice)}万` : ''}`
v.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${v.serviceItemId}` : ''}`
return v
})
return val
......@@ -274,7 +275,10 @@ export default {
serviceName: val.serviceName,
serviceGrade: val.serviceGrade,
servicePeriod: val.servicePeriod,
standardSalesCost: val.standardSalesCost
djCost: val.djCost,
serviceItemId: val.serviceItemId,
minPrice: val.minPrice,
maxPrice: val.maxPrice
})
})
arr.push({
......@@ -330,7 +334,10 @@ export default {
serviceName: val.serviceName,
serviceGrade: val.serviceGrade,
servicePeriod: val.servicePeriod,
standardSalesCost: val.standardSalesCost
djCost: val.djCost,
serviceItemId: val.serviceItemId,
minPrice: val.minPrice,
maxPrice: val.maxPrice
})
})
if (item.statusFlag != 2) {
......
......@@ -203,7 +203,7 @@ import { mapActions } from "vuex"
import { limitPrice } from "@/common/format"
import selectGoodsDialog from "../../../components/selectGoodsDialog.vue"
import { baseConfig } from "@/main"
import { filterSpecsStr } from "../../../filterOption"
import { filterSpecsStr, convertYuanToWan } from "../../../filterOption"
import { businessLineOpt } from "@/common/constants.js"
import { computeProductProfitDetail } from "@api/shelfManage"
export default {
......@@ -342,7 +342,7 @@ export default {
tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}`
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})
?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods),
......@@ -403,7 +403,7 @@ export default {
tempGoodsTypeName: result,
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList
?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}`
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})
?.join(","), // 服务项目
// positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
......
......@@ -324,7 +324,7 @@ import { mapActions } from "vuex"
import { limitPrice } from "@/common/format"
import selectGoodsDialog from "../../../components/selectGoodsDialog.vue"
import { baseConfig } from "@/main"
import { filterSpecsStr } from "../../../filterOption"
import { filterSpecsStr, convertYuanToWan } from "../../../filterOption"
import { computeProductProfitDetail } from "@api/shelfManage"
export default {
name: "PackageTab",
......@@ -559,7 +559,7 @@ export default {
tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}`
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})
?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods),
......@@ -720,7 +720,7 @@ export default {
tempGoodsTypeName: result,
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList
?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}`
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})
?.join(","), // 服务项目
// positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
......
......@@ -195,7 +195,7 @@ import { deepClone } from "@/common/util"
import { mapActions } from "vuex"
import { limitPrice } from "@/common/format"
import { baseConfig } from "@/main"
import { filterSpecsStr } from "@/views/goods/filterOption"
import { filterSpecsStr, convertYuanToWan } from "@/views/goods/filterOption"
import { businessLineOpt } from "@/common/constants.js"
export default {
name: "GoodTab",
......@@ -317,7 +317,7 @@ export default {
tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}`
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})
?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods),
......
......@@ -311,7 +311,7 @@ import { businessNature, businessLineOpt } from "@/common/constants.js"
import { mapActions } from "vuex"
import { limitPrice } from "@/common/format"
import { baseConfig } from "@/main"
import { filterSpecsStr } from "@/views/goods/filterOption"
import { filterSpecsStr, convertYuanToWan } from "@/views/goods/filterOption"
export default {
name: "PackageTab",
......@@ -442,7 +442,7 @@ export default {
tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => {
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}`
return `${item.serviceName}-${item.serviceGrade}/${item.servicePeriod}${(item.serviceItemId) ? `/${convertYuanToWan(item.minPrice)}-${convertYuanToWan(item.maxPrice)}万` : ''}`
})
?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods),
......
......@@ -125,6 +125,7 @@ const isSelect = [
{ label: "近两个月出单", value: 1 },
{ label: "近三个月出单", value: 2 }
]
export default {
components: {
carDialog
......@@ -134,6 +135,7 @@ export default {
return {
sceneList,
searchForm: {
showAllStaff:'',
staffType: 0,
brandIdList: [this.baseConfig.brandId],
sceneType: "0",
......@@ -205,6 +207,17 @@ export default {
optionId: "id",
optionLabel: "label",
optionsName: "secondBrandIdList"
},
{
label: "是否展示所有员工",
name: "showAllStaff",
type: "select",
optionList: [
{ label: "否", value: 0 },
{ label: "是", value: 1 }
],
optionId: "value",
optionLabel: "label"
}
],
tableData: [],
......@@ -672,8 +685,8 @@ export default {
// 第4列(员工姓名列)根据 staffUuid 进行合并
const columnNum = this.searchForm.sceneType == "0" ? 7 : 6
if (columnIndex === 3 || columnIndex > columnNum) {
console.log(rowIndex, row.staffUuid)
console.log(row, column, rowIndex, columnIndex)
// console.log(rowIndex, row.staffUuid)
// console.log(row, column, rowIndex, columnIndex)
let rowspan = 1
for (let i = rowIndex + 1; i < this.tableData.length; i++) {
......@@ -858,6 +871,7 @@ export default {
this.getList()
},
handleReset() {
this.searchForm.showAllStaff=''
this.searchForm.staffType = 0
this.searchForm.brandIdList = [this.baseConfig.brandId]
this.searchForm.merchantNameList = []
......
......@@ -239,7 +239,7 @@ export default {
id: {
type: Number,
default: ""
}
},
},
computed: {
dialogShow: {
......@@ -328,9 +328,11 @@ export default {
})
},
getOrderOperateData() {
let params = {
orderCode: this.detailInfo.orderCode,
operationType: 1
let params = { operationType: 1}
if(this.detailInfo.status=='已失效'){
params.id=this.id
}else{
params.orderCode=this.detailInfo.orderCode
}
getOperationRecord(params).then((res) => {
console.log(res)
......
<template>
<d2-container class="point-list">
<div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'150px'"
:form-data="showFormData" />
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'150px'"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
......@@ -13,21 +18,37 @@
<div class="d2-container-content">
<div class="header-flex">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane v-for="(item, index) in tabPaneList" :label="item.label" :name="item.name" :key="index">
<el-tab-pane
v-for="(item, index) in tabPaneList"
:label="item.label"
:name="item.name"
:key="index"
>
</el-tab-pane>
</el-tabs>
<div>
<span style="margin-right: 10px"><auth-button category="Button" :show-btn-ids="['9140105']" /></span>
<span style="margin-right: 10px"
><auth-button category="Button" :show-btn-ids="['9140105']"
/></span>
<auth-button category="Button" :show-btn-ids="['9140103']" />
</div>
</div>
<d2-table v-if="show" ref="pointTable" :search-form="searchFormSearch" :table-params="tableParams"
:get-list-api="getListApi" :before-search-fn="beforeSearchFn">
<d2-table
v-if="show"
ref="pointTable"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
<div slot="statusSlot" slot-scope="scope">
<span :style="{
'background-color': statusEnum[scope.scope.status].color
}" class="circle"></span>
<span
:style="{
'background-color': statusEnum[scope.scope.status].color
}"
class="circle"
></span>
<span>{{ statusEnum[scope.scope.status].name }}</span>
</div>
<div slot="auth-button" slot-scope="scope">
......@@ -37,22 +58,48 @@
</span>
<!-- 审核 -->
<span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9140101']"
v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1" />
<auth-button v-if="
scope.scope.status == 1 &&
scope.scope.pointsRefundAvailable == 'Y'
" :data="scope.scope" :show-btn-ids="['9140104']" />
<auth-button
:data="scope.scope"
:show-btn-ids="['9140101']"
v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1"
/>
<auth-button
v-if="
scope.scope.status == 1 &&
scope.scope.pointsRefundAvailable == 'Y'
"
:data="scope.scope"
:show-btn-ids="['9140104']"
/>
</span>
</div>
</d2-table>
<!-- 详细信息 -->
<detail-dialog :visible.sync="detailVisible" v-if="detailVisible" :id="id" />
<d2-dialog title="提示" class="refund-dialog" v-if="refundVisible" :is-visible="refundVisible"
@closeDialog="handleRefundClose" @confirmDialog="handleRefundConfirm">
<detail-dialog
:visible.sync="detailVisible"
v-if="detailVisible"
:id="id"
/>
<d2-dialog
title="提示"
class="refund-dialog"
v-if="refundVisible"
:is-visible="refundVisible"
@closeDialog="handleRefundClose"
@confirmDialog="handleRefundConfirm"
>
<div class="title">请确定此次退款的类型</div>
<glsx-combi-form :isBlock="true" ref="refundFormRef" label-width="220px" :form-ref="handleFormRef"
default-width="400px" :form-rules="formRules" :form-obj="refundForm" :form-data="refundFormData">
<glsx-combi-form
:isBlock="true"
ref="refundFormRef"
label-width="220px"
:form-ref="handleFormRef"
default-width="400px"
:form-rules="formRules"
:form-obj="refundForm"
:form-data="refundFormData"
>
</glsx-combi-form>
</d2-dialog>
</div>
......@@ -81,7 +128,6 @@ export default {
},
data() {
var checkIntegral = (rule, value, callback) => {
console.log(this.refundForm.remainingScore, 'this.refundForm.remainingScore')
if (!value) {
return callback(new Error("请输入退回积分"))
}
......@@ -91,28 +137,37 @@ export default {
//第一次退款积分
if (this.refundForm.firstInto) {
if (
value > this.refundForm.remainingScore && this.refundForm.refundType == 1
value > this.refundForm.remainingScore &&
this.refundForm.refundType == 1
) {
callback(new Error("输入的积分超过当前订单最大积分"))
} else if (
value >= this.refundForm.remainingScore && this.refundForm.refundType == 2
value >= this.refundForm.remainingScore &&
this.refundForm.refundType == 2
) {
callback(new Error("输入的积分超过当前订单最大积分"))
} else {
callback()
}
} else {
if (
value > this.refundForm.remainingScore
) {
if (value > this.refundForm.remainingScore) {
callback(new Error("输入的积分超过当前订单最大积分"))
} else {
callback()
}
}
}
}
var checkAmount = (rule, value, callback) => {
if (!value) {
return callback(new Error("请输入退回金额"))
}
if (isNaN(value) || value <= 0) {
callback(new Error("输入大于0的数字"))
} else {
callback()
}
}
return {
show: true,
handleFormRef: "handleFormRef",
......@@ -289,13 +344,15 @@ export default {
orderCode: "",
refundType: "",
refundPoints: "",
firstInto: true
firstInto: true,
refundAmount:''
},
formRules: {
refundType: [
{ required: true, message: "请选择退款类型", trigger: "change" }
],
refundPoints: [{ validator: checkIntegral, trigger: "blur" }]
refundPoints: [{ validator: checkIntegral, trigger: "blur" }],
refundAmount: [{ validator: checkAmount, trigger: "blur" }]
},
refundFormData: [
{
......@@ -320,6 +377,13 @@ export default {
type: "input",
width: "290px",
isDisabled: false
},
{
label: "退回金额",
name: "refundAmount",
type: "input",
width: "290px",
isDisabled: false
}
]
}
......@@ -481,7 +545,7 @@ export default {
if (
this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel
this.showFormData[index].optionLabel
] !== "全部"
) {
const temp = {}
......@@ -589,7 +653,8 @@ export default {
this.refundVisible = true
this.refundForm.orderCode = data.orderCode
this.refundForm.tempPoints = data.integralIncome
this.refundForm.refundPoints = data.integralIncome
this.refundForm.refundPoints = data.integralIncome //退还积分
this.refundForm.refundAmount = data.orderMoney //退还金额
//当前积分能抵扣的最大值
this.getScore()
},
......@@ -599,16 +664,18 @@ export default {
}).then((res) => {
this.refundForm.integralIncome = res.addScore
//最大积分
if (this.refundForm.refundPoints == this.refundForm.integralIncome) {
this.refundForm.remainingScore = res.remainingScore
if (this.refundForm.refundPoints == res.addScore) {
this.refundForm.remainingScore = res.remainingScore //剩余积分
// this.refundForm.remainAmount = res.remainAmount //剩余金额
this.refundForm.firstInto = true
this.refundForm.refundType = 1 //退款类型(1:全退,2:部分退),
this.refundFormData[0].optionList[0].isDisabled = false
this.refundFormData[this.findAttrIdx("refundType")].optionList[0].isDisabled = false
} else {
this.refundForm.remainingScore = res.remainingScore
// this.refundForm.remainAmount = res.remainAmount //剩余金额
this.refundForm.firstInto = false
this.refundForm.refundType = 2
this.refundFormData[0].optionList[0].isDisabled = true
this.refundFormData[this.findAttrIdx("refundType")].optionList[0].isDisabled = true
}
this.updateDisable()
})
......@@ -618,10 +685,13 @@ export default {
if (this.refundForm.refundType == 1) {
this.refundForm.refundPoints = this.refundForm.tempPoints
}
this.refundFormData[1].isDisabled = disabled
this.refundFormData[this.findAttrIdx("refundPoints")].isDisabled = disabled
this.refundFormData[this.findAttrIdx("refundAmount")].isDisabled = disabled
this.refundFormData = deepClone(this.refundFormData)
},
findAttrIdx(attrName) {
return this.refundFormData.findIndex((item) => item.name == attrName)
},
//关闭标记退款
handleRefundClose() {
this.refundVisible = false
......@@ -634,7 +704,8 @@ export default {
markAsRefunded({
orderCode: this.refundForm.orderCode,
refundType: this.refundForm.refundType,
refundPoints: this.refundForm.refundPoints
refundPoints: this.refundForm.refundPoints,
refundAmount:this.refundForm.refundAmount
}).then((res) => {
if (res) {
this.$message.success("退款成功!")
......
......@@ -81,6 +81,7 @@
>
<el-radio :label="1">分值</el-radio>
<el-radio :label="2">排名</el-radio>
<el-radio :label="3">满勤</el-radio>
</el-radio-group>
</div>
<div slot="ratingRankHtml" slot-scope="scope">
......@@ -363,9 +364,11 @@ export default {
this.showOrHideAttr("editFormData", "评级项目", false)
this.showOrHideAttr("editFormData", "评级方式", false)
this.pointRule()
// if (this.infoForm.ratingMethod == 1) {
// this.showOrHideAttr('editFormData', '评级积分', false)
// }
if (this.infoForm.ratingMethod == 1) {
this.showOrHideAttr('editFormData', '评级积分', false)
} else if (this.infoForm.ratingMethod == 2) {
this.showOrHideAttr('editFormData', '评级排名', false)
}
} else if (this.infoForm.levelType == 1) {
this.showOrHideAttr("editFormData", "评级积分", false)
}
......@@ -446,9 +449,12 @@ export default {
if (value == 1) {
this.showOrHideAttr("editFormData", "评级积分", false)
this.showOrHideAttr("editFormData", "评级排名", true)
} else {
} else if (value == 2) {
this.showOrHideAttr("editFormData", "评级积分", true)
this.showOrHideAttr("editFormData", "评级排名", false)
} else if (value == 3) {
this.showOrHideAttr("editFormData", "评级积分", true)
this.showOrHideAttr("editFormData", "评级排名", true)
}
},
......
......@@ -6,12 +6,15 @@
<el-tabs v-model="activeName">
<el-tab-pane label="积分记录"
name="pointsRecord" />
<el-tab-pane label="月度统计记录"
name="monthlyStatistics" />
<el-tab-pane label="积分配置管理"
name="pointsConfig" />
</el-tabs>
<div>
<points-record v-if="activeName === 'pointsRecord'" />
<points-config v-if="activeName === 'pointsConfig'" />
<monthly-statistics v-if="activeName === 'monthlyStatistics'" />
</div>
</div>
</div>
......@@ -20,6 +23,7 @@
<script>
import pointsRecord from './pointsRecord'
import pointsConfig from './pointsConfig'
import monthlyStatistics from './monthlyStatistics'
// import { deepClone } from '@/common/util'
export default {
name: 'StaffIndex',
......@@ -33,7 +37,8 @@ export default {
components: {
pointsRecord,
pointsConfig
pointsConfig,
monthlyStatistics
},
mounted() {
......
<!-- 月度统计记录 -->
<template>
<d2-container class="points-config">
<div class="header"
slot="header">
<d2-search ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px" />
<div class="up-btns">
<el-button :id="tableParams.btnId"
size="small"
type="primary">
查询
</el-button>
<el-button size="small"
@click="handleReset">
重置
</el-button>
</div>
</div>
<div class="d2-container-content">
<d2-table-header>
<el-button @click="handleExport">导出 </el-button>
</d2-table-header>
<d2-table ref="detailListTable"
:search-form="searchData"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn">
</d2-table>
</div>
</d2-container>
</template>
<script>
import { Util, deepClone, downLoadFile } from '@/common/util'
import { brandList, yqMerchantList, query4SRefByYqShop, monthlyStatistisc, monthlyStatistiscExport} from '@api/inStorePoints'
export default {
name: 'PointsConfig',
props: {
},
data() {
return {
searchForm: {
grantTime: ''
},
searchData: {},
showFormData: [
{
label: '员工姓名',
name: 'staffName',
type: 'input',
isClear: true,
},
{
label: '电话号码',
name: 'staffPhone',
type: 'input',
isClear: true,
},
{
label: '服务门店',
name: 'serviceMerchantId',
type: 'select',
isClear: true,
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'serviceMerchantList'
},
{
label: '门店品牌',
name: 'brandId',
type: 'select',
isClear: true,
optionList: [],
optionId: 'id',
optionLabel: 'label',
optionsName: 'brandList'
},
{
label: '归属商户',
name: 'yqMerchantId',
type: 'select',
isClear: true,
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
optionsName: 'merchantList'
},
{
label: "发放时间",
name: "grantTime",
type: "datePicker",
isClear: false,
pickerOptions: "rangePickerOptions"
}],
getListApi: monthlyStatistisc,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: false,
// tableOption: { width: '150px' },
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
}, {
label: '电话号码',
prop: 'staffPhone'
}, {
label: '服务门店',
prop: "serviceMerchantName"
}, {
label: '门店品牌',
prop: 'merchantBrand'
}, {
label: '角色',
prop: 'roleName'
}, {
label: '归属商户',
prop: 'yqMerchantName'
}, {
label: '培训类',
prop: 'trainingScore'
}, {
label: '学习类',
prop: 'studyScore'
}, {
label: '行为类',
prop: 'studyScore'
}, {
label: '总积分',
prop: 'totalScore'
}, {
label: '发放时间',
prop: 'grantTimeRange',
width: '150',
// formatter: (cellValue) => {
// return Util.dateFormate(cellValue.grantTimeRange, 'YYYY-MM-DD HH:mm:ss')
// }
}
]
},
baseData: {
serviceMerchantList: [],
brandList: [],
merchantList: []
},
}
},
created() {
this.searchForm.grantTime = [new Date(), new Date()]
},
mounted() {
this.getBaseData()
},
methods: {
async getBaseData() {
this.findAllServiceMerchant()
this.findAllBrandList()
this.findAllMerchantList()
},
beforeSearchFn() {
return new Promise(resolve => {
console.log('this.searchForm', this.searchForm)
this.searchData = deepClone(this.searchForm)
if(this.searchData.brandId) {
this.searchData.brandIdList = [this.searchForm.brandId]
delete this.searchData.brandId
}
if (this.searchData.grantTime) {
this.searchData.grantTimeStart = Util.dateFormate(this.searchData.grantTime[0], 'YYYY-MM-DD') + ' 00:00:00'
this.searchData.grantTimeEnd = Util.dateFormate(this.searchData.grantTime[1], 'YYYY-MM-DD') + ' 23:59:59'
delete this.searchData.grantTime
}
resolve()
})
},
findAllServiceMerchant() {
query4SRefByYqShop().then((res) => {
this.baseData.serviceMerchantList = res
this.getOptionsList()
})
},
findAllBrandList(id) {
brandList().then((res) => {
this.baseData.brandList = res || []
this.getOptionsList()
})
},
findAllMerchantList() {
yqMerchantList().then(res => {
this.baseData.merchantList = res || []
this.getOptionsList()
})
},
handleReset() {
this.searchForm = {
grantTime: [new Date(), new Date()]
}
this.searchData = {}
this.$refs.detailListTable.refreshTable()
},
getOptionsList() {
this.showFormData.forEach((item, index) => {
if (item.type === 'select') {
if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.showFormData[index].optionLabel] !== '全部'
) {
const temp = {}
temp[this.showFormData[index].optionId] = ''
temp[this.showFormData[index].optionLabel] = '全部'
this.baseData[item.optionsName].unshift(temp)
}
this.$set(
this.showFormData[index],
'optionList',
this.baseData[item.optionsName]
)
}
})
},
handleExport() {
var params = this.searchForm
monthlyStatistiscExport(params).then((res) => {
res && downLoadFile(res)
})
}
}
}
</script>
<style lang="scss" scoped>
.points-config {
margin-top: 40px;
.m-l-md {
margin-left: 20px;
}
}
</style>
<template>
<d2-dialog
title="预警设置"
:is-visible="warningVisible"
class="warningDailog"
width="750px"
btn-ok-label="确定"
@closeDialog="handleClose"
@confirmDialog="handleAddConfirm"
>
<p class="title">延保</p>
<glsx-combi-form
label-width="150px"
default-width="400px"
:form-obj="warningForm"
:form-data="warningFormData"
></glsx-combi-form>
<p class="title">权益</p>
<glsx-combi-form
label-width="150px"
default-width="400px"
:form-obj="warningForm"
:form-data="warningFormData2"
></glsx-combi-form>
<div class="explain">
说明:设置业务兜底指标,按每月进行实时监测,一旦低于设置的指标+3%时,系统自动进行预警。
</div>
</d2-dialog>
</template>
<script>
import { limitPrice } from "@/common/format"
import {
saveOrUpdateWarningConfig,
findWarningConfig
} from "@/api/shopConfig.js"
export default {
data() {
return {
warningForm: {
id: "",
merchantNo: "",
ewConRate: "", //延保转化率
ewAxbConRate: "", //延保安心包转化率
ewLtConRate: "", //延保轮胎转化率
riConRate: "" //权益转化率
},
oldVal: {
ewConRate: "", //延保转化率
ewAxbConRate: "", //延保安心包转化率
ewLtConRate: "", //延保轮胎转化率
riConRate: "" //权益转化率
},
warningFormData: [
{
label: "转化率",
name: "ewConRate",
type: "input",
append: "%",
listeners: {
blur: () => {
this.handleInput(this.warningForm.ewConRate, "ewConRate")
}
}
},
{
label: "安心包转化率",
name: "ewAxbConRate",
type: "input",
append: "%",
listeners: {
blur: () => {
this.handleInput(this.warningForm.ewAxbConRate, "ewAxbConRate")
}
}
},
{
label: "轮胎转化率",
name: "ewLtConRate",
type: "input",
append: "%",
listeners: {
blur: (e) => {
this.handleInput(this.warningForm.ewLtConRate, "ewLtConRate")
}
}
}
],
warningFormData2: [
{
label: "转化率",
name: "riConRate",
type: "input",
append: "%",
listeners: {
blur: (e) => {
this.handleInput(this.warningForm.riConRate, "riConRate")
}
}
}
]
}
},
props: {
warningVisible: {
type: Boolean,
default: false
},
info: {
type: Object,
default: ()=>{}
}
},
watch: {
warningVisible(val) {
if (val) {
this.getData()
}
}
},
mounted() {
this.getData()
},
methods: {
async getData() {
console.log(this.info)
const details =await findWarningConfig({
merchantNo: this.info.merchantId
})
console.log(details,'999')
if (details) {
this.warningForm = details
}
},
handleInput(newVal, name) {
newVal = newVal.replace(/[^\d.]/g, "") // 清除“数字”和“.”以外的字符
this.warningForm[name] = limitPrice(
newVal,
this.oldVal[name],
3,
2,
0,
100
)
this.oldVal[name] = this.warningForm[name]
},
async handleAddConfirm() {
try {
let params = {
id: this.warningForm.id,
merchantNo: this.warningForm.merchantNo,
ewConRate: this.warningForm.ewConRate,
ewAxbConRate: this.warningForm.ewAxbConRate,
ewLtConRate: this.warningForm.ewLtConRate,
riConRate: this.warningForm.riConRate
}
const res = await saveOrUpdateWarningConfig(params)
if (res) {
this.$message.success("保存成功")
this.warningVisible = false
this.$emit("confirmWarnDialog")
}
} catch (error) {
this.$message.error(error)
}
},
handleClose() {
this.$emit("closeWarnDialog")
}
}
}
</script>
<style scoped lang="scss">
.warningDailog {
.title {
color: #292d33;
font-size: 15px;
font-weight: bold;
}
.explain {
color: #999ea8;
font-size: 14px;
}
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!