Commit 710c08f3 by yuzhenWang

产品上架发布测试

parent c2e25e1b
......@@ -29,6 +29,7 @@
"js-beautify": "1.14.11",
"js-cookie": "3.0.5",
"jsencrypt": "3.3.2",
"lodash-es": "^4.17.21",
"nprogress": "0.2.0",
"pinia": "3.0.2",
"splitpanes": "^4.0.4",
......
......@@ -26,3 +26,11 @@ export function getVisitPermission(projectBizId, tenantBizId) {
method: 'get'
})
}
//获取保险公司列表
export function getAllCompanys(data) {
return request({
url: '/user/api/sysDept/company/page',
method: 'post',
data: data
})
}
import request from '@/utils/request'
// 查询产品上架列表
export function getProductList(data) {
return request({
url: '/product/api/product/page',
method: 'post',
data: data
})
}
// 查询产品上架列表
export function getCategoryTreeList(data) {
return request({
url: '/base/api/category/page',
method: 'post',
data: data
})
}
// 新增产品
export function addProduct(data) {
return request({
url: '/product/api/productLaunch/add/category',
method: 'post',
data: data
})
}
// 获取产品详情
export function getProductDetail(productLaunchBizId) {
return request({
url: `/product/api/productLaunch/detail?productLaunchBizId=${productLaunchBizId}`,
method: 'get'
})
}
// 查询产品参数信息
export function productParams(data) {
return request({
url: '/base/api/relObjectField/query',
method: 'post',
data: data
})
}
// 查询产品参数右侧下拉框数据
export function ParamRightOptions(data) {
return request({
url: '/base/api/relFieldValue/field/list',
method: 'post',
data: data
})
}
// 查询产品规格信息列表
export function productSpecies(data) {
return request({
url: '/base/api/relObjectSpecies/query',
method: 'post',
data: data
})
}
// 查询选中的分类列表
export function querySelectCategory(data) {
return request({
url: '/base/api/relObjectCategory/query/selected',
method: 'post',
data: data
})
}
// 保存上架产品
export function saveProductLaunch(data) {
return request({
url: '/product/api/productLaunch/save',
method: 'post',
data: data
})
}
// 发佣管理更新规格信息
export function exportSpecies(data) {
return request({
url: '/product/api/announcementSpecies/import/species',
method: 'post',
data: data
})
}
// 发佣管理查询公告佣列表
export function sendSpecies(data) {
return request({
url: '/product/api/announcementSpecies/page',
method: 'post',
data: data
})
}
// 发佣管理查询公告佣金明细列表
export function sendCommissionRatio(data) {
return request({
url: '/product/api/announcementCommissionRatio/page',
method: 'post',
data: data
})
}
// 发佣管理批量保存公告佣金设置
export function saveBatchSendCommission(data) {
return request({
url: '/product/api/announcementCommissionRatio/batch/save',
method: 'post',
data: data
})
}
// 发佣管理单个删除公告佣金设置
export function deleteCommission(announcementCommissionRatioBizId) {
return request({
url: `/product/api/announcementCommissionRatio/del?announcementCommissionRatioBizId=${announcementCommissionRatioBizId}`,
method: 'delete'
})
}
// 获得来佣列表的数据
export function comeCommissionList(data) {
return request({
url: '/product/api/expectedSpecies/page',
method: 'post',
data: data
})
}
// 获得来佣列表的数据
export function comeExpectedSpecies(data) {
return request({
url: '/product/api/expectedSpecies/import/species',
method: 'post',
data: data
})
}
// 批量保存来佣佣金设置
export function comeBatchSave(data) {
return request({
url: '/product/api/expectedCommissionRatio/batch/save',
method: 'post',
data: data
})
}
// 批量保存来佣佣金设置
export function comeCommissionRatio(data) {
return request({
url: '/product/api/expectedCommissionRatio/page',
method: 'post',
data: data
})
}
// 来佣管理单个删除佣金设置
export function deleteComeCommission(expectedCommissionRatioBizId) {
return request({
url: `/product/api/expectedCommissionRatio/del?expectedCommissionRatioBizId=${expectedCommissionRatioBizId}`,
method: 'delete'
})
}
// 商品列表
export function goodsList(data) {
return request({
url: '/product/api/productLaunch/page',
method: 'post',
data: data
})
}
// 审核商品状态
export function productApproval(data) {
return request({
url: '/product/api/productLaunch/approval',
method: 'put',
data: data
})
}
// 修改商品上架下架状态
export function changeProductStatus(data) {
return request({
url: '/product/api/productLaunch/edit/status',
method: 'put',
data: data
})
}
// 修改来佣佣金设置状态
export function changeComeStatus(data) {
return request({
url: `/product/api/expectedCommissionRatio/edit/status?expectedCommissionRatioBizId=${data.expectedCommissionRatioBizId}&status=${data.status}`,
method: 'put'
})
}
// 修改发佣佣金设置状态
export function changeSendStatus(data) {
return request({
url: `/product/api/announcementCommissionRatio/edit/status?announcementCommissionRatioBizId=${data.announcementCommissionRatioBizId}&status=${data.status}`,
method: 'put'
})
}
<template>
<div class="box">
<el-row>
<el-col :span="12">
<!-- v-model="queryParams.productName"
@blur="handleSelectChange"
:remote-method="searchProduct"
-->
<!-- <el-select
filterable
remote
default-first-option
:reserve-keyword="false"
placeholder="类目搜索"
clearable
remote-show-suffix
style="margin-bottom: 10px"
>
<el-option
v-for="item in productList"
:key="item.productBizId"
:label="item.productName"
:value="item.productBizId"
/>
</el-select> -->
</el-col>
<el-col :span="24" v-if="categoryName">
<div class="chooseName">
<span style="color: rgb(0 0 0 / 55%)">已选类目:</span>{{ categoryName }}
</div>
</el-col>
</el-row>
<div class="category-container">
<div class="tableHeader">
<div
class="headerItem"
:style="{ width: `${100 / categoryList.length}%` }"
v-for="item in categoryList"
:key="item.level"
>
{{ item.title }}
</div>
</div>
<div class="tableBody">
<div
class="bodyItem"
v-for="(item, index) in categoryList"
:key="item.level"
:style="{
width: `${100 / categoryList.length}%`,
borderRight: categoryList.length - 1 === index ? 'none' : '1px solid #ccc'
}"
>
<div
class="categoryItem"
v-for="(cItem, cIndex) in item.data"
:key="cItem.id"
@click="handleClickCategory(item, cItem, cIndex)"
:style="{
backgroundColor: cItem.isSelected ? 'rgb(64, 158, 255,0.1)' : null
}"
>
<span> {{ cItem.name }}</span>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { getCategoryTreeList } from '@/api/product/index'
import { computed } from 'vue'
import { ref } from 'vue'
const props = defineProps({
// 类目数据,
data: {
type: Array,
default: () => []
},
// 类型,是新增还是编辑,
type: {
type: String,
default: 'add'
}
})
const categoryList = ref([])
const level1Obj = ref([])
// 中文数字单位
const units = ['', '十', '百', '千']
const bigUnits = ['', '万', '亿', '兆', '京', '垓', '秭', '穰', '沟', '涧', '正', '载']
// 中文数字字符
const digits = ['零', '一', '二', '三', '四', '五', '六', '七', '八', '九']
const categoryName = computed(() => {
let result = []
categoryList.value.forEach(item => {
item.data.forEach(c => {
if (c.isSelected) result.push(c.name)
})
})
if (result.length > 0) {
return result.join(' > ')
} else {
return ''
}
})
const emit = defineEmits(['handleClickCategory'])
const handleClickCategory = (fItem, cItem, cIndex) => {
categoryList.value.forEach(item => {
item.data.forEach(c => {
if (c.categoryBizId == cItem.categoryBizId && fItem.level == item.level) {
c.isSelected = true
} else if (fItem.level == item.level) {
c.isSelected = false
}
})
})
getCategoryData(cItem)
}
function getCategoryData(obj) {
// let name = query ? query.trim() : ''
let data = {
// name: name,
type: 'PRODUCT',
pid: obj.categoryBizId ? obj.categoryBizId : '0',
pageSize: 9999,
pageNo: 1
}
getCategoryTreeList(data).then(response => {
if (response.code === 200) {
let res = response.data.records
res.forEach(item => {
item.isSelected = false
})
if (!obj.level) {
categoryList.value = [
{ level: 1, data: res, title: `${convertSection(1)}级类目` },
{ level: 2, data: [], title: `${convertSection(2)}级类目` },
{ level: 3, data: [], title: `${convertSection(3)}级类目` },
{ level: 4, data: [], title: `${convertSection(4)}级类目` }
]
} else {
if (res.length > 0) {
// 先删除当前层级以后的数据
if (categoryList.value.length > 4 && obj.level > 4) {
categoryList.value.splice(obj.level, categoryList.value.length - obj.level)
}
let cIndex = categoryList.value.findIndex(item => item.level == res[0].level)
if (cIndex > -1) {
// 固定显示4个类目,如果超过4个类目,则删除多余的类目
if (categoryList.value.length > 4 && obj.level < 4) {
categoryList.value.splice(4, categoryList.value.length - 4)
}
categoryList.value[cIndex].data = res
for (let i = cIndex + 1; i < categoryList.value.length; i++) {
categoryList.value[i].data = []
}
} else {
categoryList.value.push({
level: res[0].level,
data: res,
title: `${convertSection(res[0].level)}级类目`
})
}
}
}
console.log('categoryList', categoryList.value)
} else {
categoryList.value = []
proxy.$modal.msgError(response.msg)
}
})
}
// 转换4位数字节
const convertSection = sectionNum => {
const len = sectionNum
let result = ''
let hasZero = false
for (let i = 0; i < len; i++) {
const digit = sectionNum
if (digit === 0) {
hasZero = true
} else {
if (hasZero) {
result += '零'
hasZero = false
}
result += digits[digit]
return result
}
}
// 处理全零的情况
if (result === '') {
return '零'
}
return result
}
if (props.type == 'add') {
getCategoryData({ categoryBizId: '0' })
} else if (props.type == 'edit') {
console.log('props.data', props.data);
// 先回显已经选择好的类目
categoryList.value = JSON.parse(JSON.stringify(props.data))
categoryList.value.forEach(item => {
item.title = `${convertSection(item.level)}级类目`
// 还应该把data里的数据都加上 isSelected: true
})
}
// 暴露给父组件
defineExpose({
categoryList,
categoryName
})
</script>
<style lang="scss" scoped>
.box {
width: 100%;
box-sizing: border-box;
}
.category-container {
width: 100%;
border: 1px solid #ccc;
border-radius: 10px;
overflow: hidden;
height: 100%;
}
.tableHeader {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #ccc;
color: rgb(0 0 0 / 55%);
font-size: 16px;
}
.headerItem {
padding: 10px 20px;
text-align: left;
}
.tableBody {
display: flex;
justify-content: space-between;
color: rgb(0 0 0 / 55%);
font-size: 14px;
height: calc(100% - 40px);
}
.bodyItem {
overflow-y: auto;
padding: 10px 10px;
}
.categoryItem {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
margin-bottom: 10px;
padding: 10px;
border-radius: 5px;
}
.chooseName {
padding: 10px 20px;
background-color: #f7f7f7;
border-radius: 5px;
font-size: 14px;
margin-bottom: 10px;
}
</style>
This diff is collapsed. Click to expand it.
speciesJson
:
"[{\"isIllustration\":\"1\",\"speciesTypeBizId\":\"species_type_IUVxfmyu8RUTHsfq\",\"typeCode\":\"PROTECTION_PLAN\",\"typeName\":\"保障计划\",\"value\":\"70岁\"},{\"illustrationUrl\":\"\",\"isIllustration\":\"0\",\"speciesTypeBizId\":\"species_type_TcQNeGLE4rcBcjsj\",\"typeCode\":\"PAYMENT_TERM\",\"typeName\":\"供款年期\",\"value\":\"3\"},{\"illustrationUrl\":\"\",\"isIllustration\":\"0\",\"speciesTypeBizId\":\"species_type_uvdLgZQHUZQMfv1k\",\"typeCode\":\"SPECIES_TYPE_CODE1616036003\",\"typeName\":\"尺码\",\"value\":\"S\"}]"
status
:
1
......@@ -122,6 +122,9 @@ service.interceptors.response.use(
} else if (code === 601) {
ElMessage({ message: msg, type: 'warning' })
return Promise.reject(new Error(msg))
} else if (code == 1004) {
// 后端自定义的错误码便于前端显示错误信息,非系统性
return Promise.resolve(res.data)
} else if (code !== 200) {
ElNotification.error({ title: msg })
return Promise.reject('error')
......
<template>
<div class="app-container">
<el-tabs v-model="activeName" class="demo-tabs" :before-leave="beforeTabLeave">
<el-tab-pane v-for="tab in tabsList" :key="tab.name" :label="tab.label" :name="tab.name">
<ProductBaseInfo
:activeName="activeName"
v-if="tab.name === 'baseInfo'"
:detailInfo="productBaseInfo"
@handleSuccess="handleSuccess"
/>
<div v-if="tab.name === 'comeCommission'">
<ComeInfo :activeName="activeName"></ComeInfo>
</div>
<div v-if="tab.name === 'sendCommission'">
<SendInfo :activeName="activeName"></SendInfo>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script setup name="InsuranceProduct">
import { getProductDetail } from '@/api/product/index'
import { ref } from 'vue'
import ProductBaseInfo from './components/productBaseInfo.vue'
import SendInfo from './components/sendInfo.vue'
import ComeInfo from './components/comeInfo.vue'
const route = useRoute()
const { proxy } = getCurrentInstance()
const activeName = ref('baseInfo')
const productBaseInfo = ref({}) //产品基本信息
const tabsList = ref([
{
label: '基础信息',
name: 'baseInfo',
key: 'baseInfo',
id: 1
},
{
label: '来佣管理',
name: 'comeCommission',
id: 2,
key: 'comeCommission'
},
{
label: '发佣管理',
name: 'sendCommission',
id: 3,
key: 'sendCommission'
}
])
const handleSuccess = (source, id) => {
if (source === 'baseInfo') {
getProductInfo('comeCommission', id)
}
}
// Tab切换前的验证
const beforeTabLeave = (activeTabName, oldTabName) => {
if (activeTabName !== 'baseInfo' && productBaseInfo.value.apiSpeciesPriceDtoList.length == 0) {
proxy.$modal.msgError('请先提交产品相关信息,再进行下一步操作!')
return false
}
return true
}
/** 获取产品详情 */
function getProductInfo(tabName, id) {
let productLaunchBizId = ''
if (route.query.source && route.query.source == 'copy') {
productLaunchBizId = id
} else {
productLaunchBizId = route.query.productLaunchBizId
}
getProductDetail(productLaunchBizId).then(response => {
if (response.code === 200) {
productBaseInfo.value = response.data
activeName.value = tabName
} else {
proxy.$modal.msgError(response.msg)
}
})
}
if (route.query.source && route.query.source == 'copy') {
getProductInfo('baseInfo', route.query.productLaunchBizId)
} else {
getProductInfo('baseInfo')
}
</script>
<style lang="scss" scoped>
.app-container {
width: 100%;
height: 89.8vh !important;
box-sizing: border-box;
/* background-color: rgb(247 247 247) !important; */
/* padding: 0 !important; */
/* height: 500px !important;
overflow: hidden;
overflow-y: scroll; */
}
</style>
......@@ -28,7 +28,10 @@ const appName = computed(() => props.project.projectName)
const handleClick = () => {
console.log('点击了应用卡片', props.project)
getVisitPermission(props.project.projectBizId, userStore.currentTenant.apiLoginTenantInfoResponse.tenantBizId).then(response => {
getVisitPermission(
props.project.projectBizId,
userStore.currentTenant.apiLoginTenantInfoResponse.tenantBizId
).then(response => {
if (response.code === 200) {
// 有权限访问项目,进行跳转
// 记录最近使用的应用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment