v-viewer转化成cdn文件,优化包
This commit is contained in:
@@ -4,74 +4,74 @@
|
||||
<ai-search-bar>
|
||||
<template slot="left">
|
||||
<ai-select
|
||||
v-model="search.goodsType"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择商品类型"
|
||||
:selectList="dict.getDict('integralSGType')">
|
||||
v-model="search.goodsType"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择商品类型"
|
||||
:selectList="dict.getDict('integralSGType')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择订单状态"
|
||||
:selectList="dict.getDict('integralSGOStatus')">
|
||||
v-model="search.status"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择订单状态"
|
||||
:selectList="dict.getDict('integralSGOStatus')">
|
||||
</ai-select>
|
||||
<el-date-picker
|
||||
v-model="search.startTime"
|
||||
type="date"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择订单开始日期"
|
||||
@change="search.current = 1, getList()">
|
||||
v-model="search.startTime"
|
||||
type="date"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择订单开始日期"
|
||||
@change="search.current = 1, getList()">
|
||||
</el-date-picker>
|
||||
<el-date-picker
|
||||
v-model="search.endTime"
|
||||
type="date"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择订单结束日期"
|
||||
@change="search.current = 1, getList()">
|
||||
v-model="search.endTime"
|
||||
type="date"
|
||||
size="small"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择订单结束日期"
|
||||
@change="search.current = 1, getList()">
|
||||
</el-date-picker>
|
||||
<ai-select
|
||||
v-model="search.agentOrder"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="是否代兑换"
|
||||
:selectList="dict.getDict('yesOrNo')">
|
||||
v-model="search.agentOrder"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="是否代兑换"
|
||||
:selectList="dict.getDict('yesOrNo')">
|
||||
</ai-select>
|
||||
<ai-download
|
||||
v-if="permissions('app_appintegralsupermarketorder_export')"
|
||||
:instance="instance"
|
||||
url="/app/appintegralsupermarketorder/export"
|
||||
:params="search"
|
||||
fileName="订单列表"
|
||||
:disabled="tableData.length == 0">
|
||||
v-if="permissions('app_appintegralsupermarketorder_export')"
|
||||
:instance="instance"
|
||||
url="/app/appintegralsupermarketorder/export"
|
||||
:params="search"
|
||||
fileName="订单列表"
|
||||
:disabled="tableData.length == 0">
|
||||
</ai-download>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="search.goodsTitle"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入商品名称、兑换人"
|
||||
clearable
|
||||
@clear="search.current = 1, search.goodsTitle = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
v-model="search.goodsTitle"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入商品名称、兑换人"
|
||||
clearable
|
||||
@clear="search.current = 1, search.goodsTitle = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
style="margin-top: 8px;"
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
style="margin-top: 8px;"
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column
|
||||
label="商品"
|
||||
slot="goods"
|
||||
align="left"
|
||||
width="350">
|
||||
label="商品"
|
||||
slot="goods"
|
||||
align="left"
|
||||
width="350">
|
||||
<template v-slot="{ row }">
|
||||
<div class="goods">
|
||||
<div class="img-content">
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
<!-- <span class="type type0" v-if="row.goodsType === '0'">积分兑换</span>
|
||||
<span class="type type1" v-else>京东低价商品</span> -->
|
||||
<span class="type" :class="`type${row.typeText}`">{{dict.getLabel('integralSGTypeText', row.typeText)}}</span>
|
||||
<span class="type" :class="`type${row.typeText}`">{{ dict.getLabel('integralSGTypeText', row.typeText) }}</span>
|
||||
</div>
|
||||
<p>{{ row.goodsTitle }}</p>
|
||||
</div>
|
||||
@@ -96,12 +96,12 @@
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
<ai-dialog
|
||||
title="订单核销"
|
||||
:visible.sync="isShow"
|
||||
:destroyOnClose="true"
|
||||
width="650px"
|
||||
@onConfirm="onConfirm"
|
||||
@close="form.verificationCode = '', id = ''">
|
||||
title="订单核销"
|
||||
:visible.sync="isShow"
|
||||
:destroyOnClose="true"
|
||||
width="650px"
|
||||
@onConfirm="onConfirm"
|
||||
@close="form.verificationCode = '', id = ''">
|
||||
<el-form style="height: 200px" class="ai-form" ref="form" :model="form" label-width="120px">
|
||||
<el-form-item label="核销码" style="width: 100%" prop="verificationCode" :rules="[{required: true, message: '请输入核销码', trigger: 'blur'}]">
|
||||
<el-input v-model="form.verificationCode" placeholder="请输入核销码" size="small"></el-input>
|
||||
@@ -113,153 +113,154 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Viewer from 'v-viewer'
|
||||
import Vue from 'vue'
|
||||
Vue.use(Viewer)
|
||||
export default {
|
||||
name: 'ResidentList',
|
||||
export default {
|
||||
name: 'ResidentList',
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
},
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function,
|
||||
areaId: String,
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
goodsType: '',
|
||||
goodsTitle: '',
|
||||
current: 1,
|
||||
status: '',
|
||||
size: 10,
|
||||
startTime: '',
|
||||
type: 1,
|
||||
endTime: '',
|
||||
agentOrder: ''
|
||||
},
|
||||
isShow: false,
|
||||
form: {
|
||||
verificationCode: ''
|
||||
},
|
||||
id: '',
|
||||
total: 0,
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{ prop: 'goodsSerialNumber', label: '商品ID', align: 'left' },
|
||||
{ slot: 'goods', align: 'center' },
|
||||
{ prop: 'goodsType', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
|
||||
{ prop: 'quantity', label: '数量', align: 'center', format: v => `${v}` },
|
||||
{ prop: 'usedIntegral', label: '消耗积分', align: 'center' },
|
||||
{ prop: 'payMoney', label: '兑换后再付', align: 'center' },
|
||||
{ prop: 'integralUserName', label: '兑换人', align: 'center' },
|
||||
{ prop: 'agentOrder', label: '是否代兑换', align: 'center', format: v => this.dict.getLabel('yesOrNo', v) },
|
||||
{ prop: 'createTime', width: 150, label: '创建时间', align: 'center' },
|
||||
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGOStatus', v) }
|
||||
]
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
goodsType: '',
|
||||
goodsTitle: '',
|
||||
current: 1,
|
||||
status: '',
|
||||
size: 10,
|
||||
startTime: '',
|
||||
type: 1,
|
||||
endTime: '',
|
||||
agentOrder: ''
|
||||
},
|
||||
isShow: false,
|
||||
form: {
|
||||
verificationCode: ''
|
||||
},
|
||||
id: '',
|
||||
total: 0,
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{prop: 'goodsSerialNumber', label: '商品ID', align: 'left'},
|
||||
{slot: 'goods', align: 'center'},
|
||||
{prop: 'goodsType', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v)},
|
||||
{prop: 'quantity', label: '数量', align: 'center', format: v => `${v}`},
|
||||
{prop: 'usedIntegral', label: '消耗积分', align: 'center'},
|
||||
{prop: 'payMoney', label: '兑换后再付', align: 'center'},
|
||||
{prop: 'integralUserName', label: '兑换人', align: 'center'},
|
||||
{prop: 'agentOrder', label: '是否代兑换', align: 'center', format: v => this.dict.getLabel('yesOrNo', v)},
|
||||
{prop: 'createTime', width: 150, label: '创建时间', align: 'center'},
|
||||
{prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGOStatus', v)}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
},
|
||||
computed: {},
|
||||
|
||||
created () {
|
||||
this.dict.load('integralSGType', 'integralSGOStatus', 'yesOrNo', 'integralSGTypeText').then(() => {
|
||||
this.getList()
|
||||
created() {
|
||||
this.dict.load('integralSGType', 'integralSGOStatus', 'yesOrNo', 'integralSGTypeText').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
girdCode: this.areaId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.typeText = item.goodsType == 0 ? 0 : 1
|
||||
})
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/list`, null, {
|
||||
params: {
|
||||
...this.search,
|
||||
girdCode: this.areaId
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.typeText = item.goodsType == 0 ? 0 : 1
|
||||
})
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
onConfirm () {
|
||||
this.$refs.form.validate((valid)=> {
|
||||
if(valid) {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/examine`, null, {
|
||||
params: {
|
||||
...this.form,
|
||||
id: this.id
|
||||
}
|
||||
}).then(res => {
|
||||
if(res.code == 0) {
|
||||
this.isShow = false
|
||||
this.getList()
|
||||
this.$message.success('核销成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toDetail (id) {
|
||||
this.$emit('change', {
|
||||
type: 'ResidentDetail',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel (id) {
|
||||
this.$confirm('确定取消该订单吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/cancel?id=${id}`).then(res => {
|
||||
onConfirm() {
|
||||
this.$refs.form.validate((valid) => {
|
||||
if (valid) {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/examine`, null, {
|
||||
params: {
|
||||
...this.form,
|
||||
id: this.id
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('取消成功!')
|
||||
this.isShow = false
|
||||
this.getList()
|
||||
this.$message.success('核销成功')
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toDetail(id) {
|
||||
this.$emit('change', {
|
||||
type: 'ResidentDetail',
|
||||
params: {
|
||||
id
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
cancel(id) {
|
||||
this.$confirm('确定取消该订单吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketorder/cancel?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('取消成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.GoodsList {
|
||||
.goods {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.img-content {
|
||||
position: relative;
|
||||
margin-right: 8px;
|
||||
img {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.type {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
font-size: 12px;
|
||||
.GoodsList {
|
||||
.goods {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.img-content {
|
||||
position: relative;
|
||||
margin-right: 8px;
|
||||
|
||||
img {
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
z-index: 999;
|
||||
}
|
||||
.type1 {
|
||||
background-color: #E64E39;
|
||||
}
|
||||
.type0 {
|
||||
background-color: #FF6900;
|
||||
height: 120px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.type {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
font-size: 12px;
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
z-index: 999;
|
||||
}
|
||||
|
||||
.type1 {
|
||||
background-color: #E64E39;
|
||||
}
|
||||
|
||||
.type0 {
|
||||
background-color: #FF6900;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -5,44 +5,44 @@
|
||||
<template slot="left">
|
||||
<el-button type="primary" icon="iconfont iconAdd" @click="toAdd('')">添加</el-button>
|
||||
<ai-select
|
||||
v-model="search.type"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择商品类型"
|
||||
:selectList="dict.getDict('integralSGType')">
|
||||
v-model="search.type"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择商品类型"
|
||||
:selectList="dict.getDict('integralSGType')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.status"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择类型"
|
||||
:selectList="dict.getDict('integralSGStatus')">
|
||||
v-model="search.status"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择类型"
|
||||
:selectList="dict.getDict('integralSGStatus')">
|
||||
</ai-select>
|
||||
</template>
|
||||
<template slot="right">
|
||||
<el-input
|
||||
v-model="search.title"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
@clear="search.current = 1, search.title = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
v-model="search.title"
|
||||
class="search-input"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
placeholder="请输入商品名称"
|
||||
clearable
|
||||
@clear="search.current = 1, search.title = '', getList()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-table
|
||||
style="margin-top: 8px;"
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
style="margin-top: 8px;"
|
||||
:tableData="tableData"
|
||||
:col-configs="colConfigs"
|
||||
:total="total"
|
||||
:current.sync="search.current"
|
||||
:size.sync="search.size"
|
||||
@getList="getList">
|
||||
<el-table-column
|
||||
label="商品"
|
||||
slot="goods"
|
||||
align="left"
|
||||
width="450">
|
||||
label="商品"
|
||||
slot="goods"
|
||||
align="left"
|
||||
width="450">
|
||||
<template v-slot="{ row }">
|
||||
<div class="goods">
|
||||
<!-- <ai-uploader class="upload"
|
||||
@@ -56,7 +56,7 @@
|
||||
<img :src="row.picUrl" alt="" v-viewer>
|
||||
<!-- <span class="type type0" v-if="row.type === '0'">积分兑换</span>
|
||||
<span class="type type1" v-else>京东低价商品</span> -->
|
||||
<span class="type" :class="`type${row.typeText}`">{{dict.getLabel('integralSGTypeText', row.typeText)}}</span>
|
||||
<span class="type" :class="`type${row.typeText}`">{{ dict.getLabel('integralSGTypeText', row.typeText) }}</span>
|
||||
</div>
|
||||
|
||||
<p>{{ row.title }}</p>
|
||||
@@ -79,151 +79,151 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Viewer from 'v-viewer'
|
||||
import Vue from 'vue'
|
||||
Vue.use(Viewer)
|
||||
export default {
|
||||
name: 'GoodsList',
|
||||
export default {
|
||||
name: 'GoodsList',
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object,
|
||||
permissions: Function
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
type: '',
|
||||
title: '',
|
||||
current: 1,
|
||||
status: '',
|
||||
size: 10,
|
||||
},
|
||||
total: 0,
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{prop: 'serialNumber', label: '商品ID', align: 'left'},
|
||||
{slot: 'goods', align: 'center'},
|
||||
{prop: 'type', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v)},
|
||||
{prop: 'onlineTime', label: '上架时间', align: 'center'},
|
||||
{prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGStatus', v)}
|
||||
],
|
||||
userList: []
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
type: '',
|
||||
title: '',
|
||||
current: 1,
|
||||
status: '',
|
||||
size: 10,
|
||||
},
|
||||
total: 0,
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{ prop: 'serialNumber', label: '商品ID', align: 'left' },
|
||||
{ slot: 'goods', align: 'center' },
|
||||
{ prop: 'type', label: '商品类型', align: 'center', format: v => this.dict.getLabel('integralSGType', v) },
|
||||
{ prop: 'onlineTime', label: '上架时间', align: 'center' },
|
||||
{ prop: 'status', label: '状态', align: 'center', format: v => this.dict.getLabel('integralSGStatus', v) }
|
||||
],
|
||||
userList: []
|
||||
}
|
||||
},
|
||||
computed: {},
|
||||
|
||||
computed: {
|
||||
},
|
||||
created() {
|
||||
this.dict.load('integralSGType', 'integralSGStatus', 'integralSGTypeText').then(() => {
|
||||
this.getList()
|
||||
})
|
||||
},
|
||||
|
||||
created () {
|
||||
this.dict.load('integralSGType', 'integralSGStatus', 'integralSGTypeText').then(() => {
|
||||
this.getList()
|
||||
methods: {
|
||||
getList() {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then((res) => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.typeText = item.type == 0 ? 0 : 1
|
||||
})
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList () {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/list`, null, {
|
||||
params: {
|
||||
...this.search
|
||||
}
|
||||
}).then((res) => {
|
||||
onAreaChange() {
|
||||
this.search.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getTableData()
|
||||
})
|
||||
},
|
||||
|
||||
toAdd(id) {
|
||||
this.$emit('change', {
|
||||
type: 'AddGoods',
|
||||
params: {
|
||||
id: id || ''
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
copy(url) {
|
||||
let oInput = document.createElement('input')
|
||||
oInput.value = url
|
||||
document.body.appendChild(oInput)
|
||||
oInput.select()
|
||||
document.execCommand('Copy')
|
||||
this.$message({
|
||||
message: '已复制',
|
||||
type: 'success'
|
||||
})
|
||||
oInput.remove()
|
||||
},
|
||||
|
||||
remove(id) {
|
||||
this.$confirm('确定删除该商品吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/delete?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
res.data.records.map((item) => {
|
||||
item.typeText = item.type == 0 ? 0 : 1
|
||||
})
|
||||
this.tableData = res.data.records
|
||||
this.total = res.data.total
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
onAreaChange () {
|
||||
this.search.current = 1
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.getTableData()
|
||||
})
|
||||
},
|
||||
|
||||
toAdd (id) {
|
||||
this.$emit('change', {
|
||||
type: 'AddGoods',
|
||||
params: {
|
||||
id: id || ''
|
||||
changeStatus(row) {
|
||||
this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/online?id=${row.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
copy (url) {
|
||||
let oInput = document.createElement('input')
|
||||
oInput.value = url
|
||||
document.body.appendChild(oInput)
|
||||
oInput.select()
|
||||
document.execCommand('Copy')
|
||||
this.$message({
|
||||
message: '已复制',
|
||||
type: 'success'
|
||||
})
|
||||
oInput.remove()
|
||||
},
|
||||
|
||||
remove (id) {
|
||||
this.$confirm('确定删除该商品吗?').then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/delete?id=${id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success('删除成功!')
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
changeStatus (row) {
|
||||
this.$confirm(`确定${row.status === '0' ? '上架' : '下架'}该商品?`).then(() => {
|
||||
this.instance.post(`/app/appintegralsupermarketgoods/online?id=${row.id}`).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.$message.success(`${row.status === '0' ? '上架' : '下架'}成功`)
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.GoodsList {
|
||||
.goods {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.img-content {
|
||||
position: relative;
|
||||
margin-right: 8px;
|
||||
img {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.type {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
.GoodsList {
|
||||
.goods {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.img-content {
|
||||
position: relative;
|
||||
margin-right: 8px;
|
||||
|
||||
img {
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
z-index: 999;
|
||||
font-size: 12px;
|
||||
}
|
||||
.type1 {
|
||||
background-color: #E64E39;
|
||||
}
|
||||
.type0 {
|
||||
background-color: #FF6900;
|
||||
height: 120px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.type {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
z-index: 999;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.type1 {
|
||||
background-color: #E64E39;
|
||||
}
|
||||
|
||||
.type0 {
|
||||
background-color: #FF6900;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user