|
@@ -9,31 +9,31 @@
|
|
|
:model="form"
|
|
|
:rules="formRules"
|
|
|
label-width="160px">
|
|
|
- <el-form-item prop="place_name"
|
|
|
+ <el-form-item prop="category_name"
|
|
|
:rules="formRules.required"
|
|
|
label="分类名称:">
|
|
|
<el-col :span="16">
|
|
|
- <el-input v-model="form.place_name"
|
|
|
- placeholder="请输入座位名称"
|
|
|
+ <el-input v-model="form.category_name"
|
|
|
+ placeholder="请输入分类名称"
|
|
|
clearable></el-input>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
|
- <el-form-item prop="order_sign_status"
|
|
|
- :rules="formRules.required"
|
|
|
- label="是否显示:">
|
|
|
- <el-radio v-model="form.order_sign_status" label="1">显示</el-radio>
|
|
|
- <el-radio v-model="form.order_sign_status" label="0">不显示</el-radio>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item prop="place_name"
|
|
|
+ <el-form-item prop="category_sort_id"
|
|
|
:rules="formRules.InterNum"
|
|
|
- label="排序:">
|
|
|
+ label="分类排序:">
|
|
|
<el-col :span="16">
|
|
|
- <el-input v-model="form.place_name"
|
|
|
+ <el-input v-model="form.category_sort_id"
|
|
|
type="number"
|
|
|
- placeholder="请输入顺序编号"
|
|
|
+ placeholder="请输入分类排序序号(数字)"
|
|
|
clearable></el-input>
|
|
|
</el-col>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item prop="category_status"
|
|
|
+ :rules="formRules.required"
|
|
|
+ label="分类状态:">
|
|
|
+ <el-radio v-model="form.category_status" label="1">上架</el-radio>
|
|
|
+ <el-radio v-model="form.category_status" label="0">下架</el-radio>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer text-center">
|
|
|
<el-button @click="dialog = false">取 消</el-button>
|
|
@@ -44,8 +44,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { fen2Yuan, yuan2Fen } from '@/utils'
|
|
|
-
|
|
|
export default {
|
|
|
components: {},
|
|
|
props: {
|
|
@@ -64,18 +62,19 @@ export default {
|
|
|
return {
|
|
|
dialog: !!this.value,
|
|
|
form: {
|
|
|
- place_name: '' // 座位名称
|
|
|
+ category_name: '', // 分类名称
|
|
|
+ category_sort_id: '', // 分类排序
|
|
|
+ category_status: '1' // 分类状态(0下架1上架)
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
handleSubmit () {
|
|
|
- const url = this.exData.id ? '/v1/bar/place/template/modify' : '/v1/bar/place/template/add'
|
|
|
+ const url = this.exData.id ? '/v1/bar/product/category/modify' : '/v1/bar/product/category/add'
|
|
|
this.$refs.form.validate(async valid => {
|
|
|
if (valid) {
|
|
|
const data = await this.$fetch(url, {
|
|
|
- ...this.form,
|
|
|
- place_price: yuan2Fen(this.form.place_price)
|
|
|
+ ...this.form
|
|
|
})
|
|
|
if (data.code === 200) {
|
|
|
this.$message.success('提交成功')
|
|
@@ -93,8 +92,8 @@ export default {
|
|
|
if (this.form.hasOwnProperty(key)) {
|
|
|
let value = this.exData[key]
|
|
|
if ((Array.isArray(value) && value.length > 0) || value === 0 || value) {
|
|
|
- if (key === 'place_price') {
|
|
|
- value = fen2Yuan(value)
|
|
|
+ if (key === 'category_status') {
|
|
|
+ value = value.toString()
|
|
|
}
|
|
|
this.$set(this.form, key, value)
|
|
|
}
|