mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-22 19:05:54 +08:00
适配重构促销
This commit is contained in:
@@ -18,45 +18,90 @@
|
||||
</Row>
|
||||
<Row class="operation">
|
||||
<Tabs type="card" v-model="tabCurrent">
|
||||
<TabPane v-for="(tab, tabIndex) in goodsList" :key="tabIndex" :label="tab.hour" :name="tabIndex + ''">
|
||||
<Table :loading="loading" border :columns="goodsColumns" v-if="tabIndex == tabCurrent" :data="tab.list" :ref="'table' + tabIndex"
|
||||
@on-selection-change="changeSelect">
|
||||
<TabPane
|
||||
v-for="(tab, tabIndex) in goodsList"
|
||||
:key="tabIndex"
|
||||
:label="tab.hour"
|
||||
:name="tabIndex + ''"
|
||||
>
|
||||
<Table
|
||||
:loading="loading"
|
||||
border
|
||||
:columns="goodsColumns"
|
||||
v-if="tabIndex == tabCurrent"
|
||||
:data="tab.list"
|
||||
:ref="'table' + tabIndex"
|
||||
@on-selection-change="changeSelect"
|
||||
>
|
||||
<template slot-scope="{ row }" slot="originalPrice">
|
||||
|
||||
<div>{{ row.originalPrice | unitPrice("¥") }}</div>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row, index }" slot="quantity">
|
||||
<InputNumber :min="0" v-model="row.quantity" :disabled="row.promotionApplyStatus == 'PASS'" @input="
|
||||
goodsList[tabIndex].list[index].quantity = row.quantity
|
||||
" />
|
||||
<InputNumber
|
||||
:min="0"
|
||||
v-model="row.quantity"
|
||||
:disabled="row.promotionApplyStatus == 'PASS'"
|
||||
@input="goodsList[tabIndex].list[index].quantity = row.quantity"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row, index }" slot="price">
|
||||
<InputNumber :min="0" style="width:100%;" v-model="row.price" :disabled="row.promotionApplyStatus == 'PASS'"
|
||||
@input="goodsList[tabIndex].list[index].price = row.price" />
|
||||
<InputNumber
|
||||
:min="0"
|
||||
style="width: 100%"
|
||||
v-model="row.price"
|
||||
:disabled="row.promotionApplyStatus == 'PASS'"
|
||||
@input="goodsList[tabIndex].list[index].price = row.price"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="promotionApplyStatus">
|
||||
<Badge status="success" v-if="row.promotionApplyStatus == 'PASS'"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)" />
|
||||
<Badge status="blue" v-if="row.promotionApplyStatus == 'APPLY'"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)" />
|
||||
<Badge status="error" v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)" />
|
||||
<span v-if="row.promotionApplyStatus == 'REFUSE'" @click="showReason(row.failReason)"
|
||||
class="reason">(拒绝原因)</span>
|
||||
<Badge status="error" v-if="row.promotionApplyStatus == ''"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)" />
|
||||
<Badge
|
||||
status="success"
|
||||
v-if="row.promotionApplyStatus == 'PASS'"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||
/>
|
||||
<Badge
|
||||
status="blue"
|
||||
v-if="row.promotionApplyStatus == 'APPLY'"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||
/>
|
||||
<Badge
|
||||
status="error"
|
||||
v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||
/>
|
||||
<span
|
||||
v-if="row.promotionApplyStatus == 'REFUSE'"
|
||||
@click="showReason(row.failReason)"
|
||||
class="reason"
|
||||
>(拒绝原因)</span
|
||||
>
|
||||
<Badge
|
||||
status="error"
|
||||
v-if="row.promotionApplyStatus == ''"
|
||||
:text="promotionApplyStatus(row.promotionApplyStatus)"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<template slot-scope="{ row }" slot="QRCode">
|
||||
<img v-if="row.QRCode" :src="row.QRCode || '../../../assets/lili.png'" width="50px" height="50px"
|
||||
alt="" />
|
||||
<img
|
||||
v-if="row.QRCode"
|
||||
:src="row.QRCode || '../../../assets/lili.png'"
|
||||
width="50px"
|
||||
height="50px"
|
||||
alt=""
|
||||
/>
|
||||
</template>
|
||||
<template slot-scope="{ row, index }" slot="action">
|
||||
<Button type="error" v-if="promotionStatus === 'NEW'" size="small" ghost
|
||||
@click="delGoods(index, row)">删除
|
||||
<Button
|
||||
type="error"
|
||||
v-if="promotionStatus === 'NEW'"
|
||||
size="small"
|
||||
ghost
|
||||
@click="delGoods(index, row)"
|
||||
>删除
|
||||
</Button>
|
||||
</template>
|
||||
</Table>
|
||||
@@ -66,7 +111,12 @@
|
||||
|
||||
<Row class="operation">
|
||||
<Button @click="closeCurrentPage">返回</Button>
|
||||
<Button type="primary" :loading="submitLoading" v-if="promotionStatus === 'NEW'" @click="save">提交
|
||||
<Button
|
||||
type="primary"
|
||||
:loading="submitLoading"
|
||||
v-if="promotionStatus === 'NEW'"
|
||||
@click="save"
|
||||
>提交
|
||||
</Button>
|
||||
</Row>
|
||||
</Card>
|
||||
@@ -87,14 +137,14 @@ export default {
|
||||
components: {
|
||||
skuSelect,
|
||||
},
|
||||
watch:{
|
||||
tabCurrent(val){
|
||||
this.tabIndex = val
|
||||
}
|
||||
watch: {
|
||||
tabCurrent(val) {
|
||||
this.tabIndex = val;
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tabCurrent:0,
|
||||
tabCurrent: 0,
|
||||
promotionStatus: "", // 活动状态
|
||||
loading: false, // 表单加载状态
|
||||
searchForm: {
|
||||
@@ -292,10 +342,9 @@ export default {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
this.$set(this.goodsList[this.tabIndex], "list", [
|
||||
...way,
|
||||
...this.defaultGoodsList,
|
||||
// ...this.defaultGoodsList,
|
||||
]);
|
||||
// this.$nextTick(() => {
|
||||
// this.$forceUpdate();
|
||||
@@ -305,14 +354,11 @@ export default {
|
||||
// 显示商品选择器
|
||||
|
||||
this.$refs.skuSelect.open("goods");
|
||||
this.$refs.skuSelect.selectedWay = [];
|
||||
console.warn(this.goodsList[this.tabIndex].list);
|
||||
let data = this.goodsList[this.tabIndex].list;
|
||||
data.forEach((e) => {
|
||||
e.id = e.skuId;
|
||||
});
|
||||
this.$refs.skuSelect.selectedWay = data;
|
||||
console.log(this.$refs.skuSelect.selectedWay);
|
||||
this.$refs.skuSelect.goodsData = data;
|
||||
},
|
||||
unixDate(time) {
|
||||
// 处理报名截止时间
|
||||
Reference in New Issue
Block a user