|
@@ -14,8 +14,8 @@
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
<el-form-item label="项目类型" prop="projectType" :rules="[{ required: true, message: '请输入项目类型', trigger: ['blur', 'change'] }]">
|
|
|
<el-select placeholder="选择项目类型" v-model="form.projectType" clearable >
|
|
|
- <el-option label="二维码拉新项目" value="1" checked></el-option>
|
|
|
- <el-option label="夸克拉新项目" value="2" ></el-option>
|
|
|
+ <el-option label="二维码拉新项目" :value="1" checked></el-option>
|
|
|
+ <el-option label="夸克拉新项目" :value="2" ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -67,7 +67,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
|
|
|
- <el-form-item label="项目价格">
|
|
|
+ <el-form-item label="项目价格" v-if="state.buttontype==0">
|
|
|
<el-form :inline="true" ref="PriceformRef" :model="state.formPrice" class="demo-form-inline">
|
|
|
<el-form-item prop="name" :rules="[{ required: true, message: '请输入结算标准', trigger: ['blur', 'change'] }]">
|
|
|
<el-input v-model="state.formPrice.name" autocomplete="off" placeholder="结算标准" ></el-input>
|
|
@@ -81,12 +81,12 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="" prop="prices" :rules="[{ required: true, message: '请添加项目价格', trigger: ['blur', 'change'] }]">
|
|
|
+ <el-form-item label="价格列表" prop="prices" :rules="[{ required: true, message: '请添加项目价格', trigger: ['blur', 'change'] }]">
|
|
|
<el-table :data="state.form.prices" row-key="id" height="'100%'" style="width: 100%; height: 100%">
|
|
|
<el-table-column type="index" width="80" label="序号"></el-table-column>
|
|
|
<el-table-column prop="name" label="结算标准" min-width="140" show-overflow-tooltip/>
|
|
|
<el-table-column prop="price" label="价格" width="100" show-overflow-tooltip/>
|
|
|
- <el-table-column label="操作" width="140" header-align="center" align="center" fixed="right">
|
|
|
+ <el-table-column label="操作" width="140" header-align="center" align="center" fixed="right" v-if="state.buttontype == 0">
|
|
|
<template #default="{row}">
|
|
|
<el-button size="small" text type="primary" @click="onPriceDelete(row)">删除</el-button>
|
|
|
</template>
|
|
@@ -103,7 +103,7 @@
|
|
|
</el-row>
|
|
|
</el-form>
|
|
|
|
|
|
- <template #footer>
|
|
|
+ <template #footer v-if="state.buttontype==0">
|
|
|
<span class="dialog-footer">
|
|
|
<el-button @click="onCancel" size="default">取 消</el-button>
|
|
|
<el-button type="primary" @click="onSure" size="default" :loading="state.sureLoading">确 定</el-button>
|
|
@@ -115,7 +115,7 @@
|
|
|
|
|
|
<script lang="ts" setup name="admin/project/form">
|
|
|
import { reactive, toRefs, getCurrentInstance, ref, computed, defineAsyncComponent } from 'vue'
|
|
|
-import { ProjectAddInput, TenantUpdateInput } from '/@/api/admin/data-contracts'
|
|
|
+import { ProjectAddInput, ProjectUpdateInput } from '/@/api/admin/data-contracts'
|
|
|
import { ProjectApi } from '/@/api/admin/project'
|
|
|
import type { UploadInstance, UploadProps, UploadFile } from 'element-plus'
|
|
|
import eventBus from '/@/utils/mitt'
|
|
@@ -145,7 +145,7 @@ const PriceformRef = ref()
|
|
|
const state = reactive({
|
|
|
showDialog: false,
|
|
|
sureLoading: false,
|
|
|
- form: {} as ProjectAddInput & TenantUpdateInput,
|
|
|
+ form: {} as ProjectAddInput & ProjectUpdateInput,
|
|
|
fileList: [] as UploadFile[],
|
|
|
fileDirectory:'project',
|
|
|
token: storesUserInfo.getToken(),
|
|
@@ -157,24 +157,27 @@ const state = reactive({
|
|
|
htmlVal: '',
|
|
|
textVal: '',
|
|
|
disable: false,
|
|
|
- }
|
|
|
+ },
|
|
|
+ buttontype:0
|
|
|
})
|
|
|
const { form } = toRefs(state)
|
|
|
|
|
|
|
|
|
// 打开对话框
|
|
|
-const open = async (row: any = {}) => {
|
|
|
-
|
|
|
+const open = async (row: any = {},buttontype:number=0) => {
|
|
|
+ state.buttontype = buttontype
|
|
|
if (row.id > 0) {
|
|
|
const res = await new ProjectApi().get({ id: row.id }, { loading: true }).catch(() => {
|
|
|
proxy.$modal.closeLoading()
|
|
|
})
|
|
|
|
|
|
if (res?.success) {
|
|
|
- state.form = res.data as ProjectAddInput & TenantUpdateInput
|
|
|
+ state.form = res.data as ProjectAddInput & ProjectUpdateInput
|
|
|
+ state.editor.htmlVal = state.form.detail
|
|
|
+ state.editor.textVal = state.form.detailText
|
|
|
}
|
|
|
} else {
|
|
|
- state.form = { } as ProjectAddInput & TenantUpdateInput
|
|
|
+ state.form = { } as ProjectAddInput & ProjectUpdateInput
|
|
|
}
|
|
|
state.showDialog = true
|
|
|
}
|