dishesDetail.vue
7.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<template>
<div>
<a-card>
<h3 style="font-weight: bold;">基本信息</h3>
<a-form-model ref="ruleForm" :model="form" :rules="rules">
<a-row>
<a-col :span="8">
<a-form-model-item ref="staffId" label="菜品编号">
<a-input :disabled="true" style="width: 250px" v-model="form.staffId" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item ref="staffId" label="创建时间">
<a-input :disabled="true" style="width: 250px" v-model="form.staffId" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="状态" prop="staffId">
<a-select v-model="form.staffId" style="width: 250px;" placeholder="请选择">
<a-select-option v-for="(item,i) in provinceData" :key="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row>
<a-col :span="8">
<a-form-model-item ref="staffId" label="菜品名称" prop="staffId">
<a-input style="width: 250px;" v-model="form.staffId" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="菜品分类" prop="staffId">
<a-select v-model="form.staffId" style="width: 250px;" placeholder="请选择">
<a-select-option v-for="(item,i) in departData" :key="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</a-card>
<a-card>
<h3 style="font-weight: bold;">价格设置</h3>
<a-button type="primary" @click="addpart">
添加
</a-button>
<a-form-model>
<a-row v-for="(value,i) in partnerList" :key="i">
<a-col :span="8">
<a-form-model-item label="规格">
<a-input style="width: 250px" v-model="value.staffId" />
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="价格(元)">
<a-input style="width: 250px" v-model="value.staffId" />
</a-form-model-item>
</a-col>
</a-row>
<a-button style="background: red;" type="danger" @click="deletelpart" v-if="partnerList.length>1">
删除
</a-button>
</a-form-model>
</a-card>
<a-card>
<h3 style="font-weight: bold;">食材设置</h3>
<a-button type="primary" @click="addfood">
添加
</a-button>
<a-form-model>
<a-row v-for="(value,i) in foodList" :key="i">
<a-col :span="8">
<a-form-model-item label="食材类型" prop="staffId">
<a-select v-model="value.staffId" style="width: 250px;" placeholder="请选择">
<a-select-option v-for="(item,i) in departData" :key="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="食材名称" prop="staffId">
<a-select v-model="value.staffId" style="width: 250px;" placeholder="请选择">
<a-select-option v-for="(item,i) in departData" :key="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :span="8">
<a-form-model-item label="用量" prop="staffId">
半份:<a-input style="width: 100px" v-model="value.staffId" />
一份:<a-input style="width: 100px" v-model="value.staffId" />
</a-form-model-item>
</a-col>
</a-row>
<a-button style="background: red;" type="danger" @click="deletelfood" v-if="foodList.length>1">
删除
</a-button>
</a-form-model>
</a-card>
<div style="float: right; margin:20px;">
<a-button @click="$router.back(-1)">
返回
</a-button>
<a-button type="primary" style="margin-left: 10px;" @click="onSubmit">
保存
</a-button>
</div>
</div>
</template>
<script>
import '@/assets/less/TableExpand.less'
// import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
name: "",
// mixins: [JeecgListMixin],
components: {
},
created() {
},
data() {
return {
form: {
staffId: '123',
},
provinceData: [
{ id: 0, name: "上架" },
{ id: 1, name: "下架" }
],
departData: [
{ id: 1, name: "素菜" },
{ id: 2, name: "荤菜" }
],
partnerList: [
{
staffId: "",
}
],
foodList: [
{
staffId: "",
}
],
rules: {
staffId: [
{ required: true, message: '请输入姓名', trigger: 'blur' },
],
},
endOpen: false,
url: {
getList: "/veri/veriDetail/delete",
},
}
},
computed: {
},
methods: {
onSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
console.log(this.form)
} else {
console.log('error submit!!');
return false;
}
});
},
addpart() {
this.partnerList.push({
staffId: "",
})
},
deletelpart() {
this.partnerList.pop()
},
addfood(){
this.foodList.push({
staffId: "",
})
},
deletelfood(){
this.foodList.pop()
}
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>