|
@@ -5,15 +5,34 @@
|
|
<el-col :span="24" class="one">
|
|
<el-col :span="24" class="one">
|
|
<c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
|
|
<c-search :is_title="true" :is_back="true" @toBack="toBack"></c-search>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col :span="24" class="two">
|
|
|
|
- <data-form :fields="fields" :form="form" :rules="{}" @save="toSave">
|
|
|
|
- <template #type>
|
|
|
|
- <el-option v-for="i in typeList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
|
|
|
|
- </template>
|
|
|
|
- <template #is_use>
|
|
|
|
- <el-option v-for="i in is_useList" :key="i.dict_value" :label="i.dict_label" :value="i.dict_value"></el-option>
|
|
|
|
- </template>
|
|
|
|
- </data-form>
|
|
|
|
|
|
+ <el-col :span="12" class="two">
|
|
|
|
+ <el-col :span="24" class="two_1"><i class="el-icon-s-shop"></i>{{ shopInfo.name }}</el-col>
|
|
|
|
+ <el-col :span="24" class="two_2">
|
|
|
|
+ <el-col :span="24" class="left">桌号:{{ form.table_num }}</el-col>
|
|
|
|
+ <el-col :span="24" class="right">人数:{{ form.num }}人</el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="two_3" v-for="(item, index) in form.list" :key="index">
|
|
|
|
+ <el-col :span="8" class="img">
|
|
|
|
+ <el-image :src="item.file && item.file.length > 0 ? item.file[0].url : ''" fit="fill"></el-image>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="8" class="name">
|
|
|
|
+ <el-col :span="24" class="name_1">{{ item.name }} </el-col>
|
|
|
|
+ <el-col :span="24" class="name_2"> {{ item.spec }}</el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="7" class="mtwoy">
|
|
|
|
+ <el-col :span="24" class="mtwoy_1">¥{{ item.price }} </el-col>
|
|
|
|
+ <el-col :span="24" class="mtwoy_2"> ×{{ item.num }}</el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="two_4">
|
|
|
|
+ <el-col :span="12" class="left">餐位费:×{{ form.num }}</el-col>
|
|
|
|
+ <el-col :span="12" class="right">¥{{ form.money_num }}</el-col>
|
|
|
|
+ </el-col>
|
|
|
|
+ <el-col :span="24" class="two_5"> 合计:¥{{ form.money }} </el-col>
|
|
|
|
+ <el-col :span="24" class="two_6">
|
|
|
|
+ <el-col :span="12" class="left">下单时间:{{ form.time }}</el-col>
|
|
|
|
+ <el-col :span="12" class="right">类型:{{ form.type_name }}</el-col>
|
|
|
|
+ </el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -24,23 +43,18 @@
|
|
import { is_use, order_type } from '@common/src/layout/site';
|
|
import { is_use, order_type } from '@common/src/layout/site';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
const { mapActions } = createNamespacedHelpers('order');
|
|
const { mapActions } = createNamespacedHelpers('order');
|
|
|
|
+const { mapActions: shop } = createNamespacedHelpers('shop');
|
|
|
|
+const { mapActions: table } = createNamespacedHelpers('table');
|
|
export default {
|
|
export default {
|
|
name: 'add',
|
|
name: 'add',
|
|
props: {},
|
|
props: {},
|
|
- components: {},
|
|
|
|
|
|
+ comptwonts: {},
|
|
data: function () {
|
|
data: function () {
|
|
return {
|
|
return {
|
|
- fields: [
|
|
|
|
- { label: '节目类型', model: 'type', type: 'select' },
|
|
|
|
- { label: '名称', model: 'name' },
|
|
|
|
- { label: '简介', model: 'brief', type: 'textarea' },
|
|
|
|
- { label: '视频流', model: 'path' },
|
|
|
|
- { label: '排序', model: 'sort', type: 'number' },
|
|
|
|
- { label: '是否启用', model: 'is_use', type: 'select' },
|
|
|
|
- ],
|
|
|
|
form: {},
|
|
form: {},
|
|
|
|
+ shopInfo: {},
|
|
is_useList: is_use,
|
|
is_useList: is_use,
|
|
- // 节目类型
|
|
|
|
|
|
+ // 订单类型
|
|
typeList: order_type,
|
|
typeList: order_type,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -49,23 +63,27 @@ export default {
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
...mapActions(['fetch', 'create', 'update']),
|
|
...mapActions(['fetch', 'create', 'update']),
|
|
|
|
+ ...shop({ sFetch: 'fetch' }),
|
|
|
|
+ ...table({ tFetch: 'fetch' }),
|
|
async search() {
|
|
async search() {
|
|
if (this.id) {
|
|
if (this.id) {
|
|
- let res = await this.fetch(this.id);
|
|
|
|
|
|
+ let res;
|
|
|
|
+ res = await this.fetch(this.id);
|
|
if (this.$checkRes(res)) {
|
|
if (this.$checkRes(res)) {
|
|
- this.$set(this, `form`, res.data);
|
|
|
|
|
|
+ let table = await this.tFetch(res.data.table);
|
|
|
|
+ if (this.$checkRes(table)) {
|
|
|
|
+ let data = this.typeList.find((r) => r.dict_value == res.data.type);
|
|
|
|
+ if (data) res.data.type_name = data.dict_label;
|
|
|
|
+ res.data.table_num = table.data.name;
|
|
|
|
+ this.$set(this, `form`, res.data);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ res = await this.sFetch(this.user.shop);
|
|
|
|
+ if (this.$checkRes(res)) {
|
|
|
|
+ this.$set(this, `shopInfo`, res.data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
- // 保存信息
|
|
|
|
- async toSave({ data }) {
|
|
|
|
- let res;
|
|
|
|
- if (data.id) res = await this.update(data);
|
|
|
|
- else res = await this.create(data);
|
|
|
|
- if (this.$checkRes(res, `维护信息成功`, res.errmsg)) this.toBack();
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
// 返回
|
|
// 返回
|
|
toBack() {
|
|
toBack() {
|
|
window.history.go('-1');
|
|
window.history.go('-1');
|
|
@@ -90,4 +108,72 @@ export default {
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+.main {
|
|
|
|
+ display: flex;
|
|
|
|
+ flex-direction: column;
|
|
|
|
+ align-items: center;
|
|
|
|
+ .two {
|
|
|
|
+ padding: 1vw;
|
|
|
|
+ border: 1px solid #858585;
|
|
|
|
+ border-radius: 1vw;
|
|
|
|
+ .two_1 {
|
|
|
|
+ padding: 0.5vw 0;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
|
+ }
|
|
|
|
+ .two_2 {
|
|
|
|
+ display: flex;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ padding: 0.5vw 0;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
|
+ .right {
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .two_3 {
|
|
|
|
+ padding: 0.5vw 0;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
|
+ .name {
|
|
|
|
+ margin: 0 0 0 1vw;
|
|
|
|
+ .name_2 {
|
|
|
|
+ color: #858585;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .mtwoy {
|
|
|
|
+ text-align: right;
|
|
|
|
+ .mtwoy_1 {
|
|
|
|
+ color: red;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .two_4 {
|
|
|
|
+ padding: 0.5vw 0;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
|
+ .right {
|
|
|
|
+ color: red;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .two_5 {
|
|
|
|
+ padding: 0.5vw 0;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ text-align: right;
|
|
|
|
+ color: red;
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
|
+ }
|
|
|
|
+ .two_6 {
|
|
|
|
+ padding: 0.5vw 0;
|
|
|
|
+ font-size: 18px;
|
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
|
+ .right {
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|