|
@@ -66,24 +66,6 @@
|
|
|
|
|
|
<el-table-column prop="shopShortName" label="所属店铺" width="120" show-overflow-tooltip />
|
|
|
|
|
|
- <el-table-column prop="oldPrice" label="原价" width="100">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span>¥ {{ row.oldPrice.toFixed(2) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="price" label="优惠价" width="100">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span>¥ {{ row.price.toFixed(2) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
- <el-table-column prop="memberPrice" label="会员价" width="100">
|
|
|
- <template slot-scope="{ row }">
|
|
|
- <span>¥ {{ row.memberPrice.toFixed(2) }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
<el-table-column prop="unit" label="单位" width="100">
|
|
|
<template slot-scope="{ row }">
|
|
|
<span>{{ row.unitNum + row.unit }}</span>
|
|
@@ -119,103 +101,58 @@
|
|
|
<!-- 基础信息 -->
|
|
|
<el-tab-pane label="基础信息" name="basic">
|
|
|
<el-form :model="dialogForm" label-width="100px" class="dialog-form">
|
|
|
+
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="服务名称" prop="name">
|
|
|
- <el-input v-model="dialogForm.name" placeholder="请输入服务名称" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="服务品类" prop="cateIds">
|
|
|
- <el-cascader v-model="dialogForm.cateIds" :options="categoryList" :props="categoryProps" :show-all-levels="false"
|
|
|
- placeholder="请选择服务品类" clearable style="width: 100%" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <!-- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="服务模式" prop="serviceMode">
|
|
|
- <el-checkbox-group v-model="serviceModeList" @change="onChangeServiceModeCbx">
|
|
|
- <el-checkbox v-for="(item,index) in serviceModes" :key="index" :label="item">
|
|
|
- {{item}}
|
|
|
- </el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
+ <el-form-item label="封面图" prop="image">
|
|
|
+ <upload-image v-model="dialogForm.image" :mode="'attachment'" :boxSize="{width: '100px', height: '100px'}" :multiple="false" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="发布人" prop="userId">
|
|
|
- <el-input v-model="userName" placeholder="请选择发布人" @focus="showUsersDialog" readonly />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row> -->
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="服务描述" prop="describes">
|
|
|
- <el-input v-model="dialogForm.describes" type="textarea" :rows="3" placeholder="请输入服务描述" />
|
|
|
+ <el-form-item label="详情图" prop="detailsImage">
|
|
|
+ <upload-image v-model="detailsImageList" :mode="'attachment'" :boxSize="{width: '100px', height: '100px'}" :multiple="true" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
+
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="12">
|
|
|
- <el-form-item label="预约价格" prop="appointmentPrice">
|
|
|
- <el-input-number v-model="dialogForm.appointmentPrice" :precision="2" :step="0.1" :min="0" style="width: 100%" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
-
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="最低时间" prop="minNum">
|
|
|
- <el-input-number v-model="dialogForm.minNum" :min="1" style="width: 100%" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="单位" prop="unit">
|
|
|
- <el-radio-group v-model="dialogForm.unit">
|
|
|
- <el-radio label="小时">小时</el-radio>
|
|
|
- <el-radio label="分钟">分钟</el-radio>
|
|
|
- </el-radio-group>
|
|
|
+ <el-form-item label="服务名称" prop="name">
|
|
|
+ <el-input v-model="dialogForm.name" placeholder="请输入服务名称" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
- <el-form-item label="单位数量" prop="unitNum">
|
|
|
- <el-input-number v-model="dialogForm.unitNum" :min="10" style="width: 100%" />
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="服务品类" prop="cateIds">
|
|
|
+ <el-cascader v-model="dialogForm.cateIds" :options="categoryList" :props="categoryProps" :show-all-levels="false"
|
|
|
+ placeholder="请选择服务品类" clearable style="width: 100%" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="服务地区" prop="region">
|
|
|
- <el-cascader style="width: 100%" size="large" :options="regionData" v-model="storeAddress" :placeholder="storeAddre"
|
|
|
- @change="handleAddressChange" />
|
|
|
+ <el-form-item label="服务保障" prop="serviceProjects">
|
|
|
+ <el-select v-model="dialogForm.serviceProjects" multiple placeholder="请选择服务保障" style="width: 100%">
|
|
|
+ <el-option
|
|
|
+ v-for="item in serviceProject"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
<el-row :gutter="20">
|
|
|
<el-col :span="24">
|
|
|
- <el-form-item label="详细地址" prop="detailsAddress">
|
|
|
- <el-input v-model="dialogForm.detailsAddress" placeholder="请输入详细地址" @keydown.enter.native="setLocation" clearable />
|
|
|
+ <el-form-item label="服务描述" prop="describes">
|
|
|
+ <el-input v-model="dialogForm.describes" type="textarea" :rows="3" placeholder="请输入服务描述" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="封面图" prop="image">
|
|
|
- <upload-image v-model="dialogForm.image" :mode="'attachment'" :boxSize="{width: '100px', height: '100px'}" :multiple="false" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="详情图" prop="detailsImage">
|
|
|
- <upload-image v-model="detailsImageList" :mode="'attachment'" :boxSize="{width: '100px', height: '100px'}" :multiple="true" />
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+
|
|
|
</el-form>
|
|
|
</el-tab-pane>
|
|
|
|
|
@@ -236,8 +173,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="salePrice" label="价格" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
- <span v-if="scope.row.priceType === 1">¥{{ scope.row.salePrice }}</span>
|
|
|
- <span v-else>待定</span>
|
|
|
+ <span>¥{{ scope.row.salePrice }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="oldPrice" label="原价" width="120">
|
|
@@ -259,7 +195,7 @@
|
|
|
<!-- 表单配置 -->
|
|
|
<el-tab-pane label="表单配置" name="form">
|
|
|
<div class="form-config-container">
|
|
|
- <el-button type="primary" size="small" @click="addField">添加字段</el-button>
|
|
|
+ <el-button type="primary" size="small" @click="addField" style="margin-bottom: 10px;">添加字段</el-button>
|
|
|
<el-form ref="formConfigForm" :model="formConfig" label-width="100px">
|
|
|
<div v-for="(field, index) in formConfig.fields" :key="index" class="field-item">
|
|
|
<el-row :gutter="20">
|
|
@@ -275,8 +211,18 @@
|
|
|
<el-select v-model="field.type" placeholder="请选择字段类型" style="width: 100%" @change="handleFieldTypeChange(field)">
|
|
|
<el-option label="文本" value="text" />
|
|
|
<el-option label="数字" value="number" />
|
|
|
- <el-option label="选择" value="select" />
|
|
|
+ <el-option label="下拉" value="select" />
|
|
|
<el-option label="多选" value="checkbox" />
|
|
|
+ <el-option label="图片" value="upload" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item :label="'是否必填'" :prop="'fields.' + index + '.required'"
|
|
|
+ :rules="[{ required: true, message: '请选择是否必填', trigger: 'change' }]">
|
|
|
+ <el-select v-model="field.required" placeholder="请选择是否必填" style="width: 100%" @change="handleFieldTypeChange(field)">
|
|
|
+ <el-option label="是" :value="true" />
|
|
|
+ <el-option label="否" :value="false" />
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -285,7 +231,7 @@
|
|
|
<el-input v-model="field.placeholder" placeholder="请输入提示文字" />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :span="6">
|
|
|
+ <el-col :span="24">
|
|
|
<el-form-item :label="'选项内容'" v-if="field.type === 'select' || field.type === 'checkbox'" :prop="'fields.' + index + '.options'"
|
|
|
:rules="[{ required: true, message: '请输入选项内容', trigger: 'blur' }]">
|
|
|
<el-input type="textarea" v-model="field.options" placeholder="请输入选项内容,多个选项用逗号分隔" :rows="3" />
|
|
@@ -300,14 +246,45 @@
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
|
|
|
+ <!-- 收费标准 -->
|
|
|
+ <el-tab-pane label="收费标准" name="cost">
|
|
|
+ <div class="cost-container">
|
|
|
+ <div class="cost-header">
|
|
|
+ <el-button type="primary" size="small" @click="addCostStandard">添加收费标准</el-button>
|
|
|
+ </div>
|
|
|
+ <el-table :data="costStandardList" border style="width: 100%">
|
|
|
+ <el-table-column prop="name" label="标准名称" width="180" />
|
|
|
+ <el-table-column prop="price" label="价格" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>¥{{ scope.row.price }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="remark" label="备注" show-overflow-tooltip />
|
|
|
+ <el-table-column label="操作" width="150">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" @click="handleEditCostStandard(scope.row)">编辑</el-button>
|
|
|
+ <el-button size="mini" type="danger" @click="handleDeleteCostStandard(scope.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <el-form :model="dialogForm" style="margin-top: 10px;">
|
|
|
+ <el-form-item label="收费标准说明" class="cost-form-item">
|
|
|
+ <WangEditor
|
|
|
+ style="width: 100%"
|
|
|
+ :height="300"
|
|
|
+ :value="costContent"
|
|
|
+ @input="getCostContent"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+
|
|
|
<!-- 详情 -->
|
|
|
<el-tab-pane label="详情" name="detail">
|
|
|
<div class="detail-container">
|
|
|
<el-form :model="dialogForm" label-width="100px">
|
|
|
- <el-form-item label="服务详情">
|
|
|
- <WangEditor style="width: 100%" :height="500" :value="content" @input="getEditorContent" />
|
|
|
- </el-form-item>
|
|
|
-
|
|
|
<el-form-item label="优惠券">
|
|
|
<div class="coupon-container">
|
|
|
<el-tag v-for="(tag, index) in dialogForm.coupons" :key="index" class="mr10 mb10" :closable="true" @close="handleCloseCoupon(tag)">
|
|
@@ -319,9 +296,14 @@
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="服务详情">
|
|
|
+ <WangEditor style="width: 100%" :height="500" :value="content" @input="getEditorContent" />
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-tab-pane>
|
|
|
+
|
|
|
+
|
|
|
</el-tabs>
|
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -343,8 +325,9 @@
|
|
|
<el-radio :label="2">动态价格</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="价格" prop="salePrice" v-if="specForm.priceType === 1">
|
|
|
+ <el-form-item label="价格" prop="salePrice">
|
|
|
<el-input-number v-model="specForm.salePrice" :precision="2" :step="0.1" />
|
|
|
+ <div>如果是动态价格,则此处为首付款</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="原价" prop="oldPrice" v-if="specForm.priceType === 1">
|
|
|
<el-input-number v-model="specForm.oldPrice" :precision="2" :step="0.1" />
|
|
@@ -419,6 +402,45 @@
|
|
|
:page-sizes="[5, 10, 20, 30, 40]" @pagination="getUserList" />
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 收费标准编辑弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ :title="costStandardDialogTitle"
|
|
|
+ :visible.sync="costStandardDialogVisible"
|
|
|
+ width="500px"
|
|
|
+ >
|
|
|
+ <el-form
|
|
|
+ :model="costStandardForm"
|
|
|
+ :rules="costStandardRules"
|
|
|
+ ref="costStandardForm"
|
|
|
+ label-width="100px"
|
|
|
+ >
|
|
|
+ <el-form-item label="标准名称" prop="name">
|
|
|
+ <el-input v-model="costStandardForm.name" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="价格" prop="price">
|
|
|
+ <el-input-number
|
|
|
+ v-model="costStandardForm.price"
|
|
|
+ :precision="2"
|
|
|
+ :step="0.1"
|
|
|
+ :min="0"
|
|
|
+ style="width: 100%"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="备注" prop="remark">
|
|
|
+ <el-input
|
|
|
+ type="textarea"
|
|
|
+ v-model="costStandardForm.remark"
|
|
|
+ :rows="3"
|
|
|
+ placeholder="请输入备注信息"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="costStandardDialogVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitCostStandardForm">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
<pagination v-show="tableData.total" :total="tableData.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
@pagination="getList" />
|
|
|
</div>
|
|
@@ -461,6 +483,7 @@ export default {
|
|
|
},
|
|
|
categoryValue: '',
|
|
|
categoryList: [],
|
|
|
+ serviceProject: [],
|
|
|
categoryProps: {
|
|
|
children: 'children',
|
|
|
label: 'name',
|
|
@@ -508,7 +531,10 @@ export default {
|
|
|
detailsAddress: '',
|
|
|
describes: '',
|
|
|
couponIds: [],
|
|
|
- coupons: []
|
|
|
+ coupons: [],
|
|
|
+ costStandards: [],
|
|
|
+ costContent: '',
|
|
|
+ serviceProjects: []
|
|
|
},
|
|
|
userName: '',
|
|
|
longitude: '',
|
|
@@ -565,12 +591,30 @@ export default {
|
|
|
formConfig: {
|
|
|
fields: []
|
|
|
},
|
|
|
- content: ''
|
|
|
+ content: '',
|
|
|
+ costStandardList: [],
|
|
|
+ costContent: '',
|
|
|
+ costStandardDialogVisible: false,
|
|
|
+ costStandardDialogTitle: '添加收费标准',
|
|
|
+ costStandardForm: {
|
|
|
+ name: '',
|
|
|
+ price: 0,
|
|
|
+ remark: ''
|
|
|
+ },
|
|
|
+ costStandardRules: {
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请输入标准名称', trigger: 'blur' }
|
|
|
+ ],
|
|
|
+ price: [
|
|
|
+ { required: true, message: '请输入价格', trigger: 'blur' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
this.getCategoryList()
|
|
|
this.getList()
|
|
|
+ this.getServiceProject()
|
|
|
},
|
|
|
methods: {
|
|
|
// 原有的方法保持不变
|
|
@@ -588,6 +632,17 @@ export default {
|
|
|
this.multiple = !selection.length
|
|
|
this.single = selection.length !== 1
|
|
|
},
|
|
|
+ getServiceProject(){
|
|
|
+ this.request({
|
|
|
+ url: '/system/group/data/selectByKey?key=service_guarantee',
|
|
|
+ method: 'get'
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.serviceProject = res.data
|
|
|
+ }
|
|
|
+ }).catch(() => {
|
|
|
+ })
|
|
|
+ },
|
|
|
getList() {
|
|
|
this.loading = true
|
|
|
this.request({
|
|
@@ -687,25 +742,43 @@ export default {
|
|
|
this.dialogForm[k] = rows[k]
|
|
|
}
|
|
|
this.content = rows.content
|
|
|
- this.userName = rows.userName
|
|
|
- if (this.dialogForm.detailsImage !== '' && this.dialogForm.detailsImage != null) {
|
|
|
- this.detailsImageList = this.dialogForm.detailsImage.split(',')
|
|
|
+ this.costContent = rows.costContent || ''
|
|
|
+ this.costStandardList = rows.costStandards || []
|
|
|
+
|
|
|
+ // 处理服务保障数据
|
|
|
+ if (rows.serviceProjects) {
|
|
|
+ this.dialogForm.serviceProjects = rows.serviceProjects.split(',').map(id => parseInt(id))
|
|
|
+ } else {
|
|
|
+ this.dialogForm.serviceProjects = []
|
|
|
}
|
|
|
- this.dialogForm.cateIds = rows.cateId.split(',')
|
|
|
- this.serviceModeList = this.dialogForm.serviceMode.split(',')
|
|
|
- this.storeAddress = []
|
|
|
- this.storeAddre = ''
|
|
|
- if (!this.isEmpty(this.dialogForm.province)) {
|
|
|
- this.storeAddre += this.dialogForm.province
|
|
|
- this.storeAddre += '/'
|
|
|
+
|
|
|
+ // 处理规格数据
|
|
|
+ if (rows.specs) {
|
|
|
+ try {
|
|
|
+ this.specList = JSON.parse(rows.specs)
|
|
|
+ } catch (e) {
|
|
|
+ this.specList = []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.specList = []
|
|
|
}
|
|
|
- if (!this.isEmpty(this.dialogForm.city)) {
|
|
|
- this.storeAddre += this.dialogForm.city
|
|
|
- this.storeAddre += '/'
|
|
|
+
|
|
|
+ // 处理表单配置
|
|
|
+ if (rows.formConfig) {
|
|
|
+ try {
|
|
|
+ const formConfig = JSON.parse(rows.formConfig)
|
|
|
+ this.formConfig.fields = formConfig
|
|
|
+ } catch (e) {
|
|
|
+ this.formConfig.fields = []
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.formConfig.fields = []
|
|
|
}
|
|
|
- if (!this.isEmpty(this.dialogForm.district)) {
|
|
|
- this.storeAddre += this.dialogForm.district
|
|
|
+
|
|
|
+ if (this.dialogForm.detailsImage !== '' && this.dialogForm.detailsImage != null) {
|
|
|
+ this.detailsImageList = this.dialogForm.detailsImage.split(',')
|
|
|
}
|
|
|
+ this.dialogForm.cateIds = rows.cateId.split(',')
|
|
|
this.dialogTitle = '编辑服务'
|
|
|
this.dialogVisible = true
|
|
|
this.dialogEditVisible = true
|
|
@@ -725,18 +798,36 @@ export default {
|
|
|
this.dialogForm.detailsImage = this.detailsImageList.toString()
|
|
|
this.dialogForm.cateId = this.dialogForm.cateIds.join(',')
|
|
|
this.dialogForm.content = this.content
|
|
|
-
|
|
|
- // 添加表单配置
|
|
|
- if (this.activeTab === 'form') {
|
|
|
- this.handleFormConfig().then(formConfig => {
|
|
|
+ this.dialogForm.costContent = this.costContent
|
|
|
+ this.dialogForm.costStandards = this.costStandardList
|
|
|
+
|
|
|
+ // 处理服务保障数据
|
|
|
+ this.dialogForm.serviceProjects = this.dialogForm.serviceProjects.join(',')
|
|
|
+
|
|
|
+ // 添加规格数据
|
|
|
+ this.dialogForm.specs = this.specList
|
|
|
+
|
|
|
+ // 处理表单配置
|
|
|
+ this.$refs.formConfigForm.validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ const formConfig = this.formConfig.fields.map(field => {
|
|
|
+ const config = {
|
|
|
+ name: field.name,
|
|
|
+ type: field.type,
|
|
|
+ placeholder: field.placeholder,
|
|
|
+ required: field.required,
|
|
|
+ options: field.options
|
|
|
+ }
|
|
|
+ return config
|
|
|
+ })
|
|
|
this.dialogForm.formConfig = formConfig
|
|
|
+
|
|
|
+ // 提交请求
|
|
|
this.submitRequest(url)
|
|
|
- }).catch(error => {
|
|
|
- this.$message.error(error.message || '表单验证失败')
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.submitRequest(url)
|
|
|
- }
|
|
|
+ } else {
|
|
|
+ this.$message.error('表单配置验证失败')
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
submitRequest(url) {
|
|
@@ -755,50 +846,17 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
validateForm() {
|
|
|
- if (this.dialogForm.cateIds.length === 0) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请选择服务分类' })
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.isEmpty(this.dialogForm.serviceMode)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请选择服务模式' })
|
|
|
- return false
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
if (this.isEmpty(this.dialogForm.image)) {
|
|
|
this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请上传服务封面图' })
|
|
|
return false
|
|
|
}
|
|
|
- if (this.isEmpty(this.dialogForm.userId)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请选择发布人' })
|
|
|
- return false
|
|
|
- }
|
|
|
+
|
|
|
if (this.isEmpty(this.dialogForm.name)) {
|
|
|
this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请输入服务名称' })
|
|
|
return false
|
|
|
}
|
|
|
- if (this.isEmpty(this.dialogForm.oldPrice)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请输入发布价格' })
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.isEmpty(this.dialogForm.price)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请输入接单价格' })
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.isEmpty(this.dialogForm.memberPrice)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请输入会员价格' })
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.isEmpty(this.dialogForm.minNum)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请输入最低服务时间' })
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.isEmpty(this.dialogForm.unitNum)) {
|
|
|
- this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请输入单位数量' })
|
|
|
- return false
|
|
|
- }
|
|
|
- if (this.isEmpty(this.dialogForm.city)) {
|
|
|
- // this.$notify({ title: '提示', duration: 1800, type: 'warning', message: '请选择服务地区' })
|
|
|
- // return false
|
|
|
- }
|
|
|
return true
|
|
|
},
|
|
|
hideDialog() {
|
|
@@ -1027,7 +1085,7 @@ export default {
|
|
|
this.dialogForm.coupons = [];
|
|
|
this.dialogForm.couponIds = [];
|
|
|
this.request({
|
|
|
- url: '/api/admin/coupon/product/list',
|
|
|
+ url: '/api/admin/product/info',
|
|
|
method: 'get',
|
|
|
params: { productId: productId }
|
|
|
}).then(res => {
|
|
@@ -1187,7 +1245,6 @@ export default {
|
|
|
placeholder: field.placeholder,
|
|
|
required: field.required
|
|
|
}
|
|
|
-
|
|
|
if (field.type === 'select' || field.type === 'checkbox') {
|
|
|
config.options = field.options.split(',').map(opt => opt.trim()).filter(opt => opt)
|
|
|
}
|
|
@@ -1223,6 +1280,56 @@ export default {
|
|
|
3: '已拒绝'
|
|
|
}
|
|
|
return statusMap[status] || '未知'
|
|
|
+ },
|
|
|
+ // 收费标准相关方法
|
|
|
+ addCostStandard() {
|
|
|
+ this.costStandardDialogTitle = '添加收费标准'
|
|
|
+ this.costStandardForm = {
|
|
|
+ name: '',
|
|
|
+ price: 0,
|
|
|
+ remark: ''
|
|
|
+ }
|
|
|
+ this.costStandardDialogVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ handleEditCostStandard(row) {
|
|
|
+ this.costStandardDialogTitle = '编辑收费标准'
|
|
|
+ this.costStandardForm = { ...row }
|
|
|
+ this.costStandardDialogVisible = true
|
|
|
+ },
|
|
|
+
|
|
|
+ handleDeleteCostStandard(row) {
|
|
|
+ this.$confirm('确认删除该收费标准?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ const index = this.costStandardList.findIndex(item => item === row)
|
|
|
+ if (index > -1) {
|
|
|
+ this.costStandardList.splice(index, 1)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ submitCostStandardForm() {
|
|
|
+ this.$refs.costStandardForm.validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.costStandardDialogTitle === '添加收费标准') {
|
|
|
+ this.costStandardList.push({ ...this.costStandardForm })
|
|
|
+ } else {
|
|
|
+ const index = this.costStandardList.findIndex(item => item.name === this.costStandardForm.name)
|
|
|
+ if (index > -1) {
|
|
|
+ this.costStandardList.splice(index, 1, { ...this.costStandardForm })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.costStandardDialogVisible = false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ getCostContent(content) {
|
|
|
+ this.costContent = content
|
|
|
+ this.dialogForm.costContent = content
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -1231,7 +1338,7 @@ export default {
|
|
|
|
|
|
<style>
|
|
|
.customWidth {
|
|
|
- width: 80% !important;
|
|
|
+ width: 85% !important;
|
|
|
}
|
|
|
|
|
|
.dialog-form {
|
|
@@ -1285,6 +1392,36 @@ export default {
|
|
|
height: 500px !important;
|
|
|
}
|
|
|
|
|
|
+::v-deep .w-e-toolbar {
|
|
|
+ border-bottom: 1px solid #dcdfe6;
|
|
|
+}
|
|
|
+
|
|
|
+.cost-container {
|
|
|
+ padding: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.cost-header {
|
|
|
+ margin-bottom: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.cost-form-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+
|
|
|
+.cost-form-item .el-form-item__label {
|
|
|
+ text-align: left;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.cost-form-item .el-form-item__content {
|
|
|
+ margin-left: 0 !important;
|
|
|
+}
|
|
|
+
|
|
|
+::v-deep .w-e-text-container {
|
|
|
+ height: 300px !important;
|
|
|
+}
|
|
|
+
|
|
|
::v-deep .w-e-toolbar {
|
|
|
border-bottom: 1px solid #dcdfe6;
|
|
|
}
|