Commit 7deb64a0 by 前端

Merge branch 'SAAS+V4.45.2-1021' into 'master'

上线合并

See merge request !75
2 parents fa5aba15 4a426aa1
......@@ -160,6 +160,61 @@ const addCategoryApi = params => {
})
}
// 查询套餐合同模板列表
const getProdPackageListApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 套餐合同导出
const exportProdPackageApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.export`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 初始化套餐合同模板
const initProdPackageApi = params => {
params.method = `scrm.api.equity.service.contract.template.initParentTemplate`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取套餐详情
const getProdPackageDetailApi = params => {
params.method = `scrm.api.equity.service.contract.parent.template.detail`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
// 获取商品部位映射数据
const getProdPartListApi = params => {
params.method = `scrm.api.equity.service.contract.parent.goodsPosition.list`
return http({
url: CUR_BASE_URL,
method: 'POST',
data: params,
sign: true
})
}
export default {
getContractListApi,
getBaseTempListApi,
......@@ -175,5 +230,10 @@ export default {
getProdContractListApi,
exportProdContractApi,
getProdCategoryListApi,
addCategoryApi
addCategoryApi,
getProdPackageListApi,
exportProdPackageApi,
initProdPackageApi,
getProdPackageDetailApi,
getProdPartListApi
}
......@@ -74,5 +74,27 @@ const auditStatusList = [{
confName: '审核失败'
}
]
// 太阳膜升级产品供货模式
const upgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 3,
confName: '门店套码+嘀加'
}, {
confId: 4,
confName: '门店回收原厂+嘀加'
}, {
confId: 5,
confName: '服务商自采+嘀加'
}]
// 1.3场景 升级产品供货模式
const crowdUpgradeSupplyModeList = [{
confId: 1,
confName: '嘀加'
}, {
confId: 2,
confName: '门店'
}]
export { limitPrice, liveStatusList, auditStatusList }
\ No newline at end of file
export { limitPrice, liveStatusList, auditStatusList, upgradeSupplyModeList, crowdUpgradeSupplyModeList }
\ No newline at end of file
......@@ -197,7 +197,7 @@ export default {
}
this.pdfObj = {
merchantId: res.templateConfig.merchantId,
packageCode: res.templateConfig.packageCode
packageCode: this.routerInfo.isParent ? res.templateConfig.parentId : res.templateConfig.packageCode
}
}
})
......@@ -260,7 +260,7 @@ export default {
})
const params = {
packageCode: this.pdfObj.packageCode,
baseFlag: this.routerInfo.skuId ? 1 : 0
baseFlag: this.routerInfo.isParent ? 2 : (this.routerInfo.skuId ? 1 : 0)
}
if (!this.routerInfo.skuId) params.merchantId = this.pdfObj.merchantId
this.$apis.contractManager.printContractApi(params).then(res => {
......
<template>
<div class="goods-components gl-form-page">
<div class="title">商品信息</div>
<div class="detail_pannel" v-for="(item, index) in goodsInfo" :key="index">
<div class="item_label">上架商品:</div>
<div class="item_value">
<div class="incid_box">
<div class="item" v-for="(subItem, subIndex) in detailInfo" :key="subIndex">
<div class="label">{{ subItem.unit ? (membraneTypeList.includes(item['goodsType']) ? subItem.label +
`(元)/${subItem.value == 'purchasePrice' ? '卷' : '车'}` : (subItem.label + '(元)/件')) : subItem.label }}:</div>
<div class="value">{{ subItem.unit ? (priceFilter(item[subItem.value]) || '-') : (item[subItem.value] || '-') }}</div>
</div>
<!-- 商品分类 延保类 -->
<div class="item" v-if="item['goodsType'] == 1 || (extendedPosiType.includes(item['goodsType']) && !supplierCode.includes(item['supplierCode'] + ''))">
<div class="label">部位:</div>
<div class="value">{{ item['positionNames'] || '-' }}</div>
</div>
<!-- 质保年限 膜类展示-->
<div class="item" v-if="membraneTypeList.includes(item['goodsType'])">
<div class="label">质保年限/年:</div>
<div class="value">{{ item['warrantyPeriod'] || '-' }}</div>
</div>
<!-- 商品分类 权益升级 -->
<div class="item" v-if="equitySceneType.includes(item['goodsType']) && !supplierCode.includes(item['supplierCode'] + '')">
<div class="label">服务时间/年:</div>
<div class="value">{{ item['serviceYears'] || '-' }}</div>
</div>
<!-- 商品分类 权益升级 -->
<div class="item" v-if="equitySceneType.includes(item['goodsType'])">
<div class="label">实体卡:</div>
<div class="value">{{ item['entityCardFlag'] == 'Y' ? '是' : '否' }}</div>
</div>
<div class="item" v-if="equitySceneType.includes(item['goodsType']) || extendedPosiType.includes(item['goodsType'])">
<div class="label">适用车价:</div>
<div v-if="!filterEmpty(item['minSuitCarPrice']) && !filterEmpty(item['maxSuitCarPrice'])">{{ item['minSuitCarPrice'] }} - {{ item['maxSuitCarPrice'] }}万</div>
<div v-else>-</div>
</div>
<!-- 商品分类 权益升级 -->
<div class="item flex_1" v-if="equitySceneType.includes(item['goodsType']) && !supplierCode.includes(item['supplierCode'] + '')">
<div class="label">服务项目:</div>
<div class="value">{{ item['serviceItemNames'] || '-' }}</div>
</div>
</div>
<div class="grounding_box">
<!-- 太阳膜/延保类(第三方供应方)时展示 -->
<div class="grounding_item" v-if="(extendedPosiType.includes(item['goodsType']) && !supplierCode.includes(item['supplierCode'] + '')) || item['goodsType'] == 1">
<div class="label">上架部位:</div>
<div class="value">{{ item['positionStr'] || '-' }}</div>
</div>
<div class="grounding_item">
<div class="label">商品别名:</div>
<div class="value">{{ item['goodsAlias'] || '-' }}</div>
</div>
<!-- 太阳膜时展示 -->
<div class="grounding_item" v-if="item['goodsType'] == 1">
<div class="label">质保卡类型:</div>
<div class="value">{{ item['warrantyTypeStr'] || '-' }}</div>
</div>
<!-- 太阳膜/售后众筹场景时展示 -->
<div class="grounding_item" v-if="item['goodsType'] == 1 || item['sceneType'] == 3">
<div class="label">升级产品供货模式:</div>
<div class="value">{{ item['upgradeSupplyModeStr'] || '-' }}</div>
</div>
<div class="grounding_item">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '售价(元)/车:' : '售价(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['sellPrice']) || '-' }}</div>
</div>
<div class="grounding_item">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '最低售价(元)/车:' : '最低售价(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['minSellPrice']) || '-' }}</div>
</div>
<!-- 非权益/延保类或售后众筹场景时展示 -->
<div class="grounding_item" v-if="!equitySceneType.includes(item['goodsType']) && !extendedPosiType.includes(item['goodsType']) || item['sceneType'] == 3">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '产品、升级成本(元)/车:' : '产品、升级成本(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['upgradeProductCost']) || '-' }}</div>
</div>
<!-- 产品供货模式选择“门店回收原厂+嘀加”时展示 -->
<div class="grounding_item" v-if="item['upgradeSupplyMode'] == 4">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '回收成本(元)/车:' : '回收成本(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['recoveryCost']) || '-' }}</div>
</div>
<!-- 产品供货模式选择“门店套码+嘀加”“ 服务商自采+嘀加”时展示 -->
<div class="grounding_item" v-if="item['upgradeSupplyMode'] == 3 || item['upgradeSupplyMode'] == 5">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '虚拟对账成本(元)/车:' : '虚拟对账成本(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['virtualAccountCost']) || '-' }}</div>
</div>
<!-- 权益类目/延保类目 -->
<div class="grounding_item" v-if="equitySceneType.includes(item['goodsType']) || extendedPosiType.includes(item['goodsType'])">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '嘀加成本(元)/车:' : '嘀加成本(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['djCost']) || '-' }}</div>
</div>
<!-- 权益类目/延保类目 -->
<div class="grounding_item" v-if="equitySceneType.includes(item['goodsType']) || extendedPosiType.includes(item['goodsType'])">
<div class="label">{{ membraneTypeList.includes(item['goodsType']) ? '第三方成本(元)/车:' : '第三方成本(元)/件:' }}</div>
<div class="value">{{ priceFilter(item['thirdPartyCost']) || '-' }}</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
import { fetchConfig } from '@/config'
import { upgradeSupplyModeList, crowdUpgradeSupplyModeList } from '@/common/constant'
export default {
name: 'GoodsInfo',
props: {
goodsInfo: Array
},
data() {
return {
equitySceneType: [], // 权益类目
extendedPosiType: [], // 延保类
membraneTypeList: [], // 膜类
supplierCode: [], // 第三方供应商编码
detailInfo: [
{
label: '商品名称',
value: 'upgradeGoodsName'
},
{
label: '商品编码',
value: 'type'
},
{
label: '第三方编码',
value: 'thirdPartyCode'
},
{
label: '采购价',
value: 'purchasePrice',
unit: true
},
{
label: '参考售价',
value: 'upgradePrice',
unit: true
},
{
label: '所属系列',
value: 'goodsName'
},
{
label: '所属分类',
value: 'goodsTypeName'
},
{
label: '商品ID',
value: 'upgradeCommodityCode'
}
],
warrantyTypeShow: {
0: '质保卡',
1: '质保权益卡'
}
}
},
mounted() {
this.getBaseConfig()
},
methods: {
// 获取配置服务上面配置的类目
async getBaseConfig() {
try {
const { equitySceneType, extendedPosiType, membraneTypeList, supplierCode } = await fetchConfig()
this.equitySceneType = equitySceneType
this.extendedPosiType = extendedPosiType
this.membraneTypeList = membraneTypeList
this.supplierCode = supplierCode
// 获取商品部位数据
const positionTypeList = await this.$apis.contractManager.getProdPartListApi({goodsType: 1}) // 太阳膜
const extendedPosiTypeList = await this.$apis.contractManager.getProdPartListApi({ goodsType: extendedPosiType && extendedPosiType[0] }) // 延保
this.goodsInfo?.forEach(val => {
const { upgradeGoods, goodsInfo, warrantyType, upgradeSupplyMode } = val
const positionNamesArr = this.$common.utils.deepClone(positionTypeList.concat(extendedPosiTypeList)).filter(subVal => (upgradeGoods?.position?.split(','))?.includes(subVal.position + '')) || []
const arr = val.goodsType == 1 ? upgradeSupplyModeList : crowdUpgradeSupplyModeList
val.positionStr = this.$common.utils.deepClone(positionTypeList.concat(extendedPosiTypeList)).filter(subVal => val?.position == subVal.position)[0]?.confName || '' // 上架部位
val.positionNames = positionNamesArr.length ? positionNamesArr.map(subItem => subItem?.confName).join('/') : '' // 部位名称
val.purchasePrice = upgradeGoods?.purchasePrice // 采购价
val.serviceYears = upgradeGoods?.serviceYears // 服务时间
val.serviceItemNames = upgradeGoods?.upgradeGoodsServiceItemsList?.map(v => `${v.serviceName}-${v.serviceGrade}/${v.servicePeriod}`).join(',') // 服务项目
val.type = upgradeGoods?.type // 编码
val.thirdPartyCode = upgradeGoods?.thirdPartyCode // 第三方编码
val.entityCardFlag = upgradeGoods?.entityCardFlag // 是否实体卡
val.minSuitCarPrice = upgradeGoods?.minSuitCarPrice // 适用车价最低价
val.maxSuitCarPrice = upgradeGoods?.maxSuitCarPrice // 适用车价最高价
val.supplierCode = goodsInfo?.supplierCode // 供应方
val.warrantyTypeStr = this.warrantyTypeShow[warrantyType] || '-' // 质保卡类型
val.warrantyPeriod = upgradeGoods?.warrantyPeriod // 质保年限
val.upgradePrice = upgradeGoods?.upgradePrice // 参考售价
val.upgradeSupplyModeStr = arr?.filter(v => v.confId == upgradeSupplyMode)[0]?.confName || '' // 升级产品供货模式
})
} catch (error) {
console.log(error)
}
},
// 处理金额补零
priceFilter(num) {
var pow = Math.pow(10, 2)
if (this.filterEmpty(num)) return '-'
return (Math.round(num * pow) / pow).toFixed(2)
},
filterEmpty(data) {
return (data ?? '') === ''
}
}
}
</script>
<style lang="scss" scoped>
.goods-components {
margin-top: 10px;
background: white;
.title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #d8d8d8;
margin: 0 0;
color: #333;
}
.edit-form-container {
padding: 32px 0 12px;
}
.detail_pannel {
display: flex;
padding: 32px 20px 12px;
border-bottom: 1px solid #e8e8ea;
font-size: 14px;
&:last-child {
border: none;
}
.item_label {
width: 160px;
text-align: right;
color: #666666;
}
.item_value {
width: 100%;
.incid_box {
background: #f9f9f9;
display: flex;
flex-wrap: wrap;
padding: 10px 0;
.item{
flex: 0 0 33%;
margin: 10px 0;
display: flex;
.label{
width: 160px;
text-align: right;
color: #333333;
}
}
.flex_1{
flex: 0 0 100%;
.value{
line-height: 30px;
margin-top: -8px;
}
}
}
.grounding_box {
display: flex;
flex-wrap: wrap;
padding: 10px 0;
.grounding_item{
flex: 0 0 33%;
margin: 10px 0;
display: flex;
.label{
width: 160px;
text-align: right;
color: #333333;
}
}
}
}
}
}
</style>
<template>
<div class="meal-components gl-form-page">
<div class="title">套餐信息</div>
<template>
<div class="detail_pannel">
<div class="wrap flex_sc">
<div v-for="(item, index) in editDetail" :key="index">
<div class="line_widget flex_sc">
<div class="label">
<span class="text">{{ item.label }}</span>
<span class="text">:</span>
</div>
<div class="value">{{ item.isPrice ? (priceFilter(item.value) || '-') : item.value || '-' }}</div>
</div>
</div>
</div>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'MealCombo',
props: {
editForm: Object,
},
data() {
return {
editDetail: []
}
},
mounted() {
this.handlerDetail()
},
methods: {
handlerDetail() {
this.editDetail = [
{
label: '套餐名称',
value: this.editForm.packageName
},
{
label: '售价(元)',
value: this.editForm.sellPrice,
isPrice: true
},
{
label: '最低售价(元)',
value: this.editForm.minSellPrice,
isPrice: true
},
{
label: '产品、升级成本(元)',
value: this.editForm.upgradeProductCost,
isPrice: true
},
{
label: '回收成本(元)',
value: this.editForm.recoveryCost,
isPrice: true
},
{
label: '虚拟对账成本(元)',
value: this.editForm.virtualAccountCost,
isPrice: true
},
{
label: '嘀加成本(元)',
value: this.editForm.djCost,
isPrice: true
},
{
label: '第三方成本(元)',
value: this.editForm.thirdPartyCost,
isPrice: true
}
]
},
// 处理金额补零
priceFilter(num) {
var pow = Math.pow(10, 2)
if (this.filterEmpty(num)) return '-'
return (Math.round(num * pow) / pow).toFixed(2)
},
filterEmpty(data) {
return (data ?? '') === ''
}
}
}
</script>
<style lang="scss" scoped>
.meal-components {
background: white;
.title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #d8d8d8;
margin: 0 0;
color: #333;
}
.edit-form-container {
padding: 32px 0 12px;
}
/deep/ .el-form-item {
display: flex;
.el-textarea {
textarea {
font-family: auto;
}
}
}
}
.detail_pannel {
padding: 20px;
.wrap {
flex-wrap: wrap;
}
.line_widget {
margin-bottom: 20px;
.label {
width: 154px;
text-align: right;
.required {
color: #eb4e4e;
font-size: 6px;
margin-right: 4px;
}
.text {
font-size: 14px;
font-weight: 400;
color: #666666;
line-height: 20px;
}
}
.value {
width: 348px;
font-size: 14px;
font-weight: 400;
color: #333333;
line-height: 20px;
}
}
}
</style>
<template>
<div class="store-components gl-form-page">
<div class="title">门店信息</div>
<template>
<div class="content">
<div class="detail">
<div class="label">业务场景:</div>
<div class="value">{{ sceneList[storeInfo.sceneType] || '-' }}</div>
</div>
<div class="detail">
<div class="label">上架门店:</div>
<div class="value">
<GLTable ref="mutiProRef" :tableData="storeInfo.merchantGoodsRefList" :hasPage="false" :tableParams="tableParams">
</GLTable>
</div>
</div>
</div>
</template>
</div>
</template>
<script>
export default {
name: 'StoreInfo',
props: {
storeInfo: Object
},
data() {
return {
tableParams: {
listName: 'list',
tableColumns: [
{
label: '门店名称',
prop: 'merchantName',
formatter: cellValue => {
return cellValue.merchantName || '-'
}
},
{
label: '门店商户号',
prop: 'merchantId',
formatter: cellValue => {
return cellValue.merchantId || '-'
}
}
]
},
sceneList: {
1: "精品升级",
2: "次新车转化",
3: "售后众筹",
0: "会员权益/升级",
4: "积分商城"
}
}
},
created() {
},
methods: {
}
}
</script>
<style lang="scss" scoped>
.store-components{
margin-top: 10px;
background: white;
.title {
padding: 0 20px;
font-size: 16px;
font-weight: bold;
height: 58px;
line-height: 58px;
border-bottom: 1px solid #d8d8d8;
margin: 0 0;
color: #333;
}
.content {
padding: 32px 0 12px;
font-size: 14px;
.detail {
display: flex;
margin-bottom: 20px;
.label {
width: 154px;
text-align: right;
color: #666666;
}
.value{
flex: 0 0 50%;
}
}
}
}
</style>
\ No newline at end of file
......@@ -137,7 +137,12 @@ export default {
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.contractManager.printContractApi({ packageCode: row.packageCode, merchantId: row.merchantId || '', baseFlag: this.changeContractObj.isBase == 2 ? 1 : 0 }).then(res => {
let params = {
packageCode: this.changeContractObj.isParent ? row.parentId : row.packageCode,
merchantId: row.merchantId || '',
baseFlag: this.changeContractObj.isParent ? 2 : (this.changeContractObj.isBase == 2 ? 1 : 0)
}
this.$apis.contractManager.printContractApi(params).then(res => {
loading.close()
if (res) {
this.pdfUrl = res
......@@ -146,7 +151,7 @@ export default {
})
},
beforeSearchFn() {
const _apiStr = this.changeContractObj.isBase == 1 ? 'getBaseContractListApi' : this.changeContractObj.isBase == 2 ? 'getBaseTempListApi' : 'getContractListApi'
const _apiStr = this.changeContractObj.isParent ? 'getProdPackageListApi' : (this.changeContractObj.isBase == 1 ? 'getBaseContractListApi' : this.changeContractObj.isBase == 2 ? 'getBaseTempListApi' : 'getContractListApi')
this.getListApi = this.$apis.contractManager[_apiStr]
return new Promise(resolve => {
resolve()
......@@ -175,7 +180,7 @@ export default {
} else {
params = {
sourceId: this.curId,
baseFlag: this.changeContractObj.isBase == 2 ? 1 : 0
baseFlag: this.changeContractObj.isParent ? 2 : (this.changeContractObj.isBase == 2 ? 1 : 0)
}
if (this.changeContractObj.id) {
//单个商品合同更换
......
......@@ -4,26 +4,34 @@
<template v-if="tabId == '2'">
<goodIndex></goodIndex>
</template>
<template v-else>
<template v-if="tabId == '1'">
<prodIndex></prodIndex>
</template>
<template v-if="tabId == '3'">
<parentIndex></parentIndex>
</template>
</div>
</template>
<script>
import goodIndex from './goodIndex.vue'
import prodIndex from './prodIndex.vue'
import parentIndex from './parentIndex.vue'
export default {
name: 'index',
components: {
goodIndex,
prodIndex
prodIndex,
parentIndex
},
beforeRouteEnter(to, from, next) {
next(vm => {
if (from.path.indexOf('/ContractManager/addTmpl') == 0 && from.path.indexOf('skuId') == -1) {
vm.tabId = '2'
}
if ((from.path.indexOf('/ContractManager/addTmpl') == 0 && from.path.indexOf('skuId') == -1 && from.path.indexOf('isParent') > -1) || from.path.indexOf('/ContractManager/parentDetail') == 0) {
vm.tabId = '3'
}
})
},
data() {
......@@ -31,7 +39,8 @@ export default {
tabId: '1',
tabPaneList: [
{ name: '1', label: '产品合同' },
{ name: '2', label: '商品合同' }
{ name: '2', label: '商品合同' },
{ name: '3', label: '套餐合同'}
]
}
},
......
<!-- 套餐详情 -->
<template>
<div v-if="pageShow">
<!-- 套餐信息 -->
<meal-combo :editForm="editForm"></meal-combo>
<!-- 商品信息 -->
<goods-info :goodsInfo="editForm.merchantGoodsInfoList"></goods-info>
<!-- 门店信息 -->
<store-info :storeInfo="editForm"></store-info>
</div>
</template>
<script>
import MealCombo from "./components/MealCombo.vue"
import GoodsInfo from "./components/GoodsInfo.vue"
import StoreInfo from "./components/StoreInfo.vue"
export default {
name: 'packageDetail',
components: {
MealCombo,
GoodsInfo,
StoreInfo
},
data() {
return {
pageShow: false,
editForm: {}
}
},
created() {
this.routerInfo = JSON.parse(decodeURIComponent(this.$route.params.id))
},
mounted() {
this.getParentDetailInfo()
},
methods: {
getParentDetailInfo() {
let params = {
parentId: this.routerInfo?.parentId
}
this.$apis.contractManager.getProdPackageDetailApi(params).then(res => {
this.editForm = res || {}
this.pageShow = true
})
}
}
}
</script>
\ No newline at end of file
<template>
<div class="container">
<div class="find_wrap">
<GLCombiForm ref="showSearch" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="table_wrapper">
<div class="operate_wrap">
<span class="table_title">合同列表</span>
<div class="operate_btn">
<el-button type="primary" plain :size="size" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="equityRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<div slot="serviceContent" slot-scope="scope">
<div v-html="scope.scope.serviceContent"></div>
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</span>
</GLTable>
</div>
<pdf-dialog :isVisible="isPdfVisible" title="合同" :pdfUrl="pdfUrl" @closeDialog="handlePdfClose"></pdf-dialog>
<changeContractDialog v-if="changeContractObj.visible" @closeDialog="closeTmplDialog" :changeContractObj="changeContractObj"></changeContractDialog>
<GLDialog :visible.sync="tipObj.visible" :close-on-click-modal="false" mode="small" title="提示" @onOk="toInitTmpl" @onCancel="closeTipDialog" :before-close="closeTipDialog">
<div class="tip-body">
<i class="el-icon-warning icon"></i>
<p class="title">是否确认初始化?</p>
<p class="content">选中的商品合同模板将初始化,读取后台的最新配置</p>
</div>
</GLDialog>
</div>
</template>
<script>
const throttle = function(fn, time) {
let timer = null
time = time || 1000
return function(...args) {
if (timer) {
return
}
const _this = this
timer = setTimeout(() => {
timer = null
}, time)
fn.apply(_this, args)
}
}
import * as dayjs from 'dayjs'
import utils from '../../util/util'
import pdfDialog from '@/views/beforeSale/pdfDialog'
import changeContractDialog from './components/changeContractDialog'
export default {
name: 'goodIndex',
components: {
pdfDialog,
changeContractDialog
},
data() {
return {
size: 'small',
tipObj: {
visible: false,
ids: []
},
isPdfVisible: false,
changeContractObj: {
visible: false,
id: '',
isParent: true
},
buttonList: [
{
type: 'el-button',
name: row => {
return '打印'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.handlePdf(row.scope)
}
},
{
type: 'el-button',
name: row => {
return '编辑'
},
attrs: {
type: 'text'
},
listeners: {
click: row => this.editContract(row.scope)
}
},
{
type: 'GLButton',
name: row => {
return '更换合同'
},
attrs: {
type: 'text',
fn: '更换模板'
},
listeners: {
click: row => this.changeContractTMPL(row.scope)
}
},
{
type: 'GLButton',
name: row => {
return '模板初始化'
},
attrs: {
type: 'text',
fn: '模板初始化'
},
listeners: {
click: row => this.initTmpl(row.scope)
}
},
{
type: 'GLButton',
name: row => {
return '套餐详情'
},
attrs: {
type: 'text',
fn: '套餐详情'
},
listeners: {
click: row => this.parentDetail(row.scope)
}
}
],
searchForm: {
parentId: '',
parentName: '',
createdDate: '',
updatedDate: ''
},
tableSearchForm: {},
searchFormData: [
{
label: '套餐ID',
name: 'parentId',
type: 'input',
isClear: true
},
{
label: '套餐名称',
name: 'parentName',
type: 'input',
isClear: true
},
{
label: '创建时间',
name: 'createdDate',
type: 'datePicker',
labelWidth: 95,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '更新时间',
name: 'updatedDate',
type: 'datePicker',
labelWidth: 95,
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格
getListApi: this.$apis.contractManager.getProdPackageListApi,
tableParams: {
listName: 'list',
// mutiSelectName: 'tmplIndex',
// mutiSelectUniqueKey: 'id',
tableOption: true,
tableColumns: [
{
label: '套餐ID',
prop: 'parentId',
width: 220
},
{
label: '套餐名称',
prop: 'parentName',
width: 200
},
{
label: '套餐合同编号',
prop: 'id',
width: 180
},
{
label: '上架门店',
prop: 'merchantName',
width: 216,
line: 1
},
{
label: '权益商品',
prop: 'packageName',
width: 260,
line: 1
},
{
label: '创建时间',
prop: 'createdDate',
formatter: cellValue => {
return cellValue.createdDate ? dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss') : '--'
},
width: 180
},
{
label: '更新时间',
prop: 'updatedDate',
formatter: cellValue => {
return cellValue.updatedDate ? dayjs(cellValue.updatedDate).format('YYYY-MM-DD HH:mm:ss') : '--'
},
width: 180
},
{
label: '操作人',
prop: 'updatedBy',
width: 140
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
routerInfo: {}
}
},
mounted() {},
methods: {
closeTmplDialog() {
this.changeContractObj.visible = false
this.handleSearch()
},
initTmpl(row) {
this.tipObj = {
visible: true,
ids: [row.id]
}
},
toInitTmpl() {
const params = {
templateIds: this.tipObj.ids,
baseFlag: 2
}
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.contractManager
.initProdPackageApi(params)
.then(res => {
if (res) {
this.$message.success('初始化模板成功')
this.closeTipDialog()
}
})
.finally(end => {
loading.close()
})
},
closeTipDialog() {
this.tipObj = {
visible: false,
ids: []
}
this.handleSearch()
},
changeContractTMPL(row) {
this.changeContractObj = {
visible: true,
id: row.id,
isParent: true // 是套餐合同
}
},
getParams() {
let params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm?.createdDate?.length) {
params.beginCreateDate = new Date(this.searchForm.createdDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endCreateDate = new Date(this.searchForm.createdDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
if (this.searchForm?.updatedDate?.length) {
params.beginUpdateDate = new Date(this.searchForm.updatedDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endUpdateDate = new Date(this.searchForm.updatedDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createdDate
delete params.updatedDate
return { ...params }
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
resolve()
})
},
handlePdfClose() {
this.isPdfVisible = !this.isPdfVisible
},
// 打印
handlePdf(row) {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.contractManager.printContractApi({ packageCode: row.parentId, merchantId: row.merchantId, baseFlag: 2 }).then(res => {
this.pdfUrl = res
this.handlePdfClose()
loading.close()
})
},
// 导出
handleExport: throttle(function() {
var params = this.getParams()
this.$apis.contractManager.exportProdPackageApi(params).then(res => {
// window.open(res)
let tempaa = utils.getExplorer()
if (tempaa == 'QQ') {
window.open(res)
} else {
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = res
document.body.appendChild(iframe)
}
})
}, 1000),
handleSearch() {
this.$refs.equityRef.refreshTable()
},
handleReset() {
this.searchForm = {
parentId: '',
parentName: '',
createdDate: '',
updatedDate: ''
}
this.handleSearch()
},
editContract(row) {
const { id } = row || {}
let query = {
id,
isParent: true
}
const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push('/ContractManager/addTmpl/' + queryStr)
},
// 套餐详情
parentDetail(row) {
const { parentId } = row || {}
let query = {
parentId
}
const queryStr = encodeURIComponent(JSON.stringify(query))
this.$router.push({ path: '/ContractManager/parentDetail/' + queryStr })
}
}
}
</script>
<style lang="scss" scoped>
.find_wrap {
background: #ffffff;
padding: 20px 20px 2px 20px;
.resetBtn {
background: #ffffff;
color: #5850ff;
border: 1px solid #5850ff;
}
.m-r-l-20 {
margin: 0 20px;
}
}
.table_wrapper {
background: #ffffff;
padding: 0 20px 20px;
}
.tip-body {
width: 100%;
text-align: center;
.icon {
font-size: 48px;
color: #5850ff;
margin-top: 18px;
}
.title {
font-weight: 400;
font-size: 16px;
color: #333333;
text-align: center;
margin: 12px 0 8px;
}
.content {
font-weight: 400;
font-size: 14px;
color: #666666;
text-align: center;
}
}
</style>
......@@ -1121,86 +1121,181 @@ export default {
// 切换套餐---赋默认值
changeCheckBox(e, item, index) {
this.vailGlassPackage(item, index)
if (e) {
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
// 套餐商品包含的权益商品数据
const parentArr = this.productList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
const customAttr = {
attributeGroup: 'planId',
attributeName: 'planId'
}
if (parentArr.length) {
if (e) {
const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes)
this.packageCodeList.push(...parentCodes)
this.curSelectPro.push(...parentCodes)
parentArr.forEach(v => {
const _haveTableTarget = v?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[v.idName][key], v, attr)
}
})
}
if (v.idName == 'crash') {
this.commonPart(this.productModal[v.idName]['planId'], v, customAttr)
}
})
}
if (item.idName == 'crash') {
const customAttr = {
attributeGroup: 'planId',
attributeName: 'planId'
}
this.commonPart(this.productModal[item.idName]['planId'], item, customAttr)
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.packageCodeList = this.packageCodeList.filter(t => t != item.packageCode)
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
this.curSelectPro = Array.from(new Set(this.curSelectPro))
} else {
const codesToRemove = new Set(parentArr.map(v => v.packageCode))
this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t))
this.packageCodeList = this.packageCodeList.filter(t => !codesToRemove.has(t))
this.curSelectPro = this.curSelectPro.filter(t => !codesToRemove.has(t))
parentArr.forEach(v => {
for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[v.idName][key], v, attr)
}
})
}
})
}
} else {
if (e) {
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
if (item.idName == 'crash') {
this.commonPart(this.productModal[item.idName]['planId'], item, customAttr)
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.packageCodeList = this.packageCodeList.filter(t => t != item.packageCode)
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
}
}
let hasRefitFlagList = this.allProdList.filter(item => this.packageCodeList.includes(item.packageCode))
this.refitFormObj.autoFlag = !!hasRefitFlagList?.find(item => item.qsFlag)
},
changeRaido(e, item, isDel) {
// isDel 删除选中的
if (e) {
// this.checkCodeList = []
// this.autoPackageCodeList = []
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
// 套餐商品包含的权益商品数据
const parentArr = this.customProductList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
const customAttr = {
attributeGroup: 'planId',
attributeName: 'planId'
}
if (parentArr?.length) {
if (e) {
const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes)
this.autoPackageCodeList.push(...parentCodes)
this.curSelectCustomPro.push(...parentCodes)
parentArr.forEach(v => {
const _haveTableTarget = v?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[v.idName][key], v, attr)
}
})
}
this.commonPart(this.productModal[`vip${v.packageCode}`]['planId'], v, customAttr)
if (v.printType == 2) {
this.showUploadInfo = true
}
})
}
const customAttr = {
attributeGroup: 'planId',
attributeName: 'planId'
}
this.commonPart(this.productModal[`vip${item.packageCode}`]['planId'], item, customAttr)
if (item.printType == 2) {
this.showUploadInfo = true
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => t != item.packageCode)
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != item.packageCode)
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro))
} else {
const codesToRemove = new Set(parentArr.map(v => v.packageCode))
this.checkCodeList = this.checkCodeList.filter(t => !codesToRemove.has(t))
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => !codesToRemove.has(t))
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => !codesToRemove.has(t))
parentArr.forEach(v => {
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != v.packageCode)
}
for (let key in this.productModal[v.idName]) {
v.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[v.idName][key], v, attr)
}
})
}
if (v.printType == 2) {
this.showUploadInfo = false
}
})
}
if (item.printType == 2) {
this.showUploadInfo = false
} else {
if (e) {
// this.checkCodeList = []
// this.autoPackageCodeList = []
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
this.$set(this.TDOTableData, item.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
this.commonPart(this.productModal[`vip${item.packageCode}`]['planId'], item, customAttr)
if (item.printType == 2) {
this.showUploadInfo = true
}
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.autoPackageCodeList = this.autoPackageCodeList.filter(t => t != item.packageCode)
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != item.packageCode)
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
this.commonPart(this.productModal[item.idName][key], item, attr)
}
})
}
if (item.printType == 2) {
this.showUploadInfo = false
}
}
}
let hasRefitFlagList = this.allProdList.filter(item => this.autoPackageCodeList.includes(item.packageCode))
......@@ -1739,7 +1834,8 @@ export default {
if (_price && this.editForm.orderStatus != 2) {
let _list = []
this.copyCustomProductList.forEach(item => {
if (!item.carHighestPrice || (item.carHighestPrice && _price <= NP.divide(item.carHighestPrice || 0, 100) && _price >= NP.divide(item.carLowestPrice || 0, 100))) {
// 套餐商品不做过滤
if (item.parentId || !item.carHighestPrice || (item.carHighestPrice && _price <= NP.divide(item.carHighestPrice || 0, 100) && _price >= NP.divide(item.carLowestPrice || 0, 100))) {
_list.push(item)
} else {
if (this.autoPackageCodeList.includes(item.packageCode)) {
......@@ -1926,7 +2022,9 @@ export default {
...el,
packageCode: item.packageCode,
contractNo: item.contractNo,
printType: item.printType
printType: item.printType,
parentId: item.parentId,
parentName: item.parentName
})
})
})
......
......@@ -464,6 +464,11 @@ export default {
width: '160px'
},
{
label: '套餐名称',
prop: 'parentName',
width: '200px'
},
{
label: '产品名称',
prop: 'packageName',
width: '200px'
......
......@@ -463,7 +463,7 @@ export default {
.name {
font-weight: 600;
height: 20px;
min-height: 20px;
line-height: 20px;
}
.price-wrap {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!