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) { ...@@ -145,3 +145,33 @@ export function exportGrantRecord(data) {
data.method = 'dj.api.smartcarlife.resident.coupon.grant.record.export' data.method = 'dj.api.smartcarlife.resident.coupon.grant.record.export'
return request(data, RequestMethods.POST) 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) { ...@@ -217,3 +217,14 @@ export function deliverTargeConfigImport(data) {
return request(data, "post", ["file"]) return request(data, "post", ["file"])
} }
/** 主机厂交付数 end */ /** 主机厂交付数 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 = [ ...@@ -827,7 +827,8 @@ export const downloadReportManage_reportType = [
{ confId: "selleruseruserdipadanalysis", confValue: "驻店人员平板使用分析" }, { confId: "selleruseruserdipadanalysis", confValue: "驻店人员平板使用分析" },
{ confId: "dailybehaviorsummary", confValue: "日行为汇总表" }, { confId: "dailybehaviorsummary", confValue: "日行为汇总表" },
{ confId: "weeklybehaviorsummary", confValue: "周行为汇总表" }, { confId: "weeklybehaviorsummary", confValue: "周行为汇总表" },
{ confId: "businessDataSummary", confValue: "业务数据汇总" } { confId: "businessDataSummary", confValue: "业务数据汇总" },
{ confId: "yanbaoMerAndPerRanking", confValue: "门店产值及个人成交排名" }
] ]
// 下载报表 业务类型 // 下载报表 业务类型
...@@ -982,7 +983,10 @@ export const filterOpt = [ ...@@ -982,7 +983,10 @@ export const filterOpt = [
{ confId: 2, confValue: "待我处理的" }, { confId: 2, confValue: "待我处理的" },
{ confId: 3, confValue: "我处理过的" } { confId: 3, confValue: "我处理过的" }
] ]
export const supervisorStatuOpt=[
{ confId: 1, confValue: "已跟进" },
{ confId: 0, confValue: "未跟进" }
]
// 驻店积分管理 状态 // 驻店积分管理 状态
export const pointStatusOpt = [ export const pointStatusOpt = [
{ confId: 1, confValue: "启用" }, { confId: 1, confValue: "启用" },
......
...@@ -890,6 +890,12 @@ export const routerName = { ...@@ -890,6 +890,12 @@ export const routerName = {
parentId: "90619", parentId: "90619",
label: "删除", label: "删除",
handle: "handleDelete" handle: "handleDelete"
},
{
authId: "9061927",
parentId: "90619",
label: "预警设置",
handle: "warningHandle"
} }
], ],
// component: _import("systemConfig/ShopConfig/index") // component: _import("systemConfig/ShopConfig/index")
......
...@@ -98,7 +98,8 @@ import { ...@@ -98,7 +98,8 @@ import {
warnStageyOpt, warnStageyOpt,
statusOpt, statusOpt,
priorityShowText, priorityShowText,
filterOpt filterOpt,
supervisorStatuOpt
} from "@/common/constants.js" } from "@/common/constants.js"
export default { export default {
name: "Details", name: "Details",
...@@ -123,6 +124,7 @@ export default { ...@@ -123,6 +124,7 @@ export default {
salespersonId: "", salespersonId: "",
createTime: [dayjs().subtract(30, "day").toDate(), dayjs().toDate()], createTime: [dayjs().subtract(30, "day").toDate(), dayjs().toDate()],
bussinessType: "", bussinessType: "",
supervisorCompletionFlag:'',
statusList: [], statusList: [],
storePersonId: "", storePersonId: "",
searchType: "" searchType: ""
...@@ -285,7 +287,17 @@ export default { ...@@ -285,7 +287,17 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confValue", optionLabel: "confValue",
optionsName: "businessOpt" optionsName: "businessOpt"
} },
{
label: "督导跟进",
name: "supervisorCompletionFlag",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "supervisorStatuOpt"
},
], ],
getListApi: warningMsgDetailListWithPage, getListApi: warningMsgDetailListWithPage,
// 表格参数 // 表格参数
...@@ -316,6 +328,11 @@ export default { ...@@ -316,6 +328,11 @@ export default {
width: "150" width: "150"
}, },
{ {
label: "指标说明",
prop: "msgDetail",
width: "150"
},
{
label: "预警周期", label: "预警周期",
prop: "updatedDate", prop: "updatedDate",
width: "180", width: "180",
...@@ -396,6 +413,22 @@ export default { ...@@ -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: "下次跟进人", label: "下次跟进人",
prop: "followerName", prop: "followerName",
width: "150" width: "150"
...@@ -421,6 +454,7 @@ export default { ...@@ -421,6 +454,7 @@ export default {
warnStageyOpt: deepClone(warnStageyOpt), warnStageyOpt: deepClone(warnStageyOpt),
statusOpt: deepClone(statusOpt), statusOpt: deepClone(statusOpt),
filterOpt: deepClone(filterOpt), filterOpt: deepClone(filterOpt),
supervisorStatuOpt:deepClone(supervisorStatuOpt),
supervisorOpt: [], supervisorOpt: [],
saleOpt: [], saleOpt: [],
categoryList: [], categoryList: [],
...@@ -464,6 +498,7 @@ export default { ...@@ -464,6 +498,7 @@ export default {
this.searchForm.staffName = this.params_obj.staffName this.searchForm.staffName = this.params_obj.staffName
this.searchForm.merchantName = this.params_obj.merchantName this.searchForm.merchantName = this.params_obj.merchantName
this.searchForm.bussinessType = this.params_obj.bussinessType this.searchForm.bussinessType = this.params_obj.bussinessType
this.searchForm.supervisorCompletionFlag=this.params_obj.supervisorCompletionFlag
this.searchForm.statusList = this.params_obj.statusList this.searchForm.statusList = this.params_obj.statusList
} }
this.getBaseData() this.getBaseData()
...@@ -489,7 +524,7 @@ export default { ...@@ -489,7 +524,7 @@ export default {
beforeSearchFn() { beforeSearchFn() {
return new Promise((resolve) => { return new Promise((resolve) => {
console.log("this.searchForm.warnCycle", this.searchForm.warnCycle) console.log("this.searchForm", this.searchForm)
if (this.searchForm.warnCycle) { if (this.searchForm.warnCycle) {
this.searchForm.warningStartDate = Util.dateFormate( this.searchForm.warningStartDate = Util.dateFormate(
this.searchForm.warnCycle[0], this.searchForm.warnCycle[0],
...@@ -538,6 +573,7 @@ export default { ...@@ -538,6 +573,7 @@ export default {
salespersonId: "", salespersonId: "",
createTime: [dayjs().subtract(30, "day").toDate(), dayjs().toDate()], createTime: [dayjs().subtract(30, "day").toDate(), dayjs().toDate()],
bussinessType: "", bussinessType: "",
supervisorCompletionFlag:'',
statusList: [], statusList: [],
storePersonId: "", storePersonId: "",
searchType: "" searchType: ""
......
...@@ -184,7 +184,19 @@ export default { ...@@ -184,7 +184,19 @@ export default {
label: '跟进内容', label: '跟进内容',
prop: 'followNotes', prop: 'followNotes',
width: '250px' width: '250px'
}, { },
{
label: "执行完成时间",
prop: "completionTime",
width: "150",
formatter: (cellValue) => {
return Util.dateFormate(
cellValue.completionTime,
"YYYY-MM-DD HH:mm:ss"
)
}
},
{
label: '跟进人', label: '跟进人',
prop: 'followerName' prop: 'followerName'
}, { }, {
......
...@@ -161,7 +161,19 @@ export default { ...@@ -161,7 +161,19 @@ export default {
label: '跟进内容', label: '跟进内容',
prop: 'followNotes', prop: 'followNotes',
width: '250px' width: '250px'
}, { },
{
label: "执行完成时间",
prop: "completionTime",
width: "150",
formatter: (cellValue) => {
return Util.dateFormate(
cellValue.completionTime,
"YYYY-MM-DD"
)
}
},
{
label: '跟进人', label: '跟进人',
prop: 'followerName' prop: 'followerName'
}, { }, {
......
...@@ -118,7 +118,7 @@ import { Util, deepClone, downLoadFile } from '@/common/util' ...@@ -118,7 +118,7 @@ import { Util, deepClone, downLoadFile } from '@/common/util'
import detailDialog from './components/detailDialog' import detailDialog from './components/detailDialog'
import handleDialog from './components/handleDialog' import handleDialog from './components/handleDialog'
import { findAllData, findAllPersonRelations, warningMsgDetailListWithPage, warningMsgDetailListWithPageExport } from '@api/earlyWarningManager' 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 { export default {
name: 'Details', name: 'Details',
props: { props: {
...@@ -140,6 +140,7 @@ export default { ...@@ -140,6 +140,7 @@ export default {
salespersonId: '', salespersonId: '',
createTime: '', createTime: '',
bussinessType: '', bussinessType: '',
supervisorCompletionFlag:'',
statusList: [], statusList: [],
storePersonId: '', storePersonId: '',
searchType: '' searchType: ''
...@@ -269,7 +270,17 @@ export default { ...@@ -269,7 +270,17 @@ export default {
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue', optionLabel: 'confValue',
optionsName: 'businessOpt' optionsName: 'businessOpt'
}], },
{
label: "督导跟进",
name: "supervisorCompletionFlag",
type: "select",
isClear: true,
optionList: [],
optionId: "confId",
optionLabel: "confValue",
optionsName: "supervisorStatuOpt"
}],
getListApi: warningMsgDetailListWithPage, getListApi: warningMsgDetailListWithPage,
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -295,7 +306,13 @@ export default { ...@@ -295,7 +306,13 @@ export default {
label: '预警事项', label: '预警事项',
prop: 'rule', prop: 'rule',
width: '150' width: '150'
}, { },
{
label: "指标说明",
prop: "msgDetail",
width: "150"
},
{
label: '预警周期', label: '预警周期',
prop: 'updatedDate', prop: 'updatedDate',
width: '180', width: '180',
...@@ -357,7 +374,23 @@ export default { ...@@ -357,7 +374,23 @@ export default {
0: 'ashSpot' 0: 'ashSpot'
}[cellValue.status] }[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: '下次跟进人', label: '下次跟进人',
prop: 'followerName', prop: 'followerName',
width: '150' width: '150'
...@@ -379,6 +412,7 @@ export default { ...@@ -379,6 +412,7 @@ export default {
warnStageyOpt: deepClone(warnStageyOpt), warnStageyOpt: deepClone(warnStageyOpt),
statusOpt: deepClone(statusOpt), statusOpt: deepClone(statusOpt),
filterOpt: deepClone(filterOpt), filterOpt: deepClone(filterOpt),
supervisorStatuOpt:deepClone(supervisorStatuOpt),
supervisorOpt: [], supervisorOpt: [],
saleOpt: [], saleOpt: [],
categoryList: [], categoryList: [],
...@@ -419,6 +453,7 @@ export default { ...@@ -419,6 +453,7 @@ export default {
this.searchForm.merchantName = this.params_obj.merchantName this.searchForm.merchantName = this.params_obj.merchantName
this.searchForm.bussinessType = this.params_obj.bussinessType this.searchForm.bussinessType = this.params_obj.bussinessType
this.searchForm.statusList = this.params_obj.statusList this.searchForm.statusList = this.params_obj.statusList
this.searchForm.supervisorCompletionFlag=this.params_obj.supervisorCompletionFlag
} }
this.getBaseData() this.getBaseData()
}, },
...@@ -470,6 +505,7 @@ export default { ...@@ -470,6 +505,7 @@ export default {
salespersonId: '', salespersonId: '',
createTime: '', createTime: '',
bussinessType: '', bussinessType: '',
supervisorCompletionFlag:'',
statusList: [], statusList: [],
storePersonId: '', storePersonId: '',
searchType: '' searchType: ''
......
...@@ -23,3 +23,14 @@ export function filterSpecsStr(data) { ...@@ -23,3 +23,14 @@ export function filterSpecsStr(data) {
return "-" 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' ...@@ -270,7 +270,7 @@ import relateStoreTable from './relateStoreTable.vue'
import { getList, getAccountMerchantList } from '@/api/merchant' import { getList, getAccountMerchantList } from '@/api/merchant'
import selectGoodsDialog from '../../components/selectGoodsDialog.vue' import selectGoodsDialog from '../../components/selectGoodsDialog.vue'
import ellipsisPopover from '../../components/ellipsisPopover.vue' import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption' import { filterSpecsStr, convertYuanToWan } from '../../filterOption'
export default { export default {
name: 'GroundingForm', name: 'GroundingForm',
components: { components: {
...@@ -610,7 +610,9 @@ export default { ...@@ -610,7 +610,9 @@ export default {
..._valueObj, ..._valueObj,
goodsName: _valueObj.goodsInfo.goodsName, goodsName: _valueObj.goodsInfo.goodsName,
tempGoodsTypeName: result, 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('/') : '', positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(_valueObj), specificationData: this.filterSpecsStr(_valueObj),
djCost: _valueObj?.djCost, djCost: _valueObj?.djCost,
......
...@@ -16,7 +16,7 @@ import { BaseData, sceneCodeList } from '@/common/constants.js' ...@@ -16,7 +16,7 @@ import { BaseData, sceneCodeList } from '@/common/constants.js'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { filterSpecsStr } from "../filterOption" import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default { export default {
name: 'EditGrounding', name: 'EditGrounding',
components: { components: {
...@@ -307,7 +307,9 @@ export default { ...@@ -307,7 +307,9 @@ export default {
...res?.upgradeGoods, ...res?.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
tempGoodsTypeName: result, 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('/') : '', positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods), specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'), carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......
...@@ -16,7 +16,7 @@ import { mapActions } from 'vuex' ...@@ -16,7 +16,7 @@ import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data' import { productList, baseSupplyModeList, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from './constants/data'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { filterSpecsStr } from '../filterOption' import { filterSpecsStr, convertYuanToWan } from '../filterOption'
export default { export default {
name: 'GroundingDetail', name: 'GroundingDetail',
components: { components: {
...@@ -226,7 +226,9 @@ export default { ...@@ -226,7 +226,9 @@ export default {
...res.upgradeGoods, ...res.upgradeGoods,
goodsName: res.goodsInfo.goodsName, goodsName: res.goodsInfo.goodsName,
tempGoodsTypeName: result, 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('/') : '', positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(res?.upgradeGoods), specificationData: this.filterSpecsStr(res?.upgradeGoods),
carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'), carTypeConfigName: res?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......
...@@ -269,7 +269,7 @@ import { getList, getAccountMerchantList } from '@/api/merchant' ...@@ -269,7 +269,7 @@ import { getList, getAccountMerchantList } from '@/api/merchant'
import { upgradeSupplyModeList, crowdUpgradeSupplyModeList, packageGoodsForm } from "../../grounding/constants/data" import { upgradeSupplyModeList, crowdUpgradeSupplyModeList, packageGoodsForm } from "../../grounding/constants/data"
import selectGoodsDialog from '../../components/selectGoodsDialog.vue' import selectGoodsDialog from '../../components/selectGoodsDialog.vue'
import ellipsisPopover from '../../components/ellipsisPopover.vue' import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption' import { filterSpecsStr, convertYuanToWan } from '../../filterOption'
export default { export default {
name: 'GroundingForm', name: 'GroundingForm',
components: { components: {
...@@ -462,7 +462,11 @@ export default { ...@@ -462,7 +462,11 @@ export default {
..._valueObj, ..._valueObj,
goodsName: _valueObj.goodsInfo.goodsName, goodsName: _valueObj.goodsInfo.goodsName,
tempGoodsTypeName: result, 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('/') : '', positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(_valueObj), specificationData: this.filterSpecsStr(_valueObj),
djCost: _valueObj?.djCost, djCost: _valueObj?.djCost,
...@@ -541,7 +545,7 @@ export default { ...@@ -541,7 +545,7 @@ export default {
this.$set(this.formData.groundingGoodsList[index], 'upgradeProductCost', '') 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.$set(_formBlock[_formBlock.findIndex(subItem => subItem.name == 'djCost')], 'isDisabled', true)
} }
this.show = true this.show = true
......
...@@ -16,7 +16,7 @@ import { packageGoodsForm } from '../grounding/constants/data' ...@@ -16,7 +16,7 @@ import { packageGoodsForm } from '../grounding/constants/data'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { filterSpecsStr } from "../filterOption" import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default { export default {
name: 'EditPackage', name: 'EditPackage',
components: { components: {
...@@ -251,7 +251,9 @@ export default { ...@@ -251,7 +251,9 @@ export default {
goodsName: val.goodsName, goodsName: val.goodsName,
upgradeGoodsName: val?.upgradeGoodsName, upgradeGoodsName: val?.upgradeGoodsName,
tempGoodsTypeName: result, 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('/') : '', positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(val?.upgradeGoods), specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'), carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
...@@ -351,6 +353,12 @@ export default { ...@@ -351,6 +353,12 @@ export default {
this.editData = data this.editData = data
// 判断套餐的所有子商品适用车型是否存在交集 // 判断套餐的所有子商品适用车型是否存在交集
let seriesIdFlag = false 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 => const seriesIdsSet = data?.groundingGoodsList?.map(item =>
new Set(item?.upgradeGoods?.carTypeConfigList?.map(bItem => bItem.seriesId)) new Set(item?.upgradeGoods?.carTypeConfigList?.map(bItem => bItem.seriesId))
) )
...@@ -368,28 +376,35 @@ export default { ...@@ -368,28 +376,35 @@ export default {
break break
} }
} }
const confirmSave = () => {
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', {
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
this.checkEvent(params)
}).catch(err => {
console.log(err)
})
}
if (seriesIdFlag) { if (seriesIdFlag) {
this.$confirm('<p>当前套餐商品的适用车型不一致,</p>是否确认继续使用?', '提示', { this.$confirm('<p>当前套餐商品的适用车型不一致,</p>是否确认继续使用?', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
dangerouslyUseHTMLString: true, dangerouslyUseHTMLString: true,
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if ((num == 1)) { if (num === 1) {
this.$confirm('<p>上架信息保存后,自动进入上架审核流程</p>是否确定保存?', '提示', { confirmSave()
confirmButtonText: '确定',
dangerouslyUseHTMLString: true,
type: 'warning'
}).then(() => {
this.checkEvent(params)
}).catch(err => {
console.log(err)
})
} else { } else {
this.checkEvent(params) this.checkEvent(params)
} }
}) })
} else { } else {
this.checkEvent(params) if (num === 1) {
confirmSave()
} else {
this.checkEvent(params)
}
} }
}, },
checkEvent(params) { checkEvent(params) {
......
...@@ -16,7 +16,7 @@ import { mapActions } from 'vuex' ...@@ -16,7 +16,7 @@ import { mapActions } from 'vuex'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { packageGoodsDetail, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '../grounding/constants/data' import { packageGoodsDetail, upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '../grounding/constants/data'
import { filterSpecsStr } from "../filterOption" import { filterSpecsStr, convertYuanToWan } from "../filterOption"
export default { export default {
name: 'PackageDetail', name: 'PackageDetail',
components: { components: {
...@@ -183,7 +183,9 @@ export default { ...@@ -183,7 +183,9 @@ export default {
upgradeGoodsName: val?.upgradeGoodsName, upgradeGoodsName: val?.upgradeGoodsName,
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目 goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result, 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('/') : '', positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
specificationData: this.filterSpecsStr(val?.upgradeGoods), specificationData: this.filterSpecsStr(val?.upgradeGoods),
carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'), carTypeConfigName: val?.upgradeGoods?.carTypeConfigList?.map(item => item.seriesName).join('/'),
......
...@@ -121,7 +121,7 @@ import { getGoodsInfoById } from '@/api/commodity' ...@@ -121,7 +121,7 @@ import { getGoodsInfoById } from '@/api/commodity'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import ellipsisPopover from '../../components/ellipsisPopover.vue' import ellipsisPopover from '../../components/ellipsisPopover.vue'
import { filterSpecsStr } from '../../filterOption' import { filterSpecsStr, convertYuanToWan } from '../../filterOption'
export default { export default {
name: 'DrawerDetail', name: 'DrawerDetail',
components: {ellipsisPopover}, components: {ellipsisPopover},
...@@ -178,7 +178,9 @@ export default { ...@@ -178,7 +178,9 @@ export default {
} }
const positionNamesArr = deepClone(this.positionTypeList).filter(val => item.position?.split(',')?.includes(val.position + '')) || [] 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.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.extendServiceItemNames = item?.upgradeGoodsServiceItemsList?.map(v => { return `${v.serviceName}` })?.join(',')
item.specificationName = this.filterSpecsStr(obj) item.specificationName = this.filterSpecsStr(obj)
item.carSeriesName = item?.carTypeConfigList?.map(v => { return v.seriesName })?.join('/') item.carSeriesName = item?.carTypeConfigList?.map(v => { return v.seriesName })?.join('/')
......
...@@ -227,7 +227,7 @@ ...@@ -227,7 +227,7 @@
size="small" size="small"
v-model="subItem.djCost" v-model="subItem.djCost"
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }"
:disabled="goodsInfoData.scrmFlag == 'Y'" :disabled="true"
@input="handlePrice($event, subIndex, 'djCost')"> @input="handlePrice($event, subIndex, 'djCost')">
<el-popover v-if="filterEmpty(subItem.djCost) && subItem.djCostEmpty" <el-popover v-if="filterEmpty(subItem.djCost) && subItem.djCostEmpty"
slot="suffix" slot="suffix"
...@@ -567,6 +567,9 @@ export default { ...@@ -567,6 +567,9 @@ export default {
specsInputVal: '', specsInputVal: '',
specsStartInputVal: '', specsStartInputVal: '',
specsEndInputVal: '', specsEndInputVal: '',
oldspecsInputVal: '',
oldspecsStartInputVal: '',
oldspecsEndInputVal: '',
reg: { reg: {
priceReg: /^\d[\d\.]*$/ priceReg: /^\d[\d\.]*$/
}, },
...@@ -804,15 +807,37 @@ export default { ...@@ -804,15 +807,37 @@ export default {
this.serviceSelectIndex = index this.serviceSelectIndex = index
this.serviceItemsVisible = true 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) { handleRelateServiceConfirm(data) {
// 批量操作服务项目 // 批量操作服务项目
if (this.filterEmpty(this.serviceSelectIndex)) { if (this.filterEmpty(this.serviceSelectIndex)) {
this.goodsInfoData?.goodsSpecificationList.map(v => { this.goodsInfoData?.goodsSpecificationList.map(v => {
if (v.checked) { if (v.checked) {
v.serviceItemArr = data v.serviceItemArr = data
v.djCost = data.reduce((v, i) => { v.djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
return v + i.standardSalesCost
}, 0)
} }
return v return v
}) })
...@@ -820,13 +845,11 @@ export default { ...@@ -820,13 +845,11 @@ export default {
} }
const index = this.serviceSelectIndex const index = this.serviceSelectIndex
let djCost = 0 let djCost = 0
data.forEach(v => { // 嘀加成本通过已选服务项目的销售成本自动累计 // 嘀加成本通过已选服务项目的销售成本自动累计
djCost += v.standardSalesCost djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
})
if (!data?.length) djCost = '' if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationList[index], 'serviceItemArr', data) 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.serviceSelectIndex = null
this.serviceSelected = [] this.serviceSelected = []
this.serviceItemsVisible = false this.serviceItemsVisible = false
...@@ -984,7 +1007,11 @@ export default { ...@@ -984,7 +1007,11 @@ export default {
handleSpecsInput(e, key) { handleSpecsInput(e, key) {
if (this.selectTypeSequence > 0) { if (this.selectTypeSequence > 0) {
let newValue = e.replace(/[^\d.]/g, '') 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, key, limitPrice(newValue, oldValue, 2, this.selectTypeSequence == 3 ? 2 : 0, 0))
this.$set(this, `old${key}`, this[key]) this.$set(this, `old${key}`, this[key])
} }
...@@ -1033,8 +1060,11 @@ export default { ...@@ -1033,8 +1060,11 @@ export default {
if (this.selectTypeSequence == 3) { if (this.selectTypeSequence == 3) {
this.specsStartInputVal = tag.specificationValue?.split('-')[0] this.specsStartInputVal = tag.specificationValue?.split('-')[0]
this.specsEndInputVal = tag.specificationValue?.split('-')[1] this.specsEndInputVal = tag.specificationValue?.split('-')[1]
this.oldspecsStartInputVal = tag.specificationValue?.split('-')[0]
this.oldspecsEndInputVal = tag.specificationValue?.split('-')[1]
} else { } else {
this.specsInputVal = tag.specificationValue this.specsInputVal = tag.specificationValue
this.oldspecsInputVal = tag.specificationValue
} }
this.tempTag = tag.specificationValue this.tempTag = tag.specificationValue
this.isChange = true this.isChange = true
...@@ -1139,7 +1169,7 @@ export default { ...@@ -1139,7 +1169,7 @@ export default {
for (let i = 0; i < ranges.length; i++) { for (let i = 0; i < ranges.length; i++) {
const [rangeStart, rangeEnd] = ranges[i].map(Number) const [rangeStart, rangeEnd] = ranges[i].map(Number)
// 判断是否存在冲突 // 判断是否存在冲突
if (start <= rangeEnd && end >= rangeStart) { if (start < rangeEnd && end > rangeStart) {
return true return true
} }
} }
......
...@@ -40,10 +40,18 @@ ...@@ -40,10 +40,18 @@
label="年限" label="年限"
align="center"> align="center">
</el-table-column> </el-table-column>
<el-table-column prop="standardSalesCost" <el-table-column prop="price"
label="销售成本/元" label="适用车价/万元"
width="140" width="140"
align="center"> 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>
<el-table-column prop="serviceOverview" <el-table-column prop="serviceOverview"
width="210" width="210"
...@@ -81,6 +89,7 @@ ...@@ -81,6 +89,7 @@
<script> <script>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { convertYuanToWan } from '../../filterOption'
export default { export default {
name: 'RelateServiceDialog', name: 'RelateServiceDialog',
data() { data() {
...@@ -90,7 +99,8 @@ export default { ...@@ -90,7 +99,8 @@ export default {
// 分页 // 分页
total: 0, total: 0,
currentPage: 1, currentPage: 1,
pageSize: 20 pageSize: 20,
convertYuanToWan
} }
}, },
...@@ -115,10 +125,15 @@ export default { ...@@ -115,10 +125,15 @@ export default {
mounted() { mounted() {
this.selectedData = deepClone(this.serviceSelected) this.selectedData = deepClone(this.serviceSelected)
// 若是历史服务项目数据不回显(历史已选服务项目没有适用车价)
this.selectedData = this.selectedData?.filter(val => !this.filterEmpty(val.serviceItemId))
this.getSelectingList() this.getSelectingList()
}, },
methods: { methods: {
filterEmpty(data) {
return data instanceof Array ? data.length <= 0 : (data ?? '') === ''
},
selectable(row) { selectable(row) {
const { selectedData } = this const { selectedData } = this
// 每个服务项目code只能选中一个 按等级和年限区分 // 每个服务项目code只能选中一个 按等级和年限区分
...@@ -143,8 +158,8 @@ export default { ...@@ -143,8 +158,8 @@ export default {
pageSize: this.pageSize pageSize: this.pageSize
}).then(res => { }).then(res => {
res?.list?.forEach(val => { res?.list?.forEach(val => {
val.uniqueValue = `${val.serviceName}-${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.uniqueCode = `${val.serviceCode}-${val.serviceGrade}/${val.servicePeriod}${(val.serviceItemId) ? `/${val.serviceItemId}` : ''}`
}) })
this.selectingData = res.list this.selectingData = res.list
this.total = res.total this.total = res.total
......
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
<td v-if="(extendedPosiType.includes(goodsInfoData.goodsType) || equitySceneType.includes(goodsInfoData.goodsType)) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)"> <td v-if="(extendedPosiType.includes(goodsInfoData.goodsType) || equitySceneType.includes(goodsInfoData.goodsType)) && !baseConfig.supplierCode.includes(`${goodsInfoData.supplierCode}`)">
<el-input placeholder="请输入" <el-input placeholder="请输入"
size="small" size="small"
:disabled="goodsInfoData.scrmFlag == 'Y'" :disabled="true"
v-model="subItem.djCost" v-model="subItem.djCost"
:class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }" :class="{ 'w-150-per': true, 'border-red': filterEmpty(subItem.djCost) && subItem.djCostEmpty }"
@input="handlePrice($event, subIndex, 'djCost')"> @input="handlePrice($event, subIndex, 'djCost')">
...@@ -650,15 +650,37 @@ export default { ...@@ -650,15 +650,37 @@ export default {
this.serviceSelectIndex = index this.serviceSelectIndex = index
this.serviceItemsVisible = true 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) { handleRelateServiceConfirm(data) {
// 批量操作权益服务项目 // 批量操作权益服务项目
if (this.filterEmpty(this.serviceSelectIndex)) { if (this.filterEmpty(this.serviceSelectIndex)) {
this.goodsInfoData?.goodsSpecificationSingleList.map(v => { this.goodsInfoData?.goodsSpecificationSingleList.map(v => {
if (v.checked) { if (v.checked) {
v.serviceItemArr = data v.serviceItemArr = data
v.djCost = data.reduce((v, i) => { v.djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
return v + i.standardSalesCost
}, 0)
} }
return v return v
}) })
...@@ -666,13 +688,11 @@ export default { ...@@ -666,13 +688,11 @@ export default {
} }
const index = this.serviceSelectIndex const index = this.serviceSelectIndex
let djCost = 0 let djCost = 0
data.forEach(v => { // 嘀加成本通过已选服务项目的销售成本自动累计 // 嘀加成本通过已选服务项目的销售成本自动累计
djCost += v.standardSalesCost djCost = this.highPrecisionAdd(data?.map(i => i.djCost))
})
if (!data?.length) djCost = '' if (!data?.length) djCost = ''
this.$set(this.goodsInfoData.goodsSpecificationSingleList[index], 'serviceItemArr', data) 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.serviceSelectIndex = null
this.serviceSelected = [] this.serviceSelected = []
this.serviceItemsVisible = false this.serviceItemsVisible = false
......
...@@ -34,6 +34,7 @@ import { addProductManage, UpdateProductManage } from '@api/productManage' ...@@ -34,6 +34,7 @@ import { addProductManage, UpdateProductManage } from '@api/productManage'
import { BaseData, applicableModelTypeList } from '@/common/constants.js' import { BaseData, applicableModelTypeList } from '@/common/constants.js'
import { getGoodsInfoById } from '@api/commodity' import { getGoodsInfoById } from '@api/commodity'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
import { convertYuanToWan } from '../filterOption'
export default { export default {
name: 'EditProductManage', name: 'EditProductManage',
components: { components: {
...@@ -129,8 +130,8 @@ export default { ...@@ -129,8 +130,8 @@ export default {
let objData = {} let objData = {}
this.copyUpgradeGoodsList = deepClone(res.upgradeGoodsList).map((val, index) => { this.copyUpgradeGoodsList = deepClone(res.upgradeGoodsList).map((val, index) => {
val?.upgradeGoodsServiceItemsList?.forEach(v => { val?.upgradeGoodsServiceItemsList?.forEach(v => {
v.uniqueValue = `${v.serviceName}-${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.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${v.serviceItemId}` : ''}`
}) })
return { return {
id: val.id, id: val.id,
...@@ -192,8 +193,8 @@ export default { ...@@ -192,8 +193,8 @@ export default {
goodsSpecificationSingleList: deepClone(this.copyUpgradeGoodsList), goodsSpecificationSingleList: deepClone(this.copyUpgradeGoodsList),
upgradeGoodsList: res.upgradeGoodsList?.map(val => { upgradeGoodsList: res.upgradeGoodsList?.map(val => {
val?.upgradeGoodsServiceItemsList?.map(v => { val?.upgradeGoodsServiceItemsList?.map(v => {
v.uniqueValue = `${v.serviceName}-${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.uniqueCode = `${v.serviceCode}-${v.serviceGrade}/${v.servicePeriod}${(v.serviceItemId) ? `/${v.serviceItemId}` : ''}`
return v return v
}) })
return val return val
...@@ -274,7 +275,10 @@ export default { ...@@ -274,7 +275,10 @@ export default {
serviceName: val.serviceName, serviceName: val.serviceName,
serviceGrade: val.serviceGrade, serviceGrade: val.serviceGrade,
servicePeriod: val.servicePeriod, servicePeriod: val.servicePeriod,
standardSalesCost: val.standardSalesCost djCost: val.djCost,
serviceItemId: val.serviceItemId,
minPrice: val.minPrice,
maxPrice: val.maxPrice
}) })
}) })
arr.push({ arr.push({
...@@ -330,7 +334,10 @@ export default { ...@@ -330,7 +334,10 @@ export default {
serviceName: val.serviceName, serviceName: val.serviceName,
serviceGrade: val.serviceGrade, serviceGrade: val.serviceGrade,
servicePeriod: val.servicePeriod, servicePeriod: val.servicePeriod,
standardSalesCost: val.standardSalesCost djCost: val.djCost,
serviceItemId: val.serviceItemId,
minPrice: val.minPrice,
maxPrice: val.maxPrice
}) })
}) })
if (item.statusFlag != 2) { if (item.statusFlag != 2) {
......
...@@ -203,7 +203,7 @@ import { mapActions } from "vuex" ...@@ -203,7 +203,7 @@ import { mapActions } from "vuex"
import { limitPrice } from "@/common/format" import { limitPrice } from "@/common/format"
import selectGoodsDialog from "../../../components/selectGoodsDialog.vue" import selectGoodsDialog from "../../../components/selectGoodsDialog.vue"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { filterSpecsStr } from "../../../filterOption" import { filterSpecsStr, convertYuanToWan } from "../../../filterOption"
import { businessLineOpt } from "@/common/constants.js" import { businessLineOpt } from "@/common/constants.js"
import { computeProductProfitDetail } from "@api/shelfManage" import { computeProductProfitDetail } from "@api/shelfManage"
export default { export default {
...@@ -342,7 +342,7 @@ export default { ...@@ -342,7 +342,7 @@ export default {
tempGoodsTypeName: result, tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => { ?.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(","), // 服务项目 ?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods), specificationData: this.filterSpecsStr(_formData.upgradeGoods),
...@@ -403,7 +403,7 @@ export default { ...@@ -403,7 +403,7 @@ export default {
tempGoodsTypeName: result, tempGoodsTypeName: result,
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList
?.map((item) => { ?.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(","), // 服务项目 ?.join(","), // 服务项目
// positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
......
...@@ -324,7 +324,7 @@ import { mapActions } from "vuex" ...@@ -324,7 +324,7 @@ import { mapActions } from "vuex"
import { limitPrice } from "@/common/format" import { limitPrice } from "@/common/format"
import selectGoodsDialog from "../../../components/selectGoodsDialog.vue" import selectGoodsDialog from "../../../components/selectGoodsDialog.vue"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { filterSpecsStr } from "../../../filterOption" import { filterSpecsStr, convertYuanToWan } from "../../../filterOption"
import { computeProductProfitDetail } from "@api/shelfManage" import { computeProductProfitDetail } from "@api/shelfManage"
export default { export default {
name: "PackageTab", name: "PackageTab",
...@@ -559,7 +559,7 @@ export default { ...@@ -559,7 +559,7 @@ export default {
tempGoodsTypeName: result, tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => { ?.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(","), // 服务项目 ?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods), specificationData: this.filterSpecsStr(_formData.upgradeGoods),
...@@ -720,7 +720,7 @@ export default { ...@@ -720,7 +720,7 @@ export default {
tempGoodsTypeName: result, tempGoodsTypeName: result,
serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList serviceItemNames: _valueObj?.upgradeGoodsServiceItemsList
?.map((item) => { ?.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(","), // 服务项目 ?.join(","), // 服务项目
// positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // positionNames: _positionNamesArr.length ? _positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '',
......
...@@ -195,7 +195,7 @@ import { deepClone } from "@/common/util" ...@@ -195,7 +195,7 @@ import { deepClone } from "@/common/util"
import { mapActions } from "vuex" import { mapActions } from "vuex"
import { limitPrice } from "@/common/format" import { limitPrice } from "@/common/format"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { filterSpecsStr } from "@/views/goods/filterOption" import { filterSpecsStr, convertYuanToWan } from "@/views/goods/filterOption"
import { businessLineOpt } from "@/common/constants.js" import { businessLineOpt } from "@/common/constants.js"
export default { export default {
name: "GoodTab", name: "GoodTab",
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
tempGoodsTypeName: result, tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => { ?.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(","), // 服务项目 ?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods), specificationData: this.filterSpecsStr(_formData.upgradeGoods),
......
...@@ -311,7 +311,7 @@ import { businessNature, businessLineOpt } from "@/common/constants.js" ...@@ -311,7 +311,7 @@ import { businessNature, businessLineOpt } from "@/common/constants.js"
import { mapActions } from "vuex" import { mapActions } from "vuex"
import { limitPrice } from "@/common/format" import { limitPrice } from "@/common/format"
import { baseConfig } from "@/main" import { baseConfig } from "@/main"
import { filterSpecsStr } from "@/views/goods/filterOption" import { filterSpecsStr, convertYuanToWan } from "@/views/goods/filterOption"
export default { export default {
name: "PackageTab", name: "PackageTab",
...@@ -442,7 +442,7 @@ export default { ...@@ -442,7 +442,7 @@ export default {
tempGoodsTypeName: result, tempGoodsTypeName: result,
serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList serviceItemNames: _formData.upgradeGoods?.upgradeGoodsServiceItemsList
?.map((item) => { ?.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(","), // 服务项目 ?.join(","), // 服务项目
specificationData: this.filterSpecsStr(_formData.upgradeGoods), specificationData: this.filterSpecsStr(_formData.upgradeGoods),
......
...@@ -125,6 +125,7 @@ const isSelect = [ ...@@ -125,6 +125,7 @@ const isSelect = [
{ label: "近两个月出单", value: 1 }, { label: "近两个月出单", value: 1 },
{ label: "近三个月出单", value: 2 } { label: "近三个月出单", value: 2 }
] ]
export default { export default {
components: { components: {
carDialog carDialog
...@@ -134,6 +135,7 @@ export default { ...@@ -134,6 +135,7 @@ export default {
return { return {
sceneList, sceneList,
searchForm: { searchForm: {
showAllStaff:'',
staffType: 0, staffType: 0,
brandIdList: [this.baseConfig.brandId], brandIdList: [this.baseConfig.brandId],
sceneType: "0", sceneType: "0",
...@@ -205,6 +207,17 @@ export default { ...@@ -205,6 +207,17 @@ export default {
optionId: "id", optionId: "id",
optionLabel: "label", optionLabel: "label",
optionsName: "secondBrandIdList" optionsName: "secondBrandIdList"
},
{
label: "是否展示所有员工",
name: "showAllStaff",
type: "select",
optionList: [
{ label: "否", value: 0 },
{ label: "是", value: 1 }
],
optionId: "value",
optionLabel: "label"
} }
], ],
tableData: [], tableData: [],
...@@ -672,8 +685,8 @@ export default { ...@@ -672,8 +685,8 @@ export default {
// 第4列(员工姓名列)根据 staffUuid 进行合并 // 第4列(员工姓名列)根据 staffUuid 进行合并
const columnNum = this.searchForm.sceneType == "0" ? 7 : 6 const columnNum = this.searchForm.sceneType == "0" ? 7 : 6
if (columnIndex === 3 || columnIndex > columnNum) { if (columnIndex === 3 || columnIndex > columnNum) {
console.log(rowIndex, row.staffUuid) // console.log(rowIndex, row.staffUuid)
console.log(row, column, rowIndex, columnIndex) // console.log(row, column, rowIndex, columnIndex)
let rowspan = 1 let rowspan = 1
for (let i = rowIndex + 1; i < this.tableData.length; i++) { for (let i = rowIndex + 1; i < this.tableData.length; i++) {
...@@ -858,6 +871,7 @@ export default { ...@@ -858,6 +871,7 @@ export default {
this.getList() this.getList()
}, },
handleReset() { handleReset() {
this.searchForm.showAllStaff=''
this.searchForm.staffType = 0 this.searchForm.staffType = 0
this.searchForm.brandIdList = [this.baseConfig.brandId] this.searchForm.brandIdList = [this.baseConfig.brandId]
this.searchForm.merchantNameList = [] this.searchForm.merchantNameList = []
......
...@@ -239,7 +239,7 @@ export default { ...@@ -239,7 +239,7 @@ export default {
id: { id: {
type: Number, type: Number,
default: "" default: ""
} },
}, },
computed: { computed: {
dialogShow: { dialogShow: {
...@@ -328,9 +328,11 @@ export default { ...@@ -328,9 +328,11 @@ export default {
}) })
}, },
getOrderOperateData() { getOrderOperateData() {
let params = { let params = { operationType: 1}
orderCode: this.detailInfo.orderCode, if(this.detailInfo.status=='已失效'){
operationType: 1 params.id=this.id
}else{
params.orderCode=this.detailInfo.orderCode
} }
getOperationRecord(params).then((res) => { getOperationRecord(params).then((res) => {
console.log(res) console.log(res)
......
<template> <template>
<d2-container class="point-list"> <d2-container class="point-list">
<div class="header" slot="header"> <div class="header" slot="header">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="'150px'" <d2-search
:form-data="showFormData" /> ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="'150px'"
:form-data="showFormData"
/>
<div class="up-btns"> <div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary"> <el-button @click="handleSearch" size="small" type="primary">
查询 查询
...@@ -13,21 +18,37 @@ ...@@ -13,21 +18,37 @@
<div class="d2-container-content"> <div class="d2-container-content">
<div class="header-flex"> <div class="header-flex">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <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-tab-pane>
</el-tabs> </el-tabs>
<div> <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']" /> <auth-button category="Button" :show-btn-ids="['9140103']" />
</div> </div>
</div> </div>
<d2-table v-if="show" ref="pointTable" :search-form="searchFormSearch" :table-params="tableParams" <d2-table
:get-list-api="getListApi" :before-search-fn="beforeSearchFn"> 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"> <div slot="statusSlot" slot-scope="scope">
<span :style="{ <span
'background-color': statusEnum[scope.scope.status].color :style="{
}" class="circle"></span> 'background-color': statusEnum[scope.scope.status].color
}"
class="circle"
></span>
<span>{{ statusEnum[scope.scope.status].name }}</span> <span>{{ statusEnum[scope.scope.status].name }}</span>
</div> </div>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
...@@ -37,22 +58,48 @@ ...@@ -37,22 +58,48 @@
</span> </span>
<!-- 审核 --> <!-- 审核 -->
<span style="margin-right: 10px"> <span style="margin-right: 10px">
<auth-button :data="scope.scope" :show-btn-ids="['9140101']" <auth-button
v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1" /> :data="scope.scope"
<auth-button v-if=" :show-btn-ids="['9140101']"
scope.scope.status == 1 && v-if="scope.scope.status == 0 && scope.scope.supervisorAudit == 1"
scope.scope.pointsRefundAvailable == 'Y' />
" :data="scope.scope" :show-btn-ids="['9140104']" /> <auth-button
v-if="
scope.scope.status == 1 &&
scope.scope.pointsRefundAvailable == 'Y'
"
:data="scope.scope"
:show-btn-ids="['9140104']"
/>
</span> </span>
</div> </div>
</d2-table> </d2-table>
<!-- 详细信息 --> <!-- 详细信息 -->
<detail-dialog :visible.sync="detailVisible" v-if="detailVisible" :id="id" /> <detail-dialog
<d2-dialog title="提示" class="refund-dialog" v-if="refundVisible" :is-visible="refundVisible" :visible.sync="detailVisible"
@closeDialog="handleRefundClose" @confirmDialog="handleRefundConfirm"> 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> <div class="title">请确定此次退款的类型</div>
<glsx-combi-form :isBlock="true" ref="refundFormRef" label-width="220px" :form-ref="handleFormRef" <glsx-combi-form
default-width="400px" :form-rules="formRules" :form-obj="refundForm" :form-data="refundFormData"> :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> </glsx-combi-form>
</d2-dialog> </d2-dialog>
</div> </div>
...@@ -81,7 +128,6 @@ export default { ...@@ -81,7 +128,6 @@ export default {
}, },
data() { data() {
var checkIntegral = (rule, value, callback) => { var checkIntegral = (rule, value, callback) => {
console.log(this.refundForm.remainingScore, 'this.refundForm.remainingScore')
if (!value) { if (!value) {
return callback(new Error("请输入退回积分")) return callback(new Error("请输入退回积分"))
} }
...@@ -91,28 +137,37 @@ export default { ...@@ -91,28 +137,37 @@ export default {
//第一次退款积分 //第一次退款积分
if (this.refundForm.firstInto) { if (this.refundForm.firstInto) {
if ( if (
value > this.refundForm.remainingScore && this.refundForm.refundType == 1 value > this.refundForm.remainingScore &&
this.refundForm.refundType == 1
) { ) {
callback(new Error("输入的积分超过当前订单最大积分")) callback(new Error("输入的积分超过当前订单最大积分"))
} else if ( } else if (
value >= this.refundForm.remainingScore && this.refundForm.refundType == 2 value >= this.refundForm.remainingScore &&
this.refundForm.refundType == 2
) { ) {
callback(new Error("输入的积分超过当前订单最大积分")) callback(new Error("输入的积分超过当前订单最大积分"))
} else { } else {
callback() callback()
} }
} else { } else {
if ( if (value > this.refundForm.remainingScore) {
value > this.refundForm.remainingScore
) {
callback(new Error("输入的积分超过当前订单最大积分")) callback(new Error("输入的积分超过当前订单最大积分"))
} else { } else {
callback() callback()
} }
} }
} }
} }
var checkAmount = (rule, value, callback) => {
if (!value) {
return callback(new Error("请输入退回金额"))
}
if (isNaN(value) || value <= 0) {
callback(new Error("输入大于0的数字"))
} else {
callback()
}
}
return { return {
show: true, show: true,
handleFormRef: "handleFormRef", handleFormRef: "handleFormRef",
...@@ -289,13 +344,15 @@ export default { ...@@ -289,13 +344,15 @@ export default {
orderCode: "", orderCode: "",
refundType: "", refundType: "",
refundPoints: "", refundPoints: "",
firstInto: true firstInto: true,
refundAmount:''
}, },
formRules: { formRules: {
refundType: [ refundType: [
{ required: true, message: "请选择退款类型", trigger: "change" } { required: true, message: "请选择退款类型", trigger: "change" }
], ],
refundPoints: [{ validator: checkIntegral, trigger: "blur" }] refundPoints: [{ validator: checkIntegral, trigger: "blur" }],
refundAmount: [{ validator: checkAmount, trigger: "blur" }]
}, },
refundFormData: [ refundFormData: [
{ {
...@@ -320,6 +377,13 @@ export default { ...@@ -320,6 +377,13 @@ export default {
type: "input", type: "input",
width: "290px", width: "290px",
isDisabled: false isDisabled: false
},
{
label: "退回金额",
name: "refundAmount",
type: "input",
width: "290px",
isDisabled: false
} }
] ]
} }
...@@ -481,7 +545,7 @@ export default { ...@@ -481,7 +545,7 @@ export default {
if ( if (
this.baseData[item.optionsName].length && this.baseData[item.optionsName].length &&
this.baseData[item.optionsName][0][ this.baseData[item.optionsName][0][
this.showFormData[index].optionLabel this.showFormData[index].optionLabel
] !== "全部" ] !== "全部"
) { ) {
const temp = {} const temp = {}
...@@ -589,7 +653,8 @@ export default { ...@@ -589,7 +653,8 @@ export default {
this.refundVisible = true this.refundVisible = true
this.refundForm.orderCode = data.orderCode this.refundForm.orderCode = data.orderCode
this.refundForm.tempPoints = data.integralIncome this.refundForm.tempPoints = data.integralIncome
this.refundForm.refundPoints = data.integralIncome this.refundForm.refundPoints = data.integralIncome //退还积分
this.refundForm.refundAmount = data.orderMoney //退还金额
//当前积分能抵扣的最大值 //当前积分能抵扣的最大值
this.getScore() this.getScore()
}, },
...@@ -599,16 +664,18 @@ export default { ...@@ -599,16 +664,18 @@ export default {
}).then((res) => { }).then((res) => {
this.refundForm.integralIncome = res.addScore this.refundForm.integralIncome = res.addScore
//最大积分 //最大积分
if (this.refundForm.refundPoints == this.refundForm.integralIncome) { if (this.refundForm.refundPoints == res.addScore) {
this.refundForm.remainingScore = res.remainingScore this.refundForm.remainingScore = res.remainingScore //剩余积分
// this.refundForm.remainAmount = res.remainAmount //剩余金额
this.refundForm.firstInto = true this.refundForm.firstInto = true
this.refundForm.refundType = 1 //退款类型(1:全退,2:部分退), this.refundForm.refundType = 1 //退款类型(1:全退,2:部分退),
this.refundFormData[0].optionList[0].isDisabled = false this.refundFormData[this.findAttrIdx("refundType")].optionList[0].isDisabled = false
} else { } else {
this.refundForm.remainingScore = res.remainingScore this.refundForm.remainingScore = res.remainingScore
// this.refundForm.remainAmount = res.remainAmount //剩余金额
this.refundForm.firstInto = false this.refundForm.firstInto = false
this.refundForm.refundType = 2 this.refundForm.refundType = 2
this.refundFormData[0].optionList[0].isDisabled = true this.refundFormData[this.findAttrIdx("refundType")].optionList[0].isDisabled = true
} }
this.updateDisable() this.updateDisable()
}) })
...@@ -618,10 +685,13 @@ export default { ...@@ -618,10 +685,13 @@ export default {
if (this.refundForm.refundType == 1) { if (this.refundForm.refundType == 1) {
this.refundForm.refundPoints = this.refundForm.tempPoints this.refundForm.refundPoints = this.refundForm.tempPoints
} }
this.refundFormData[this.findAttrIdx("refundPoints")].isDisabled = disabled
this.refundFormData[1].isDisabled = disabled this.refundFormData[this.findAttrIdx("refundAmount")].isDisabled = disabled
this.refundFormData = deepClone(this.refundFormData) this.refundFormData = deepClone(this.refundFormData)
}, },
findAttrIdx(attrName) {
return this.refundFormData.findIndex((item) => item.name == attrName)
},
//关闭标记退款 //关闭标记退款
handleRefundClose() { handleRefundClose() {
this.refundVisible = false this.refundVisible = false
...@@ -634,7 +704,8 @@ export default { ...@@ -634,7 +704,8 @@ export default {
markAsRefunded({ markAsRefunded({
orderCode: this.refundForm.orderCode, orderCode: this.refundForm.orderCode,
refundType: this.refundForm.refundType, refundType: this.refundForm.refundType,
refundPoints: this.refundForm.refundPoints refundPoints: this.refundForm.refundPoints,
refundAmount:this.refundForm.refundAmount
}).then((res) => { }).then((res) => {
if (res) { if (res) {
this.$message.success("退款成功!") this.$message.success("退款成功!")
......
...@@ -81,6 +81,7 @@ ...@@ -81,6 +81,7 @@
> >
<el-radio :label="1">分值</el-radio> <el-radio :label="1">分值</el-radio>
<el-radio :label="2">排名</el-radio> <el-radio :label="2">排名</el-radio>
<el-radio :label="3">满勤</el-radio>
</el-radio-group> </el-radio-group>
</div> </div>
<div slot="ratingRankHtml" slot-scope="scope"> <div slot="ratingRankHtml" slot-scope="scope">
...@@ -363,9 +364,11 @@ export default { ...@@ -363,9 +364,11 @@ export default {
this.showOrHideAttr("editFormData", "评级项目", false) this.showOrHideAttr("editFormData", "评级项目", false)
this.showOrHideAttr("editFormData", "评级方式", false) this.showOrHideAttr("editFormData", "评级方式", false)
this.pointRule() this.pointRule()
// if (this.infoForm.ratingMethod == 1) { if (this.infoForm.ratingMethod == 1) {
// this.showOrHideAttr('editFormData', '评级积分', false) this.showOrHideAttr('editFormData', '评级积分', false)
// } } else if (this.infoForm.ratingMethod == 2) {
this.showOrHideAttr('editFormData', '评级排名', false)
}
} else if (this.infoForm.levelType == 1) { } else if (this.infoForm.levelType == 1) {
this.showOrHideAttr("editFormData", "评级积分", false) this.showOrHideAttr("editFormData", "评级积分", false)
} }
...@@ -446,9 +449,12 @@ export default { ...@@ -446,9 +449,12 @@ export default {
if (value == 1) { if (value == 1) {
this.showOrHideAttr("editFormData", "评级积分", false) this.showOrHideAttr("editFormData", "评级积分", false)
this.showOrHideAttr("editFormData", "评级排名", true) this.showOrHideAttr("editFormData", "评级排名", true)
} else { } else if (value == 2) {
this.showOrHideAttr("editFormData", "评级积分", true) this.showOrHideAttr("editFormData", "评级积分", true)
this.showOrHideAttr("editFormData", "评级排名", false) this.showOrHideAttr("editFormData", "评级排名", false)
} else if (value == 3) {
this.showOrHideAttr("editFormData", "评级积分", true)
this.showOrHideAttr("editFormData", "评级排名", true)
} }
}, },
......
...@@ -6,12 +6,15 @@ ...@@ -6,12 +6,15 @@
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="积分记录" <el-tab-pane label="积分记录"
name="pointsRecord" /> name="pointsRecord" />
<el-tab-pane label="月度统计记录"
name="monthlyStatistics" />
<el-tab-pane label="积分配置管理" <el-tab-pane label="积分配置管理"
name="pointsConfig" /> name="pointsConfig" />
</el-tabs> </el-tabs>
<div> <div>
<points-record v-if="activeName === 'pointsRecord'" /> <points-record v-if="activeName === 'pointsRecord'" />
<points-config v-if="activeName === 'pointsConfig'" /> <points-config v-if="activeName === 'pointsConfig'" />
<monthly-statistics v-if="activeName === 'monthlyStatistics'" />
</div> </div>
</div> </div>
</div> </div>
...@@ -20,6 +23,7 @@ ...@@ -20,6 +23,7 @@
<script> <script>
import pointsRecord from './pointsRecord' import pointsRecord from './pointsRecord'
import pointsConfig from './pointsConfig' import pointsConfig from './pointsConfig'
import monthlyStatistics from './monthlyStatistics'
// import { deepClone } from '@/common/util' // import { deepClone } from '@/common/util'
export default { export default {
name: 'StaffIndex', name: 'StaffIndex',
...@@ -33,7 +37,8 @@ export default { ...@@ -33,7 +37,8 @@ export default {
components: { components: {
pointsRecord, pointsRecord,
pointsConfig pointsConfig,
monthlyStatistics
}, },
mounted() { 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 \ 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!