Commit 69160f37 by 陈宁

# 商品信息查询 开发

parent 46ec5aa1
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</Col> </Col>
<Col span="12"> <Col span="12">
<FormItem label="时间"> <FormItem label="时间">
<TimePicker :value="time" format="HH:mm:ss" placeholder="时间" style="width: 168px"></TimePicker> <TimePicker v-model="time" format="HH:mm:ss" placeholder="时间" style="width: 168px"></TimePicker>
</FormItem> </FormItem>
</Col> </Col>
<Col span="12"> <Col span="12">
...@@ -167,7 +167,7 @@ export default { ...@@ -167,7 +167,7 @@ export default {
loadingSearch: false, loadingSearch: false,
channel: 'delivery', channel: 'delivery',
env: 'prod', env: 'prod',
time: '12:34:56', time: '',
couponCode: '385438604009450,527577357365398,QQQ', couponCode: '385438604009450,527577357365398,QQQ',
storeId: '99998', storeId: '99998',
metaData: [], metaData: [],
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
</Col> </Col>
<Col span="12"> <Col span="12">
<FormItem label="时间"> <FormItem label="时间">
<TimePicker :value="time" format="HH:mm:ss" placeholder="时间" style="width: 168px"></TimePicker> <TimePicker v-model="time" format="HH:mm:ss" placeholder="时间" style="width: 168px"></TimePicker>
</FormItem> </FormItem>
</Col> </Col>
<Col span="12"> <Col span="12">
...@@ -68,6 +68,7 @@ ...@@ -68,6 +68,7 @@
<Table <Table
v-if="item.product.data" v-if="item.product.data"
border border
disabled-hover
size="small" size="small"
:columns="colCoupons" :columns="colCoupons"
:data="item.product.data.data" :data="item.product.data.data"
...@@ -102,12 +103,12 @@ ...@@ -102,12 +103,12 @@
<div v-for="pg in row.val" :key="pg.name" style="margin: 5px 0px;"> <div v-for="pg in row.val" :key="pg.name" style="margin: 5px 0px;">
<List border size="small"> <List border size="small">
<ListItem> <ListItem>
<Tag color="blue">#商品组名: {{ pg.name }}</Tag> <Tag color="purple">商品组名: {{ pg.name }}</Tag>
<Tag color="blue">#商品组ID: {{ pg.pgid }}</Tag> <Tag color="purple">商品组ID: {{ pg.pgid }}</Tag>
<Tag color="blue">#是否必选: {{ pg.must }}</Tag> <Tag color="purple">是否必选: {{ pg.must }}</Tag>
<Tag color="blue">#最大选择数量: {{ pg.maxNumber }}</Tag> <Tag color="purple">最大选择数量: {{ pg.maxNumber }}</Tag>
<Tag color="blue">#备注: {{ pg.remark }}</Tag> <Tag color="purple">备注: {{ pg.remark }}</Tag>
<Tag color="blue">#类型: {{ pg.type }}</Tag> <Tag color="purple">类型: {{ pg.type }}</Tag>
</ListItem> </ListItem>
<ListItem <ListItem
v-for="product in buildGroupProductData(pg.groupDetail)" v-for="product in buildGroupProductData(pg.groupDetail)"
...@@ -169,6 +170,82 @@ ...@@ -169,6 +170,82 @@
</List> </List>
</div> </div>
</div> </div>
<div v-else-if="row.field === 'productSpecification'">
<List v-if="row.val.length > 0" border size="small" style="margin: 5px 0px;">
<ListItem
v-for="p in buildSpecificationProductData(row.val)"
:key="p.productId"
>
<Table
border
size="small"
:columns="colCoupons"
:data="p.data"
:show-header="false"
>
<template slot-scope="{ row }" slot="name">
<div class="xxx">
<strong>{{ row.name }}</strong>
<Tag color="geekblue">{{row.field}}</Tag>
</div>
</template>
<template slot-scope="{ row }" slot="val">
<div v-if="row.field === 'customizes'">
<div
v-for="customize in row.val"
:key="customize.id"
style="margin: 5px 0px;"
>
<List border size="small">
<ListItem>
<Tag color="blue">{{ customize.group }}</Tag>
</ListItem>
<ListItem v-for="spec in customize.spec" :key="spec.code">
<Tag color="geekblue">{{ spec.name }} - {{ spec.code }}</Tag>
<br />
<Table
border
size="small"
:columns="colGrills"
:data="spec.grill"
></Table>
</ListItem>
</List>
</div>
</div>
<div v-else>
{{ row.val }}
<Tooltip
v-if="row.descriptor"
max-width="200"
placement="right"
transfer
>
<span style="color:#ed4014">({{row.descriptor.memo}})</span>
<Icon type="md-information-circle" />
<div slot="content">{{row.descriptor.desc}}</div>
</Tooltip>
</div>
</template>
</Table>
</ListItem>
</List>
</div>
<div v-else-if="row.field === 'productExendsions'">
<Table
v-if="row.val.props.length > 0"
border
size="small"
:columns="colExtendsions"
:data="row.val.props"
style="margin: 5px 0px;"
>
<template slot-scope="{ row }" slot="propKey">
<Tag>{{row.propCode}}</Tag>
<Tag>{{row.propDetailName}}</Tag>
</template>
</Table>
</div>
<div v-else> <div v-else>
{{ row.val }} {{ row.val }}
<Tooltip v-if="row.descriptor" max-width="200" placement="right" transfer> <Tooltip v-if="row.descriptor" max-width="200" placement="right" transfer>
...@@ -213,8 +290,8 @@ export default { ...@@ -213,8 +290,8 @@ export default {
loadingSearch: false, loadingSearch: false,
channel: 'delivery', channel: 'delivery',
env: 'dev', env: 'dev',
time: '12:34:56', time: '',
productId: '123470098,123472924,123471941,123472439,123470930,123', productId: '123473149,123470098,123472924,123471941,123472439,123470930,123',
storeId: '1450217', storeId: '1450217',
metaData: [], metaData: [],
vData: [], vData: [],
...@@ -225,32 +302,22 @@ export default { ...@@ -225,32 +302,22 @@ export default {
model: 'text/javascript', model: 'text/javascript',
theme: 'the-matrix' theme: 'the-matrix'
}, },
colCoupons: [{ colCoupons: [
slot: 'name', { slot: 'name', maxWidth: 280 },
maxWidth: 250 { slot: 'val' }
}, { ],
slot: 'val'
}],
colGrills: [ colGrills: [
{ { title: 'des', key: 'des' },
title: 'des', { title: 'modifier', key: 'modifier' },
key: 'des' { title: 'pid', key: 'pid' },
}, { { title: 'price', key: 'price' },
title: 'modifier', { title: 'qty', key: 'qty' },
key: 'modifier' { title: 'selected', key: 'selected' }
}, { ],
title: 'pid', colExtendsions: [
key: 'pid' { title: '名称', key: 'propDetailDesc', maxWidth: 150 },
}, { { title: '键', slot: 'propKey' },
title: 'price', { title: '值', key: 'value' }
key: 'price'
}, {
title: 'qty',
key: 'qty'
}, {
title: 'selected',
key: 'selected'
}
] ]
} }
}, },
...@@ -288,20 +355,24 @@ export default { ...@@ -288,20 +355,24 @@ export default {
bindData (data) { bindData (data) {
const products = [] const products = []
const responseProducts = JSON.parse(data[0].responseContent) const responseProducts = JSON.parse(data[0].responseContent)
const responseExendsions = JSON.parse(data[1].responseContent)
responseProducts.data.products.forEach(p => { responseProducts.data.products.forEach(p => {
const pExendsions = this._.find(responseExendsions.data, { productId: parseInt(p.pid) })
const data = [ const data = [
{ name: '编号', field: 'pid', val: p.pid }, { name: '编号', field: 'pid', val: p.pid },
{ name: '名称', field: 'name', val: p.name }, { name: '名称', field: 'name', val: p.name },
{ name: 'customerCode', field: 'customerCode', val: p.customerCode }, { name: 'customerCode', field: 'customerCode', val: p.customerCode },
{ name: '业务类型', field: 'businessType', val: p.businessType }, { name: '业务类型', field: 'businessType', val: p.businessType },
{ name: '价格', field: 'finalPrice', val: p.finalPrice }, { name: '价格(单位: 分)', field: 'finalPrice', val: p.finalPrice },
{ name: '外带价格', field: 'finalPriceTakeout', val: p.finalPriceTakeout }, { name: '外带价格(单位: 分)', field: 'finalPriceTakeout', val: p.finalPriceTakeout },
{ name: '原价', field: 'originalPrice', val: p.originalPrice }, { name: '原价(单位: 分)', field: 'originalPrice', val: p.originalPrice },
{ name: '外带原价', field: 'originalPriceTakeout', val: p.originalPriceTakeout }, { name: '外带原价(单位: 分)', field: 'originalPriceTakeout', val: p.originalPriceTakeout },
{ name: '状态', field: 'status', val: p.status }, { name: '状态', field: 'status', val: p.status },
{ name: '菜品类型', field: 'type', val: p.type }, { name: '菜品类型', field: 'type', val: p.type },
{ name: '子品信息', field: 'productGroupList', val: p.productGroupList }, { name: '特制信息', field: 'customizes', val: p.customizes },
{ name: '特制信息', field: 'customizes', val: p.customizes } { name: '套餐信息', field: 'productGroupList', val: p.productGroupList },
{ name: '多规格信息', field: 'productSpecification', val: p.productSpecification },
{ name: '扩展信息', field: 'productExendsions', val: pExendsions }
] ]
products.push({ id: p.pid, name: p.name, data: data }) products.push({ id: p.pid, name: p.name, data: data })
}) })
...@@ -355,10 +426,34 @@ export default { ...@@ -355,10 +426,34 @@ export default {
{ name: '编号', field: 'productId', val: p.productId }, { name: '编号', field: 'productId', val: p.productId },
{ name: '名称', field: 'productName', val: p.productName }, { name: '名称', field: 'productName', val: p.productName },
{ name: 'customerCode', field: 'customerCode', val: p.customerCode }, { name: 'customerCode', field: 'customerCode', val: p.customerCode },
{ name: '价格', field: 'productFinalPrice', val: p.productFinalPrice }, { name: '价格(单位: 分)', field: 'productFinalPrice', val: p.productFinalPrice },
{ name: '外带价格', field: 'productFinalPriceTakeout', val: p.productFinalPriceTakeout }, { name: '外带价格(单位: 分)', field: 'productFinalPriceTakeout', val: p.productFinalPriceTakeout },
{ name: '原价', field: 'productPrice', val: p.productPrice }, { name: '原价(单位: 分)', field: 'productPrice', val: p.productPrice },
{ name: '外带原价', field: 'productPriceTakeout', val: p.productPriceTakeout }, { name: '外带原价(单位: 分)', field: 'productPriceTakeout', val: p.productPriceTakeout },
{ name: '状态', field: 'status', val: p.status },
{ name: '特制信息', field: 'customizes', val: p.customizes }
]
products.push({ id: p.pid, name: p.name, data: data })
})
products.forEach(p => {
p.data.forEach(d => {
d.descriptor = this.buildProductDescriptor(d.field, d.val)
})
})
return products
},
buildSpecificationProductData (data) {
const products = []
data.forEach(p => {
const data = [
{ name: '编号', field: 'productId', val: p.productId },
{ name: 'customerCode', field: 'customerCode', val: p.customerCode },
{ name: '类型', field: 'productType', val: p.productType },
{ name: '价格(单位: 分)', field: 'finalPrice', val: p.finalPrice },
{ name: '外带价格(单位: 分)', field: 'finalPriceTakeout', val: p.finalPriceTakeout },
{ name: '原价(单位: 分)', field: 'originalPrice', val: p.originalPrice },
{ name: '外带原价(单位: 分)', field: 'originalPriceTakeout', val: p.originalPriceTakeout },
{ name: '状态', field: 'status', val: p.status }, { name: '状态', field: 'status', val: p.status },
{ name: '特制信息', field: 'customizes', val: p.customizes } { name: '特制信息', field: 'customizes', val: p.customizes }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment