Commit c7c123e1 by chenwq

限制

1 parent c3e5064c
......@@ -19,10 +19,38 @@
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<GLTable v-loading="loading" v-show="activeName == 'service'" ref="serviceRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'cash'" ref="cashRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'discount'" ref="discountRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'exchange'" ref="exchangeRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable"></GLTable>
<GLTable v-loading="loading" v-show="activeName == 'service'" ref="serviceRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'cash'" ref="cashRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType" slot-scope="scope">
<span>{{ toCashRestrictLabelText(scope.scope) }}</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'discount'" ref="discountRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType">
<span>-</span>
</span>
</GLTable>
<GLTable v-loading="loading" v-show="activeName == 'exchange'" ref="exchangeRef" :tableData="giftList" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList" @selectionTable="handleSelectionTable">
<span slot="effectiveType" slot-scope="scope">
<span>{{ toLabelText(scope.scope) }}</span>
</span>
<span slot="useType">
<span>-</span>
</span>
</GLTable>
</div>
</div>
<div class="selected-list">
......@@ -109,11 +137,13 @@ export default {
},
{
label: '有效期',
prop: 'followerTypeName'
prop: 'effectiveType',
addHtml: 'effectiveType'
},
{
label: '使用原则',
prop: 'followerTypeName'
prop: 'useType',
addHtml: 'useType'
},
{
label: '剩余库存',
......@@ -206,6 +236,36 @@ export default {
this.getList(true)
},
toLabelText(row) {
switch (row.effectiveType) {
case 3:
return '无有效期'
case 2:
return row.effectiveStartTime ? row.effectiveStartTime.split(' ')[0] + '-' + row.effectiveEndTime.split(' ')[0] : ''
case 1:
return row.effectiveDays + '天'
}
},
toRestrictLabelText(row) {
switch (row.useType) {
case 0:
return '无限制'
case 1:
return '有效期内可使用' + row.useAmount + '次'
case 2:
return '每' + row.useLimitDays + '天可以使用' + row.useAmount + '次'
}
},
toCashRestrictLabelText(row) {
switch (row.useType) {
case 1:
return '无限制'
case 2:
return '订单满' + row.useAmount + '元可用'
}
},
recoverySelected() {
if (this.selectedGiftList[this.activeName].list && this.selectedGiftList[this.activeName].list.length) {
this.selectedGiftList[this.activeName].list.forEach(row => {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!