Commit fd9c1c1e by 张立顺

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

…ife-system into SAAS+V4.49.0-0121
2 parents 8859b807 fcf02092
Showing 54 changed files with 2642 additions and 230 deletions
...@@ -87,3 +87,15 @@ export function levelManageExport(data) { ...@@ -87,3 +87,15 @@ export function levelManageExport(data) {
data.method = `${path}resident.level.manage.export` data.method = `${path}resident.level.manage.export`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 根据奖励类型查询奖励名称
export function levelNameList(data) {
data.method = `${path}resident.level.name.list`
return request(data, RequestMethods.POST)
}
// 根据手机号获取员工信息
export function pointStaffQuery(data) {
data.method = `${path}resident.point.staff.query`
return request(data, RequestMethods.POST)
}
...@@ -71,3 +71,9 @@ export function getProductInfo(data) { ...@@ -71,3 +71,9 @@ export function getProductInfo(data) {
data.method = `${path}goodsinfo.get.byId` data.method = `${path}goodsinfo.get.byId`
return request(data, "post") return request(data, "post")
} }
// 获取三级全部类目
export function getAllCategory(data) {
data.method = `${path}goodsCategoryConfiguration.page.new`
return request(data, "post")
}
...@@ -127,13 +127,21 @@ export function reportTrack(data) { ...@@ -127,13 +127,21 @@ export function reportTrack(data) {
// 获取门店工资绩效列表 // 获取门店工资绩效列表
export function getStoreSalaryListApi(data) { export function getStoreSalaryListApi(data) {
data.method = `${path2}merchantPerformanceConfig.page` data.method = `${path2}merchantPerformanceConfig.pageByMerchant`
// data.method = `${path2}merchantPerformanceConfig.page`
return request(data, "post")
}
// 编辑进入页面获取最新配置的绩效数据
export function getStoreLastDetailApi(data) {
data.method = `${path2}merchantPerformanceConfig.getLatestConfigDetailByMerchantId`
return request(data, "post") return request(data, "post")
} }
// 禁用/启用门店工资绩效 // 禁用/启用门店工资绩效
export function editStoreSalaryStatusApi(data) { export function editStoreSalaryStatusApi(data) {
data.method = `${path2}merchantPerformanceConfig.updateStatus` // data.method = `${path2}merchantPerformanceConfig.updateStatus`
data.method = `${path2}merchantPerformanceConfig.updateStatusByMerchant`
return request(data, "post") return request(data, "post")
} }
...@@ -257,6 +265,12 @@ export function editStaffApi(data) { ...@@ -257,6 +265,12 @@ export function editStaffApi(data) {
return request(data, "post") return request(data, "post")
} }
// 编辑员工扣款项配置数据
export function editStaffDeductionApi(data) {
data.method = `${path2}staffConfig.update`
return request(data, "post")
}
// 员工分配门店账号 // 员工分配门店账号
export function assignStoreAccountApi(data) { export function assignStoreAccountApi(data) {
data.method = `${path2}staffBaseInfo.account.other.add` data.method = `${path2}staffBaseInfo.account.other.add`
...@@ -363,4 +377,64 @@ export function exportSummary(data) { ...@@ -363,4 +377,64 @@ export function exportSummary(data) {
export function getAllStaff(data) { export function getAllStaff(data) {
data.method = 'dj.api.smartcarlife.staff.specificBusinessRolePerson.areaSupervision.pageConfigured' data.method = 'dj.api.smartcarlife.staff.specificBusinessRolePerson.areaSupervision.pageConfigured'
return request(data, 'post') return request(data, 'post')
}
// 收入测算-白名单员工分页
export function getWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.list'
return request(data, 'post')
}
// 收入测算-查询收入测算配置开关
export function getSwitchConfig(data = {}) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.switch.config.get'
return request(data, 'post')
}
// 收入测算-添加白名单员工
export function addWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.add'
return request(data, 'post')
}
// 收入测算配置开关更新
export function addSwitchConfig(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.switch.config.add'
return request(data, 'post')
}
// 收入测算-删除白名单员工
export function delWhiteStaff(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.white.staff.del'
return request(data, 'post')
}
// 查询员工详情
export function getStaffInfo(data) {
data.method = 'dj.smartcarlife.api.incomeMeasurement.staff.info.get'
return request(data, 'post')
}
// 职级介绍配置查询
export function getRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.get'
return request(data, 'post')
}
// 职级介绍配置更新
export function addRankConfig(data) {
data.method = 'dj.smartcarlife.api.job.rank.config.add'
return request(data, 'post')
}
// 员工收入测算
export function getIncomePage(data) {
data.method = 'dj.api.smartcarlife.staff.incomeCalculation.page'
return request(data, 'post')
}
// 获取商品信息列表
export function listGoodsType(data = {}) {
data.method = 'dj.api.smartcarlife.staff.incomeCalculation.listGoodsType'
return request(data, 'post')
} }
\ No newline at end of file \ No newline at end of file
...@@ -38,3 +38,33 @@ export function queryGoodsCategoryBySceneId(data) { ...@@ -38,3 +38,33 @@ export function queryGoodsCategoryBySceneId(data) {
data.method = `${path}queryGoodsCategoryBySceneId` data.method = `${path}queryGoodsCategoryBySceneId`
return request(data, RequestMethods.POST) return request(data, RequestMethods.POST)
} }
// 查询商品类目列表(新)
export function getCategoryList_new(data) {
data.method = `${path}page.new`
return request(data, RequestMethods.POST)
}
// 新增商品类目(新)
export function addGoodsCategory_new(data) {
data.method = `${path}addGoodsCategory.new`
return request(data, RequestMethods.POST)
}
// 编辑类目
export function updateGoodsCategory(data) {
data.method = `${path}updateGoodsCategory`
return request(data, RequestMethods.POST)
}
// 删除类目
export function deleteGoodsCategory(data) {
data.method = `${path}deleteGoodsCategory`
return request(data, RequestMethods.POST)
}
// 查询类目所属的一级类目及其子类目
export function queryParent(data) {
data.method = `${path}query.parent`
return request(data, RequestMethods.POST)
}
...@@ -21,7 +21,8 @@ export function getProductType(data) { ...@@ -21,7 +21,8 @@ export function getProductType(data) {
export function getGoodsCategoryConfiguration(data) { export function getGoodsCategoryConfiguration(data) {
data.currentPage = 1 data.currentPage = 1
data.pageSize = 999999 data.pageSize = 999999
data.method = `${path}goodsCategoryConfiguration.page` // data.method = `${path}goodsCategoryConfiguration.page`
data.method = `${path}goodsCategoryConfiguration.page.new`
return request(data) return request(data)
} }
......
...@@ -990,9 +990,9 @@ export const pointValueSignOpt = [ ...@@ -990,9 +990,9 @@ export const pointValueSignOpt = [
{ confId: -1, confValue: "积分扣减" } { confId: -1, confValue: "积分扣减" }
] ]
// 成长等级 等级类型 // 成长等级 奖励类型
export const levelTypeOpt = [ export const levelTypeOpt = [
{ confId: 1, confValue: "成长等级" }, { confId: 1, confValue: "积分区间" },
{ confId: 2, confValue: "勋章" } { confId: 2, confValue: "勋章" }
] ]
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<el-option v-for="(subItem, subIndex) in item.optionList" :key="subIndex" <el-option v-for="(subItem, subIndex) in item.optionList" :key="subIndex"
:label="subItem[item.optionLabel]" :value="subItem[item.optionId]" /> :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" />
</el-select> </el-select>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="searchForm[item.name]" <el-date-picker v-else-if="item.type === 'datePicker'" :style="{ width: item.width || '100%' }" v-model="searchForm[item.name]"
:type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]" /> start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]" />
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item" /> <slot v-if="item.addHtml" :name="item.addHtml" :scope="item" />
......
...@@ -427,7 +427,7 @@ export const routerName = { ...@@ -427,7 +427,7 @@ export const routerName = {
{ {
authId: "9061202", authId: "9061202",
parentId: "90612", parentId: "90612",
label: "新增类目", label: "新增一级类目",
icon: "plus", icon: "plus",
category: "Button", category: "Button",
type: "primary", type: "primary",
...@@ -444,6 +444,12 @@ export const routerName = { ...@@ -444,6 +444,12 @@ export const routerName = {
parentId: "90612", parentId: "90612",
label: "删除", label: "删除",
handle: "deleteCategory" handle: "deleteCategory"
},
{
authId: "9061205",
parentId: "90612",
label: "添加子类目",
handle: "addChildCategory"
} }
], ],
component: _import("systemConfig/sceneCategoryManage/index") component: _import("systemConfig/sceneCategoryManage/index")
...@@ -798,8 +804,7 @@ export const routerName = { ...@@ -798,8 +804,7 @@ export const routerName = {
parentId: "90619", parentId: "90619",
label: "阳光激励配置", label: "阳光激励配置",
handle: "markRefundHandle" handle: "markRefundHandle"
}, }
], ],
component: _import("systemConfig/ShopConfig/index") component: _import("systemConfig/ShopConfig/index")
}, },
......
...@@ -637,9 +637,9 @@ export const routerName = { ...@@ -637,9 +637,9 @@ export const routerName = {
handle: "handleToEdit", handle: "handleToEdit",
addRoutePath: [ addRoutePath: [
{ {
authId: "912070101", authId: "912120101",
name: "编辑", name: "编辑",
parentId: "91207" parentId: "91212"
} }
] ]
}, },
...@@ -655,11 +655,13 @@ export const routerName = { ...@@ -655,11 +655,13 @@ export const routerName = {
label: "启用", label: "启用",
handle: "handleEnableOrDisable", handle: "handleEnableOrDisable",
ruleObj: { ruleObj: {
attr: "status", attr: "minPerformConfigStatus",
rule: { rule: {
null: '启用',
2: "启用", 2: "启用",
1: "禁用" 1: "禁用"
} },
disabledStatusList: [null]
} }
}, },
{ {
...@@ -697,7 +699,15 @@ export const routerName = { ...@@ -697,7 +699,15 @@ export const routerName = {
parentId: "91212", parentId: "91212",
label: "明细", label: "明细",
handle: "handleDetail" handle: "handleDetail"
} },
{
authId: "9121210",
parentId: "91212",
label: "导入绩效方案",
category: "Button",
type: "primary",
handle: "handleImport"
},
], ],
component: _import("residentManage/salaryPerformance/index") component: _import("residentManage/salaryPerformance/index")
}, },
...@@ -829,16 +839,28 @@ export const routerName = { ...@@ -829,16 +839,28 @@ export const routerName = {
parentId: "912", parentId: "912",
cache: false cache: false
}, },
auth: [
{
authId: "9121501",
parentId: "91215",
label: "导出",
category: "Button",
type: "primary",
handle: "handleExport"
}
],
component: _import("residentManage/dailyPaperManagement/index") component: _import("residentManage/dailyPaperManagement/index")
},
91216: {
path: "/measurement",
name: "measurement",
meta: {
title: "收入测算配置",
authId: "91216",
parentId: "912",
cache: false
},
component: _import("residentManage/measurement/index")
},
91217: {
path: "/promotionAndDmotion",
name: "promotionAndDmotion",
meta: {
title: "晋升/降级配置",
authId: "91217",
parentId: "912",
cache: false
},
component: _import("residentManage/promotionAndDmotion/index")
} }
} }
...@@ -40,16 +40,18 @@ ...@@ -40,16 +40,18 @@
<td class="lb"> <td class="lb">
商品类别 商品类别
</td> </td>
<td>{{ $$(detail.subOrder,'upgradeGoodsTypeName') }}</td> <td>{{ $$(detail.subOrder,'goodsTypeNameStr') }}</td>
<td class="lb"> <td class="lb">
数量 数量
</td> </td>
<td>{{ $$(detail.subOrder,'number') }}件</td> <td>{{ $$(detail.subOrder,'number') }}件</td>
<td rowspan="2" colspan="2" <td rowspan="2"
colspan="2"
class="lb"> class="lb">
支付金额 支付金额
</td> </td>
<td rowspan="2" colspan="2"> <td rowspan="2"
colspan="2">
{{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }} {{ detail.totalPrice ? '¥ ' + detail.totalPrice : '' }}
</td> </td>
</tr> </tr>
...@@ -219,7 +221,9 @@ ...@@ -219,7 +221,9 @@
商品成本 商品成本
</td> </td>
<!-- 子订单有嘀加成本或第三方成本 商品成本显示- --> <!-- 子订单有嘀加成本或第三方成本 商品成本显示- -->
<td v-if="isSubOrder">{{ !filterEmpty(detail.djCost) || !filterEmpty(detail.thirdPartyCost) ? '-' : (detail.goodsCost?('¥ '+detail.goodsCost):'¥0') }}</td> <td v-if="isSubOrder">
{{ !filterEmpty(detail.djCost) || !filterEmpty(detail.thirdPartyCost) ? '-' : (detail.goodsCost?('¥ '+detail.goodsCost):'¥0') }}
</td>
<td v-else>{{ detail.goodsCostForShow?('¥ '+detail.goodsCostForShow):'-' }}</td> <td v-else>{{ detail.goodsCostForShow?('¥ '+detail.goodsCostForShow):'-' }}</td>
<td class="lb"> <td class="lb">
回收成本 回收成本
...@@ -312,7 +316,9 @@ ...@@ -312,7 +316,9 @@
<td v-else> <td v-else>
{{ proportionTypeOpts[item.expenseCategoryCalculateType]?(proportionTypeOpts[item.expenseCategoryCalculateType]+item.expenseCategoryValue+(item.expenseCategoryCalculateType == 3 ? '元' : '%') ):'-' }} {{ proportionTypeOpts[item.expenseCategoryCalculateType]?(proportionTypeOpts[item.expenseCategoryCalculateType]+item.expenseCategoryValue+(item.expenseCategoryCalculateType == 3 ? '元' : '%') ):'-' }}
</td> </td>
<td>{{ !item.noData ? (item.expenseCategoryResult?('¥ '+item.expenseCategoryResult):'¥0') : '-' }}</td> <td>
{{ !item.noData ? (item.expenseCategoryResult?('¥ '+item.expenseCategoryResult):'¥0') : '-' }}
</td>
</tr> </tr>
</table> </table>
<!-- 审计需求先屏蔽 --> <!-- 审计需求先屏蔽 -->
...@@ -454,7 +460,12 @@ export default { ...@@ -454,7 +460,12 @@ export default {
if (res.goodsOrder?.payOrder?.successDate) { if (res.goodsOrder?.payOrder?.successDate) {
res.goodsOrder.payOrder.successDate = Util.dateFormate(res.goodsOrder.payOrder.successDate, 'YYYY-MM-DD HH:mm:ss') res.goodsOrder.payOrder.successDate = Util.dateFormate(res.goodsOrder.payOrder.successDate, 'YYYY-MM-DD HH:mm:ss')
} }
if (res.subOrder) res.subOrder.positionStr = this.positionTypeList?.filter(val => val.position == res.subOrder?.upgradeGoodsPosition)[0]?.confName || '-' if (res.subOrder) {
res.subOrder.positionStr = this.positionTypeList?.filter(val => val.position == res.subOrder?.upgradeGoodsPosition)[0]?.confName || '-'
res.subOrder.goodsTypeNameStr = res.subOrder.upgradeGoodsTypeName || '-'
res.subOrder.goodsTypeNameStr += res.subOrder.upgradeSecondaryGoodsTypeName ? ' - ' + res.subOrder.upgradeSecondaryGoodsTypeName : ''
res.subOrder.goodsTypeNameStr += res.subOrder.upgradeThirdLevelGoodsTypeName ? ' - ' + res.subOrder.upgradeThirdLevelGoodsTypeName : ''
}
this.detail = res this.detail = res
const calculateds = res.expenseCategoryCalculateds const calculateds = res.expenseCategoryCalculateds
if (calculateds && calculateds.length > 0) { if (calculateds && calculateds.length > 0) {
...@@ -470,8 +481,8 @@ export default { ...@@ -470,8 +481,8 @@ export default {
} }
// 未匹配到流量费规则,默认展示一条空数据 // 未匹配到流量费规则,默认展示一条空数据
if (!this.ledgerData?.length) { if (!this.ledgerData?.length) {
let _data = { const _data = {
expenseCategoryName: '流量费', expenseCategoryName: '流量费',
targetType: 1, targetType: 1,
targetMerchantName: res?.orderDivision?.realityShopMerchantName, targetMerchantName: res?.orderDivision?.realityShopMerchantName,
targetMerchantId: res?.orderDivision?.realityShopMerchantId, targetMerchantId: res?.orderDivision?.realityShopMerchantId,
...@@ -536,7 +547,7 @@ export default { ...@@ -536,7 +547,7 @@ export default {
text-align: center; text-align: center;
// padding: 10px; // padding: 10px;
padding: 6px; padding: 6px;
.text-hide{ .text-hide {
display: inline-block; display: inline-block;
width: 19.5em; width: 19.5em;
overflow: hidden; overflow: hidden;
......
...@@ -674,6 +674,7 @@ export default { ...@@ -674,6 +674,7 @@ export default {
_formData.positionNamesArr = _positionNamesArr _formData.positionNamesArr = _positionNamesArr
_formData.goodsName = _valueObj?.goodsName _formData.goodsName = _valueObj?.goodsName
_formData.goodsTypeName = _valueObj?.goodsTypeName _formData.goodsTypeName = _valueObj?.goodsTypeName
_formData.tempGoodsTypeName = _valueObj?.tempGoodsTypeName
_formData.goodsType = _valueObj?.goodsType _formData.goodsType = _valueObj?.goodsType
_formData.serviceItemNames = _valueObj?.serviceItemNames _formData.serviceItemNames = _valueObj?.serviceItemNames
_formData.productType = [] // 切换上架商品 将服务类型清空 _formData.productType = [] // 切换上架商品 将服务类型清空
......
...@@ -74,7 +74,7 @@ export const packageGoodsForm = [{ ...@@ -74,7 +74,7 @@ export const packageGoodsForm = [{
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
...@@ -191,7 +191,7 @@ export const packageGoodsDetail = [ ...@@ -191,7 +191,7 @@ export const packageGoodsDetail = [
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
......
...@@ -66,7 +66,7 @@ export default { ...@@ -66,7 +66,7 @@ export default {
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
...@@ -292,6 +292,9 @@ export default { ...@@ -292,6 +292,9 @@ export default {
this.allPages = res.pages this.allPages = res.pages
const resArr = [] const resArr = []
res.list && res.list.forEach(val => { res.list && res.list.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -301,6 +304,7 @@ export default { ...@@ -301,6 +304,7 @@ export default {
upgradeGoodsName: v?.upgradeGoodsName, upgradeGoodsName: v?.upgradeGoodsName,
goodsName: val?.goodsInfo?.goodsName, goodsName: val?.goodsInfo?.goodsName,
goodsTypeName: val?.goodsInfo?.goodsTypeName, goodsTypeName: val?.goodsInfo?.goodsTypeName,
tempGoodsTypeName: result,
upgradePrice: v?.upgradePrice, upgradePrice: v?.upgradePrice,
purchasePrice: v?.purchasePrice, purchasePrice: v?.purchasePrice,
type: v?.type, type: v?.type,
...@@ -363,10 +367,14 @@ export default { ...@@ -363,10 +367,14 @@ export default {
const positionNamesArr = deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList)?.filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
res.productType = productType // 产品类型 res.productType = productType // 产品类型
res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价 res.upgradePrice = res.upgradeGoods?.upgradePrice // 参考售价
res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位 res.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '' // 部位
res.positionNamesArr = positionNamesArr res.positionNamesArr = positionNamesArr
res.tempGoodsTypeName = result // 所属分类
res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价 res.purchasePrice = res.upgradeGoods?.purchasePrice // 采购价价
res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID res.upgradeCommodityCode = res?.upgradeCommodityCode // 商品ID
res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限 res.warrantyPeriod = res?.upgradeGoods?.warrantyPeriod // 质保年限
......
...@@ -71,7 +71,7 @@ export default { ...@@ -71,7 +71,7 @@ export default {
value: 'goodsName' value: 'goodsName'
}, { }, {
label: '所属分类', label: '所属分类',
value: 'goodsTypeName' value: 'tempGoodsTypeName'
}, { }, {
label: '商品ID', label: '商品ID',
value: 'upgradeCommodityCode' value: 'upgradeCommodityCode'
...@@ -183,6 +183,9 @@ export default { ...@@ -183,6 +183,9 @@ export default {
const productType = [] const productType = []
if (res?.upgradeProductFlag == 'Y') productType.push(2) if (res?.upgradeProductFlag == 'Y') productType.push(2)
if (res?.baseProductFlag == 'Y') productType.push(1) if (res?.baseProductFlag == 'Y') productType.push(1)
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = res.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
const productTypeTextArr = [] const productTypeTextArr = []
// 太阳膜/延保类回显部位 // 太阳膜/延保类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(val => (res?.upgradeGoods.position?.split(','))?.includes(val.position + '')) || []
...@@ -200,6 +203,7 @@ export default { ...@@ -200,6 +203,7 @@ export default {
if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (res.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
res.tempGoodsTypeName = result // 所属分类
res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-' res.productTypeStr = productTypeTextArr?.length ? productTypeTextArr.join(';') : '-'
res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-' res.warrantyTypeStr = this.warrantyTypeShow[res?.warrantyType] || '-'
res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || '' res.baseSupplyModeStr = baseSupplyModeList?.filter(v => v.confId == res.baseSupplyMode)[0]?.confName || ''
......
...@@ -9,6 +9,13 @@ ...@@ -9,6 +9,13 @@
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData" :form-data="showFormData"
@handleChangeSelect="handleChangeSelect"> @handleChangeSelect="handleChangeSelect">
<template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'" filterable
@change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" <el-button :id="tableParams.btnId"
...@@ -188,7 +195,7 @@ ...@@ -188,7 +195,7 @@
</d2-container> </d2-container>
</template> </template>
<script> <script>
import { getProductTypeBySceneId, getList } from '@api/product' import { getList, getAllCategory } from '@api/product'
import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy, batchSetValidMinSellPrice, groundingImport } from '@api/grounding' import { getGroundingManageList, updateGoodsStatus, batchReviewAPI, delGroundingById, batchUpdateStatus, batchUpdateBatchCopy, batchSetValidMinSellPrice, groundingImport } from '@api/grounding'
import { deepClone, Util } from '@/common/util' import { deepClone, Util } from '@/common/util'
import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js' import { sceneCodeList, sceneList, BaseData } from '@/common/constants.js'
...@@ -212,12 +219,15 @@ export default { ...@@ -212,12 +219,15 @@ export default {
sceneType: '', sceneType: '',
goodsCode: '', goodsCode: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
goodsAlias: '', goodsAlias: '',
status: '', status: '',
yqMerchantId: '', yqMerchantId: '',
goodsSource: 0, goodsSource: 0,
financeCheckFlag: '' financeCheckFlag: ''
}, },
tempGoodsType: [],
getListApi: getGroundingManageList, getListApi: getGroundingManageList,
drawerDetailVisible: false, drawerDetailVisible: false,
showFormData: [{ showFormData: [{
...@@ -251,11 +261,7 @@ export default { ...@@ -251,11 +261,7 @@ export default {
}, { }, {
label: '所属分类', label: '所属分类',
name: 'goodsType', name: 'goodsType',
type: 'select', addHtml: 'goodsCascader'
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, { }, {
label: '所属系列', label: '所属系列',
name: 'goodsCode', name: 'goodsCode',
...@@ -464,7 +470,13 @@ export default { ...@@ -464,7 +470,13 @@ export default {
label: '所属分类', label: '所属分类',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName', prop: 'goodsTypeName',
width: 140 formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
return result
},
width: 170
}, { }, {
label: '上架部位', label: '上架部位',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
...@@ -594,9 +606,8 @@ export default { ...@@ -594,9 +606,8 @@ export default {
this.getOptionsList() this.getOptionsList()
}) })
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getProductTypeBySceneId({ categoryTypeList: this.selfBuildGoodsType }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res this.baseData.productTypeList = res?.list || []
this.getOptionsList()
}) })
// 获取全部素材 素材商品来源(0嘀加,1自建商品) // 获取全部素材 素材商品来源(0嘀加,1自建商品)
getList({ currentPage: 1, pageSize: 9999, goodsSource: 0 }).then(res => { getList({ currentPage: 1, pageSize: 9999, goodsSource: 0 }).then(res => {
...@@ -626,6 +637,11 @@ export default { ...@@ -626,6 +637,11 @@ export default {
}), }),
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
selectAddAttr(value) {
this.searchForm.goodsType = value?.[0]
this.searchForm.secondaryGoodsType = value?.[1]
this.searchForm.thirdLevelGoodsType = value?.[2]
},
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList) this.positionTypeList = await this.get(BaseData.positionTypeList)
}, },
...@@ -784,12 +800,15 @@ export default { ...@@ -784,12 +800,15 @@ export default {
sceneType: '', sceneType: '',
goodsCode: '', goodsCode: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
goodsAlias: '', goodsAlias: '',
status: '', status: '',
yqMerchantId: '', yqMerchantId: '',
goodsSource: 0, goodsSource: 0,
financeCheckFlag: '' financeCheckFlag: ''
} }
this.tempGoodsType = []
// 重新查询 // 重新查询
this.$refs.groundingIndexTable.refreshTable(true, true) this.$refs.groundingIndexTable.refreshTable(true, true)
}, },
......
...@@ -725,6 +725,7 @@ export default { ...@@ -725,6 +725,7 @@ export default {
_formData.positionNamesArr = _positionNamesArr _formData.positionNamesArr = _positionNamesArr
_formData.goodsName = _valueObj?.goodsName _formData.goodsName = _valueObj?.goodsName
_formData.goodsTypeName = _valueObj?.goodsTypeName _formData.goodsTypeName = _valueObj?.goodsTypeName
_formData.tempGoodsTypeName = _valueObj?.tempGoodsTypeName
_formData.goodsType = _valueObj?.goodsType _formData.goodsType = _valueObj?.goodsType
_formData.serviceItemNames = _valueObj?.serviceItemNames _formData.serviceItemNames = _valueObj?.serviceItemNames
_formData.upgradeSupplyMode = '' // 切换上架商品 将升级/产品供货模式清空 _formData.upgradeSupplyMode = '' // 切换上架商品 将升级/产品供货模式清空
......
...@@ -248,6 +248,9 @@ export default { ...@@ -248,6 +248,9 @@ export default {
this.allPages = res.pages this.allPages = res.pages
const resArr = [] const resArr = []
res.list && res.list.forEach(val => { res.list && res.list.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -257,6 +260,7 @@ export default { ...@@ -257,6 +260,7 @@ export default {
upgradeGoodsName: v?.upgradeGoodsName, upgradeGoodsName: v?.upgradeGoodsName,
goodsName: val?.goodsInfo?.goodsName, goodsName: val?.goodsInfo?.goodsName,
goodsTypeName: val?.goodsInfo?.goodsTypeName, goodsTypeName: val?.goodsInfo?.goodsTypeName,
tempGoodsTypeName: result,
upgradePrice: v?.upgradePrice, upgradePrice: v?.upgradePrice,
purchasePrice: v?.purchasePrice, purchasePrice: v?.purchasePrice,
type: v?.type, type: v?.type,
...@@ -307,6 +311,9 @@ export default { ...@@ -307,6 +311,9 @@ export default {
res.groundingGoodsList = [] res.groundingGoodsList = []
const defaultSelect = [] // 上架商品 默认选中项 const defaultSelect = [] // 上架商品 默认选中项
res?.merchantGoodsInfoList?.forEach(val => { res?.merchantGoodsInfoList?.forEach(val => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
const positionNamesArr = deepClone(this.positionTypeList)?.filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList)?.filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
res.groundingGoodsList.push({ res.groundingGoodsList.push({
id: val.id, id: val.id,
...@@ -315,6 +322,7 @@ export default { ...@@ -315,6 +322,7 @@ export default {
upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称 upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称
goodsAlias: val?.goodsAlias, // 商品别名 goodsAlias: val?.goodsAlias, // 商品别名
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目 goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result, // 商品所属类目
upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价 upgradePrice: val?.upgradeGoods?.upgradePrice, // 参考售价
position: val?.position, // 上架部位 position: val?.position, // 上架部位
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称 positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称
......
...@@ -150,6 +150,9 @@ export default { ...@@ -150,6 +150,9 @@ export default {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
this.editForm[1].formBlock.push(packageGoodsDetail) this.editForm[1].formBlock.push(packageGoodsDetail)
// 太阳膜类回显部位 // 太阳膜类回显部位
const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || [] const positionNamesArr = deepClone(this.positionTypeList).filter(subVal => (val?.upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
...@@ -159,6 +162,7 @@ export default { ...@@ -159,6 +162,7 @@ export default {
upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称 upgradeGoodsName: val?.upgradeGoodsName, // 升级商品名称
goodsAlias: val?.goodsAlias || '-', // 商品别名 goodsAlias: val?.goodsAlias || '-', // 商品别名
goodsTypeName: val?.goodsTypeName, // 升级商品所属类目 goodsTypeName: val?.goodsTypeName, // 升级商品所属类目
tempGoodsTypeName: result, // 商品所属类目
// upgradePrice: val?.upgradePrice, // 参考售价 // upgradePrice: val?.upgradePrice, // 参考售价
positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位 positionStr: deepClone(this.positionTypeList)?.filter(subVal => val?.position == subVal.position)[0]?.confName || '', // 上架部位
positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称 positionNames: positionNamesArr.length ? positionNamesArr.map(subItem => { return subItem?.confName }).join('/') : '', // 部位名称
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
<p class="item_class"> <p class="item_class">
<span class="label">类目:</span> <span class="label">类目:</span>
<span class="value">{{ $$(commodityInfo.goodsInfo,'goodsTypeName') }}</span> <span class="value">{{ $$(commodityInfo.goodsInfo,'goodsTypeName') }}</span>
<span class="value" v-if="$$(commodityInfo.goodsInfo,'secondaryGoodsTypeName')">-{{ $$(commodityInfo.goodsInfo,'secondaryGoodsTypeName') }}</span>
<span class="value" v-if="$$(commodityInfo.goodsInfo,'thirdLevelGoodsTypeName')">-{{ $$(commodityInfo.goodsInfo,'thirdLevelGoodsTypeName') }}</span>
</p> </p>
<p class="item_class"> <p class="item_class">
<span class="label">品牌方:</span> <span class="label">品牌方:</span>
......
...@@ -24,7 +24,8 @@ ...@@ -24,7 +24,8 @@
v-if=" v-if="
item.type === 'input' || item.type === 'input' ||
item.type === 'select' || item.type === 'select' ||
item.type === 'special-select' item.type === 'special-select' ||
item.type === 'cascader'
" "
> >
<el-input <el-input
...@@ -172,6 +173,12 @@ ...@@ -172,6 +173,12 @@
</div> </div>
</div> </div>
</el-select> </el-select>
<!-- 级联选择器 -->
<el-cascader v-else-if="item.type === 'cascader'" :style="{ width: item.width || formItemWidth }" :options="item.optionList"
v-model="formData[item.name]" :placeholder="'请选择' + item.label" filterable
@change="selectAddAttr($event, item)" aria-hidden="false"
:props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }">
</el-cascader>
</el-form-item> </el-form-item>
</div> </div>
<!-- 膜类配置字段 1太阳膜 14改色膜 6改色膜(众筹)12车衣 4车衣(众筹)--> <!-- 膜类配置字段 1太阳膜 14改色膜 6改色膜(众筹)12车衣 4车衣(众筹)-->
...@@ -607,6 +614,7 @@ export default { ...@@ -607,6 +614,7 @@ export default {
data() { data() {
return { return {
equitySceneType: baseConfig.equitySceneType || [], equitySceneType: baseConfig.equitySceneType || [],
membraneTypeList: baseConfig.membraneTypeList || [],
solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112], solarFilmArr: baseConfig.solarFilmArr || [1, 111, 112],
userInfo: this.$store.state.d2admin.user.info, userInfo: this.$store.state.d2admin.user.info,
lookImgVisible: false, lookImgVisible: false,
...@@ -642,7 +650,7 @@ export default { ...@@ -642,7 +650,7 @@ export default {
trigger: "blur" trigger: "blur"
} }
], ],
goodsType: [ tempGoodsType: [
{ required: true, message: "请选择类目", trigger: "change" } { required: true, message: "请选择类目", trigger: "change" }
], ],
supplierCode: [ supplierCode: [
...@@ -915,11 +923,30 @@ export default { ...@@ -915,11 +923,30 @@ export default {
selectAddAttr(value, targetItem) { selectAddAttr(value, targetItem) {
this.selectedValue = value this.selectedValue = value
this.editOptionIndex = -1 this.editOptionIndex = -1
if (targetItem.name == "goodsType") { if (targetItem.name == "tempGoodsType") {
var tempVal = targetItem.optionList.find( var tempVal = targetItem.optionList.find(
(item) => item.categoryType === value (item) => item.categoryType === value?.[0]
) )
this.formData.goodsTypeName = tempVal.categoryName let secondGoodsObj
let thirdGoodsObj
targetItem.optionList?.forEach(val => {
val.children?.find(item => {
if (item.categoryType === value?.[1]) {
secondGoodsObj = item
}
item.children?.find(val => {
if (val.categoryType === value?.[2]) {
thirdGoodsObj = val
}
})
})
})
this.formData.goodsType = value?.[0] // 一级类目
this.formData.secondaryGoodsType = value?.[1] || '' // 二级类目
this.formData.thirdLevelGoodsType = value?.[2] || '' // 三级类目
this.formData.goodsTypeName = tempVal.categoryName // 一级类目名
this.formData.secondaryGoodsTypeName = secondGoodsObj?.categoryName || '' // 二级类目名
this.formData.thirdLevelGoodsTypeName = thirdGoodsObj?.categoryName || '' // 三级类目名
const copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock) const copyMembranesFormBlock = deepClone(this.copyMembranesFormBlock)
// 太阳膜类 部位下拉框数据 // 太阳膜类 部位下拉框数据
copyMembranesFormBlock[ copyMembranesFormBlock[
...@@ -929,15 +956,10 @@ export default { ...@@ -929,15 +956,10 @@ export default {
this.membranesFormBlock = [] this.membranesFormBlock = []
if (this.formData.goodsType == 1) { if (this.formData.goodsType == 1) {
this.membranesFormBlock = copyMembranesFormBlock this.membranesFormBlock = copyMembranesFormBlock
} else if ( } else if (this.membraneTypeList?.includes(this.formData.goodsType)) { // 膜类配置比例换算
this.formData.goodsType == 12 ||
this.formData.goodsType == 14 ||
this.formData.goodsType == 4 ||
this.formData.goodsType == 6
) {
this.membranesFormBlock = [copyMembranesFormBlock[1]] this.membranesFormBlock = [copyMembranesFormBlock[1]]
} }
this.setUpdateGoodsInfo({ goodsType: value }) this.setUpdateGoodsInfo({ goodsType: value?.[0] })
} }
// 修改供应方 // 修改供应方
if (targetItem.name == "supplierCode") { if (targetItem.name == "supplierCode") {
...@@ -1338,5 +1360,13 @@ export default { ...@@ -1338,5 +1360,13 @@ export default {
.add_icon { .add_icon {
color: #3fcf77; color: #3fcf77;
} }
::v-deep .el-radio__original {
display: none !important;
}
::v-deep .el-radio:focus:not(.is-focus):not(:active):not(.is-disabled)
.el-radio__inner {
box-shadow: none !important;
}
</style> </style>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
<script> <script>
import { deepClone } from '@/common/util' import { deepClone } from '@/common/util'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { getBrandSupplyMerchant, addBrandSupplyMerchant, editBrandSupplyMerchant, getProductTypeBySceneId } from '@/api/product' import { getBrandSupplyMerchant, addBrandSupplyMerchant, editBrandSupplyMerchant, getProductTypeBySceneId, getAllCategory } from '@/api/product'
import productForm from './productForm.vue' import productForm from './productForm.vue'
import { baseConfig } from '@/main' import { baseConfig } from '@/main'
export default { export default {
...@@ -29,6 +29,7 @@ export default { ...@@ -29,6 +29,7 @@ export default {
editData: { editData: {
goodsName: '', goodsName: '',
goodsType: '', goodsType: '',
tempGoodsType: [],
goodsTypeName: '', goodsTypeName: '',
sapCode: '', sapCode: '',
brandMerchantCode: '', brandMerchantCode: '',
...@@ -56,10 +57,10 @@ export default { ...@@ -56,10 +57,10 @@ export default {
width: '432px' width: '432px'
}, },
{ {
name: 'goodsType', name: 'tempGoodsType',
label: '类目', label: '类目',
isRequired: true, isRequired: true,
type: 'select', type: 'cascader',
isClear: false, isClear: false,
isDisabled: false, isDisabled: false,
optionList: [], optionList: [],
...@@ -175,10 +176,22 @@ export default { ...@@ -175,10 +176,22 @@ export default {
}), }),
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getGoodTypeList() { getGoodTypeList() {
getProductTypeBySceneId({ categoryTypeList: this.selfBuildGoodsType }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
const obj = this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'goodsType')] const obj = this.editForm[0].formBlock[this.editForm[0].formBlock.findIndex(val => val.name == 'tempGoodsType')]
obj.optionList = res obj.optionList = res?.list || []
if (this.addOrEdit === 'edit' && this.formData?.status != 3) obj.isDisabled = true if (this.addOrEdit === 'edit' && this.formData?.status != 3) {
obj.optionList.forEach(item => {
if (item.categoryType != this.editData.goodsType) {
item.disabled = true
item?.children?.forEach(i => {
i.disabled = true
i?.children?.forEach(j => {
j.disabled = true
})
})
}
})
}
}) })
}, },
// 获取品牌/供应方 // 获取品牌/供应方
......
...@@ -8,6 +8,13 @@ ...@@ -8,6 +8,13 @@
:search-form="searchForm" :search-form="searchForm"
:label-width="'100px'" :label-width="'100px'"
:form-data="showFormData"> :form-data="showFormData">
<template slot="goodsCascader">
<el-cascader :options="baseData.productTypeList" style="width: 100%;"
v-model="tempGoodsType" :placeholder="'请选择'" filterable
@change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }">
</el-cascader>
</template>
</d2-search> </d2-search>
<div class="up-btns"> <div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary"> <el-button :id="tableParams.btnId" size="small" type="primary">
...@@ -112,7 +119,7 @@ ...@@ -112,7 +119,7 @@
<script> <script>
import { Util } from '@/common/util' import { Util } from '@/common/util'
import { getProductManageList, productImport } from '@api/productManage' import { getProductManageList, productImport } from '@api/productManage'
import { getProductTypeBySceneId } from '@api/product' import { getAllCategory } from '@api/product'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import { baseGoodsDelete } from '@api/commodity' import { baseGoodsDelete } from '@api/commodity'
import drawerDetail from './components/drawerDetail.vue' import drawerDetail from './components/drawerDetail.vue'
...@@ -127,9 +134,12 @@ export default { ...@@ -127,9 +134,12 @@ export default {
commodityCode: '', commodityCode: '',
baseGoodsName: '', baseGoodsName: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
baseGoodsStatus: '', baseGoodsStatus: '',
type: '' type: ''
}, },
tempGoodsType: [],
showFormData: [{ showFormData: [{
label: 'ID', label: 'ID',
name: 'commodityCode', name: 'commodityCode',
...@@ -151,11 +161,7 @@ export default { ...@@ -151,11 +161,7 @@ export default {
}, { }, {
label: '类目', label: '类目',
name: 'goodsType', name: 'goodsType',
type: 'select', addHtml: 'goodsCascader'
optionList: [],
optionId: 'categoryType',
optionLabel: 'categoryName',
optionsName: 'productTypeList'
}, { }, {
label: '商品状态', label: '商品状态',
name: 'baseGoodsStatus', name: 'baseGoodsStatus',
...@@ -202,7 +208,13 @@ export default { ...@@ -202,7 +208,13 @@ export default {
}, { }, {
label: '类目', label: '类目',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName' prop: 'goodsTypeName',
formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const types = [goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName]
const result = types.filter(type => type).join('-')
return result
}
}, { }, {
label: '规格', label: '规格',
prop: 'listShowSpecificationData', prop: 'listShowSpecificationData',
...@@ -301,10 +313,10 @@ export default { ...@@ -301,10 +313,10 @@ export default {
mounted() { mounted() {
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt) this.baseData.statusList.unshift(allOpt)
this.getBaseData()
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
getProductTypeBySceneId({ categoryTypeList: this.selfBuildGoodsType }).then(res => { getAllCategory({ categoryTypeList: this.selfBuildGoodsType, pageSize: 9999, currentPage: 1 }).then(res => {
this.baseData.productTypeList = res this.baseData.productTypeList = res?.list || []
this.getBaseData()
}) })
}, },
...@@ -315,12 +327,13 @@ export default { ...@@ -315,12 +327,13 @@ export default {
}), }),
...mapMutations('d2admin/user', ['setUpdateRefesh']), ...mapMutations('d2admin/user', ['setUpdateRefesh']),
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
selectAddAttr(value) {
this.searchForm.goodsType = value?.[0]
this.searchForm.secondaryGoodsType = value?.[1]
this.searchForm.thirdLevelGoodsType = value?.[2]
},
async getBaseData() { async getBaseData() {
this.positionTypeList = await this.get(BaseData.positionTypeList) this.positionTypeList = await this.get(BaseData.positionTypeList)
this.baseData.productTypeList.unshift({
categoryType: '',
categoryName: '全部'
})
this.showFormData.forEach((item, index) => { this.showFormData.forEach((item, index) => {
if (item.type === 'select') { if (item.type === 'select') {
this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName]) this.$set(this.showFormData[index], 'optionList', this.baseData[item.optionsName])
...@@ -406,9 +419,12 @@ export default { ...@@ -406,9 +419,12 @@ export default {
commodityCode: '', commodityCode: '',
baseGoodsName: '', baseGoodsName: '',
goodsType: '', goodsType: '',
secondaryGoodsType: '',
thirdLevelGoodsType: '',
baseGoodsStatus: '', baseGoodsStatus: '',
type: '' type: ''
} }
this.tempGoodsType = []
this.$refs.productManageTable.refreshTable(true, true) this.$refs.productManageTable.refreshTable(true, true)
}, },
handleAdd(form) { handleAdd(form) {
......
...@@ -163,9 +163,14 @@ export default { ...@@ -163,9 +163,14 @@ export default {
specificationDetailList.push(val) specificationDetailList.push(val)
}) })
const selectedPositions = res.goodsInfo?.goodsPositionList?.map((val) => { return val.position }) || [] const selectedPositions = res.goodsInfo?.goodsPositionList?.map((val) => { return val.position }) || []
const { goodsType, secondaryGoodsType, thirdLevelGoodsType } = res.goodsInfo || {}
const tempGoodsType = [goodsType, secondaryGoodsType, thirdLevelGoodsType].filter(item => item != -1 && Boolean(item)) // 未设置时后端会返回默认值-1
objData = { objData = {
status: res.status, status: res.status,
goodsType: res.goodsInfo.goodsType, goodsType: res.goodsInfo.goodsType,
tempGoodsType: tempGoodsType,
secondaryGoodsType: res.goodsInfo.secondaryGoodsType,
thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType,
goodsCode: res.goodsInfo.goodsCode, goodsCode: res.goodsInfo.goodsCode,
goodsSpecificationNameList: res.goodsSpecificationNameList, goodsSpecificationNameList: res.goodsSpecificationNameList,
specificationDetailList: specificationDetailList, // 多规格数据 specificationDetailList: specificationDetailList, // 多规格数据
...@@ -185,7 +190,9 @@ export default { ...@@ -185,7 +190,9 @@ export default {
supplierCode: res.goodsInfo.supplierCode, supplierCode: res.goodsInfo.supplierCode,
merchantGoodsInfos: res?.merchantGoodsInfos merchantGoodsInfos: res?.merchantGoodsInfos
} }
this.productFormData = deepClone({ ...res.goodsInfo, status: res?.status, oldconvertedValue: res.goodsInfo?.convertedValue }) || {} this.productFormData = deepClone({ ...res.goodsInfo, status: res?.status, oldconvertedValue: res.goodsInfo?.convertedValue, tempGoodsType: tempGoodsType,
secondaryGoodsType: res.goodsInfo.secondaryGoodsType,
thirdLevelGoodsType: res.goodsInfo.thirdLevelGoodsType }) || {}
this.setUpdateGoodsInfo(objData) this.setUpdateGoodsInfo(objData)
this.show = true this.show = true
// this.$nextTick(() => { // this.$nextTick(() => {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<div class="content"> <div class="content">
<div class="title">基本信息</div> <div class="title">基本信息</div>
<template v-if="type == 1"> <template v-if="type == 1">
<el-transfer class="transfer" v-model="value" filterable :titles="['待选列表', '已选列表']" <el-transfer :key="key" class="transfer" v-model="value" filterable :titles="['待选列表', '已选列表']"
:left-default-checked="leftDefaultChecked" :right-default-checked="rightDefaultChecked" :format="{ :left-default-checked="leftDefaultChecked" :right-default-checked="rightDefaultChecked" :format="{
noChecked: '${total}项', noChecked: '${total}项',
hasChecked: '${checked}/${total}项' hasChecked: '${checked}/${total}项'
...@@ -23,15 +23,23 @@ ...@@ -23,15 +23,23 @@
<div class="basic-info"><span>日报日期:</span>{{ templateData.createdDate }}</div> <div class="basic-info"><span>日报日期:</span>{{ templateData.createdDate }}</div>
<div class="basic-info"><span>缺失份数:</span>{{ templateData.undoCount }}份</div> <div class="basic-info"><span>缺失份数:</span>{{ templateData.undoCount }}份</div>
<div class="title">明细数据 <el-button type="primary" size="mini" @click="exportTable">导出</el-button></div> <div class="title">明细数据 <el-button type="primary" size="mini" @click="exportTable">导出</el-button></div>
<el-table :data="tableData" border style="width: 100%;text-align: center;"> <el-table :data="tableData" border style="width: 100%;text-align: center;">
<el-table-column prop="staffName" label="督导姓名"> <el-table-column v-for="(item, index) in tableParams" :sortable="item.sortable" :key="index" :prop="item.prop" :label="item.label">
<template slot-scope="scope">
<slot :scope="scope.row">
{{ scope.row[item.prop] == null ? '-' : scope.row[item.prop] }}
</slot>
</template>
</el-table-column>
<!-- <el-table-column prop="staffName" label="督导姓名">
{{ scope.row.staffName || "-" }}
</el-table-column> </el-table-column>
<el-table-column prop="lastSubmitDate" label="最近提交日报日期"> <el-table-column prop="lastSubmitDate" sortable label="最近提交日报日期">
</el-table-column> </el-table-column>
<el-table-column prop="weekSubmitCount" label="本周提交总数"> <el-table-column prop="weekSubmitCount" sortable label="本周提交总数">
</el-table-column>
<el-table-column prop="monthSubmitCount" label="本月提交总数">
</el-table-column> </el-table-column>
<el-table-column prop="monthSubmitCount" sortable label="本月提交总数">
</el-table-column> -->
</el-table> </el-table>
</template> </template>
<template v-else> <template v-else>
...@@ -76,6 +84,12 @@ export default { ...@@ -76,6 +84,12 @@ export default {
if (this.type == 2) { if (this.type == 2) {
this.getSummaryStaff() this.getSummaryStaff()
} else if (this.type == 1) { } else if (this.type == 1) {
this.value = []
this.leftChecked = []
this.rightChecked= []
this.leftDefaultChecked = []
this.rightDefaultChecked= []
this.key = new Date().getTime()
this.getStaff() this.getStaff()
} }
} }
...@@ -101,7 +115,29 @@ export default { ...@@ -101,7 +115,29 @@ export default {
rightChecked: [], rightChecked: [],
leftDefaultChecked: [], leftDefaultChecked: [],
rightDefaultChecked: [], rightDefaultChecked: [],
tableData: [] tableData: [],
tableParams: [
{
label: '督导姓名',
prop: 'staffName'
},
{
label: '最近提交日报日期',
prop: 'lastSubmitDate',
sortable: true
},
{
label: '本周提交总数',
prop: 'weekSubmitCount',
sortable: true
},
{
label: '本月提交总数',
prop: 'monthSubmitCount',
sortable: true
}
],
key: new Date().getTime()
} }
}, },
...@@ -186,9 +222,6 @@ export default { ...@@ -186,9 +222,6 @@ export default {
templateCode: code, templateCode: code,
createdDate createdDate
} }
exportSummary(params).then(res => {
console.log(res);
})
params.method = 'dj.api.smartcarlife.digital.management.record.staff.summary.export' params.method = 'dj.api.smartcarlife.digital.management.record.staff.summary.export'
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
...@@ -232,8 +265,12 @@ export default { ...@@ -232,8 +265,12 @@ export default {
createdDate createdDate
} }
getSummaryStaff(params).then(res => { getSummaryStaff(params).then(res => {
console.log(res, '===='); // console.log(res, '====');
// if (res.length) {
// res.forEach(item => {
// if (!item.staffName) item.s
// })
// }
this.tableData = res this.tableData = res
}) })
} }
...@@ -305,4 +342,7 @@ export default { ...@@ -305,4 +342,7 @@ export default {
} }
} }
} }
.el-table .cell {
text-align: center;
}
</style> </style>
\ No newline at end of file \ No newline at end of file
<template> <template>
<div> <div>
<!-- class="order-detail" -->
<d2-container> <d2-container>
<!-- <div class="offline-account"> -->
<div class="header" slot="header" style="padding: 10px 20px;"> <div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth" <d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth"
:form-data="showFormData"> :form-data="showFormData">
<div slot="createdDate">
<el-date-picker
v-model="searchForm.createdDate"
type="date"
placeholder="选择日期"
:clearable="false"
:picker-options="pickerOption"
@change="dateChange">
</el-date-picker>
</div>
<div slot="merchantId"> <div slot="merchantId">
<el-select v-model="searchForm.merchantIds" multiple filterable placeholder="请选择"> <el-select v-model="searchForm.merchantIds" multiple filterable placeholder="请选择">
<el-option <el-option
...@@ -47,8 +55,8 @@ ...@@ -47,8 +55,8 @@
<el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.key"> <el-tab-pane v-for="item in tabList" :key="item.id" :label="item.name" :name="item.key">
<d2-table :ref="item.key + 'Table'" :key="key" :hasNum="false" :tableTotal="tableTotal" @sortChange="sortChange" :sort-obj="sortObj" :tableData="tableData" :search-form="searchFormSearch" :table-params="tableParams" @refreshTable="refreshTable"> <d2-table :ref="item.key + 'Table'" :key="key" :hasNum="false" :tableTotal="tableTotal" @sortChange="sortChange" :sort-obj="sortObj" :tableData="tableData" :search-form="searchFormSearch" :table-params="tableParams" @refreshTable="refreshTable">
<div class="text-box" slot="multiterm" slot-scope="scope"> <div class="text-box" slot="multiterm" slot-scope="scope">
<span>{{ scope.scope[scope.prop].split(',')[0] }}</span> <span>{{ scope.scope[scope.prop] ? scope.scope[scope.prop].split(',')[0] : '-'}}</span>
<el-popover placement="top" width="fit-content" trigger="hover"> <el-popover v-if="scope.scope[scope.prop]" placement="top" width="fit-content" trigger="hover">
<div> <div>
<div <div
v-for="(item, index) in scope.scope[scope.prop].split(',')" v-for="(item, index) in scope.scope[scope.prop].split(',')"
...@@ -62,9 +70,15 @@ ...@@ -62,9 +70,15 @@
<div class="precent-box" slot="percent" slot-scope="scope"> <div class="precent-box" slot="percent" slot-scope="scope">
<div class="total">{{scope.scope[scope.prop].value}}{{scope.scope[scope.prop].suffix}}</div> <div class="total">{{scope.scope[scope.prop].value}}{{scope.scope[scope.prop].suffix}}</div>
<div class="precent"> <div class="precent">
<template v-if="scope.scope[scope.prop].monthRate">
<div :class="scope.scope[scope.prop].monthRate > 0 ? 'red' : scope.scope[scope.prop].monthRate == 0 ? '' : 'green'">月 {{scope.scope[scope.prop].monthRate}}%</div> <div :class="scope.scope[scope.prop].monthRate > 0 ? 'red' : scope.scope[scope.prop].monthRate == 0 ? '' : 'green'">月 {{scope.scope[scope.prop].monthRate}}%</div>
</template>
<template v-else>月 -</template>
<div class="line"></div> <div class="line"></div>
<div :class="scope.scope[scope.prop].weekRate > 0 ? 'red' : scope.scope[scope.prop].weekRate == 0 ? '' : 'green'">周 {{scope.scope[scope.prop].weekRate}}%</div> <template v-if="scope.scope[scope.prop].weekRate">
<div :class="scope.scope[scope.prop].weekRate > 0 ? 'red' : scope.scope[scope.prop].weekRate == 0 ? '' : 'green'">周 {{scope.scope[scope.prop].weekRate}}%</div>
</template>
<template v-else>周 -</template>
</div> </div>
</div> </div>
<div class="text-box" slot="text" slot-scope="scope"> <div class="text-box" slot="text" slot-scope="scope">
...@@ -74,10 +88,16 @@ ...@@ -74,10 +88,16 @@
{{scope.scope[scope.prop] || '-'}} {{scope.scope[scope.prop] || '-'}}
</div> </div>
<div class="text-box" slot="link" slot-scope="scope"> <div class="text-box" slot="link" slot-scope="scope">
<template v-if="scope.scope[scope.prop]">
<a :href="scope.scope[scope.prop]" target="_blank">复制链接</a> <a :href="scope.scope[scope.prop]" target="_blank">复制链接</a>
</template>
<template v-else>-</template>
</div> </div>
<div class="text-box" slot="picture" slot-scope="scope"> <div class="text-box" slot="picture" slot-scope="scope">
<a :href="scope.scope[scope.prop]" target="_blank">查看</a> <template v-if="scope.scope[scope.prop]">
<a :href="scope.scope[scope.prop]" target="_blank">查看</a>
</template>
<template v-else>-</template>
</div> </div>
</d2-table> </d2-table>
</el-tab-pane> </el-tab-pane>
...@@ -87,7 +107,6 @@ ...@@ -87,7 +107,6 @@
<Drawer :drawerVisible="drawer" :type="contentType" :templateData="templateData" @handleClose="handleClose" @handleSubmit="handleSubmit"> <Drawer :drawerVisible="drawer" :type="contentType" :templateData="templateData" @handleClose="handleClose" @handleSubmit="handleSubmit">
</Drawer> </Drawer>
</d2-container> </d2-container>
</div> </div>
</template> </template>
...@@ -99,6 +118,7 @@ import Drawer from './drawer.vue'; ...@@ -99,6 +118,7 @@ import Drawer from './drawer.vue';
import mockData from '../data.json' import mockData from '../data.json'
import recordData from './record.json' import recordData from './record.json'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { rangePickerOptions } from '@/common/format'
export default { export default {
name: 'TransferAccountsList', name: 'TransferAccountsList',
components: { components: {
...@@ -113,6 +133,7 @@ export default { ...@@ -113,6 +133,7 @@ export default {
merchantIds: '' merchantIds: ''
}, },
searchFormSearch: {}, searchFormSearch: {},
pickerOption: rangePickerOptions,
showFormData: [ showFormData: [
{ {
label: '日报模板', label: '日报模板',
...@@ -130,13 +151,15 @@ export default { ...@@ -130,13 +151,15 @@ export default {
label: '模板2', label: '模板2',
value: 2 value: 2
} }
] ],
changeAttr: (value, targetItem) => {
console.log(value);
this.getStaff()
}
}, { }, {
label: '日报日期', label: '日报日期',
name: 'createdDate', name: 'createdDate',
type: 'datePicker', addHtml: 'createdDate'
dateType: 'date',
pickerOptions: 'rangePickerOptions'
}, { }, {
label: '督导', label: '督导',
name: 'merchantIds', name: 'merchantIds',
...@@ -177,7 +200,7 @@ export default { ...@@ -177,7 +200,7 @@ export default {
drawer: false, drawer: false,
contentType: 0, contentType: 0,
tabList: [], tabList: [],
activeName: '', activeName: null,
recordData: [], recordData: [],
summaryData: {}, summaryData: {},
templateData: {}, templateData: {},
...@@ -186,7 +209,7 @@ export default { ...@@ -186,7 +209,7 @@ export default {
} }
}, },
created() {//默认当前日期 created() {//默认当前日期
this.searchForm.createdDate = new Date('2025-01-06') this.searchForm.createdDate = new Date()
this.getTemplate() this.getTemplate()
}, },
mounted() { mounted() {
...@@ -211,6 +234,7 @@ export default { ...@@ -211,6 +234,7 @@ export default {
}) })
}, },
getTemplate() { getTemplate() {
// 获取日报模板下拉内容
getTemplateList().then(res => { getTemplateList().then(res => {
this.showFormData[0].optionList = res this.showFormData[0].optionList = res
this.searchForm.typeName = res[0].typeName this.searchForm.typeName = res[0].typeName
...@@ -218,6 +242,7 @@ export default { ...@@ -218,6 +242,7 @@ export default {
typeName: this.searchForm.typeName, typeName: this.searchForm.typeName,
createdDate: dayjs(new Date(this.searchForm.createdDate)).format('YYYY-MM-DD') createdDate: dayjs(new Date(this.searchForm.createdDate)).format('YYYY-MM-DD')
} }
// 根据日期和模板内容 ,获取督导下拉
getStaffList(params).then(res => { getStaffList(params).then(res => {
this.merchantIdOptions = res this.merchantIdOptions = res
this.handleSearch() this.handleSearch()
...@@ -253,7 +278,7 @@ export default { ...@@ -253,7 +278,7 @@ export default {
this.changeTable() this.changeTable()
}, },
// 改变表头 // 改变表头
changeTable() { changeTable(isSort = false) {
this.tableData = [] this.tableData = []
let colums = [] let colums = []
this.sortObj = {} this.sortObj = {}
...@@ -264,6 +289,7 @@ export default { ...@@ -264,6 +289,7 @@ export default {
label: i.name, label: i.name,
prop: i.key prop: i.key
} }
// 写入前端规则
if (frontRule) { if (frontRule) {
if (frontRule.hasOwnProperty('sortable')) { if (frontRule.hasOwnProperty('sortable')) {
obj.sortable = 'custom' obj.sortable = 'custom'
...@@ -277,6 +303,7 @@ export default { ...@@ -277,6 +303,7 @@ export default {
} }
colums.push(obj) colums.push(obj)
}) })
// 制作表格数据
const _table = this.recordData.map(item => item.types.find(i => i.key == this.activeName)) const _table = this.recordData.map(item => item.types.find(i => i.key == this.activeName))
_table.forEach((m,i) => { _table.forEach((m,i) => {
const obj = {} const obj = {}
...@@ -298,7 +325,7 @@ export default { ...@@ -298,7 +325,7 @@ export default {
this.tableParams.tableColumns = colums this.tableParams.tableColumns = colums
const _index = this.tabList.findIndex(item => item.key == this.activeName) const _index = this.tabList.findIndex(item => item.key == this.activeName)
this.tabList[_index].tableColumns = colums this.tabList[_index].tableColumns = colums
this.key = new Date().getTime() if (!isSort) this.key = new Date().getTime() // 切换表格强制刷新,排序不刷新
}, },
async handleSearch() { async handleSearch() {
console.log(this.searchForm); console.log(this.searchForm);
...@@ -335,11 +362,11 @@ export default { ...@@ -335,11 +362,11 @@ export default {
orderByType: sortObj[sortColum][sort], orderByType: sortObj[sortColum][sort],
orderByKey: sortColum orderByKey: sortColum
} }
this.getTableList(params) this.getTableList(params, true)
} }
}, },
// 获取列表数据 // 获取列表数据
async getTableList(sort = {}){ async getTableList(sort = {}, isSort = false){
const { typeName, createdDate, merchantIds } = this.searchForm const { typeName, createdDate, merchantIds } = this.searchForm
const params2 = { const params2 = {
templateCode: this.templateData.code, templateCode: this.templateData.code,
...@@ -352,10 +379,12 @@ export default { ...@@ -352,10 +379,12 @@ export default {
// 表格 // 表格
const r2 = await getRecordPage(params2) const r2 = await getRecordPage(params2)
console.log(r2); console.log(r2);
this.tableTotal = r2.total this.tableTotal = r2.total;
this.activeName = this.tabList[0].key // this.activeName = this.tabList[0].key;
this.recordData = r2.list if (this.activeName == 0) this.activeName = this.tabList[0].key
this.changeTable() console.log(this.activeName, this.activeName == 0, 'active');
this.recordData = r2.list;
this.changeTable(isSort);
}, },
handleReset() { handleReset() {
this.searchForm = { this.searchForm = {
...@@ -364,7 +393,6 @@ export default { ...@@ -364,7 +393,6 @@ export default {
merchantIds: [] merchantIds: []
} }
this.handleSearch() this.handleSearch()
// this.$refs.recordTable.refreshTable(false, true)
}, },
handleExport() { handleExport() {
...@@ -395,6 +423,19 @@ export default { ...@@ -395,6 +423,19 @@ export default {
] ]
this.actionSetDownloadList({ list, type: 'dowloadList' }) this.actionSetDownloadList({ list, type: 'dowloadList' })
}, },
dateChange(e) {
this.getStaff()
},
getStaff() {
const {createdDate, typeName} = this.searchForm
const params = {
typeName,
createdDate: dayjs(new Date(createdDate)).format('YYYY-MM-DD')
}
getStaffList(params).then(res => {
this.merchantIdOptions = res
})
}
} }
} }
......
...@@ -71,13 +71,13 @@ export default { ...@@ -71,13 +71,13 @@ export default {
openState: '' openState: ''
}, },
showFormData: [{ showFormData: [{
label: '等级名称', label: '奖励名称',
name: 'levelName', name: 'levelName',
type: 'input', type: 'input',
maxlength: '20', maxlength: '20',
isClear: true isClear: true
}, { }, {
label: '等级类型', label: '奖励类型',
name: 'levelType', name: 'levelType',
type: 'select', type: 'select',
isClear: true, isClear: true,
...@@ -104,25 +104,25 @@ export default { ...@@ -104,25 +104,25 @@ export default {
tableOption: { width: '150px' }, tableOption: { width: '150px' },
tableColumns: [ tableColumns: [
{ {
label: '等级名称', label: '奖励类型',
prop: 'levelName'
}, {
label: '等级类型',
prop: 'levelType', prop: 'levelType',
width: '150', width: '150',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.levelType ? this.baseData.levelTypeOpt.find(item => item.confId === cellValue.levelType).confValue : '--' return cellValue.levelType ? this.baseData.levelTypeOpt.find(item => item.confId === cellValue.levelType).confValue : '--'
} }
}, { }, {
label: '奖励名称',
prop: 'levelName'
}, {
label: '评级项目', label: '评级项目',
prop: "ratingProjectType" prop: "ratingProjectType"
}, { }, {
label: '最高排名', label: '最低积分/排名',
prop: 'highRanking', prop: 'minRanking',
width: '150' width: '150'
}, { }, {
label: '最低排名', label: '最高积分',
prop: 'minRanking', prop: 'highRanking',
width: '150' width: '150'
}, { }, {
label: '等级结算周期', label: '等级结算周期',
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
<script> <script>
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { Util, deepClone, downLoadFile } from '@/common/util' import { Util, deepClone, downLoadFile } from '@/common/util'
import { levelManagePage, levelManageDelete, levelManageExport } from '@api/inStorePoints' import { levelManagePage, levelManageDelete, levelManageExport, levelNameList } from '@api/inStorePoints'
import { levelTypeOpt, levelNameOpt } from '@/common/constants.js' import { levelTypeOpt, levelNameOpt } from '@/common/constants.js'
export default { export default {
name: 'Record', name: 'Record',
...@@ -74,7 +74,7 @@ export default { ...@@ -74,7 +74,7 @@ export default {
maxlength: '11', maxlength: '11',
isClear: true isClear: true
}, { }, {
label: '等级类型', label: '奖励类型',
name: 'levelType', name: 'levelType',
type: 'select', type: 'select',
isClear: true, isClear: true,
...@@ -83,24 +83,25 @@ export default { ...@@ -83,24 +83,25 @@ export default {
optionLabel: 'confValue', optionLabel: 'confValue',
optionsName: 'levelTypeOpt', optionsName: 'levelTypeOpt',
changeAttr: (value, targetItem) => { changeAttr: (value, targetItem) => {
this.baseData.levelNameOpt = [] this.getLevelNameList(value)
const nameOpt = deepClone(levelNameOpt) // this.baseData.levelNameOpt = []
if (value) { // const nameOpt = deepClone(levelNameOpt)
if (value == 1) { // if (value) {
this.baseData.levelNameOpt = nameOpt.slice(0, 4) // if (value == 1) {
} else if (value == 2) { // this.baseData.levelNameOpt = nameOpt.slice(0, 4)
this.baseData.levelNameOpt = nameOpt.slice(4, 8) // } else if (value == 2) {
} // this.baseData.levelNameOpt = nameOpt.slice(4, 8)
} // }
this.searchForm.levelName = "" // }
this.getOptionsList() // this.searchForm.levelName = ""
// this.getOptionsList()
} }
}, { }, {
label: '等级名称', label: '奖励名称',
name: 'levelName', name: 'levelName',
type: 'select', type: 'select',
isClear: true, isClear: true,
noDataText: "请先选择等级类型", noDataText: "请先选择奖励类型",
optionList: [], optionList: [],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confValue', optionLabel: 'confValue',
...@@ -134,14 +135,14 @@ export default { ...@@ -134,14 +135,14 @@ export default {
return Util.dateFormate(cellValue.distributionTime, 'YYYY年MM月') return Util.dateFormate(cellValue.distributionTime, 'YYYY年MM月')
} }
}, { }, {
label: '等级类型', label: '奖励类型',
prop: 'levelType', prop: 'levelType',
width: '150', width: '150',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.levelType ? this.baseData.levelTypeOpt.find(item => item.confId === cellValue.levelType).confValue : '--' return cellValue.levelType ? this.baseData.levelTypeOpt.find(item => item.confId === cellValue.levelType).confValue : '--'
} }
}, { }, {
label: '等级名称', label: '奖励名称',
prop: 'levelName' prop: 'levelName'
}, { }, {
label: '发放时间', label: '发放时间',
...@@ -252,6 +253,25 @@ export default { ...@@ -252,6 +253,25 @@ export default {
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
}) })
},
getLevelNameList(type) {
this.baseData.levelNameOpt = []
this.searchForm.levelName = ""
if (type) {
levelNameList({ levelType: type }).then(res => {
const list = deepClone(res)
this.baseData.levelNameOpt = list.map(item => {
return {
confId: item,
confValue: item
}
})
this.getOptionsList()
})
} else {
this.getOptionsList()
}
} }
} }
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
<el-select v-model="infoForm.merchantId" placeholder="请选择归属门店" :disabled="isDisabled" <el-select v-model="infoForm.merchantId" placeholder="请选择归属门店" :disabled="isDisabled"
style="width: 432px" remote reserve-keyword @visible-change="visibleChange" style="width: 432px" remote reserve-keyword @visible-change="visibleChange"
:remote-method="remoteMethod" @change="changeMerchant" v-el-select-loadmore="interestsLoadmore" filterable> :remote-method="remoteMethod" @change="changeMerchant" v-el-select-loadmore="interestsLoadmore" filterable>
<template v-if="baseData.merchantList && !baseData.merchantList.length && loadedFlag">
<el-option :label="'暂无数据'" :value="null" disabled></el-option>
</template>
<el-option v-for="(item, index) in baseData.merchantList" :key="index" :label="`${item.shopMerchantName}${item.shopMerchantId == -1 ? '' : item.shopMerchantId}`" :value="item.shopMerchantId"></el-option> <el-option v-for="(item, index) in baseData.merchantList" :key="index" :label="`${item.shopMerchantName}${item.shopMerchantId == -1 ? '' : item.shopMerchantId}`" :value="item.shopMerchantId"></el-option>
</el-select> </el-select>
</template> </template>
...@@ -118,7 +121,8 @@ export default { ...@@ -118,7 +121,8 @@ export default {
}, },
currentPage: 1, currentPage: 1,
pageSize: 50, pageSize: 50,
merchantIdName: '' merchantIdName: '',
loadedFlag: false
} }
}, },
props: { props: {
...@@ -240,6 +244,9 @@ export default { ...@@ -240,6 +244,9 @@ export default {
if (![0, 7, 8, 9].includes(this.infoForm.jobType)) { if (![0, 7, 8, 9].includes(this.infoForm.jobType)) {
this.$set(this.infoForm, 'merchantId', '') this.$set(this.infoForm, 'merchantId', '')
this.$set(this.infoForm, 'yqMerchantId', '') this.$set(this.infoForm, 'yqMerchantId', '')
this.baseData.merchantList = []
this.baseData.yqMerchantList = []
this.getOptions()
this.clearValidate() this.clearValidate()
} }
}, },
...@@ -283,6 +290,7 @@ export default { ...@@ -283,6 +290,7 @@ export default {
getStoreListBySceneApi(params).then(res => { getStoreListBySceneApi(params).then(res => {
this.baseData.merchantList = this.baseData.merchantList.concat(res.list) this.baseData.merchantList = this.baseData.merchantList.concat(res.list)
this.allPages = res.total this.allPages = res.total
this.loadedFlag = true
}) })
}, },
changeMerchant(val) { changeMerchant(val) {
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
style="width: 432px" remote reserve-keyword @visible-change="visibleChange" style="width: 432px" remote reserve-keyword @visible-change="visibleChange"
@change="changeMerchant" @change="changeMerchant"
:remote-method="remoteMethod" v-el-select-loadmore="interestsLoadmore" filterable> :remote-method="remoteMethod" v-el-select-loadmore="interestsLoadmore" filterable>
<template v-if="baseData.merchantList && !baseData.merchantList.length && loadedFlag">
<el-option :label="'暂无数据'" :value="null" disabled></el-option>
</template>
<el-option v-for="(item, index) in baseData.merchantList" :key="index" :label="`${item.shopMerchantName}${item.shopMerchantId == -1 ? '' : item.shopMerchantId}`" :value="item.shopMerchantId"></el-option> <el-option v-for="(item, index) in baseData.merchantList" :key="index" :label="`${item.shopMerchantName}${item.shopMerchantId == -1 ? '' : item.shopMerchantId}`" :value="item.shopMerchantId"></el-option>
</el-select> </el-select>
</template> </template>
...@@ -82,8 +85,7 @@ export default { ...@@ -82,8 +85,7 @@ export default {
optionLabel: 'confValue', optionLabel: 'confValue',
optionsName: 'channelList', optionsName: 'channelList',
changeAttr: (val) => { changeAttr: (val) => {
this.getOptions('hireType', val) this.resetForm(val)
this.resetForm()
} }
}, },
{ {
...@@ -231,7 +233,8 @@ export default { ...@@ -231,7 +233,8 @@ export default {
isDisabled: false, isDisabled: false,
currentPage: 1, currentPage: 1,
pageSize: 50, pageSize: 50,
merchantIdName: '' merchantIdName: '',
loadedFlag: false
} }
}, },
...@@ -286,7 +289,7 @@ export default { ...@@ -286,7 +289,7 @@ export default {
this.getOptions() this.getOptions()
}) })
}, },
resetForm() { resetForm(val) {
let obj = { let obj = {
jobType: '', jobType: '',
mentorPhone: '', mentorPhone: '',
...@@ -303,6 +306,9 @@ export default { ...@@ -303,6 +306,9 @@ export default {
this.staffFormData?.forEach(v => { this.staffFormData?.forEach(v => {
v.isDisabled = false v.isDisabled = false
}) })
this.baseData.merchantList = []
this.baseData.yqMerchantList = []
this.getOptions('hireType', val)
this.clearValidate() this.clearValidate()
}, },
clearValidate() { clearValidate() {
...@@ -314,6 +320,9 @@ export default { ...@@ -314,6 +320,9 @@ export default {
if (![0, 7, 8, 9].includes(this.infoForm.jobType)) { if (![0, 7, 8, 9].includes(this.infoForm.jobType)) {
this.$set(this.infoForm, 'merchantId', '') this.$set(this.infoForm, 'merchantId', '')
this.$set(this.infoForm, 'yqMerchantId', '') this.$set(this.infoForm, 'yqMerchantId', '')
this.baseData.merchantList = []
this.baseData.yqMerchantList = []
this.getOptions()
this.clearValidate() this.clearValidate()
} }
}, },
...@@ -416,6 +425,7 @@ export default { ...@@ -416,6 +425,7 @@ export default {
getStoreListBySceneApi(params).then(res => { getStoreListBySceneApi(params).then(res => {
this.baseData.merchantList = this.baseData.merchantList.concat(res.list) this.baseData.merchantList = this.baseData.merchantList.concat(res.list)
this.allPages = res.total this.allPages = res.total
this.loadedFlag = true
}) })
}, },
......
...@@ -12,6 +12,18 @@ ...@@ -12,6 +12,18 @@
:form-data="formData" :form-data="formData"
:form-rules="formRules"> :form-rules="formRules">
<template slot="syncUnit"><span class="unit">元</span></template> <template slot="syncUnit"><span class="unit">元</span></template>
<template slot="refundOffset">
<el-input style="width: 136px;" prefix-icon="el-icon-minus" @input="handleInput($event, 'refundOffset')" placeholder="请输入" v-model="infoForm.refundOffset"></el-input>
<span class="unit">元</span>
</template>
<template slot="customDeduction">
<el-input style="width: 136px;" @input="handleInput($event, 'customDeduction')" placeholder="输入正负值" v-model="infoForm.customDeduction"></el-input>
<span class="unit">元</span>
</template>
<template slot="correctSalary">
<el-input style="width: 136px;" placeholder="" disabled v-model="computedValue"></el-input>
<span class="unit">元</span>
</template>
</glsx-combi-form> </glsx-combi-form>
<div class="history-box" v-if="infoForm['historyRemark'].length"> <div class="history-box" v-if="infoForm['historyRemark'].length">
<div class="line"> <div class="line">
...@@ -32,7 +44,8 @@ ...@@ -32,7 +44,8 @@
<script> <script>
import { reviseSalaryApi, getSalaryRecordApi } from '@api/resident' import { reviseSalaryApi, getSalaryRecordApi } from '@api/resident'
import { Util,} from '@/common/util' import { Util,} from '@/common/util'
import { limitPrice } from '@/common/format' import { limitPrice, limitPriceForNegative } from '@/common/format'
import BigNumber from 'bignumber.js'
export default { export default {
name: 'RevisedSalaryDialog', name: 'RevisedSalaryDialog',
props: { props: {
...@@ -46,6 +59,20 @@ export default { ...@@ -46,6 +59,20 @@ export default {
} }
}, },
data() { data() {
var validateRefundOffset = (rule, value, callback) => {
if (Number(value) <= 0) {
callback(new Error('输入值必须大于0'))
} else {
callback()
}
}
var validateCustomDeduction = (rule, value, callback) => {
if (Number(value) == 0) {
callback(new Error('输入值不能为0'))
} else {
callback()
}
}
return { return {
dialogConfig: { dialogConfig: {
title: '修订合计应发工资', title: '修订合计应发工资',
...@@ -59,17 +86,19 @@ export default { ...@@ -59,17 +86,19 @@ export default {
isDisabled: true isDisabled: true
}, },
{ {
label: '修订为', label: '退单冲减',
name: 'refundOffset',
addHtml: 'refundOffset'
},
{
label: '正负冲减',
name: 'customDeduction',
addHtml: 'customDeduction'
},
{
label: '实发工资',
name: 'correctSalary', name: 'correctSalary',
type: 'input', addHtml: 'correctSalary'
width: '136px',
inputFn: (e) => {
e = e.replace(/[^\d.]/g, '')
let oldValue = `${this.infoForm['oldcorrectSalary']}`
this.$set(this.infoForm, 'correctSalary', limitPrice(e, oldValue, 6, 2, 0))
this.$set(this.infoForm, 'oldcorrectSalary', this.infoForm['correctSalary'])
},
suffixSlot: 'syncUnit'
}, },
{ {
label: '备注', label: '备注',
...@@ -83,6 +112,8 @@ export default { ...@@ -83,6 +112,8 @@ export default {
], ],
infoForm: { infoForm: {
correctSalary: '', correctSalary: '',
refundOffset: '',
customDeduction: '',
remark: '', remark: '',
historyRemark: [] historyRemark: []
}, },
...@@ -90,6 +121,14 @@ export default { ...@@ -90,6 +121,14 @@ export default {
correctSalary: [ correctSalary: [
{ required: true, message: '请输入修订后的应发工资', trigger: 'blur' } { required: true, message: '请输入修订后的应发工资', trigger: 'blur' }
], ],
refundOffset: [
{ required: false, message: '', trigger: 'blur' },
{ validator: validateRefundOffset, trigger: ['blur', 'change'] }
],
customDeduction: [
{ required: false, message: '', trigger: 'blur' },
{ validator: validateCustomDeduction, trigger: ['blur', 'change']}
],
remark: [ remark: [
{ required: true, message: '请输入备注', trigger: 'blur' } { required: true, message: '请输入备注', trigger: 'blur' }
] ]
...@@ -104,6 +143,15 @@ export default { ...@@ -104,6 +143,15 @@ export default {
set(newVal) { set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'revisedSalaryVisible' }) this.$emit('dialogClose', { flag: newVal, attrName: 'revisedSalaryVisible' })
} }
},
computedValue: {
get() {
let currentSalary = new BigNumber(this.infoForm.currentSalary || 0)
let refundOffset = new BigNumber(this.infoForm.refundOffset || 0)
let customDeduction = new BigNumber(this.infoForm.customDeduction != '-' ? (this.infoForm.customDeduction || 0) : 0)
this.$set(this.infoForm, 'correctSalary', `${currentSalary.minus(refundOffset).plus(customDeduction)}`)
return `${currentSalary.minus(refundOffset).plus(customDeduction)}`
}
} }
}, },
mounted() { mounted() {
...@@ -111,6 +159,41 @@ export default { ...@@ -111,6 +159,41 @@ export default {
this.getRecord() this.getRecord()
}, },
methods: { methods: {
handleInput(e, key) {
if (key == 'customDeduction') {
this.$set(this.infoForm, key, limitPriceForNegative(e))
} else {
let oldValue = `${this.infoForm['old' + key]}`
let maxlength = key == 'customDeduction' ? 7 : 6
this.$set(this.infoForm, key, limitPrice(e, oldValue, maxlength, 2))
this.$set(this.infoForm, 'old' + key, this.infoForm[key])
}
},
limitPriceForNegative(newValue) {
// 用来检索整数且不超过6位数
const limitDigit = /[0-9]{1,6}/
// 用来检索小数且小数点后不超过两位数
const limitDigitdot = /[0-9]{1,6}.[\d]{0,2}/
if (newValue) {
newValue = newValue + ""
let nn = ""
// 正负判断
if (newValue.match("-")) {
nn = newValue.match("-")[0]
}
// 小数判断
if (newValue.indexOf(".") != -1) {
if (newValue.match(limitDigitdot)) {
nn = nn + newValue.match(limitDigitdot)[0] || ""
}
} else {
if (newValue.match(limitDigit)) {
nn = nn + newValue.match(limitDigit)[0] || ""
}
}
return nn
}
},
getRecord() { getRecord() {
getSalaryRecordApi({ staffPhone: this.revisedSalaryRow.staffPhone, salaryMonth: this.revisedSalaryRow.salaryMonth, pageSize: 10, currentPage: 1 }).then(res => { getSalaryRecordApi({ staffPhone: this.revisedSalaryRow.staffPhone, salaryMonth: this.revisedSalaryRow.salaryMonth, pageSize: 10, currentPage: 1 }).then(res => {
res?.list?.forEach(item => { res?.list?.forEach(item => {
...@@ -124,7 +207,14 @@ export default { ...@@ -124,7 +207,14 @@ export default {
handleAddConfirm() { handleAddConfirm() {
this.$refs.editFormRef?.$refs?.editChildRef?.validate((valid) => { this.$refs.editFormRef?.$refs?.editChildRef?.validate((valid) => {
if (valid) { if (valid) {
reviseSalaryApi({id: this.revisedSalaryRow.id, correctSalary: this.infoForm['correctSalary'], remark: this.infoForm['remark']}).then(res => { let params = {
id: this.revisedSalaryRow.id,
refundOffset: this.infoForm.refundOffset || '',
customDeduction: this.infoForm.customDeduction || '',
correctSalary: this.computedValue,
remark: this.infoForm.remark
}
reviseSalaryApi(params).then(res => {
this.$message.success('修订成功') this.$message.success('修订成功')
this.$emit('dialogClose', { flag: true, attrName: 'revisedSalaryVisible' }) this.$emit('dialogClose', { flag: true, attrName: 'revisedSalaryVisible' })
}) })
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
<d2-table-header> <d2-table-header>
<span slot="left"> <span slot="left">
<auth-button category="Button" :show-btn-ids="['9120506']" /> <auth-button category="Button" :show-btn-ids="['9120506']" />
<span class="tips_text">仅展示「深圳嘀加」服务商的驻店员工,以及「广联数科」商户下员工</span>
</span> </span>
<span style="display: inline-block;margin-right: 10px;"> <span style="display: inline-block;margin-right: 10px;">
<auth-button category="Button" :show-btn-ids="['9120504']" /> <auth-button category="Button" :show-btn-ids="['9120504']" />
...@@ -95,7 +96,8 @@ export default { ...@@ -95,7 +96,8 @@ export default {
merchantName: "", merchantName: "",
hireType: "", hireType: "",
jobType: "", jobType: "",
workingStatus: "" workingStatus: "",
createdSource: ""
}, },
searchFormSearch: {}, searchFormSearch: {},
showFormData: [ showFormData: [
...@@ -125,7 +127,7 @@ export default { ...@@ -125,7 +127,7 @@ export default {
optionsName: "staffSceneLabelList" optionsName: "staffSceneLabelList"
}, },
{ {
label: "当前服务门店", label: "服务门店",
name: "merchantName", name: "merchantName",
type: "input", type: "input",
isClear: true isClear: true
...@@ -159,6 +161,16 @@ export default { ...@@ -159,6 +161,16 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confValue", optionLabel: "confValue",
optionsName: "workingStatusList" optionsName: "workingStatusList"
},
{
label: '渠道',
name: 'createdSource',
type: 'select',
isClear: true,
optionList: [],
optionId: 'confId',
optionLabel: 'confValue',
optionsName: 'createdSourceList'
} }
], ],
getListApi: getResidentListApi, getListApi: getResidentListApi,
...@@ -188,7 +200,24 @@ export default { ...@@ -188,7 +200,24 @@ export default {
}, },
{ {
label: "服务门店", label: "服务门店",
prop: "merchantName" prop: "",
width: '200',
formatter: (cellValue) => {
if (cellValue.merchantList && cellValue.merchantList.length > 0) {
return cellValue.merchantList.reduce(
(merchString, item) => {
merchString =
merchString +
`<p>${item.merchantName} ${item.merchantId}</p>`
return merchString
},
""
)
} else {
return "-"
}
},
html: true
}, },
{ {
label: "招聘通道", label: "招聘通道",
...@@ -205,8 +234,22 @@ export default { ...@@ -205,8 +234,22 @@ export default {
} }
}, },
{ {
label: "帮带导师", label: "创建人",
prop: "mentorName" prop: "createdBy"
},
{
label: "渠道",
prop: "createdSource",
formatter: (cellValue) => {
return filterStr(cellValue.createdSource, this.baseData.createdSourceList)
}
},
{
label: "创建时间",
prop: "createdDate",
formatter: (cellValue) => {
return cellValue.createdDate ? Util.dateFormate(cellValue.createdDate, 'YYYY-MM-DD') : '-'
}
}, },
{ {
label: "状态", label: "状态",
...@@ -235,6 +278,14 @@ export default { ...@@ -235,6 +278,14 @@ export default {
workingStatusList: [ workingStatusList: [
{ confId: '0', confValue: '在职' }, { confId: '0', confValue: '在职' },
{ confId: '1', confValue: '离职' } { confId: '1', confValue: '离职' }
],
createdSourceList: [
{ confId: '1', confValue: '账户中心' },
{ confId: '2', confValue: 'SCRM' },
{ confId: '3', confValue: '生意助手' },
{ confId: '4', confValue: '门店助手' },
{ confId: '5', confValue: 'D+' },
{ confId: '6', confValue: '员工版小程序' }
] ]
}, },
flagVisible: false, flagVisible: false,
...@@ -314,7 +365,8 @@ export default { ...@@ -314,7 +365,8 @@ export default {
merchantName: "", merchantName: "",
hireType: "", hireType: "",
jobType: "", jobType: "",
workingStatus: "" workingStatus: "",
createdSource: ""
} }
this.$refs.recordTable.refreshTable(false, true) this.$refs.recordTable.refreshTable(false, true)
}, },
...@@ -514,6 +566,10 @@ export default { ...@@ -514,6 +566,10 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
.tips_text{
margin-left: 10px;
color: #999;
}
.count-txt { .count-txt {
font-weight: 700; font-weight: 700;
color: #2a58ad; color: #2a58ad;
......
...@@ -10,5 +10,5 @@ export function filterStr(val, dataList, hireType) { ...@@ -10,5 +10,5 @@ export function filterStr(val, dataList, hireType) {
const found = dataList?.find(item => item.confId == v) const found = dataList?.find(item => item.confId == v)
return found?.confValue return found?.confValue
}) })
return result?.length ? result.join('、') : '-' return result?.length ? result.join(',') : '-'
} }
\ No newline at end of file \ No newline at end of file
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
slot-scope="scope"> slot-scope="scope">
<el-input-number v-model="infoForm.pointValue" <el-input-number v-model="infoForm.pointValue"
placeholder="输入数值" placeholder="输入数值"
:min="-100" :precision="1"
:max="100"></el-input-number> :step="0.1"
:min="-9.9"
:max="9.9"></el-input-number>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
...@@ -26,18 +28,18 @@ ...@@ -26,18 +28,18 @@
</template> </template>
<script> <script>
import { pointRule, pointAdd } from '@api/inStorePoints' import { pointRule, pointAdd, pointStaffQuery } from '@api/inStorePoints'
import { Util, deepClone } from '@/common/util' import { Util, deepClone } from '@/common/util'
export default { export default {
name: 'AddDialog', name: 'AddDialog',
data() { data() {
function checkPhone(rule, value, callback) { // function checkPhone(rule, value, callback) {
if (!Util.checkPhone(value)) { // if (!Util.checkPhone(value)) {
callback(new Error('请输入正确的手机号码')) // callback(new Error('请输入正确的手机号码'))
return false // return false
} // }
callback() // callback()
} // }
function checkPointValue(rule, value, callback) { function checkPointValue(rule, value, callback) {
if (value == 0) { if (value == 0) {
callback(new Error('积分值不能为0')) callback(new Error('积分值不能为0'))
...@@ -70,7 +72,7 @@ export default { ...@@ -70,7 +72,7 @@ export default {
message: '请填写电话号码', message: '请填写电话号码',
trigger: 'blur' trigger: 'blur'
}, { }, {
validator: checkPhone, validator: this.checkPhone,
trigger: 'blur' trigger: 'blur'
}], }],
pointClassification: [{ required: true, message: '请选择积分分类', trigger: 'blur' }], pointClassification: [{ required: true, message: '请选择积分分类', trigger: 'blur' }],
...@@ -86,13 +88,6 @@ export default { ...@@ -86,13 +88,6 @@ export default {
}] }]
}, },
editFormData: [{ editFormData: [{
label: '员工姓名',
name: 'staffName',
type: 'input',
maxlength: 8,
showLimit: true,
isClear: true
}, {
label: "电话号码", label: "电话号码",
name: "staffPhone", name: "staffPhone",
type: "input", type: "input",
...@@ -100,6 +95,15 @@ export default { ...@@ -100,6 +95,15 @@ export default {
isClear: true, isClear: true,
maxlength: "11" maxlength: "11"
}, { }, {
label: '员工姓名',
name: 'staffName',
type: 'input',
maxlength: 8,
isDisabled: true,
placeholder: '请输入电话号码匹配'
// showLimit: true,
// isClear: true
}, {
label: '积分分类', label: '积分分类',
name: 'pointClassification', name: 'pointClassification',
type: 'select', type: 'select',
...@@ -198,6 +202,22 @@ export default { ...@@ -198,6 +202,22 @@ export default {
}) })
} }
}, },
checkPhone(rule, value, callback) {
if (!Util.checkPhone(value)) {
callback(new Error('请输入正确的手机号码'))
return false
}
pointStaffQuery({ staffPhone: value }).then((res) => {
console.log('res', res)
if (res) {
this.infoForm.staffName = res.staffName
}
}).catch((err) => {
console.log('err', err)
this.infoForm.staffName = ''
})
callback()
},
pointRule() { pointRule() {
pointRule({}).then((res) => { pointRule({}).then((res) => {
this.baseData.pointClassificationOpt = res this.baseData.pointClassificationOpt = res
...@@ -209,6 +229,7 @@ export default { ...@@ -209,6 +229,7 @@ export default {
this.$refs.addFormRef.$refs[this.editChildRef].validate(valid => { this.$refs.addFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) { if (valid) {
var params = deepClone(this.infoForm) var params = deepClone(this.infoForm)
// params.pointValue = params.pointValue + '' // 后台是字符串类型接收
pointAdd(params).then(res => { pointAdd(params).then(res => {
this.notice.okTips('操作成功') this.notice.okTips('操作成功')
this.visible = true this.visible = true
......
...@@ -17,8 +17,10 @@ ...@@ -17,8 +17,10 @@
slot-scope="scope"> slot-scope="scope">
<el-input-number v-model="infoForm.pointsValue" <el-input-number v-model="infoForm.pointsValue"
placeholder="输入数值" placeholder="输入数值"
:min="-100" :precision="1"
:max="100"></el-input-number> :step="0.1"
:min="-9.9"
:max="9.9"></el-input-number>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
......
const jobTypeEnum = {
0: '实习生(理论)',
1: '实习生(实践)',
2: '初级驻店',
3: '中级驻店',
4: '高级驻店',
5: '小店长',
6: '大店长',
7: '初级区域督导',
8: '中级区域督导',
9: '高级区域督导',
10: '见习驻店'
}
const sceneTypeEnum = {
0: '会员权益/升级',
1: '轻改'
}
const carTypeEnum = {
1: '问界',
2: '其他'
}
export {
jobTypeEnum,
sceneTypeEnum,
carTypeEnum
}
\ No newline at end of file \ No newline at end of file
<template>
<!-- <d2-container> -->
<div class="measurement">
<div class="measurement-header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="收入测算" name="first">
</el-tab-pane>
<el-tab-pane label="收入测算配置" name="second">
</el-tab-pane>
</el-tabs>
</div>
<components :is="tabName"></components>
</div>
<!-- </d2-container> -->
</template>
<script>
import MeasureTable from './measureTable.vue';
import MeasureConfig from './measureConfig.vue';
export default {
data() {
return {
activeName: 'first',
}
},
components: {MeasureTable, MeasureConfig},
computed: {
tabName() {
let sname
switch(this.activeName) {
case 'first':
sname = 'MeasureTable';
break
case 'second':
sname = 'MeasureConfig'
break
default:
break
}
console.log(sname, '===');
return sname
}
},
methods: {
handleClick(tab) {
this.activeName = tab.name
}
}
}
</script>
<style lang="scss" scoped>
.measurement {
margin: 0 20px;
}
.measurement-header {
background-color: #fff;
.d2-container-content {
margin-top: 0 !important;
padding: 0 20px 20px !important;
}
}
</style>
<style lang="scss">
.measurement-header {
#tab-first {
padding-left: 20px !important;
}
.el-tabs__nav-wrap {
line-height: 54px;
.el-tabs__item {
font-size: 16px !important;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<d2-container>
<div class="measurement-header">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="收入测算" name="first">
</el-tab-pane>
<el-tab-pane label="收入测算配置" name="second">
<div class="d2-container-content">
<div class="app-config">
展业助手收入测算入口配置:
<el-radio-group v-model="configFlag" @change="radioChange">
<el-radio :label="0">会员全开</el-radio>
<el-radio :label="1">会员关闭</el-radio>
<el-radio :label="2">白名单开启</el-radio>
</el-radio-group>
</div>
<template v-if="configFlag == '2'">
<div class="theader">
<h2>白名单管理</h2>
<div>
<el-button @click="handleAdd" size="small" type="primary">
增加
</el-button>
</div>
</div>
<d2-table ref="measurementConfigTable" :hasNum="false" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="delWhite(scope.scope)">删除</el-button>
</template>
</d2-table>
</template>
</div>
</el-tab-pane>
</el-tabs>
</div>
<template v-if="activeName == 'first'">
<d2-table ref="measurementTable" :search-form="searchForm" :table-params="measurementTableParams"></d2-table>
</template>
<el-dialog class="white-dialog" title="新增白名单" :visible.sync="dialogVisible" width="668px"
:before-close="handleClose" :close-on-click-modal="false">
<el-form ref="whiteForm" class="white-form" :model="whiteForm" label-width="150px">
<el-form-item label="手机号码:">
<el-input v-model="whiteForm.staffPhone" placeholder="请输入手机号码"></el-input>
</el-form-item>
<div class="line"></div>
<el-form-item label="员工姓名:">
{{whiteForm.staffName}}
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<template v-if="whiteForm.staffName">
<el-button type="primary" @click="addWhite">加入白名单</el-button>
</template>
<template v-else>
<el-button type="primary" @click="searchStaff">查询</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</template>
</span>
</el-dialog>
</d2-container>
</template>
<script>
import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident"
export default {
data() {
return {
activeName: 'first',
// 收入测算
searchForm: {},
labelWidth: '110px',
showFormData: [
{
label: '员工姓名',
name: 'staffName',
type: 'input'
},
{
label: '电话号码',
name: 'staffPhone',
type: 'input'
},
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
{
label: '所属业务',
name: 'staffPhone',
type: 'select',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
label: '全部',
value: ''
},
{
label: '会员权益/升级',
value: '0'
},
{
label: '轻改',
value: '1'
}
]
},
{
label: '产品名称',
name: 'staffPhone',
type: 'input'
},
{
label: '品牌',
name: 'staffPhone',
type: 'input'
},
{
label: '测算收入日期',
name: 'staffPhone',
type: 'input'
}
],
measurementTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '姓名',
prop: 'staffName'
},
{
label: '电话号码',
prop: 'staffName'
},
{
label: '职级',
prop: 'staffName'
},
{
label: '服务门店',
prop: 'staffName'
},
{
label: '所属业务',
prop: 'staffName'
},
{
label: '品牌',
prop: 'staffName'
},
{
label: '应触客台数',
prop: 'staffName'
},
{
label: '产值',
prop: 'staffName'
},
{
label: '成交量',
prop: 'staffName'
},
{
label: '渗透率',
prop: 'staffName'
},
{
label: '提成系数',
prop: 'staffName'
},
{
label: '提成比例',
prop: 'staffName'
},
{
label: '客单价',
prop: 'staffName'
},
{
label: '客单价提成系数',
prop: 'staffName'
},
{
label: '提成金额',
prop: 'staffName'
},
{
label: '测算收入日期',
prop: 'staffName'
},
]
},
// 收入测算配置
configFlag: 0,
getListApi: getWhiteStaff,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '电话号码',
prop: 'staffPhone'
},
{
label: '适配业务',
prop: 'staffScenes'
},
{
label: '服务门店',
prop: 'serviceMerchantName'
}
]
},
dialogVisible: false,
whiteForm: {
staffName: '',
staffPhone: ''
}
}
},
created() {
this.getSwitch()
},
methods: {
// 查询测试配置开关
async getSwitch() {
const res = await getSwitchConfig()
this.configFlag = res.configFlag
},
handleAdd() {
console.log('111');
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
this.whiteForm = {
staffName: '',
staffPhone: ''
}
},
handleClick(tab) {
console.log(tab);
},
radioChange(e) {
console.log(e);
addSwitchConfig({ configFlag: e }).then(res => {
console.log(res)
if (res) this.$message.success('修改成功')
})
},
// 查询员工
searchStaff() {
const {staffPhone} = this.whiteForm
if (!staffPhone) return this.$message.error('请输入手机号码')
getStaffInfo({staffPhone: this.whiteForm.staffPhone}).then(res => {
console.log(res);
if (res) {
this.whiteForm.staffName = res.staffName
} else {
this.$message.error('不存在该直营驻店人员')
}
})
},
// 加入白名单
addWhite() {
const {staffPhone, staffName} = this.whiteForm
addWhiteStaff({staffPhone, staffName}).then(res => {
console.log(res);
if (res) {
this.$message.success('修改成功')
this.$refs.measurementConfigTable.refreshTable(true, true)
this.handleClose()
}
})
},
delWhite(row) {
console.log(row);
delWhiteStaff({id: row.id}).then(res => {
if (res) {
this.$message.success('删除成功')
this.$refs.measurementConfigTable.refreshTable(true, true)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.measurement-header {
background-color: #fff;
// padding: 0 20px;
.app-config {
color: #333333;
font-size: 16px;
padding: 12.5px 20px;
background-color: #F8FAFF;
// margin: 0 20px;
}
.d2-container-content {
margin-top: 0 !important;
padding: 0 20px 20px !important;
}
.theader {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
h2 {
font-weight: 600;
font-size: 16px;
color: #333333;
}
}
}
.white-form {
height: 108px;
.line {
width: 100%;
height: 1px;
background-color: #E5E5E5;
margin-bottom: 20px;
}
}
</style>
<style lang="scss">
.measurement-header {
#tab-first {
padding-left: 20px !important;
}
.el-tabs__nav-wrap {
line-height: 54px;
.el-tabs__item {
font-size: 16px !important;
}
}
}
.white-dialog {
.el-dialog__header {
border-bottom: 1px solid #E5E5E5 !important;
}
.el-dialog__footer {
border-top: 1px solid #E5E5E5 !important;
padding: 14px 20px !important;
.el-button {
width: auto;
}
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div class="d2-container-content">
<div class="app-config">
展业助手收入测算入口配置:
<el-radio-group v-model="configFlag" @change="radioChange">
<el-radio :label="0">会员全开</el-radio>
<el-radio :label="1">会员关闭</el-radio>
<el-radio :label="2">白名单开启</el-radio>
</el-radio-group>
</div>
<template v-if="configFlag == '2'">
<div class="theader">
<h2>白名单管理</h2>
<div>
<el-button @click="handleAdd" size="small" type="primary">
增加
</el-button>
</div>
</div>
<d2-table ref="measurementConfigTable" :hasNum="false" :get-list-api="getListApi"
:search-form="searchFormSearch" :table-params="tableParams">
<template slot="auth-button" slot-scope="scope">
<el-button type="text" @click="delWhite(scope.scope)">删除</el-button>
</template>
</d2-table>
</template>
</div>
<el-dialog class="white-dialog" title="新增白名单" :visible.sync="dialogVisible" width="668px"
:before-close="handleClose" :close-on-click-modal="false">
<el-form ref="whiteForm" class="white-form" :model="whiteForm" :rules="rules" label-width="150px">
<el-form-item label="手机号码:" prop="staffPhone">
<el-input v-model="whiteForm.staffPhone" maxlength="11" placeholder="请输入手机号码"></el-input>
</el-form-item>
<div class="line"></div>
<el-form-item label="员工姓名:">
{{ whiteForm.staffName }}
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<template v-if="whiteForm.staffName">
<el-button type="primary" @click="addWhite">加入白名单</el-button>
</template>
<template v-else>
<el-button type="primary" @click="searchStaff">查询</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</template>
</span>
</el-dialog>
</div>
</template>
<script>
import { Util } from '@/common/util'
import { getWhiteStaff, getSwitchConfig, addSwitchConfig, getStaffInfo, addWhiteStaff, delWhiteStaff } from "@api/resident"
export default {
name: 'MeasureConfig',
data() {
function checkPhone(rule, value, callback) {
console.log(value);
if (!Util.checkPhone(value)) {
callback(new Error('请输入正确的手机号码'))
return false
}
callback()
}
return {
// 收入测算配置
configFlag: 0,
getListApi: getWhiteStaff,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '员工姓名',
prop: 'staffName'
},
{
label: '电话号码',
prop: 'staffPhone'
},
{
label: '适配业务',
prop: 'staffScenes'
},
{
label: '服务门店',
prop: 'serviceMerchantName'
}
]
},
dialogVisible: false,
whiteForm: {
staffName: '',
staffPhone: ''
},
rules: {
staffPhone: [
{
required: true,
message: '请输入手机号码',
trigger: 'blur'
}, {
validator: checkPhone,
trigger: 'blur'
}]
}
}
},
created() {
this.getSwitch()
},
methods: {
// 查询测试配置开关
async getSwitch() {
const res = await getSwitchConfig()
this.configFlag = res.configFlag
},
handleAdd() {
console.log('111');
this.dialogVisible = true
},
handleClose() {
this.dialogVisible = false
this.whiteForm = {
staffName: '',
staffPhone: ''
}
},
radioChange(e) {
console.log(e);
addSwitchConfig({ configFlag: e }).then(res => {
console.log(res)
if (res) this.$message.success('修改成功')
})
},
// 查询员工
searchStaff() {
this.$refs.whiteForm.validate((valid) => {
if (valid) {
const {staffPhone} = this.whiteForm
// if (!staffPhone) return this.$message.error('请输入手机号码')
getStaffInfo({staffPhone}).then(res => {
console.log(res);
if (res) {
this.whiteForm.staffName = res.staffName
} else {
this.$message.error('不存在该直营驻店人员')
}
})
}
})
},
// 加入白名单
addWhite() {
const {staffPhone, staffName} = this.whiteForm
addWhiteStaff({staffPhone, staffName}).then(res => {
console.log(res);
if (res) {
this.$message.success('修改成功')
this.$refs.measurementConfigTable.refreshTable(true, true)
this.handleClose()
}
})
},
delWhite(row) {
console.log(row);
delWhiteStaff({id: row.id}).then(res => {
if (res) {
this.$message.success('删除成功')
this.$refs.measurementConfigTable.refreshTable(true, true)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.d2-container-content {
background-color: #fff;
margin-top: 0 !important;
padding: 0 20px 20px !important;
}
.app-config {
color: #333333;
font-size: 16px;
padding: 12.5px 20px;
background-color: #F8FAFF;
// margin: 0 20px;
}
.theader {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
h2 {
font-weight: 600;
font-size: 16px;
color: #333333;
}
}
.white-form {
height: 108px;
.line {
width: 100%;
height: 1px;
background-color: #E5E5E5;
margin-bottom: 20px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="">
<d2-container class="m-t-40">
<div class="header" slot="header" style="padding: 10px 20px;">
<d2-search ref="showSearch" class="show-search" :search-form="searchForm" :label-width="labelWidth"
:form-data="showFormData" />
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content" style="height: 450px; overflow: auto;">
<d2-table-header>
<el-button type="primary" @click="handleExport">导出</el-button>
</d2-table-header>
<d2-table ref="measurementTable" :before-search-fn="beforeSearchFn" :get-list-api="getListApi" :search-form="searchFormSearch" :table-params="measurementTableParams"></d2-table>
</div>
</d2-container>
</div>
</template>
<script>
import { deepClone } from "@/common/util"
import { mapActions, mapState } from 'vuex'
import { listGoodsType, getIncomePage } from '@api/resident'
import { jobTypeEnum, sceneTypeEnum, carTypeEnum } from './contant'
import dayjs from 'dayjs';
export default {
name: 'MeasureTable',
data() {
return {
// 收入测算
searchForm: {
sceneType: '',
configCarType: ''
},
searchFormSearch: {},
labelWidth: '110px',
showFormData: [
{
label: '员工姓名',
name: 'staffName',
type: 'input'
},
{
label: '电话号码',
name: 'staffPhone',
type: 'input'
},
{
label: '门店名称',
name: 'merchantName',
type: 'input'
},
{
label: '所属业务',
name: 'sceneType',
type: 'select',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
label: '全部',
value: ''
},
{
label: '会员权益/升级',
value: '0'
},
{
label: '轻改',
value: '1'
}
]
},
{
label: '产品名称',
name: 'showGoodsTypeName',
type: 'select',
optionId: 'goodsId',
optionLabel: 'goodsName',
optionList: []
},
{
label: '品牌',
name: 'configCarType',
type: 'select',
optionId: 'value',
optionLabel: 'label',
optionList: [
{
label: '全部',
value: ''
},
{
label: '问界',
value: '1'
},
{
label: '其他',
value: '2'
}
]
},
{
label: '测算收入日期',
name: 'calculationDay',
type: 'datePicker',
dateType: 'date',
isClear: true,
pickerOptions: 'rangePickerOptions'
}
],
getListApi: getIncomePage,
measurementTableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableColumns: [
{
label: '姓名',
prop: 'staffName',
width: '150px'
},
{
label: '电话号码',
prop: 'staffPhone',
width: '120px'
},
{
label: '职级',
prop: 'jobType',
width: '120px',
formatter: (cellValue) => {
return jobTypeEnum[cellValue.jobType] || '-'
}
},
{
label: '服务门店',
prop: 'merchantName',
width: '120px'
},
{
label: '所属业务',
prop: 'sceneType',
width: '100px',
formatter: (cellValue) => {
return sceneTypeEnum[cellValue.sceneType] || '-'
}
},
{
label: '品牌',
prop: 'configCarType',
formatter: (cellValue) => {
return carTypeEnum[cellValue.configCarType] || '-'
}
},
{
label: '应触客台数',
prop: 'shouldToShopCount'
},
{
label: '产值',
prop: 'orderTotalPrice'
},
{
label: '成交量',
prop: 'orderCount'
},
{
label: '渗透率',
prop: 'penetrationRate',
formatter: (cellValue) => {
return cellValue.penetrationRate ? cellValue.penetrationRate + '%' : '-'
}
},
{
label: '提成系数',
prop: 'calculateValue'
},
{
label: '提成比例',
prop: 'commissionRatio',
formatter: (cellValue) => {
return cellValue.commissionRatio ? cellValue.commissionRatio + '%' : '-'
}
},
{
label: '客单价',
prop: 'avgCustomerOrderPrice'
},
{
label: '客单价提成系数',
prop: 'avgCustomerOrderPriceCalculateValue'
},
{
label: '提成金额',
prop: 'commissionPrice'
},
{
label: '测算收入日期',
prop: 'calculationDay'
},
]
},
}
},
created() {
this.getProduct()
},
computed: {
...mapState({
dowloadList: (state) => state.d2admin.user.dowloadList
})
},
methods: {
...mapActions('d2admin/user', ['actionSetDownloadList']),
getProduct() {
listGoodsType().then(res => {
console.log(res, '获取商品');
const list = []
if (res) {
res.forEach(item => {
const _shop = {...item}
if (item.thirdLevelGoodsTypeName) {
_shop.goodsName = item.thirdLevelGoodsTypeName
_shop.goodsId = item.thirdLevelGoodsType
// _shop.type = 3
} else if (item.secondaryGoodsTypeName) {
_shop.goodsName = item.secondaryGoodsTypeName
_shop.goodsId = item.secondaryGoodsType
// _shop.type = 2
} else {
_shop.goodsName = item.goodsTypeName
_shop.goodsId = item.goodsType
// _shop.type = 1
}
list.push(_shop)
console.log(_shop);
})
this.showFormData[4].optionList = list
} else {
this.showFormData[4].optionList = []
}
})
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = deepClone(this.getParams())
resolve()
})
},
handleSearch() {
// const params = this.getParams()
this.$refs.measurementTable.refreshTable(true, true)
},
getParams() {
let params = deepClone(this.searchForm)
const { showGoodsTypeName, calculationDay } = this.searchForm
if (showGoodsTypeName) {
const _goods = this.showFormData[4].optionList.find(item => item.goodsId == showGoodsTypeName)
// delete _goods.goodsId
// delete _goods.goodsName
params = Object.assign({}, _goods)
}
if (calculationDay) {
params.calculationDayBegin = dayjs(calculationDay).format('YYYY-MM-DD')
params.calculationDayEnd = dayjs(calculationDay).format('YYYY-MM-DD')
// delete params.calculationDay
} else {
if (params.calculationDayBegin) delete params.calculationDayBegin
if (params.calculationDayEnd) delete params.calculationDayEnd
}
return params
},
handleReset() {
this.searchForm = {
sceneType: '',
configCarType: ''
}
this.$refs.measurementTable.refreshTable(true, true)
},
handleExport() {
var params = this.getParams()
// 去除为null的值
for (const key in params) {
if (params[key] === null || params[key] === '' || params[key].length == 0) {
delete params[key]
}
}
params.method = 'dj.api.smartcarlife.staff.incomeCalculation.exportAsync'
const list = [
...this.dowloadList,
{
name: '收入测算',
exportParam: JSON.stringify(params),
status: 'waiting',
timeid: new Date().getTime()
}
]
this.actionSetDownloadList({ list, type: 'dowloadList' })
}
}
}
</script>
<style lang="scss" scoped>
.header {
background-color: #fff;
}
.m-t-40 {
margin-top: 40px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div>
<div :id="id"></div>
</div>
</template>
<script>
import { uploadImg, syncUploadVideo, uploadVideo } from "@/api/sys.base"
import E from "wangeditor"
export default {
name: "TextBox",
data() {
return {
editor: "",
content: "",
editorOption: {}
}
},
props: {
id: {
type: String,
default: 'div-demo'
},
excludeMenus: {
type: Array,
default: () => ["code"]
},
boxHeight: {
type: Number,
default: 240
}
},
mounted() {
this.getEdit()
},
methods: {
getEdit() {
const _this = this
this.editor = new E(`#${this.id}`)
this.editor.config.uploadImgShowBase64 = true
this.editor.config.showMenuTooltips = true
this.editor.config.menuTooltipPosition = "down"
this.editor.config.height = this.boxHeight
this.editor.config.width = "500px"
this.editor.config.excludeMenus = this.excludeMenus
this.editor.config.onchange = (html) => {
// console.log(html);
this.content = html // 绑定当前逐渐地值
this.$emit("change", this.content) // 将内容同步到父组件中
}
this.editor.config.onfocus = () => {
this.$emit("focus")
}
// 上传图片
this.editor.config.customUploadImg = function (resultFiles, insertImgFn) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传图片大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const imgFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
imgFile.split(",")[1]
// _this.$apis.common.pictureUpload({ file: base64 }).then(res => {
uploadImg({ file: base64, compress: 0 }).then((res) => {
if (res) {
// console.log(res)
insertImgFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
// 上传视频
this.editor.config.customUploadVideo = function (
resultFiles,
insertVideoFn
) {
var file = resultFiles[0]
var reader = new FileReader()
// 默认1MB
const limitSize = 10
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
_this.$message.error("上传视频大小不能超过" + limitSize + "MB!")
return true
}
reader.readAsDataURL(file)
reader.onload = (e) => {
const videoFile = e.target.result
const base64 =
file.name.split(".")[file.name.split(".").length - 1] +
"@" +
videoFile.split(",")[1]
_this.$apis.common.pictureUpload({ file: base64 }).then((res) => {
if (res) {
// console.log(res)
insertVideoFn(res)
}
})
// resultFiles 是 input 中选中的文件列表
// insertImgFn 是获取图片 url 后,插入到编辑器的方法
// 上传图片,返回结果,将图片插入到编辑器中
}
}
this.editor.config.onchangeTimeout = 5000
this.editor.create()
},
setEdit(html) {
this.$nextTick(() => {
this.editor.txt.html(html)
})
},
forbidEdit() {
// this.editor.$textElem.attr('contenteditable', false)
this.editor.disable()
}
}
}
</script>
<style lang="scss" scoped>
#div-demo {
width: 575px;
// margin: 16px 300px 0 0;
}
.el-form .editor {
margin-top: 20px;
}
.myQuillEditor {
background-color: #fff;
height: 200px;
}
</style>
<style>
.w-e-text-container {
z-index: 1 !important;
}
.w-e-toolbar {
z-index: 2 !important;
}
</style>
<template>
<d2-container>
<div class="promotion">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="晋升/降级配置" name="first">
<div class="sub-promotion">
<el-tabs v-model="subActiveName" type="card" @tab-click="handleSubClick">
<el-tab-pane v-for="(item, index) in tabList" :key="index" :label="item.label" :name="item.name"></el-tab-pane>
</el-tabs>
</div>
</el-tab-pane>
<el-tab-pane label="" name="second"></el-tab-pane>
</el-tabs>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="150px" class="demo-ruleForm">
<el-form-item label="职级介绍:" prop="rankIntroduction">
<TextBox ref="rankIntroduction" class="editor-box" id="rankIntroduction" :excludeMenus="['code', 'video', 'table', 'justify', 'todo', 'splitLine']" @change="(e) => handleTextBoxChange(e, 'rankIntroduction')" @focus="handleTextBoxFocus('rankIntroduction')" :boxHeight="120"></TextBox>
</el-form-item>
<el-form-item label="晋升介绍:" prop="promotionIntroduction">
<TextBox ref="promotionIntroduction" class="editor-box" id="promotionIntroduction" :excludeMenus="['code', 'video', 'table', 'justify', 'todo', 'splitLine']" @change="(e) => handleTextBoxChange(e, 'promotionIntroduction')" :boxHeight="120"></TextBox>
</el-form-item>
<el-form-item label="降级介绍:" prop="downgradeIntroduction">
<TextBox ref="downgradeIntroduction" class="editor-box" id="downgradeIntroduction" :excludeMenus="['code', 'video', 'table', 'justify', 'todo', 'splitLine']" @change="(e) => handleTextBoxChange(e, 'downgradeIntroduction')" :boxHeight="120"></TextBox>
</el-form-item>
</el-form>
<div class="btn">
<el-button type="primary" @click="submit">保存</el-button>
</div>
</div>
</d2-container>
</template>
<script>
import TextBox from './TextBox.vue';
import { getRankConfig, addRankConfig } from "@api/resident"
export default {
components: {
TextBox
},
data() {
return {
activeName: 'first',
subActiveName: '1',
tabList: [
{
label: '实习生',
name: '1'
},
{
label: '见习驻店',
name: '2'
},
{
label: '初级驻店',
name: '3'
},
{
label: '中级驻店',
name: '4'
},
{
label: '高级驻店',
name: '5'
}
],
formKey: ['rankIntroduction', 'promotionIntroduction', 'downgradeIntroduction'],
ruleForm: {
rankIntroduction: '',
promotionIntroduction: '',
downgradeIntroduction: ''
},
rules: {
rankIntroduction: [{ required: true, message: '请输入职级介绍', trigger: 'blur' }]
}
}
},
created() {
this.getConfig()
},
methods: {
getConfig() {
getRankConfig({jobType: this.subActiveName}).then(res => {
// this.ruleForm = res
if (res) {
this.formKey.forEach(i => {
this.ruleForm[i] = res[i]
this.$refs[i].setEdit(res[i])
})
if (res.id) this.ruleForm.id = res.id
} else {
console.log('121321');
this.formKey.forEach(i => {
this.ruleForm[i] = ''
this.$refs[i].setEdit('')
if (this.ruleForm.id) delete this.ruleForm.id
})
}
})
},
handleTextBoxChange(val, key) {
console.log(val, key)
this.ruleForm[key] = val
},
handleTextBoxFocus(key) {
console.log(key, 'focus');
// this.$refs.TextBox.setEdit(this.formData.content)
},
handleClick(tab) {
},
handleSubClick(tab) {
this.subActiveName = tab.name
console.log(this.subActiveName);
this.$refs.ruleForm.resetFields()
this.getConfig()
},
submit() {
console.log(this.ruleForm);
this.$refs.ruleForm.validate((valid) => {
if (valid) {
addRankConfig({...this.ruleForm, jobType: this.subActiveName}).then(res => {
if (res) this.$message.success('保存成功')
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.promotion {
background-color: #fff;
}
.btn {
width: 100%;
text-align: center;
padding-bottom: 20px;
}
</style>
<style lang="scss">
.promotion {
#tab-first {
padding-left: 20px !important;
}
.el-tabs__nav-wrap {
line-height: 54px;
.el-tabs__item {
font-size: 16px !important;
}
}
.sub-promotion {
padding: 0 20px;
.el-tabs__nav-wrap {
line-height: 40px;
.el-tabs__item {
font-size: 14px !important;
}
}
}
}
</style>
<style lang="scss">
.editor-box {
#div-demo {
width: calc(100% - 20px);
}
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -205,6 +205,12 @@ export default { ...@@ -205,6 +205,12 @@ export default {
handleSelect() { handleSelect() {
this.infoData.campusList?.sort((a, b) => a.jobType - b.jobType) this.infoData.campusList?.sort((a, b) => a.jobType - b.jobType)
}, },
// 获取配置数据
getFormData() {
return new Promise((resolve, reject) => {
resolve(this.infoData)
})
},
validateCustomForm() { validateCustomForm() {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.$refs['configForm'].validate((valid) => { this.$refs['configForm'].validate((valid) => {
......
...@@ -8,14 +8,17 @@ ...@@ -8,14 +8,17 @@
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<template slot="remark" slot-scope="scope"> <template slot="remark" slot-scope="scope">
<el-popover placement="top" width="300" trigger="hover"> <template v-if="scope.scope.remark.length > 20">
<div class="merchant-name-box"> <el-popover placement="top" width="300" trigger="hover">
{{ remarkFilter(scope.scope) }} <div class="merchant-name-box">
</div> {{ remarkFilter(scope.scope) }}
<div slot="reference"> </div>
{{ remarkFilter(scope.scope, 20) }} <div slot="reference">
</div> {{ remarkFilter(scope.scope, 20) }}
</el-popover> </div>
</el-popover>
</template>
<span v-else>{{ scope.scope.remark || '-' }}</span>
</template> </template>
<template slot="auth-button" slot-scope="scope"> <template slot="auth-button" slot-scope="scope">
<auth-button :data="scope.scope" :show-btn-ids="['9121208']" /> <auth-button :data="scope.scope" :show-btn-ids="['9121208']" />
......
...@@ -23,9 +23,16 @@ ...@@ -23,9 +23,16 @@
</div> </div>
<div class="d2-container-content"> <div class="d2-container-content">
<d2-table-header> <d2-table-header>
<auth-button category="Button" <span style="display: inline-block">
style="display: inline-block" <auth-button category="Button"
:show-btn-ids="['9121201', '9121205']" /> style="display: inline-block"
:show-btn-ids="['9121210']" />
</span>
<span style="display: inline-block;margin-left: 10px;">
<auth-button category="Button"
style="display: inline-block"
:show-btn-ids="['9121205']" />
</span>
</d2-table-header> </d2-table-header>
<d2-table ref="performanceTable" <d2-table ref="performanceTable"
:has-num="false" :has-num="false"
...@@ -33,6 +40,19 @@ ...@@ -33,6 +40,19 @@
:table-params="tableParams" :table-params="tableParams"
:get-list-api="getListApi" :get-list-api="getListApi"
:before-search-fn="beforeSearchFn"> :before-search-fn="beforeSearchFn">
<template slot="brand" slot-scope="scope">
<template v-if="scope.scope.brand && scope.scope.brand.length > 20">
<el-popover placement="top" width="300" trigger="hover">
<div class="brand-box">
{{ brandFilter(scope.scope) }}
</div>
<div slot="reference">
{{ brandFilter(scope.scope, 30) }}
</div>
</el-popover>
</template>
<span v-else>{{scope.scope.brand || '-'}}</span>
</template>
<div slot="auth-button" <div slot="auth-button"
slot-scope="scope"> slot-scope="scope">
<!-- 编辑 --> <!-- 编辑 -->
...@@ -45,11 +65,6 @@ ...@@ -45,11 +65,6 @@
<auth-button :data="scope.scope" <auth-button :data="scope.scope"
:show-btn-ids="['9121204']" /> :show-btn-ids="['9121204']" />
</span> </span>
<!-- 删除 -->
<span>
<auth-button :data="scope.scope"
:show-btn-ids="['9121203']" />
</span>
</div> </div>
</d2-table> </d2-table>
</div> </div>
...@@ -58,6 +73,8 @@ ...@@ -58,6 +73,8 @@
<script> <script>
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import { getStoreSalaryListApi, editStoreSalaryStatusApi, deleteStoreSalaryApi } from '@api/resident' import { getStoreSalaryListApi, editStoreSalaryStatusApi, deleteStoreSalaryApi } from '@api/resident'
import { getCarBrandList } from "@api/commodity.js"
import { deepClone } from '@/common/util'
export default { export default {
name: "PerformanceList", name: "PerformanceList",
data() { data() {
...@@ -91,6 +108,14 @@ export default { ...@@ -91,6 +108,14 @@ export default {
optionId: "confId", optionId: "confId",
optionLabel: "confLabel", optionLabel: "confLabel",
optionsName: "hireTypeList" optionsName: "hireTypeList"
}, {
label: '品牌',
name: 'brandId',
type: 'select',
optionList: [],
optionId: "confId",
optionLabel: "confLabel",
optionsName: "brandList"
}], }],
// 表格参数 // 表格参数
tableParams: { tableParams: {
...@@ -112,33 +137,47 @@ export default { ...@@ -112,33 +137,47 @@ export default {
formatter: (cellValue) => { formatter: (cellValue) => {
return `${cellValue.merchantName}${cellValue.merchantId}` || '-' return `${cellValue.merchantName}${cellValue.merchantId}` || '-'
} }
}, {
label: '品牌',
prop: 'brand',
width: '200',
addHtml: 'brand'
}, { }, {
label: '绩效方案', label: '绩效方案',
prop: 'schemeName' prop: 'schemeNames'
}, { }, {
label: '适配业务', label: '适配业务',
prop: 'sceneType', prop: 'sceneTypes',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.sceneType == '1' ? '轻改' : '会员权益/升级' const arr = cellValue.sceneTypes ? `${cellValue.sceneTypes}`?.split(',') : []
let result = [...new Set(arr)]?.map(v => {
const found = this.baseData.sceneTypeList?.find(item => item.confId == v)
return found?.confLabel
})
return result?.length ? result.join(',') : '-'
} }
}, { }, {
label: '招聘通道', label: '招聘通道',
prop: 'hireType', prop: 'hireTypes',
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.hireType ? cellValue.hireType == '1' ? '校招管培生' : '社会招聘' : '-' const arr = cellValue.hireTypes ? `${cellValue.hireTypes}`?.split(',') : []
let result = [...new Set(arr)]?.map(v => {
const found = this.baseData.hireTypeList?.find(item => item.confId == v)
return found?.confLabel
})
return result?.length ? result.join(',') : '-'
} }
}, { }, {
label: '状态', label: '状态',
prop: 'status', prop: 'minPerformConfigStatus ',
className: (cellValue) => { className: (cellValue) => {
return { return {
1: 'greenSpot', 1: 'greenSpot',
2: 'redSpot' 2: 'redSpot'
}[cellValue.status] }[cellValue.minPerformConfigStatus ] || ''
}, },
formatter: (cellValue) => { formatter: (cellValue) => {
return cellValue.status == 1 ? '启用' : '禁用' return cellValue.minPerformConfigStatus == 1 ? '启用' : cellValue.minPerformConfigStatus == 2 ? '禁用' : '-'
}, },
width: '100' width: '100'
}] }]
...@@ -148,7 +187,8 @@ export default { ...@@ -148,7 +187,8 @@ export default {
merchantName: '', merchantName: '',
merchantId: '', merchantId: '',
sceneType: '', sceneType: '',
hireType: '' hireType: '',
brandId: ''
}, },
baseData: { baseData: {
sceneTypeList: [{ sceneTypeList: [{
...@@ -164,7 +204,8 @@ export default { ...@@ -164,7 +204,8 @@ export default {
}, { }, {
confId: '2', confId: '2',
confLabel: '社会招聘' confLabel: '社会招聘'
}] }],
brandList: []
} }
} }
}, },
...@@ -176,7 +217,8 @@ export default { ...@@ -176,7 +217,8 @@ export default {
}) })
}, },
mounted() { mounted() {
this.getOptions() // 获取「深圳嘀加」关联的4s店的所有一级品牌数据
this.getBrandList()
}, },
methods: { methods: {
...mapActions({ ...mapActions({
...@@ -186,9 +228,30 @@ export default { ...@@ -186,9 +228,30 @@ export default {
...mapActions('d2admin/user', ['actionSetDownloadList']), ...mapActions('d2admin/user', ['actionSetDownloadList']),
beforeSearchFn() { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
this.searchForm = {
...this.searchForm,
brandIds: this.searchForm.brandId ? [this.searchForm.brandId] : []
}
resolve() resolve()
}) })
}, },
brandFilter(ele, lenght) {
if (ele.brand) {
return lenght ? (ele.brand?.length > lenght ? ele.brand.substring(0, lenght) + '\u2026' : ele.brand.substring(0, lenght)) : ele.brand
} else {
return '-'
}
},
getBrandList() {
getCarBrandList({}).then(res => {
res?.forEach(item => {
item.confId = item.id
item.confLabel = item.name
})
this.baseData.brandList = res || []
this.getOptions()
})
},
getOptions() { getOptions() {
this.showFormData?.forEach((item, index) => { this.showFormData?.forEach((item, index) => {
if (item.type == 'select') { if (item.type == 'select') {
...@@ -206,15 +269,14 @@ export default { ...@@ -206,15 +269,14 @@ export default {
} }
}) })
}, },
// 新增绩效方案 // 导入绩效
handleToAdd() { handleImport() {
this.close({ tagName: '/salaryPerformance' }) this.$alert('敬请期待', '提示', {
this.$router.push({ confirmButtonText: '确定',
path: '/performanceScheme', closeOnClickModal: true,
query: { callback: action => {
addOrEdit: 'add'
} }
}) });
}, },
// 编辑方案 // 编辑方案
handleToEdit(row) { handleToEdit(row) {
...@@ -229,13 +291,13 @@ export default { ...@@ -229,13 +291,13 @@ export default {
}, },
// 启用/禁用 // 启用/禁用
handleEnableOrDisable(row) { handleEnableOrDisable(row) {
let text = row.status == '1' ? '禁用' : '启用' let text = row.minPerformConfigStatus == '1' ? '禁用' : '启用'
this.$confirm(`是否确认${text}?`, '提示', { this.$confirm(`是否确认${text}?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
editStoreSalaryStatusApi({id: row.id, status: row.status == '1' ? '2' : '1'}).then(res => { editStoreSalaryStatusApi({merchantId: row.merchantId, status: row.minPerformConfigStatus == '1' ? '2' : '1'}).then(res => {
this.$message.success(`${text}成功`) this.$message.success(`${text}成功`)
this.$refs.performanceTable.refreshTable() this.$refs.performanceTable.refreshTable()
}) })
...@@ -260,10 +322,16 @@ export default { ...@@ -260,10 +322,16 @@ export default {
}, },
// 导出 // 导出
handleExport() { handleExport() {
var params = { var params = deepClone(this.searchForm)
...this.searchForm
}
params.method = 'dj.api.smartcarlife.merchantPerformanceConfig.exportAsync' params.method = 'dj.api.smartcarlife.merchantPerformanceConfig.exportAsync'
let brandIds = []
brandIds = [params.brandId] || undefined
brandIds?.forEach((item, index) => {
const brandId = `brandIds[${index}]`
params[brandId] = item
})
delete params.brandId
delete params.brandIds
const list = [ const list = [
...this.dowloadList, ...this.dowloadList,
{ {
...@@ -281,7 +349,8 @@ export default { ...@@ -281,7 +349,8 @@ export default {
merchantName: '', merchantName: '',
merchantId: '', merchantId: '',
sceneType: '', sceneType: '',
hireType: '' hireType: '',
brandId: ''
} }
this.$refs.performanceTable.refreshTable() this.$refs.performanceTable.refreshTable()
} }
...@@ -292,4 +361,9 @@ export default { ...@@ -292,4 +361,9 @@ export default {
.m-t-40 { .m-t-40 {
margin-top: 40px; margin-top: 40px;
} }
.brand-box {
font-size: 12px;
max-height: 400px;
overflow-y: auto;
}
</style> </style>
...@@ -281,6 +281,12 @@ export default { ...@@ -281,6 +281,12 @@ export default {
this.$set(formData[index], key, limitPrice(e, oldValue, intergerDigit, key == 'startValue' || key == 'endValue' ? 0 : 2, 0, maxValue)) this.$set(formData[index], key, limitPrice(e, oldValue, intergerDigit, key == 'startValue' || key == 'endValue' ? 0 : 2, 0, maxValue))
this.$set(formData[index], 'old' + key, formData[index][key]) this.$set(formData[index], 'old' + key, formData[index][key])
}, },
// 获取配置数据
getFormData() {
return new Promise((resolve, reject) => {
resolve(this.configInfo)
})
},
validateCustomForm() { validateCustomForm() {
return new Promise((resolve) => { return new Promise((resolve) => {
this.$refs['editFormRef'].$refs['editChildRef'].validate(async (valid) => { this.$refs['editFormRef'].$refs['editChildRef'].validate(async (valid) => {
......
<!-- 类目配置 -->
<template>
<div>
<div class="d2-container-content">
<d2-table-header>
<span slot="left">
<auth-button category="Button"
:show-btn-ids="['9061202']" />
</span>
</d2-table-header>
<el-table :data="tableData"
row-key="id"
border
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column prop="categoryName"
label="类目名称"
align="center">
</el-table-column>
<el-table-column prop="systemCategoryStr"
label="是否系统类目"
align="center"
width="180">
</el-table-column>
<el-table-column prop="createdDateStr"
label="创建时间"
align="center"
width="180">
</el-table-column>
<el-table-column prop="createdBy"
label="创建人"
align="center"
width="180">
</el-table-column>
<el-table-column prop="updatedDateStr"
label="更新时间"
align="center"
width="180">
</el-table-column>
<el-table-column prop="updatedBy"
label="更新人"
align="center"
width="180">
</el-table-column>
<el-table-column label="操作"
align="center"
width="300px">
<template slot-scope="scope">
<!-- <el-button type="text"
size="mini"
@click="handleEdit(scope.$index, scope.row)">添加子类目</el-button>
<el-button type="text"
size="mini"
@click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button type="text"
size="mini"
@click="handleDelete(scope.$index, scope.row)">删除</el-button> -->
<span style="margin-right: 10px;"
v-if="scope.row.level != 3">
<auth-button slot="auth-button"
:show-btn-ids="['9061205']"
:data="scope.row" />
</span>
<span style="margin-right: 10px;"
v-if="scope.row.systemCategory != '1'">
<auth-button slot="auth-button"
:show-btn-ids="['9061203']"
:data="scope.row" />
</span>
<span style="margin-right: 10px;"
v-if="scope.row.systemCategory != '1'">
<auth-button slot="auth-button"
:show-btn-ids="['9061204']"
:data="scope.row" />
</span>
</template>
</el-table-column>
</el-table>
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="page.currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="page.pageSize"
:total="total"
:layout="layout" />
</div>
<!-- 新增/编辑类目 -->
<add-dialog :add-visible="categoryVisible"
v-if="categoryVisible"
:category-info="categoryInfo"
@dialogClose="dialogClose" />
</div>
</template>
<script>
import { Util } from '@/common/util'
import addDialog from './components/addDialog'
import { getCategoryList_new, deleteGoodsCategory } from '@api/sceneCategory'
export default {
name: 'CategoryList',
data() {
return {
total: 0,
page: {
currentPage: 1,
pageSize: 10
},
layout: "sizes,total,->,prev,pager,next,jumper",
baseData: {
},
categoryVisible: false,
categoryInfo: {},
tableData: []
}
},
components: {
addDialog
},
mounted() {
this.getPageNew()
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
},
keyDowmGetList() {
this.$refs.categoryListTable.refreshTable()
},
getPageNew() {
var params = this.page
getCategoryList_new(params).then((res) => {
this.tableData = res.list
this.total = res.total
if (this.tableData.length > 0) {
this.tableData = this.tableData.map(item => {
if (item.createdDate) {
item.createdDateStr = Util.dateFormate(item.createdDate, 'YYYY-MM-DD HH:mm:ss')
}
if (item.updatedDate) {
item.updatedDateStr = Util.dateFormate(item.updatedDate, 'YYYY-MM-DD HH:mm:ss')
}
item.systemCategoryStr = item.systemCategory == '1' ? '是' : '否'
return item
})
}
})
},
// 每页条数
handleSizeChange(value) {
this.page.pageSize = value
this.refreshTable()
},
// 页码
handleCurrentChange(value) {
this.page.currentPage = value
this.refreshTable()
},
// 重置请求
refreshTable() {
this.getPageNew()
},
addCategory() {
this.categoryInfo = {}
this.categoryInfo.type = 'add'
this.categoryVisible = true
},
editCategory(row) {
this.categoryVisible = true
this.categoryInfo = row
this.categoryInfo.type = 'edit'
},
addChildCategory(row) {
this.categoryVisible = true
this.categoryInfo = row
this.categoryInfo.type = 'addChild'
},
dialogClose(flag) {
this.categoryVisible = !this.categoryVisible
if (flag) {
this.refreshTable()
}
},
// 删除
deleteCategory(row) {
console.log(row)
this.$confirm("<p>是否确定删除?</p>删除后即不可恢复。", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
dangerouslyUseHTMLString: true,
type: "warning"
})
.then(() => {
deleteGoodsCategory({ id: row.id }).then((res) => {
this.notice.okTips()
this.refreshTable()
})
})
.catch((err) => {
console.log(err)
})
}
}
}
</script>
<style scoped>
</style>
<!-- 新增/编辑类目 -->
<template>
<baseDialog :dialog-config="dialogConfig"
:is-show.sync="visible"
class="accountDailog"
@handleClick="handleAddConfirm">
<div class="add-dialog">
<glsx-combi-form class="edit-form-container"
ref="addFormRef"
label-width="150px"
default-width="400px"
:form-ref="editChildRef"
:form-obj="infoForm"
:form-data="editFormData"
:form-rules="formRules">
<div slot="parentCategoryHtml"
slot-scope="scope">
<el-cascader v-model="infoForm.parentId"
:options="baseData.parentCategory"
:props="cascader_props"
style="width: 400px"></el-cascader>
</div>
</glsx-combi-form>
</div>
</baseDialog>
</template>
<script>
import { addGoodsCategory_new, updateGoodsCategory, queryParent } from '@api/sceneCategory'
import { Util, deepClone } from '@/common/util'
export default {
name: 'AddDialog',
data() {
return {
infoForm: {
categoryName: '',
parentId: ''
},
dialogConfig: {
title: '新增类目',
width: '720px'
},
editChildRef: 'editChildRef',
formRules: {
categoryName: [{ required: true, message: '请填写类目名', trigger: 'blur' }]
},
editFormData: [{
label: '所属类目',
name: 'parentId',
isHide: true,
addHtml: 'parentCategoryHtml',
rules: [{ required: true, message: '请选择所属类目', trigger: 'change' }]
}, {
label: '类目名',
name: 'categoryName',
type: 'input',
maxlength: 20,
showLimit: true,
isClear: true
}],
baseData: {
// pointClassificationOpt: [],
parentCategory: []
},
cascader_props: {
checkStrictly: true,
children: 'children',
value: 'id',
label: 'categoryName'
}
}
},
props: {
addVisible: {
type: Boolean,
default: false
},
categoryInfo: {
type: Object,
default: () => { }
}
},
watch: {
},
computed: {
visible: {
get() {
return this.addVisible
},
set(newVal) {
this.$emit('dialogClose', { flag: newVal, attrName: 'addVisible' })
}
}
},
mounted() {
this.showTitle()
},
methods: {
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
showTitle() {
console.log('this.categoryInfo', this.categoryInfo)
if (this.categoryInfo) {
if (this.categoryInfo.type == 'edit') {
this.dialogConfig.title = '编辑类目'
this.infoForm.categoryName = this.categoryInfo.categoryName
if (this.categoryInfo.level == 3) {
this.showOrHideAttr('editFormData', '所属类目', false)
this.queryParent()
}
} else if (this.categoryInfo.type == 'addChild') {
this.dialogConfig.title = '添加子类目'
}
}
},
queryParent() {
var params = {}
params.categoryType = this.categoryInfo.categoryType
params.level = 2
queryParent(params).then((res) => {
this.baseData.parentCategory.push(res)
this.infoForm.parentId = this.categoryInfo.parentId
// this.getOptionsList('editFormData', false)
})
},
showOrHideAttr(formName, label, isHide) {
const idx = this[formName].findIndex(item => item.label == label)
this[formName][idx].isHide = isHide
},
handleAddConfirm() {
this.$refs.addFormRef.$refs[this.editChildRef].validate(valid => {
if (valid) {
let api = addGoodsCategory_new
// var params = deepClone(this.infoForm)
var params = {}
params.categoryName = this.infoForm.categoryName
if (this.categoryInfo.type == 'addChild') {
params.parentId = this.categoryInfo.id
} else if (this.categoryInfo.type == 'edit') {
params.id = this.categoryInfo.id
if (this.categoryInfo.level == 3) { // 编辑三级类目时需要传所属类目id
// return console.log(this.infoForm.parentId.length)
if (this.infoForm.parentId.length && this.infoForm.parentId.length > 0) {
params.parentId = this.infoForm.parentId.pop()
} else {
params.parentId = this.infoForm.parentId
}
}
api = updateGoodsCategory
}
api(params).then(res => {
this.notice.okTips('操作成功')
this.visible = true
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.add-dialog {
margin: 20px 0;
.reject-input {
::v-deep .el-textarea__inner {
height: 70px;
}
}
.el-textarea .el-input__count {
right: 90px;
bottom: -10px;
font-size: 12px;
color: #999999;
}
.tips {
color: #999999;
}
}
</style>
...@@ -19,7 +19,8 @@ ...@@ -19,7 +19,8 @@
<script> <script>
import sceneList from './sceneList' import sceneList from './sceneList'
import categoryList from './categoryList' // import categoryList from './categoryList'
import categoryList from './categoryList_new'
export default { export default {
name: 'SceneCategoryIndex', name: 'SceneCategoryIndex',
data() { data() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!