Commit 36b391cb by huyue

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 0fad4d33 675ef96f
Showing 44 changed files with 1112 additions and 172 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`
......
...@@ -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: "勋章" }
] ]
......
...@@ -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")
}, },
......
...@@ -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,7 +481,7 @@ export default { ...@@ -470,7 +481,7 @@ 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,
...@@ -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'
......
...@@ -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,10 @@ export default { ...@@ -292,6 +292,10 @@ 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 result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -301,6 +305,7 @@ export default { ...@@ -301,6 +305,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 +368,15 @@ export default { ...@@ -363,10 +368,15 @@ 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 result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
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,10 @@ export default { ...@@ -183,6 +183,10 @@ 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 result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
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 +204,7 @@ export default { ...@@ -200,6 +204,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="'请选择'"
@change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :show-all-levels="false">
</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,14 @@ export default { ...@@ -464,7 +470,14 @@ export default {
label: '所属分类', label: '所属分类',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName', prop: 'goodsTypeName',
width: 140 formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
return result
},
width: 170
}, { }, {
label: '上架部位', label: '上架部位',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
...@@ -594,9 +607,8 @@ export default { ...@@ -594,9 +607,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 +638,11 @@ export default { ...@@ -626,6 +638,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 +801,15 @@ export default { ...@@ -784,12 +801,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,10 @@ export default { ...@@ -248,6 +248,10 @@ 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 result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
val.upgradeGoodsList.forEach(v => { val.upgradeGoodsList.forEach(v => {
resArr.push({ resArr.push({
confId: v.id, confId: v.id,
...@@ -257,6 +261,7 @@ export default { ...@@ -257,6 +261,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 +312,10 @@ export default { ...@@ -307,6 +312,10 @@ 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 result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
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 +324,7 @@ export default { ...@@ -315,6 +324,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,10 @@ export default { ...@@ -150,6 +150,10 @@ export default {
if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高) if (val.goodsType == 1) { // 太阳膜类 升级产品供货模式(优先级高)
arr = upgradeSupplyModeList arr = upgradeSupplyModeList
} }
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = val.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
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 +163,7 @@ export default { ...@@ -159,6 +163,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"
@change="selectAddAttr($event, item)" aria-hidden="false"
:props="{ checkStrictly: true, label: item.optionLabel, value: item.optionId }" :show-all-levels="false">
</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="'请选择'"
@change="selectAddAttr($event)"
:props="{ checkStrictly: true, label: 'categoryName', value: 'categoryType' }" :show-all-levels="false">
</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,14 @@ export default { ...@@ -202,7 +208,14 @@ export default {
}, { }, {
label: '类目', label: '类目',
parentProp: 'goodsInfo', parentProp: 'goodsInfo',
prop: 'goodsTypeName' prop: 'goodsTypeName',
formatter: (cellValue) => {
const { goodsTypeName, secondaryGoodsTypeName, thirdLevelGoodsTypeName } = cellValue.goodsInfo
const result = [secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)
? `${goodsTypeName}-${[secondaryGoodsTypeName, thirdLevelGoodsTypeName].find(type => type)}`
: goodsTypeName
return result
}
}, { }, {
label: '规格', label: '规格',
prop: 'listShowSpecificationData', prop: 'listShowSpecificationData',
...@@ -302,9 +315,8 @@ export default { ...@@ -302,9 +315,8 @@ export default {
var allOpt = { confId: '', confValue: '全部' } var allOpt = { confId: '', confValue: '全部' }
this.baseData.statusList.unshift(allOpt) this.baseData.statusList.unshift(allOpt)
// 获取全部类目 屏蔽服务商自建类目 // 获取全部类目 屏蔽服务商自建类目
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(() => {
......
...@@ -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: 'correctSalary', name: 'refundOffset',
type: 'input', addHtml: 'refundOffset'
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: '正负冲减',
name: 'customDeduction',
addHtml: 'customDeduction'
},
{
label: '实发工资',
name: 'correctSalary',
addHtml: 'correctSalary'
}, },
{ {
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>
......
...@@ -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,6 +8,7 @@ ...@@ -8,6 +8,7 @@
: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">
<template v-if="scope.scope.remark.length > 20">
<el-popover placement="top" width="300" trigger="hover"> <el-popover placement="top" width="300" trigger="hover">
<div class="merchant-name-box"> <div class="merchant-name-box">
{{ remarkFilter(scope.scope) }} {{ remarkFilter(scope.scope) }}
...@@ -17,6 +18,8 @@ ...@@ -17,6 +18,8 @@
</div> </div>
</el-popover> </el-popover>
</template> </template>
<span v-else>{{ scope.scope.remark || '-' }}</span>
</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']" />
</template> </template>
......
...@@ -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>
<span style="display: inline-block">
<auth-button category="Button" <auth-button category="Button"
style="display: inline-block" style="display: inline-block"
:show-btn-ids="['9121201', '9121205']" /> :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!