Commit 771f6a1b by zhangxw

紧急版本需求开发

1 parent fa5aba15
......@@ -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="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
......@@ -1121,6 +1121,8 @@ export default {
// 切换套餐---赋默认值
changeCheckBox(e, item, index) {
this.vailGlassPackage(item, index)
// 套餐商品包含的权益商品数据
const parentArr = this.productList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
if (e) {
const _haveTableTarget = item?.groupAttributeList.find(item => item.attributeDesc == '轮胎参数')
if (_haveTableTarget && !this.TDOTableData[item.idName]) {
......@@ -1128,8 +1130,20 @@ export default {
}
this.checkCodeList.push(item.packageCode)
this.packageCodeList.push(item.packageCode)
if (parentArr?.length) {
const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes)
this.packageCodeList.push(...parentCodes)
this.curSelectPro.push(...parentCodes)
parentArr.forEach(v => {
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
})
}
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.packageCodeList = Array.from(new Set(this.packageCodeList))
this.curSelectPro = Array.from(new Set(this.curSelectPro))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1147,6 +1161,12 @@ export default {
} else {
this.checkCodeList = this.checkCodeList.filter(t => t != item.packageCode)
this.packageCodeList = this.packageCodeList.filter(t => t != item.packageCode)
if (parentArr?.length) {
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))
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1160,6 +1180,8 @@ export default {
},
changeRaido(e, item, isDel) {
// isDel 删除选中的
// 套餐商品包含的权益商品数据
const parentArr = this.customProductList.concat(this.productList)?.filter(v => v.parentId && v.parentId == item.parentId)
if (e) {
// this.checkCodeList = []
// this.autoPackageCodeList = []
......@@ -1169,8 +1191,20 @@ export default {
}
this.checkCodeList.push(item.packageCode)
this.autoPackageCodeList.push(item.packageCode)
if (parentArr?.length) {
const parentCodes = parentArr.map(v => v.packageCode)
this.checkCodeList.push(...parentCodes)
this.autoPackageCodeList.push(...parentCodes)
this.curSelectCustomPro.push(...parentCodes)
parentArr.forEach(v => {
if (_haveTableTarget && !this.TDOTableData[v.idName]) {
this.$set(this.TDOTableData, v.packageCode, JSON.parse(JSON.stringify(TDO_OBJ)))
}
})
}
this.checkCodeList = Array.from(new Set(this.checkCodeList))
this.autoPackageCodeList = Array.from(new Set(this.autoPackageCodeList))
this.curSelectCustomPro = Array.from(new Set(this.curSelectCustomPro))
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......@@ -1192,6 +1226,12 @@ export default {
if (isDel) {
this.curSelectCustomPro = this.curSelectCustomPro.filter(t => t != item.packageCode)
}
if (parentArr?.length) {
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))
}
for (let key in this.productModal[item.idName]) {
item.groupAttributeList.forEach(attr => {
if (attr.attributeName == key) {
......
......@@ -464,6 +464,11 @@ export default {
width: '160px'
},
{
label: '套餐名称',
prop: 'parentName',
width: '200px'
},
{
label: '产品名称',
prop: 'packageName',
width: '200px'
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!