11111111
This commit is contained in:
@@ -168,5 +168,42 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 新人推荐礼包
|
||||||
|
// 获取礼包列表
|
||||||
|
newUserGiftListPage: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ecommendnewuserbag/giftBagListPage',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
// 修改小程序礼包上架/下架状态
|
||||||
|
updateNewUserGiftState: function(sid,isEnable) {
|
||||||
|
return request({
|
||||||
|
url: '/ecommendnewuserbag/isGrounding/'+sid+"/"+isEnable
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 新增、保存礼包
|
||||||
|
saveNewUserGift: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ecommendnewuserbag/saveGiftBag',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
// 初始化礼包
|
||||||
|
newUserGiftInit: function(data) {
|
||||||
|
return request({
|
||||||
|
url: '/ecommendnewuserbag/giftBagInit/'+data,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,15 +2,9 @@
|
|||||||
<div :class="{ 'has-logo': showLogo }">
|
<div :class="{ 'has-logo': showLogo }">
|
||||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||||
<el-scrollbar wrap-class="scrollbar-wrapper">
|
<el-scrollbar wrap-class="scrollbar-wrapper">
|
||||||
<el-menu
|
<el-menu :default-active="$route.path" :background-color="variables.menuBg" :text-color="variables.menuText"
|
||||||
:default-active="$route.path"
|
:unique-opened="false" :active-text-color="variables.menuActiveText" :collapse-transition="false"
|
||||||
:background-color="variables.menuBg"
|
mode="vertical">
|
||||||
:text-color="variables.menuText"
|
|
||||||
:unique-opened="false"
|
|
||||||
:active-text-color="variables.menuActiveText"
|
|
||||||
:collapse-transition="false"
|
|
||||||
mode="vertical"
|
|
||||||
>
|
|
||||||
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
|
<sidebar-item v-for="route in routes" :key="route.path" :item="route" :base-path="route.path" />
|
||||||
</el-menu>
|
</el-menu>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
@@ -132,7 +126,16 @@
|
|||||||
name: '/marketingCard/applet',
|
name: '/marketingCard/applet',
|
||||||
path: '/marketingCard/applet'
|
path: '/marketingCard/applet'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
alwaysShow: true,
|
||||||
|
component: 'index',
|
||||||
|
meta: {
|
||||||
|
icon: 'el-icon-help',
|
||||||
|
title: '新人推荐礼包设置'
|
||||||
|
},
|
||||||
|
name: '/marketingCard/newUserGift',
|
||||||
|
path: '/marketingCard/newUserGift'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
alwaysShow: true,
|
alwaysShow: true,
|
||||||
component: 'index',
|
component: 'index',
|
||||||
@@ -511,4 +514,3 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -188,6 +188,14 @@ export const constantRoutes = [{
|
|||||||
noCache: true
|
noCache: true
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
path: '/marketingCard/newUserGift',
|
||||||
|
component: () => import('@/views/marketingCard/newUserGift.vue'),
|
||||||
|
name: 'newUserGift',
|
||||||
|
meta: {
|
||||||
|
title: '新人推荐礼包设置',
|
||||||
|
noCache: true
|
||||||
|
}
|
||||||
|
},{
|
||||||
path: '/marketingCard/index',
|
path: '/marketingCard/index',
|
||||||
component: () => import('@/views/marketingCard/index.vue'),
|
component: () => import('@/views/marketingCard/index.vue'),
|
||||||
name: 'index',
|
name: 'index',
|
||||||
|
|||||||
@@ -414,6 +414,17 @@
|
|||||||
|
|
||||||
saveOrUpdate() {
|
saveOrUpdate() {
|
||||||
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||||
|
|
||||||
|
if (this.formobj.preferentialPrice=='') {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '优惠后的价格不能为空'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.submitdisabled = true
|
this.submitdisabled = true
|
||||||
req.saveAppletGiftBag(this.formobj)
|
req.saveAppletGiftBag(this.formobj)
|
||||||
.then(resp => {
|
.then(resp => {
|
||||||
|
|||||||
282
src/views/marketingCard/newUserGift.vue
Normal file
282
src/views/marketingCard/newUserGift.vue
Normal file
@@ -0,0 +1,282 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<div v-show="viewState == 1">
|
||||||
|
<button-bar ref="btnbar" view-title="新人推荐礼包列表" :btndisabled="btndisabled" @btnhandle="btnHandle" />
|
||||||
|
<div class="main-content">
|
||||||
|
<div class="searchcon">
|
||||||
|
<el-button size="small" class="searchbtn" @click="clicksearchShow">
|
||||||
|
{{ searchxianshitit }}
|
||||||
|
</el-button>
|
||||||
|
<div v-show="isSearchShow" class="search">
|
||||||
|
<el-form :inline="true" class="tab-header">
|
||||||
|
<el-form-item label="礼包名称">
|
||||||
|
<el-input v-model="queryParams.params.name" placeholder="" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
<div class="btn" style="text-align: center;">
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-search"
|
||||||
|
@click="dosearch">查询</el-button>
|
||||||
|
<el-button type="primary" size="small" icon="el-icon-refresh"
|
||||||
|
@click="resetQuery">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Start 项目列表头部 -->
|
||||||
|
<div class="listtop">
|
||||||
|
<div class="tit">新人推荐礼包列表</div>
|
||||||
|
</div>
|
||||||
|
<!-- End 项目列表头部 -->
|
||||||
|
<!-- Start 项目列表 -->
|
||||||
|
<div class="">
|
||||||
|
<el-table v-loading="tableLoading" :data="dataList" border style="width: 100%">
|
||||||
|
<!-- <el-table-column fixed width="50" type="selection" align="center" /> -->
|
||||||
|
<el-table-column fixed width="60" label="序号" type="index" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column label="操作" align="center" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini" @click="toDetail(scope.row)">详情</el-button>
|
||||||
|
<el-button type="primary" size="mini" @click="toRelevancy(scope.row)">编辑</el-button>
|
||||||
|
<!-- <el-button type="primary" size="mini" @click="toRelevancyInfo(scope.row)">删除</el-button> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否上架" align="center" width="140">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-switch
|
||||||
|
v-model="scope.row.isGrounding"
|
||||||
|
active-text="上架"
|
||||||
|
inactive-text="下架"
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0"
|
||||||
|
@change="enableChange(scope.row.sid,scope.row.isGrounding)"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="name" label="礼包名称" align="center" />
|
||||||
|
|
||||||
|
<el-table-column label="礼包图片" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-popover placement="left" trigger="click" width="300">
|
||||||
|
<img :src="scope.row.iconUrl" width="100%" />
|
||||||
|
<img slot="reference" :src="scope.row.iconUrl" :alt="scope.row.iconUrl"
|
||||||
|
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||||
|
</el-popover>
|
||||||
|
<!-- <span v-for="(item,index) in scope.row.picUrl" :key="index">
|
||||||
|
<el-popover placement="left" trigger="click" width="300">
|
||||||
|
<img :src="item.url" width="100%" />
|
||||||
|
<img slot="reference" :src="item.url" :alt="item.url"
|
||||||
|
style="max-height: 70px;max-width: 70px; padding: 5px" />
|
||||||
|
</el-popover>
|
||||||
|
</span> -->
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="dateStart" label="起始日期" align="center" />
|
||||||
|
<el-table-column prop="dateEnd" label="终止日期" align="center" />
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
<!-- End 项目列表 -->
|
||||||
|
<div class="pages">
|
||||||
|
<div class="tit" />
|
||||||
|
<!-- 翻页 -->
|
||||||
|
<pagination v-show="dataList.length > 0" :total="queryParams.total" :page.sync="queryParams.current"
|
||||||
|
:limit.sync="queryParams.size" class="pagination" @pagination="loadList" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- End 查询和其列表部分 -->
|
||||||
|
<!-- 新增修改部分组件 -->
|
||||||
|
<divAdd v-show="viewState == 2|| viewState ==3" ref="divadd" @doback="resetState" @reloadlist="loadList" />
|
||||||
|
<divInfo v-show="viewState == 4" ref="divInfo" @doback="resetState" @reloadlist="loadList" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/marketingCard/marketingCard.js'
|
||||||
|
import ButtonBar from '@/components/ButtonBar'
|
||||||
|
import Pagination from '@/components/pagination'
|
||||||
|
import pageye from '@/components/pagination/pageye'
|
||||||
|
import divAdd from './newUserGiftAdd.vue'
|
||||||
|
import divInfo from './newUserGiftInfo.vue'
|
||||||
|
export default {
|
||||||
|
name: 'SupplierBankInfoIndex',
|
||||||
|
components: {
|
||||||
|
ButtonBar,
|
||||||
|
Pagination,
|
||||||
|
pageye,
|
||||||
|
divAdd,
|
||||||
|
divInfo
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
btndisabled: false,
|
||||||
|
viewState: 1, // 1、列表 2、添加 3、修改 4、查看
|
||||||
|
isSearchShow: false,
|
||||||
|
searchxianshitit: '显示查询条件',
|
||||||
|
tableLoading: false,
|
||||||
|
dataList: [],
|
||||||
|
btnList: [{
|
||||||
|
type: 'primary',
|
||||||
|
size: 'small',
|
||||||
|
icon: 'plus',
|
||||||
|
btnKey: 'toAdd',
|
||||||
|
btnLabel: '新增'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'info',
|
||||||
|
size: 'small',
|
||||||
|
icon: 'cross',
|
||||||
|
btnKey: 'doClose',
|
||||||
|
btnLabel: '关闭'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
queryParams: {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
params: {
|
||||||
|
name: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
sids: []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.$refs['btnbar'].setButtonList(this.btnList)
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 搜索条件效果
|
||||||
|
clicksearchShow() {
|
||||||
|
this.isSearchShow = !this.isSearchShow
|
||||||
|
if (this.isSearchShow) {
|
||||||
|
this.searchxianshitit = '隐藏查询条件'
|
||||||
|
} else {
|
||||||
|
this.searchxianshitit = '显示查询条件'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
btnHandle(btnKey) {
|
||||||
|
switch (btnKey) {
|
||||||
|
case 'toAdd':
|
||||||
|
this.toAdd()
|
||||||
|
break
|
||||||
|
case 'doClose':
|
||||||
|
this.doClose()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
break
|
||||||
|
}
|
||||||
|
},
|
||||||
|
loadList() {
|
||||||
|
this.tableLoading = true
|
||||||
|
req.newUserGiftListPage(this.queryParams).then((resp) => {
|
||||||
|
this.tableLoading = false
|
||||||
|
if (resp.success) {
|
||||||
|
const data = resp.data
|
||||||
|
this.queryParams.total = data.total
|
||||||
|
this.dataList = data.records
|
||||||
|
} else {
|
||||||
|
// 根据resp.code进行异常情况处理
|
||||||
|
this.dataList = []
|
||||||
|
this.queryParams.total = 0
|
||||||
|
}
|
||||||
|
}).catch(() => {
|
||||||
|
this.tableLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
|
// 序号
|
||||||
|
indexMethod(index) {
|
||||||
|
var pagestart = (this.queryParams.current - 1) * this.queryParams.size
|
||||||
|
var pageindex = index + 1 + pagestart
|
||||||
|
return pageindex
|
||||||
|
},
|
||||||
|
dosearch() {
|
||||||
|
this.queryParams.current = 1
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.queryParams = {
|
||||||
|
current: 1,
|
||||||
|
size: 10,
|
||||||
|
total: 0,
|
||||||
|
params: {
|
||||||
|
name: '',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.loadList()
|
||||||
|
},
|
||||||
|
toAdd() {
|
||||||
|
this.viewState = 2
|
||||||
|
this.$refs['divadd'].showAdd()
|
||||||
|
},
|
||||||
|
|
||||||
|
doClose() {
|
||||||
|
this.$store.dispatch('tagsView/delView', this.$route)
|
||||||
|
this.$router.go(-1)
|
||||||
|
},
|
||||||
|
|
||||||
|
toRelevancy(row) {
|
||||||
|
this.viewState = 3
|
||||||
|
this.$refs['divadd'].showEdit(row)
|
||||||
|
},
|
||||||
|
toDetail(row) {
|
||||||
|
this.viewState = 4
|
||||||
|
this.$refs['divInfo'].showAdd(row)
|
||||||
|
},
|
||||||
|
toRelevancyInfo(row) {
|
||||||
|
|
||||||
|
const tip = '请确认是否删除所选记录?'
|
||||||
|
this.$confirm(tip, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const loading = this.$loading({
|
||||||
|
lock: true,
|
||||||
|
text: 'Loading',
|
||||||
|
spinner: 'el-icon-loading',
|
||||||
|
background: 'rgba(0, 0, 0, 0.7)'
|
||||||
|
})
|
||||||
|
req.deleteBag(row.sid).then((resp) => {
|
||||||
|
loading.close()
|
||||||
|
if (resp.success) {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: resp.msg,
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
this.loadList()
|
||||||
|
} else {
|
||||||
|
// 根据resp.code进行异常情况处理
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
loading.close()
|
||||||
|
})
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
resetState() {
|
||||||
|
this.viewState = 1
|
||||||
|
},
|
||||||
|
enableChange(sid, state) {
|
||||||
|
console.log('sid', sid)
|
||||||
|
console.log('state', state)
|
||||||
|
req.updateNewUserGiftState(sid, state).then((resp) => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '状态已更新',
|
||||||
|
showClose: true
|
||||||
|
})
|
||||||
|
} else { // 根据resp.code进行异常情况处理
|
||||||
|
}
|
||||||
|
}).catch(e => {
|
||||||
|
console.log(e)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
</style>
|
||||||
535
src/views/marketingCard/newUserGiftAdd.vue
Normal file
535
src/views/marketingCard/newUserGiftAdd.vue
Normal file
@@ -0,0 +1,535 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="tab-header webtop">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<div>礼包信息</div>
|
||||||
|
<!-- start 添加修改按钮 -->
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button>
|
||||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- end 添加修改按钮 -->
|
||||||
|
<!-- end 详情按钮 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="listconadd">
|
||||||
|
|
||||||
|
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
|
||||||
|
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
|
||||||
|
<div>主体信息</div>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">礼包名称</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<el-input v-model="formobj.name" placeholder="" class="addinputw" style="width:100%"
|
||||||
|
clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<!-- <span slot="label">礼包金额</span> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<!-- <span slot="label">{{formobj.price}}</span> -->
|
||||||
|
<!-- <el-input v-model="formobj.boundaryPrice" placeholder="" class="addinputw"
|
||||||
|
style="width:100%" clearable
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" /> -->
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">礼包总价格</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.price}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">优惠后价格</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<!-- <span slot="label">{{formobj.price}}</span> -->
|
||||||
|
<el-input v-model="formobj.preferentialPrice" placeholder="" class="addinputw"
|
||||||
|
style="width:100%" clearable
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')" />
|
||||||
|
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">起始日期</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<el-date-picker v-model="formobj.dateStart" type="date" style="width:100%"
|
||||||
|
value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">终止日期</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<el-date-picker v-model="formobj.dateEnd" type="date" style="width:100%"
|
||||||
|
value-format="yyyy-MM-dd" placeholder="选择日期">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">备注信息</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<el-input v-model="formobj.remarks" placeholder="" class="addinputw" style="width:100%"
|
||||||
|
type="textarea" :rows="8" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">礼包图片</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<upload style="margin-top: 20px;margin-bottom: 20px;" class="addinputw" ref="uploadImg2"
|
||||||
|
v-model="imgList" :limit="1" @change="backData" bucket="map"
|
||||||
|
:upload-data="{ type: '0001' }" :class="{ hide: hideUploadBtn }"></upload>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-collapse v-model="activeNames" style="margin-top: 20px;">
|
||||||
|
<el-collapse-item name="1">
|
||||||
|
<template slot="title">
|
||||||
|
商品列表<span class="span" @click.stop="add()">添加</span>
|
||||||
|
</template>
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.goods" border style="width: 100%;"
|
||||||
|
:row-style="{height: '40px'}">
|
||||||
|
<!-- <el-table-column type="selection" align="center" width="50"/> -->
|
||||||
|
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
|
||||||
|
<el-table-column label="操作" wid align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini"
|
||||||
|
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="商品名称" prop="name" align="center" />
|
||||||
|
<el-table-column label="份数" prop="goodsNumber" align="center" />
|
||||||
|
<el-table-column label="价格(元/斤)" prop="price" align="center" />
|
||||||
|
<el-table-column label="商品单位" prop="specificationUnit" align="center" />
|
||||||
|
<el-table-column label="规格(斤份)" prop="weight" align="center" />
|
||||||
|
<el-table-column label="小计" prop="subtotal" align="center" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-dialog title="添加商品" :visible.sync="editDialog" width="30%" @close='handleCancle'>
|
||||||
|
<table class="e-table" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td>商品名称</td>
|
||||||
|
<td> <!-- @change="changeParentSid" -->
|
||||||
|
<el-select v-model="GiftBagGood.goodsSid" filterable clearable placeholder="请选择"
|
||||||
|
style="width:100%" @change="goodsSelect">
|
||||||
|
<el-option v-for="item in goods" :key="item.sid" :label="item.name" :value="item.sid">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>份数</td>
|
||||||
|
<td>
|
||||||
|
<el-input v-model="GiftBagGood.goodsNumber" style="width:100%"
|
||||||
|
oninput="value=value.replace(/^(0+)|[^\d]+/g,'')" @input="input"></el-input>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>价格(元/斤)</td>
|
||||||
|
<td>
|
||||||
|
<!-- <span style="width:100%">{{GiftBagGood.price}}</span> -->
|
||||||
|
<el-input v-model="GiftBagGood.price" style="width:100%"
|
||||||
|
oninput="value=value.replace(/[^\d.]/g, '').replace(/\.{2,}/g, '.').replace('.', '$#$').replace(/\./g, '').replace('$#$', '.').replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3').replace(/^\./g, '')"></el-input>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>商品单位</td>
|
||||||
|
<td>
|
||||||
|
<span style="width:100%">{{GiftBagGood.specificationUnit}}</span>
|
||||||
|
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>规格(斤份)</td> <!-- // 一份多少斤 -->
|
||||||
|
<td>
|
||||||
|
<span style="width:100%">{{GiftBagGood.weight}}</span>
|
||||||
|
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>小计</td> <!-- // 份数*份单价 -->
|
||||||
|
<td>
|
||||||
|
<span style="width:100%">{{GiftBagGood.subtotal}}</span>
|
||||||
|
<!-- <el-input v-model="GiftBagGood.unitName" style="width:100%"></el-input> -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div style="margin-top: 20px; text-align: center;">
|
||||||
|
<el-button type="primary" @click="save()">保 存</el-button>
|
||||||
|
<el-button @click="handleCancle">关 闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/marketingCard/marketingCard.js'
|
||||||
|
import upload from '@/components/uploadFile/upload_yanchejianchaTuBiao.vue'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
upload
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
editDialog: false,
|
||||||
|
listLoading: false,
|
||||||
|
activeNames: ['1'],
|
||||||
|
imgList: [],
|
||||||
|
submitdisabled: false,
|
||||||
|
formobj: {
|
||||||
|
sid: "",
|
||||||
|
name: '',
|
||||||
|
dateStart: '',
|
||||||
|
dateEnd: '',
|
||||||
|
preferentialPrice: "",
|
||||||
|
boundary: "",
|
||||||
|
remarks: "",
|
||||||
|
iconUrl: "",
|
||||||
|
goods: []
|
||||||
|
},
|
||||||
|
GiftBagGood: {
|
||||||
|
goodsSid: "",
|
||||||
|
goodsNumber: "",
|
||||||
|
name: "",
|
||||||
|
unitName: "",
|
||||||
|
price: "",
|
||||||
|
specificationUnit: "",
|
||||||
|
weight: "",
|
||||||
|
subtotal: "0.00"
|
||||||
|
|
||||||
|
},
|
||||||
|
goods: [],
|
||||||
|
hideUploadBtn: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getGoodList()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
doGoodsDel(sid) {
|
||||||
|
console.log("doGoodsDel》》》》", sid)
|
||||||
|
|
||||||
|
this.$confirm("是否确定删除此商品?", '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
const index = this.formobj.goods.findIndex((item) => item.goodsSid === sid)
|
||||||
|
console.log("index》》》》", index)
|
||||||
|
this.formobj.goods.splice(index, 1)
|
||||||
|
|
||||||
|
this.countPrice()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
save() {
|
||||||
|
console.log("save》》》》", this.GiftBagGood)
|
||||||
|
if (!this.GiftBagGood.goodsSid) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '请选择商品'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (!this.GiftBagGood.goodsNumber) {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '请输入数量'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const choose = this.formobj.goods.filter((item) => item.goodsSid == this.GiftBagGood.goodsSid)
|
||||||
|
console.log(">>>>>>>>>addCangku", choose)
|
||||||
|
if (choose.length == 0) {
|
||||||
|
this.formobj.goods.push(this.GiftBagGood)
|
||||||
|
|
||||||
|
this.GiftBagGood = {
|
||||||
|
goodsSid: "",
|
||||||
|
goodsNumber: "",
|
||||||
|
name: "",
|
||||||
|
unitName: "",
|
||||||
|
price: "",
|
||||||
|
specificationUnit: "",
|
||||||
|
weight: "",
|
||||||
|
subtotal: "0.00"
|
||||||
|
|
||||||
|
}
|
||||||
|
this.editDialog = false
|
||||||
|
this.countPrice()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'error',
|
||||||
|
message: "请勿重复添加商品!"
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
countPrice() {
|
||||||
|
|
||||||
|
let num = 0
|
||||||
|
|
||||||
|
for (var i = 0; i < this.formobj.goods.length; i++) {
|
||||||
|
var item = this.formobj.goods[i]
|
||||||
|
|
||||||
|
num += Number(item.subtotal)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("num", num);
|
||||||
|
|
||||||
|
this.formobj.price = Number(num).toFixed(2)
|
||||||
|
this.formobj.preferentialPrice = Number(num).toFixed(2)
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
handleCancle() {
|
||||||
|
this.GiftBagGood = {
|
||||||
|
goodsSid: "",
|
||||||
|
goodsNumber: "",
|
||||||
|
name: "",
|
||||||
|
unitName: "",
|
||||||
|
price: "",
|
||||||
|
specificationUnit: "",
|
||||||
|
weight: "",
|
||||||
|
subtotal: "0.00"
|
||||||
|
|
||||||
|
}
|
||||||
|
this.editDialog = false
|
||||||
|
},
|
||||||
|
input(val) {
|
||||||
|
console.log("input》》》》", val)
|
||||||
|
this.GiftBagGood.goodsNumber = val
|
||||||
|
|
||||||
|
this.GiftBagGood.subtotal = this.GiftBagGood.goodsNumber * this.GiftBagGood.price * this.GiftBagGood.weight
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
add() {
|
||||||
|
this.editDialog = true
|
||||||
|
|
||||||
|
},
|
||||||
|
getGoodList() {
|
||||||
|
req.getGoods().then(resp => {
|
||||||
|
console.log("getGoods》》》》", resp)
|
||||||
|
this.goods = resp.data
|
||||||
|
|
||||||
|
|
||||||
|
}).catch(() => {})
|
||||||
|
},
|
||||||
|
goodsSelect(val) {
|
||||||
|
console.log("goodsSelect》》》》", val)
|
||||||
|
const choose = this.goods.filter((item) => item.sid === val)
|
||||||
|
this.GiftBagGood.goodsSid = choose[0].sid
|
||||||
|
this.GiftBagGood.name = choose[0].name
|
||||||
|
this.GiftBagGood.unitName = choose[0].unitName
|
||||||
|
this.GiftBagGood.price = choose[0].price
|
||||||
|
this.GiftBagGood.specificationUnit = choose[0].specificationUnit
|
||||||
|
this.GiftBagGood.weight = choose[0].weight
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
indexMethod(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
|
backData(value) {
|
||||||
|
console.log("backData》》》》", value)
|
||||||
|
console.log("imgList", this.imgList)
|
||||||
|
|
||||||
|
|
||||||
|
if (this.imgList.length > 0) {
|
||||||
|
this.formobj.iconUrl = this.imgList[0].url
|
||||||
|
} else {
|
||||||
|
this.formobj.iconUrl = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hideUploadBtn = this.imgList.length != 0;
|
||||||
|
console.log("this.hideUploadBtn", this.hideUploadBtn)
|
||||||
|
},
|
||||||
|
|
||||||
|
saveOrUpdate() {
|
||||||
|
console.log('>>>>>>>>>saveOrUpdate', this.formobj)
|
||||||
|
|
||||||
|
if (this.formobj.preferentialPrice=='') {
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'warning',
|
||||||
|
message: '优惠后的价格不能为空'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
this.submitdisabled = true
|
||||||
|
req.saveNewUserGift(this.formobj)
|
||||||
|
.then(resp => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.submitdisabled = false
|
||||||
|
this.$message({
|
||||||
|
showClose: true,
|
||||||
|
type: 'success',
|
||||||
|
message: resp.msg
|
||||||
|
})
|
||||||
|
this.handleReturn('true')
|
||||||
|
} else {
|
||||||
|
this.submitdisabled = false
|
||||||
|
// 根据resp.code进行异常情况处理
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.submitdisabled = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
handleReturn(isreload) {
|
||||||
|
if (isreload === 'true') this.$emit('reloadlist')
|
||||||
|
this.imgList = []
|
||||||
|
this.formobj = {
|
||||||
|
sid: "",
|
||||||
|
name: '',
|
||||||
|
dateStart: '',
|
||||||
|
dateEnd: '',
|
||||||
|
boundaryPrice: "",
|
||||||
|
boundary: "",
|
||||||
|
remarks: "",
|
||||||
|
iconUrl: "",
|
||||||
|
goods: []
|
||||||
|
}
|
||||||
|
this.$emit('doback')
|
||||||
|
},
|
||||||
|
|
||||||
|
showAdd() {
|
||||||
|
|
||||||
|
},
|
||||||
|
showEdit(row) {
|
||||||
|
req.newUserGiftInit(row.sid)
|
||||||
|
.then(resp => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
this.imgList = []
|
||||||
|
if (resp.data.iconUrl != '')
|
||||||
|
this.imgList.push({
|
||||||
|
url: resp.data.iconUrl
|
||||||
|
})
|
||||||
|
this.hideUploadBtn = this.imgList.length != 0;
|
||||||
|
console.log("this.hideUploadBtn", this.hideUploadBtn)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.formobj = row
|
||||||
|
this.imgList = []
|
||||||
|
if (resp.data.iconUrl != '')
|
||||||
|
this.imgList.push({
|
||||||
|
url: formobj.iconUrl
|
||||||
|
})
|
||||||
|
this.hideUploadBtn = this.imgList.length != 0;
|
||||||
|
console.log("this.hideUploadBtn", this.hideUploadBtn)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
// 隐藏上传组件
|
||||||
|
|
||||||
|
::v-deep .hide {
|
||||||
|
.el-upload--picture-card {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.trightb {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trightb_item {
|
||||||
|
padding-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span {
|
||||||
|
margin-left: 50px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-collapse-item__header {
|
||||||
|
height: 40px;
|
||||||
|
padding: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
text-align: left;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #0294d7;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .el-collapse-item__content {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
245
src/views/marketingCard/newUserGiftInfo.vue
Normal file
245
src/views/marketingCard/newUserGiftInfo.vue
Normal file
@@ -0,0 +1,245 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="tab-header webtop">
|
||||||
|
<!-- 标题 -->
|
||||||
|
<div>礼包信息</div>
|
||||||
|
<!-- start 添加修改按钮 -->
|
||||||
|
<div>
|
||||||
|
<!-- <el-button type="primary" size="small" :disabled="submitdisabled" @click="saveOrUpdate">保存</el-button> -->
|
||||||
|
<el-button type="info" size="small" @click="handleReturn()">关闭</el-button>
|
||||||
|
</div>
|
||||||
|
<!-- end 添加修改按钮 -->
|
||||||
|
<!-- end 详情按钮 -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="listconadd">
|
||||||
|
|
||||||
|
<el-form ref="dataForm" :model="formobj" label-position="top" label-width="190px" class="formadd">
|
||||||
|
<div class="title" style="display: flex;align-items: center;justify-content: space-between;height:40px">
|
||||||
|
<div>主体信息</div>
|
||||||
|
</div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">礼包名称</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.name}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<!-- <span slot="label">边界金额</span> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<!-- <span slot="label">{{formobj.boundaryPrice}}</span> -->
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">礼包总价格</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.price}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">优惠后价格</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.preferentialPrice}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">起始日期</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.dateStart}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">终止日期</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.dateEnd}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">备注信息</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">{{formobj.remarks}}</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" class="trightb">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<span slot="label">礼包图片</span>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item class="trightb_item">
|
||||||
|
<img :src="formobj.iconUrl" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
|
||||||
|
<el-collapse v-model="activeNames" style="margin-top: 20px;">
|
||||||
|
<el-collapse-item name="1" title="商品列表">
|
||||||
|
<!-- <template slot="title">
|
||||||
|
商品列表<span class="span" @click.stop="add()">添加</span>
|
||||||
|
</template> -->
|
||||||
|
<el-table v-loading="listLoading" :data="formobj.goods" border style="width: 100%;"
|
||||||
|
:row-style="{height: '40px'}">
|
||||||
|
<!-- <el-table-column type="selection" align="center" width="50"/> -->
|
||||||
|
<el-table-column label="序号" type="index" width="80" :index="indexMethod" align="center" />
|
||||||
|
<!-- <el-table-column label="操作" wid align="center" width="150">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button type="primary" size="mini"
|
||||||
|
@click="doGoodsDel(scope.row.goodsSid)">删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column> -->
|
||||||
|
<el-table-column label="商品名称" prop="name" align="center" />
|
||||||
|
<el-table-column label="份数" prop="goodsNumber" align="center" />
|
||||||
|
<el-table-column label="价格(元/斤)" prop="price" align="center" />
|
||||||
|
<el-table-column label="商品单位" prop="specificationUnit" align="center" />
|
||||||
|
<el-table-column label="规格(斤份)" prop="weight" align="center" />
|
||||||
|
<el-table-column label="小计" prop="subtotal" align="center" />
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
</el-collapse-item>
|
||||||
|
</el-collapse>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import req from '@/api/marketingCard/marketingCard.js'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
listLoading: false,
|
||||||
|
activeNames: ['1'],
|
||||||
|
submitdisabled: false,
|
||||||
|
formobj: {
|
||||||
|
sid: "",
|
||||||
|
name: '',
|
||||||
|
dateStart: '',
|
||||||
|
dateEnd: '',
|
||||||
|
boundaryPrice: "",
|
||||||
|
boundary: "",
|
||||||
|
remarks: "",
|
||||||
|
iconUrl: "",
|
||||||
|
goods: []
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
|
||||||
|
handleReturn(isreload) {
|
||||||
|
if (isreload === 'true') this.$emit('reloadlist')
|
||||||
|
this.imgList = []
|
||||||
|
this.formobj = {
|
||||||
|
sid: "",
|
||||||
|
name: '',
|
||||||
|
dateStart: '',
|
||||||
|
dateEnd: '',
|
||||||
|
boundaryPrice: "",
|
||||||
|
boundary: "",
|
||||||
|
remarks: "",
|
||||||
|
iconUrl: "",
|
||||||
|
goods: []
|
||||||
|
}
|
||||||
|
this.$emit('doback')
|
||||||
|
},
|
||||||
|
indexMethod(index) {
|
||||||
|
return index + 1
|
||||||
|
},
|
||||||
|
showAdd(row) {
|
||||||
|
console.log("showAdd》》》》", row)
|
||||||
|
req.newUserGiftInit(row.sid)
|
||||||
|
.then(resp => {
|
||||||
|
if (resp.success) {
|
||||||
|
this.formobj = resp.data
|
||||||
|
this.imgList = []
|
||||||
|
this.imgList.push({
|
||||||
|
url: resp.data.iconUrl
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(e => {
|
||||||
|
this.formobj = row
|
||||||
|
this.imgList = []
|
||||||
|
this.imgList.push({
|
||||||
|
url: formobj.iconUrl
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
.trightb {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
text-align: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.trightb_item {
|
||||||
|
padding-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.span {
|
||||||
|
margin-left: 50px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.el-collapse-item__header {
|
||||||
|
height: 40px;
|
||||||
|
padding: 10px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 20px;
|
||||||
|
text-align: left;
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #0294d7;
|
||||||
|
}
|
||||||
|
|
||||||
|
/deep/.el-collapse-item__content {
|
||||||
|
padding-bottom: 0;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user