Authored by 陈峰

样式微调

<template>
<Row class="filter-item">
<Col class="label-col" span="6" v-if="label">
<Col class="label-col" span="8" v-if="label">
<label>{{label}}:</label>
</Col>
<Col class="item-col" span="18">
<Col class="item-col" :span="label ? 16 : 24">
<slot></slot>
</Col>
</Row>
... ... @@ -28,7 +28,7 @@ export default {
<style lang="scss">
.label-col {
line-height: 32px;
max-width: 100px;
max-width: 80px;
}
.item-col {
input, select, .ivu-select, .ivu-cascader {
... ...
... ... @@ -6,9 +6,9 @@ export default {
render(createElement) {
let slotChunks = _.chunk(this.$slots.default.filter(slot =>
slot.data && slot.componentOptions.propsData.label), this.col);
let submitChunk = _.chunk(this.$slots.default.filter(slot =>
slot.data && !slot.componentOptions.propsData.label), this.col);
let rowElements = _.map(_.concat(slotChunks, submitChunk), slotChunk => {
let submitSlots = this.$slots.default.filter(slot =>
slot.data && !slot.componentOptions.propsData.label);
let rowElements = _.map(slotChunks, slotChunk => {
return createElement('Row', {
class: {
'filter-row': true
... ... @@ -25,6 +25,21 @@ export default {
}));
});
_.each(submitSlots, slot => {
rowElements.push(createElement('Row', {
class: {
'filter-row': true
},
props: {
gutter: this.gutter
}
}, [createElement('Col', {
props: {
span: 24
}
}, [slot])]));
});
if (!this.noLine) {
rowElements.push(createElement('div', {
class: {
... ...
let filterFields = {
sknCode: {
label: 'SKN编码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
prodCode: {
label: '商家编码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
prodName: {
label: '商品名称',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
prodBarCode: {
label: '商品条码',
labelSpan: 6,
model: '',
holder: '',
fieldSpan: 18
},
sort: {
first: {
label: '选择类目',
holder: '选择一级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
},
second: {
label: '二级类目',
holder: '选择二级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
},
third: {
label: '三级类目',
holder: '选择三级类目',
labelSpan: 6,
fieldSpan: 18,
model: ''
}
},
brand: {
label: '选择品牌',
labelSpan: 6,
fieldSpan: 18,
model: -1
},
verifyStatus: {
label: '审核状态',
labelSpan: 6,
fieldSpan: 18,
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '下架待审核'
},
{
value: 2,
label: '下架驳回'
}
]
},
stockStatus: {
label: '库存情况',
labelSpan: 6,
fieldSpan: 18,
model: -1,
options: [
{
value: -1,
label: '全部'
},
{
value: 1,
label: '有库存'
},
{
value: 0,
label: '无库存'
}
]
}
};
let initialFields = JSON.stringify(filterFields);
let tableCols = [
{
title: '对账单号',
key: 'image',
width: 120,
align: 'center',
render (row, column, index) {
return '<cell-image :image-src="row.picImgUrl" :product-url="row.productUrl"></cell-image>';
}
},
{
title: '生成日期',
key: 'info',
align: 'center',
render(row, column, index) {
return `<cell-info
:skn="row.productSkn"
:product-name="row.productName"
:brand-name="row.brandName"
:max-name="row.maxSortName"
:middle-name="row.middleSortName"
:small-name="row.smallSortName">
</cell-info>`;
}
},
{
title: '结算周期',
key: 'price',
align: 'center',
render(row, column, index) {
row.lineIndex = index;
return `<cell-price
@click-change="editPrice(row)"
@click-save="updatePrice"
:can-change="true"
:current-row="row"
:show-change="row.changePrice"
:retail-price="row.retailPrice"
:sales-price="row.salesPrice">
</cell-price>`;
}
},
{
title: '品牌',
key: 'stock',
width: 100,
align: 'center',
},
{
title: '供应商',
key: 'shelveTime',
width: 150,
align: 'center'
},
{
title: '结算金额',
key: 'verify',
align: 'center',
render(row, column, index) {
return `${auditStatus[row.auditStatus]}`
}
},
{
title: '操作',
key: 'action',
width: 180,
align: 'center',
render: function(row, column, index) {
return `<div class="action-btn-row">
<i-button type="primary" size="small" @click="editSize(row.productSkn)">尺码维护</i-button>
<i-button v-if="row._disabled" type="primary" size="small"
@click="editProduct(${row.productSkn})" disabled>内容编辑</i-button>
<i-button v-else type="primary" size="small" @click="editProduct(${row.productSkn})">内容编辑</i-button>
</div>
<div class="btn-row-space">
<i-button v-if="row._disabled" type="error" size="small"
@click="setOffSale(${row.productSkn})" disabled>下架</i-button>
<i-button v-else type="error" size="small" @click="setOffSale(${row.productSkn})" >下架</i-button>
</div>`;
}
}
];
let tableData = [];
let pageData = {
total: 0,
current: 1
};
export {
filterFields,
initialFields,
tableCols,
tableData,
pageData
};