|
@@ -22,24 +22,29 @@
|
|
|
<el-table-column prop="price" label="价格" width="180">
|
|
|
</el-table-column>
|
|
|
<el-table-column label="设价方式" min-width="180">
|
|
|
- <template #default="{ pRow }">
|
|
|
- <el-form label-position="left" inline class="demo-table-expand">
|
|
|
- <el-form-item>
|
|
|
- <el-select placeholder="请选择设价方式">
|
|
|
- <el-option label="抽成比例" value="1"></el-option>
|
|
|
- <el-option label="抽成金额" value="2"></el-option>
|
|
|
- </el-select>
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-form :inline="true" @submit.stop.prevent>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select placeholder="请选择设价方式" v-model="row.drawPriceWay">
|
|
|
+ <el-option label="请选择设价方式" value="0"></el-option>
|
|
|
+ <el-option label="抽成比例" value="1"></el-option>
|
|
|
+ <el-option label="抽成金额" value="2"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-input placeholder="请输入设价信息"></el-input>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-if="row.drawPriceWay == 2" v-model="row.drawPrice" placeholder="请输入设价信息"></el-input>
|
|
|
+ <el-input v-if="row.drawPriceWay != 2" v-model="row.drawRatio" placeholder="请输入设价信息"></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- %
|
|
|
+ <el-form-item v-if="row.drawPriceWay==2">
|
|
|
+ 元
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="primary" @click="SetPrice">设价</el-button>
|
|
|
+ <el-form-item v-else >
|
|
|
+ %
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="text" @click="onSetProjectPrice(row)"> 设价 </el-button>
|
|
|
</el-form-item>
|
|
|
- </el-form>
|
|
|
+ </el-form>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -53,15 +58,28 @@
|
|
|
<el-table-column label="项目名称" prop="name" min-width="120" show-overflow-tooltip />
|
|
|
<el-table-column label="操作" width="180" header-align="center" align="center" fixed="right">
|
|
|
<template #default="{ row }">
|
|
|
- <el-button size="small" text type="primary" @click="onDetail(row)">平台单独设价</el-button>
|
|
|
+ <el-button size="small" text type="primary" @click="onTenantInfo(row)">平台单独设价</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
- </el-card>
|
|
|
- <!-- <LinkForm ref="LinkFormRef" :title="state.linkFormTitle"></LinkForm> -->
|
|
|
- <!-- <tenant-form ref="tenantFormRef" :title="state.tenantFormTitle"></tenant-form> -->
|
|
|
+ <div class="my-flex my-flex-end" style="margin-top: 20px">
|
|
|
+ <el-pagination
|
|
|
+ v-model:currentPage="state.pageInput.currentPage"
|
|
|
+ v-model:page-size="state.pageInput.pageSize"
|
|
|
+ :total="state.total"
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
+ small
|
|
|
+ background
|
|
|
+ @size-change="onSizeChange"
|
|
|
+ @current-change="onCurrentChange"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-card>
|
|
|
<!-- 公司抽成from -->
|
|
|
<company-form ref="companyFormRef" title="公司分成比例修改"></company-form>
|
|
|
+ <!--平台抽成明细-->
|
|
|
+ <tenant-price-form ref="TenantPriceFormRef" :title="state.TenantPriceFormTitle"></tenant-price-form>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts" setup name="admin/projectprice">
|
|
@@ -73,13 +91,16 @@ import eventBus from '/@/utils/mitt'
|
|
|
|
|
|
// 引入组件
|
|
|
const CompanyForm = defineAsyncComponent(() => import('./components/company-form.vue'))
|
|
|
+const TenantPriceForm = defineAsyncComponent(() => import('./components/tenant-price.vue'))
|
|
|
+
|
|
|
const companyFormRef = ref();
|
|
|
+const TenantPriceFormRef = ref();
|
|
|
|
|
|
-const state = reactive({
|
|
|
+const state = reactive({
|
|
|
+ TenantPriceFormTitle:'',
|
|
|
companydraw: {
|
|
|
} as CompanyDrawOutput,
|
|
|
- loading: false,
|
|
|
- tenantFormTitle: '',
|
|
|
+ loading: false,
|
|
|
linkFormTitle: '',
|
|
|
filter: {
|
|
|
},
|
|
@@ -93,6 +114,7 @@ const state = reactive({
|
|
|
onMounted(() => {
|
|
|
onCompanyQuery();
|
|
|
onQuery();
|
|
|
+ eventBus.off('refreshCompanyDraw')
|
|
|
eventBus.on('refreshCompanyDraw', async () => {
|
|
|
onCompanyQuery();
|
|
|
})
|
|
@@ -103,9 +125,10 @@ onMounted(() => {
|
|
|
|
|
|
})
|
|
|
onBeforeMount(() => {
|
|
|
+ eventBus.off('refreshCompanyDraw')
|
|
|
eventBus.off('refreshProjectPrice')
|
|
|
})
|
|
|
-//查询
|
|
|
+//查询项目价格
|
|
|
const onQuery = async () => {
|
|
|
state.loading = true
|
|
|
state.pageInput.filter = state.filter
|
|
@@ -116,6 +139,22 @@ const onQuery = async () => {
|
|
|
state.total = res?.data?.total ?? 0
|
|
|
state.loading = false
|
|
|
}
|
|
|
+//设置项目价格
|
|
|
+const onSetProjectPrice = async (row: any) => {
|
|
|
+ // state.sureLoading = true
|
|
|
+ let res = {} as any
|
|
|
+
|
|
|
+ res = await new ProjectPriceApi().updateProjectPrice(row, { showSuccessMessage: true }).catch(() => {
|
|
|
+ // state.sureLoading = false
|
|
|
+ })
|
|
|
+
|
|
|
+ // state.sureLoading = false
|
|
|
+
|
|
|
+ if (res?.success) {
|
|
|
+ eventBus.emit('refreshProjectPrice')
|
|
|
+ // state.showDialog = false
|
|
|
+ }
|
|
|
+}
|
|
|
//查询公司抽成
|
|
|
const onCompanyQuery = async () => {
|
|
|
// state.loading = true
|
|
@@ -132,10 +171,18 @@ const onCompanyEdit = () => {
|
|
|
}
|
|
|
|
|
|
|
|
|
+// 平台单独设价
|
|
|
+const onTenantInfo = (row: any) => {
|
|
|
+ state.TenantPriceFormTitle = `【${row.name}】平台单独设价`
|
|
|
+ TenantPriceFormRef.value.open(row)
|
|
|
+}
|
|
|
+const onSizeChange = (val: number) => {
|
|
|
+ state.pageInput.pageSize = val
|
|
|
+ onQuery()
|
|
|
+}
|
|
|
|
|
|
-//平台单独设价
|
|
|
-// const onDetail = (row: ProjectLinkManagePageOutput) => {
|
|
|
-// state.tenantFormTitle = '编辑租户'
|
|
|
-// tenantFormRef.value.open(row)
|
|
|
-// }
|
|
|
+const onCurrentChange = (val: number) => {
|
|
|
+ state.pageInput.currentPage = val
|
|
|
+ onQuery()
|
|
|
+}
|
|
|
</script>
|