18 Commits

Author SHA1 Message Date
mrsun
59460e9ffd 商品功能修复 2024-02-05 16:30:26 +08:00
093d954dc6 Merge pull request 'chenlianjie' (#18) from chenlianjie into master
Reviewed-on: #18
2024-02-05 01:18:34 +00:00
xk_chenlianjie
2cb5bc4342 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/PointsMall_Admin into chenlianjie 2024-02-05 09:16:24 +08:00
xk_chenlianjie
924a4b57eb 首页 2024-02-05 09:16:14 +08:00
b2da908d9f Merge pull request 'chenlianjie' (#17) from chenlianjie into master
Reviewed-on: #17
2024-02-04 02:13:45 +00:00
xk_chenlianjie
6cb9ded875 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/PointsMall_Admin into chenlianjie 2024-02-04 10:12:35 +08:00
xk_chenlianjie
9682a02cd8 bug修改 2024-02-04 10:12:21 +08:00
7d26c09305 Merge pull request 'chenlianjie' (#16) from chenlianjie into master
Reviewed-on: #16
2024-02-02 08:02:47 +00:00
xk_chenlianjie
ad61e9693b Merge branch 'master' of http://121.196.213.68:3000/caoliancun/PointsMall_Admin into chenlianjie 2024-02-02 16:01:36 +08:00
xk_chenlianjie
0a0dab83e8 111 2024-02-02 16:01:23 +08:00
dt_2916866708
d6445b02cf shoye1 2024-02-02 16:01:00 +08:00
69afce5015 Merge pull request '商品一键上下架、选择油站修复' (#15) from lc into master
Reviewed-on: #15
2024-02-02 06:24:36 +00:00
mrsun
098d8766f9 商品一键上下架、选择油站修复 2024-02-02 14:23:42 +08:00
xk_chenlianjie
4b2fd19811 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/PointsMall_Admin into chenlianjie 2024-02-02 13:55:32 +08:00
xk_chenlianjie
ecd7565c14 11 2024-02-02 13:55:20 +08:00
xk_chenlianjie
6a43e79d01 导出 2024-02-02 10:56:12 +08:00
dt_2916866708
16cc7fb9ff 12121 2024-02-02 10:55:47 +08:00
d80f76e266 Merge pull request 'chenlianjie' (#14) from chenlianjie into master
Reviewed-on: #14
2024-02-02 01:10:41 +00:00
14 changed files with 798 additions and 235 deletions

View File

@@ -79,7 +79,7 @@ export default {
exportExcel(page) {
// 导出
return request({
url: `/${service_name}/${group_name}/exportWeb`,
url: `/${service_name}/${group_name}/getByPageExport`,
method: 'post',
data: page,
responseType: 'blob'

View File

@@ -61,6 +61,13 @@ export default {
data
})
},
batchShelves(data) {
return request({
url: `/${service_name}/mallProductInfo/upOrDownShelves`,
method: 'post',
data
})
},
getAllSites(data) {
return request({
url: `/${service_name}/mallProductSiteRelation/getAllSites`,
@@ -68,6 +75,18 @@ export default {
data
})
},
getChannels() {
return request({
url: `/${service_name}/mallProductSiteRelation/getAllChannels`,
method: 'get',
})
},
getCheckedSites(productId) {
return request({
url: `/${service_name}/mallProductSiteRelation/getCheckedSites/${productId}`,
method: 'get',
})
},
brandGetAll(data) {
return request({
url: `/${service_name}/mallProductBrands/getAll`,

View File

@@ -0,0 +1,100 @@
.flex {
display: flex;
}
.column {
flex-direction: column;
}
.ac {
align-items: center;
}
.ae {
align-items: flex-end;
}
.jc {
justify-content: center;
}
.oneflex {
flex: 1;
}
.jw {
justify-content: space-between;
}
.js {
justify-content: space-around;
}
.number {
color: red;
font-size: 25px;
}
.product-card {
height: 100px;
text-align: center;
.product-card-item {
}
}
.orderData {
width: 100%;
.orderData-right {
margin-left: 50px;
flex-wrap: wrap;
height: 100px;
.orderData-right-item {
width: calc(50% - 20px);
box-sizing: border-box;
text-align: center;
padding: 10px 20px;
border-bottom: #ececec solid 1px;
}
}
.orderData-left {
padding: 20px 10px;
box-sizing: border-box;
border: solid 1px #ececec;
}
}
.orderStatistics-card {
.orderStatistics-card-right {
}
.orderStatistics-card-left {
flex-shrink: 0;
padding: 10px 50px;
border-right: solid 1px #ececec;
.orderStatistics-card-left-item {
.orderStatistics-card-left-item-title {
color: #bbbbbb;
}
.orderStatistics-card-left-item-number {
font-size: 25px;
}
}
}
}
.box-card {
margin-bottom: 30px;
}
.card-title {
font-size: 20px;
font-weight: 500;
}
.fs {
font-size: 16px;
}
.mt {
margin-top: 30px;
}
// .page{
// height:calc(100vh - 144px);
// box-sizing: border-box;
// }

View File

@@ -1,20 +1,226 @@
<template>
<div class="page">
<el-row>
<el-col :span="24">
<el-card class="box-card">
<div slot="header">
<span class="card-title">订单数据</span>
</div>
<div class="flex">
<div class="orderData flex ac">
<div class="orderData-left flex ac fs">
<i style="font-size: 40px; color:#1ABC9C" class="el-icon-tickets"></i>
<div>
<div>今日订单总数</div>
<div>200</div>
</div>
</div>
<div class="orderData-right oneflex flex jw ae">
<div class="orderData-right-item">
<span>待核销订单</span>
<span>(10)</span>
</div>
<div class="orderData-right-item">
<span>已核销订单</span>
<span>(10)</span>
</div>
<div class="orderData-right-item mt">
<span>已完成订单</span>
<span>(10)</span>
</div>
<div class="orderData-right-item mt">
<span>待退款订单</span>
<span>(10)</span>
</div>
</div>
</div>
</div>
</el-card></el-col
>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-card class="box-card">
<div slot="header">
<span class="card-title">商品总览</span>
</div>
<div class="product-card flex js ac">
<div class="product-card-item">
<div class="number">100</div>
<div>已下架</div>
</div>
<div class="product-card-item">
<div class="number">100</div>
<div>已下架</div>
</div>
<div class="product-card-item">
<div class="number">100</div>
<div>已下架</div>
</div>
<div class="product-card-item">
<div class="number">100</div>
<div>已下架</div>
</div>
</div>
</el-card>
</el-col>
<el-col :span="12">
<el-card class="box-card">
<div slot="header">
<span class="card-title">用户总览</span>
</div>
<div class="product-card flex js ac">
<div class="product-card-item">
<div class="number">100</div>
<div>今日新增</div>
</div>
<div class="product-card-item">
<div class="number">100</div>
<div>昨日新增</div>
</div>
<div class="product-card-item">
<div class="number">100</div>
<div>本月新增</div>
</div>
<div class="product-card-item">
<div class="number">100</div>
<div>会员总数</div>
</div>
</div>
</el-card>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-card class="box-card">
<div slot="header">
<span class="card-title">订单统计</span>
</div>
<div class="orderStatistics-card flex">
<div class="orderStatistics-card-left flex column jc">
<div class="orderStatistics-card-left-item">
<div class="orderStatistics-card-left-item-title">本月订单总数</div>
<div class="orderStatistics-card-left-item-number">10000</div>
<div class="orderStatistics-card-left-item-title">10% 同比上周</div>
</div>
<div class="orderStatistics-card-left-item mt">
<div class="orderStatistics-card-left-item-title">本周订单数量</div>
<div class="orderStatistics-card-left-item-number">10000</div>
<div class="orderStatistics-card-left-item-title">10% 同比上周</div>
</div>
</div>
<div class="orderStatistics-card-right oneflex">
<div class="flex ac">
<div style="width: 100%;">近一周订单统计</div>
<el-date-picker
v-model="createTime"
type="daterange"
align="right"
unlink-panels
value-format="yyyy-MM-dd"
range-separator="~"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions"
>
</el-date-picker>
<el-button type="primary" @click="userSearchs" style="margin-left:10px">查询</el-button>
</div>
<div style="width: 100%; height:500px;margin-top:20px" id="chart"></div>
</div>
</div>
</el-card>
</el-col>
</el-row>
</div>
</template>
<script>
import echarts from 'echarts'
export default {
filters: {},
data() {
return {
myChart: null,
createTime: '',
pickerOptions: {
shortcuts: [
{
text: '今天',
onClick(picker) {
const end = new Date()
const start = new Date()
picker.$emit('pick', [start, end])
}
},
{
text: '最近一周',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
picker.$emit('pick', [start, end])
}
},
{
text: '最近一个月',
onClick(picker) {
const end = new Date()
const start = new Date()
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
picker.$emit('pick', [start, end])
}
}
]
}
}
},
created() {
this.init()
},
mounted() {
this.initChart('chart')
},
methods: {
initChart(id = 'chart') {
this.myChart = echarts.init(document.getElementById(id))
this.myChart.setOption({
color: ['#4370da'],
grid: {
x: 50,
y: 25,
x2: 30,
y2: 35
},
xAxis: {
type: 'category',
boundaryGap: false,
data: ['07-01周六', '07-02周日', '07-03周一', '07-04周二', '07-05周三', '07-06周四', '07-07周五']
},
yAxis: {
type: 'value'
},
series: [
{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line',
smooth: true,
areaStyle: {}
}
]
})
},
init() {}
}
}
</script>
<style scoped></style>
<style scoped lang="scss">
@import './index.scss';
</style>

View File

@@ -60,12 +60,12 @@
</el-table-column>
<el-table-column label="用户账号" min-width="120" align="center">
<template slot-scope="scope">
<span>{{ scope.row.acctId }}</span>
<span>{{ scope.row.customerPhone }}</span>
</template>
</el-table-column>
<el-table-column label="订单金额" min-width="60" align="center">
<template slot-scope="scope">
<span>{{ scope.row.integral }}</span>
<span>¥ {{ scope.row.marketPrice }}</span>
</template>
</el-table-column>
<el-table-column label="支付积分" min-width="80" align="center">

View File

@@ -6,7 +6,7 @@
</div>
<el-descriptions title="基本信息" class="text" direction="vertical" :column="6" border>
<el-descriptions-item label="订单编号">{{ detailData.orderCode }}</el-descriptions-item>
<el-descriptions-item label="用户账号">{{ detailData.acctId }}</el-descriptions-item>
<el-descriptions-item label="用户账号">{{ detailData.customerPhone }}</el-descriptions-item>
<el-descriptions-item label="支付积分">{{ detailData.integral }}</el-descriptions-item>
<el-descriptions-item label="下单时间">{{ detailData.createTime }}</el-descriptions-item>
<el-descriptions-item label="自提油站">{{ detailData.takeSiteName }}</el-descriptions-item>
@@ -112,7 +112,7 @@ export default {
case '0':
return '待支付'
case '1':
return '已经发'
return '已支付'
case '2':
return '退款申请'
case '3':

View File

@@ -247,7 +247,7 @@ export default {
const searchParam = { ...this.page }
searchParam.pageSize = endIndex
searchParam.currentPage = this.output.startPage
orderInfoApi.exportExcel(searchParam).then(res => {
orderInfoApi.getRefundOrder(searchParam).then(res => {
const link = document.createElement('a')
// 创建Blob对象设置文件类型
const blob = new Blob([res], { type: 'application/vnd.ns-excel' }) // MIME类型
@@ -259,7 +259,8 @@ export default {
this.$message.success('导出成功')
URL.revokeObjectURL(link.href) // 释放内存
})
// const res = await orderInfoApi.getByPage(searchParam)
// tmpData = res.data.list
import('@/vendor/Export2Excel').then(excel => {
const data = this.formatJson(this.valColumn, tmpData)
excel.export_json_to_excel({

View File

@@ -1,149 +1,319 @@
<template>
<div>
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform"
@submit.native.prevent inline>
<el-form-item label="输入搜索">
<el-input clearable v-model="page.params.siteName" placeholder="请输入油站名称"
class="form_content_width"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="userSearchs">查询</el-button>
<el-button type="primary" @click="submit">确定选择</el-button>
</el-form-item>
</el-form>
<el-table max-height="500" @selection-change="selectionChange" v-loading="loading" ref="table" :data="tableList"
highlight-current-row empty-text="暂无数据" class="mt14">
<el-table-column type="selection" width="55">
</el-table-column>
<el-table-column label="油站名称" prop="siteName"> </el-table-column>
<el-table-column label="渠道" prop="channel"> </el-table-column>
<div class="station-select">
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform"
@submit.native.prevent inline>
<el-form-item label="输入搜索">
<el-input clearable v-model="page.params.siteName" placeholder="请输入油站名称"
class="form_content_width"></el-input>
</el-form-item>
<el-form-item label="油站渠道">
<el-select v-model="page.params.channel" clearable style="width:100%">
<el-option
v-for="(item,index) in channelList"
:key="index"
:label="item"
:value="item"
/>
</el-select>
</el-form-item>
<el-form-item label="省市区">
<el-cascader
v-model="page.params.addrCodes"
placeholder="请选择省市区"
style="width: 100%"
:options="areaTree"
:props="{checkStrictly: true,value:'id', label:'areaName', children:'childList'}"
filterable
clearable
/>
</el-form-item>
<el-form-item label="油站品牌">
<el-select v-model="page.params.siteBrand" clearable style="width:100%">
<el-option label="中国石油" :value="1" />
<el-option label="中国石化" :value="2" />
<el-option label="壳牌" :value="3" />
<el-option label="民营" :value="4" />
<el-option label="中海油" :value="5" />
<el-option label="京博" :value="6" />
<el-option label="中化石油" :value="7" />
<el-option label="山东高速" :value="9" />
<el-option label="其他" :value="8" />
</el-select>
</el-form-item>
<el-form-item label="油站账户" prop="siteChannelAccountId">
<el-select v-model="page.params.siteChannelAccountId" remote filterable clearable placeholder="请选择油站账户" style="width: 100%">
<el-option v-for="item in restaurants" :key="item.id" :label="item.value + '-' + item.id" :value="item.id">
{{ item.value }}-<span style="color: #bbbbbb">{{ item.id }}</span>
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="userSearchs">查询</el-button>
</el-form-item>
</el-form>
<el-row :gutter="24" class="table-area">
<el-col :span="11">
<h3>待选择</h3>
<el-table :height="tableHeight" v-loading="loading" ref="table" :data="tableList"
:row-key="(row) => row.siteId" highlight-current-row empty-text="暂无数据" class="mt14">
<el-table-column type="selection" reserve-selection width="55">
</el-table-column>
<el-table-column label="油站名称" prop="siteName" width="200"></el-table-column>
<el-table-column align="center" label="渠道" prop="channel" width="120"></el-table-column>
<el-table-column header-align="center" label="地址" prop="address"></el-table-column>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="page.currentPage" :page-sizes="[10, 15, 20, 30]" :page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="page.totalCount" />
</div>
</template>
:current-page="page.currentPage" :page-sizes="[10, 15, 20, 30]" :page-size="page.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="page.totalCount" />
</el-col>
<el-col :span="2" class="transfer-button">
<el-button type="primary" @click="delSite" class="el-icon-back"></el-button>
<el-button type="primary" @click="addSite" class="el-icon-right"></el-button>
</el-col>
<el-col :span="11">
<h3>已选择</h3>
<el-table :height="tableHeight" v-loading="checkedLoading" ref="checkedTable" :data="checkedSites"
:row-key="(row) => row.siteId" highlight-current-row empty-text="暂无数据" class="mt14">
<el-table-column type="selection" reserve-selection width="55">
</el-table-column>
<el-table-column label="油站名称" prop="siteName" width="200"></el-table-column>
<el-table-column align="center" label="渠道" prop="channel" width="120"></el-table-column>
<el-table-column header-align="center" label="地址" prop="address"></el-table-column>
</el-table>
</el-col>
</el-row>
<el-button type="primary" @click="submit" class="fr">确定</el-button>
</div>
</template>
<script>
import productApi from '@/api/product/productAttr.js';
export default {
name: "OilStationSelection",
props: {
OilStationSelectionList: {
type: Array,
default: () => []
},
selectAttrId: {
type: String,
default: () => ""
}
},
data() {
return {
selectionList: [],
loading: false,
tableList: [],
page: {
"currentPage": 1,
"pageSize": 10,
"totalCount": 0,
"params": {
"siteName": ""
},
}
}
},
watch: {
OilStationSelectionList:{
handler(n,o){
this.$refs.table.clearSelection();
n.forEach(element => {
this.$refs.table.toggleRowSelection(element);
});
},
deep:true
}
},
created() {
this.init()
},
methods: {
submit() {
this.$emit('submit', this.getSelectionList())
},
getSelectionList() {
return this.selectionList
},
selectionChange(e) {
this.selectionList = e
},
userSearchs() {
this.getByPage()
},
isStrictPromise(value) {
return !!value
&& typeof value === 'object'
&& typeof value.then === 'function'
&& typeof value.finally === 'function';
},
loadingFn(callback) {
this.loading = true;
if (this.isStrictPromise(callback)) {
callback.finally(() => {
this.loading = false;
})
};
},
getByPage() {
this.loadingFn(productApi.getAllSites(this.page).then(res => {
// ({
// data: this.tableList = [],
// currentPage: this.page.currentPage,
// pageSize: this.page.pageSize,
// totalCount: this.page.totalCount
// } = res.data);
this.tableList = res.data
console.log(res)
}));
},
handleCurrentChange(val) {
this.page.currentPage = val
this.getByPage()
},
handleSizeChange(val) {
this.page.pageSize = val
this.getByPage()
},
del(e) {
productApi.delete(e).then(res => {
if (res.code == 20000) {
this.$message.success('操作成功')
this.handleCurrentChange();
}
})
},
edit(row) {
let data = Object.assign({}, row, {
name: this.selectAttrId.split("/")[1] || "",
spec: [{
value: row.attributeName,
detail: row.attributeContent.split(",")
}],
})
this.$parent.$parent.selection = [data];
this.$parent.$parent.addAttr('typeUpdate');
},
init() {
// this.getByPage();
import productApi from '@/api/product/productAttr.js'
import dictAreaApi from '@/api/base/areaCode.js'
import financeApi from '@/api/user/oilTerminalMarket.js'
// if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {
// this.page.params.typeId = this.selectAttrId.split("/")[0] || "";
// this.getByPage();
// } else {
// this.$message.warning("初始化出错")
// }
export default {
name: 'OilStationSelection',
props: {
OilStationSelectionList: {
type: Array,
default: () => []
},
selectAttrId: {
type: String,
default: () => ''
},
productId: {
type: String,
default: () => null
},
},
data() {
return {
tableHeight: document.documentElement.clientHeight - 550,
// selectionList: [],
loading: false,
checkedLoading: false,
tableList: [],
areaTree: [],
restaurants: [],
page: {
'currentPage': 1,
'pageSize': 10,
'totalCount': 0,
'params': {
addrCodes:[]
}
},
channelList:[],
checkedSites:[],
}
},
// watch: {
// OilStationSelectionList: {
// handler(n, o) {
// this.$refs.table.clearSelection()
// n.forEach(element => {
// this.$refs.table.toggleRowSelection(element)
// })
// },
// deep: true
// }
// },
created() {
this.init()
this.getAreaData()
this.getChannlList()
this.getAccountNames()
this.getCheckedSites()
},
methods: {
submit() {
this.$emit('submit', this.getSelectionList())
},
getSelectionList() {
return this.checkedSites
},
userSearchs() {
this.getByPage()
},
addSite(){
console.log(this.$refs.table.selection)
let arr = [...this.$refs.table.selection]
let arrSiteName = []
arr.forEach(v=>{
if (this.checkedSites.some(f=>f.siteId===v.siteId)){
arrSiteName.unshift(v.siteName)
}else {
this.checkedSites.push(v)
}
})
if (arrSiteName&&arrSiteName.length>0){
this.$message.warning('部分站点出现重复,已自动为您过滤:【'+arrSiteName.join('、')+'】')
}
this.$refs.table.clearSelection()
},
delSite(){
console.log(this.$refs.checkedTable.selection)
// 获取当前选中的行
const selectedRows = this.$refs.checkedTable.selection;
// 使用filter方法创建一个新数组不包含已删除的元素
this.checkedSites = this.checkedSites.filter(site => {
return !selectedRows.some(row => row.siteId === site.siteId);
});
this.$refs.checkedTable.clearSelection()
},
isStrictPromise(value) {
return !!value
&& typeof value === 'object'
&& typeof value.then === 'function'
&& typeof value.finally === 'function'
},
loadingFn(callback) {
this.loading = true
if (this.isStrictPromise(callback)) {
callback.finally(() => {
this.loading = false
})
}
},
getAreaData(){
dictAreaApi.getTree().then(res => {
this.areaTree = res.data
})
},
getByPage() {
if (this.page.params.addrCodes&&this.page.params.addrCodes.length>0){
this.page.params.provinceCode = this.page.params.addrCodes[0]
if (this.page.params.addrCodes.length>1){
this.page.params.areaCode = this.page.params.addrCodes[1]
if (this.page.params.addrCodes.length>2){
this.page.params.cityCode = this.page.params.addrCodes[2]
}else {
this.page.params.cityCode = null
}
}else {
this.page.params.areaCode = null
this.page.params.cityCode = null
}
}else {
this.page.params.provinceCode = null
this.page.params.areaCode = null
this.page.params.cityCode = null
}
this.loadingFn(productApi.getAllSites(this.page).then(res => {
if (res.code === 20000) {
this.tableList = res.data.list
this.page.totalCount = parseInt(res.data.totalCount)
} else {
this.tableList = []
this.page.totalCount = 0
}
}))
},
handleCurrentChange(val) {
this.page.currentPage = val
this.getByPage()
},
handleSizeChange(val) {
this.page.pageSize = val
this.getByPage()
},
// 获取账户名称键值对
getAccountNames() {
financeApi.getChannelAccountMaps().then(res => {
if (res.code === 20000) {
const arr = [...res.data]
this.restaurants = arr.filter(f => f.accountState === '1')
}
})
},
del(e) {
productApi.delete(e).then(res => {
if (res.code == 20000) {
this.$message.success('操作成功')
this.handleCurrentChange()
}
})
},
getChannlList(){
productApi.getChannels().then(res=>{
if (res.code === 20000) {
this.channelList = res.data
}
})
},
getCheckedSites(){
if (this.productId){
this.checkedLoading = true
productApi.getCheckedSites(this.productId).then(res=>{
if (res.code === 20000) {
let checkedData = res.data
this.checkedSites = checkedData.filter(f => {
return this.OilStationSelectionList.find(i => i.siteId === f.siteId);
});
}
this.checkedLoading = false
})
}
},
edit(row) {
let data = Object.assign({}, row, {
name: this.selectAttrId.split('/')[1] || '',
spec: [{
value: row.attributeName,
detail: row.attributeContent.split(',')
}]
})
this.$parent.$parent.selection = [data]
this.$parent.$parent.addAttr('typeUpdate')
},
init() {
// this.getByPage();
// if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {
// this.page.params.typeId = this.selectAttrId.split("/")[0] || "";
// this.getByPage();
// } else {
// this.$message.warning("初始化出错")
// }
}
}
}
</script>
<style></style>
<style lang="less" scoped>
.station-select{
height: calc(100vh - 300px);
.table-area{
.transfer-button{
display: grid;
align-items: center;
grid-template-columns: auto auto;
button{
width: 50px;
}
}
}
}
</style>

View File

@@ -36,7 +36,7 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品分类:" prop="cate_id">
<el-form-item label="商品分类:" prop="cate_id">
<el-cascader
class="content_width"
v-model="formValidate.cate_id"
@@ -52,7 +52,7 @@
<el-form-item label="商品名称:" prop="store_name">
<el-input class="content_width" v-model.trim="formValidate.store_name" placeholder="请输入商品名称" />
</el-form-item>
</el-col>
</el-col>
<el-col :span="24">
<el-form-item label="单位:" prop="unit_name">
<el-input class="content_width" v-model="formValidate.unit_name" placeholder="请输入单位" />
@@ -1166,7 +1166,7 @@
<div
class="color-item"
:class="activity[color]"
v-for="color in formValidate.activity"
v-for="color in formValidate.activity"
:key="color"
>
{{ color }}
@@ -3052,7 +3052,7 @@ export default {
}
.box-video-style {
width: 375px;
width: 375px;
height: 211px;
border-radius: 10px;
background-color: #707070;
@@ -3276,7 +3276,7 @@ export default {
.ifam {
width: 344px;
height: 644px;
background-size: 344px 644px;
padding: 40px 20px;
padding-top: 50px;

View File

@@ -21,7 +21,7 @@
<el-row v-show="currentTab === 0" :gutter="24">
<!-- 商品信息-->
<el-col v-bind="grid2">
<el-form-item label="商品分类:" prop="categorys" :rules="[{ required: true, message: '请选择商品分类', trigger: ['blur', 'change'] }]">
<el-form-item label="商品分类:" prop="categorys" :rules="[{ required: true, message: '请选择商品分类', trigger: ['blur'] }]">
<el-cascader
@change="cascaderChange"
v-model="formValidate.categorys"
@@ -35,7 +35,7 @@
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品名称:" prop="productName" :rules="[{ required: true, message: '请输入商品名称', trigger: ['blur', 'change'] }]">
<el-form-item label="商品名称:" prop="productName" :rules="[{ required: true, message: '请输入商品名称', trigger: ['blur'] }]">
<el-input v-model="formValidate.productName" maxlength="249" placeholder="请输入商品名称" :disabled="isDisabled" />
</el-form-item>
</el-col>
@@ -45,7 +45,7 @@
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品品牌:" prop="brandId" :rules="[{ required: true, message: '请选择商品品牌', trigger: ['blur', 'change'] }]">
<el-form-item label="商品品牌:" prop="brandId" :rules="[{ required: true, message: '请选择商品品牌', trigger: ['blur'] }]">
<el-select style="width: 100%;" v-model="formValidate.brandId" placeholder="请选择">
<el-option v-for="item in brandOptions" :key="item.id" :label="item.brandName" :value="item.id"> </el-option>
</el-select>
@@ -57,12 +57,12 @@
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品售价" prop="price" :rules="[{ required: true, message: '请输入商品售价', trigger: ['blur', 'change'] }]">
<el-form-item label="商品售价" prop="price" :rules="[{ required: true, message: '请输入商品售价', trigger: ['blur'] }]">
<el-input v-model="formValidate.price" maxlength="249" type="number" placeholder="请输入商品售价" :disabled="isDisabled" />
</el-form-item>
</el-col>
<el-col v-bind="grid2">
<el-form-item label="商品类型:" prop="productType" :rules="[{ required: true, message: '请选择商品类型', trigger: ['blur', 'change'] }]">
<el-form-item label="商品类型:" prop="productType" :rules="[{ required: true, message: '请选择商品类型', trigger: ['blur'] }]">
<el-select style="width: 100%;" v-model="formValidate.productType" placeholder="请选择商品类型">
<el-option label="店铺商品" value="2"> </el-option>
<el-option label="平台商品" value="1"> </el-option>
@@ -76,9 +76,8 @@
</el-form-item>
</el-col> -->
<el-col v-bind="grid2">
<el-form-item label="自提油站" prop="siteIds" :rules="[{ required: true, message: '请选择自提油站', trigger: ['blur', 'change'] }]">
<el-form-item label="自提油站" prop="siteIds">
<el-tag
v-model="formValidate.siteIds"
style="margin-left: 10px;"
:key="tagIndex"
v-for="(tag, tagIndex) in OilStationSelectionList"
@@ -129,7 +128,7 @@
<el-form-item
label="选择规格:"
prop="attributesTypeId"
:rules="[{ required: true, message: '请选择规格', trigger: ['blur', 'change'] }]"
:rules="[{ required: true, message: '请选择规格', trigger: ['blur'] }]"
>
<div class="acea-row">
<el-select v-model="formValidate.attributesTypeId">
@@ -217,6 +216,7 @@
:disabled="isDisabled"
maxlength="9"
min="0.01"
required
v-model="scope.row[item.value]"
class="priceBox"
@blur="keyupEvent(iii, scope.row[item.value], scope.$index, 3)"
@@ -327,8 +327,8 @@
</el-form>
</el-card>
<CreatTemplates ref="addTemplates" @getList="getShippingList" />
<el-dialog title="选择油站" :visible.sync="isOilStationSelection">
<OilStationSelection :OilStationSelectionList="OilStationSelectionList" @submit="oilStationSelectionSubmit"> </OilStationSelection>
<el-dialog width="80%" title="选择油站" :visible.sync="isOilStationSelection">
<OilStationSelection :product-id="this.$route.query.id" ref="selectSites" :OilStationSelectionList="OilStationSelectionList" @submit="oilStationSelectionSubmit"> </OilStationSelection>
</el-dialog>
</div>
</template>
@@ -555,29 +555,30 @@ export default {
console.log(from.path) //从哪来
console.log(to.path, to.params) //到哪去
},
'formValidate.content': function(n) {
console.log(n, '++++++++++++++++++++++')
},
'formValidate.content': function(n) { },
ManyAttrValue(n) {},
'formValidate.attr': {
handler: function(val) {
if (this.isAttr) this.watCh(val) //重要!!!
handler: function(val,o) {
if (this.isAttr) this.watCh(val,o) //重要!!!
},
immediate: false,
deep: true
}
},
created() {
this.chenkId()
this.getCategorySelect()
this.productGetRule()
this.brandGetAll()
async created() {
await this.chenkId()
await this.getCategorySelect()
await this.productGetRule()
await this.brandGetAll()
},
mounted() {},
deactivated() {
this.$destroy();
},
methods: {
chenkId() {
if (this.$route.params && this.$route.params.id) {
this.getproductInfo(this.$route.params.id)
async chenkId() {
if (this.$route.query && this.$route.query.id) {
await this.getproductInfo(this.$route.query.id)
}
},
productAddGetSites(ids) {
@@ -590,19 +591,23 @@ export default {
})
},
async inverseAnalysis(data) {
let { categoryOneId, categoryTwoId } = data
let categorys = [categoryOneId, categoryTwoId]
this.OilStationSelectionList = data.siteInfos
Object.assign(this.formValidate, {
let { categoryOneId, categoryTwoId } = data;
let categorys = [categoryOneId, categoryTwoId];
this.OilStationSelectionList = data.siteInfos;
this.formValidate = {
...this.formValidate,
categorys,
...data
})
}
// Object.assign(this.formValidate, {
// categorys,
// ...data
// })
this.$refs.CustomUpload.fileList = [...this.formValidate.images.filter(item => item.mainMark == '1')]
this.$refs.CustomLBUpload.fileList = [...this.formValidate.images.filter(item => item.mainMark != '1')]
await this.confirm()
this.$nextTick(() => {
this.formValidate.attr = this.formValidate.attr
.map(item => {
this.formValidate.attr = this.formValidate.attr.map(item => {
let align = this.formValidate.checkedList.find(i => item.id == i.attributeId)
if (align) {
return {
@@ -615,22 +620,24 @@ export default {
} else {
return null
}
})
.filter(item => item)
}).filter(item => item);
setTimeout(() => {
this.ManyAttrValue.forEach((item, index) => {
let data = this.formValidate.stockList.find(i => i.attributeJson == JSON.stringify(item.data))
let data = this.formValidate.stockList.find(i => i.attributeJson == JSON.stringify(item.data));
if (data) {
Object.assign(item, data)
Object.assign(item, data,{delect:false})
}else{
Object.assign(item, data,{delect:true})
}
})
this.ManyAttrValue = this.ManyAttrValue.filter(item=>!item.delect)
}, 1000)
})
},
getproductInfo(id) {
productApi.productAddGetEdit(id).then(res => {
async getproductInfo(id) {
await productApi.productAddGetEdit(id).then( async res => {
if (res.code == 20000) {
this.inverseAnalysis(res.data)
await this.inverseAnalysis(res.data)
}
})
},
@@ -639,14 +646,17 @@ export default {
},
delectOilStationSelectionList(e, index) {
this.OilStationSelectionList.splice(index, 1)
if (this.$refs.selectSites&&this.$refs.selectSites.checkedSites){
this.$refs.selectSites.checkedSites = this.$refs.selectSites.checkedSites.filter(site => e.siteId !== site.siteId);
}
},
oilStationSelectionSubmit(e) {
this.OilStationSelectionList = e
this.isOilStationSelection = false
this.formValidate.siteIds = e.map(item => item.siteId)
},
brandGetAll() {
productApi.brandGetAll().then(res => {
async brandGetAll() {
await productApi.brandGetAll().then(res => {
if (res.code == 20000) {
this.brandOptions = res.data
}
@@ -709,7 +719,7 @@ export default {
},
setTagsViewTitle() {
const title = this.isDisabled ? '商品详情' : '编辑商品'
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.params.id}` })
const route = Object.assign({}, this.tempRoute, { title: `${title}-${this.$route.query.id}` })
this.$store.dispatch('tagsView/updateVisitedView', route)
},
onChangeGroup() {
@@ -720,7 +730,7 @@ export default {
this.checkboxGroup.includes('isHot') ? (this.formValidate.isHot = true) : (this.formValidate.isHot = false)
},
// sku算法
watCh(val) {
watCh(val,o) {
let arr = []
this.manyTabDate = []
for (let i = 0; i < val.length; i++) {
@@ -747,7 +757,8 @@ export default {
return res
},
[{}]
)
);
console.log(this.ManyAttrValue ,"this.ManyAttrValue ")
},
attrFormat(arr) {
let data = []
@@ -852,8 +863,8 @@ export default {
}
},
// 商品分类;
getCategorySelect() {
productApi.getClassificationTree().then(res => {
async getCategorySelect() {
await productApi.getClassificationTree().then(res => {
if (res.code == 20000) {
this.merCateList = res.data
}
@@ -961,6 +972,7 @@ export default {
} else {
item.splice(index, 1)
}
},
// 添加规则名称
createAttrName() {
@@ -1012,7 +1024,7 @@ export default {
// 详情
getInfo() {
this.fullscreenLoading = true
productDetailApi(this.$route.params.id)
productDetailApi(this.$route.query.id)
.then(async res => {
// this.isAttr = true;
let info = res
@@ -1172,6 +1184,11 @@ export default {
if (this.currentTab-- < 0) this.currentTab = 0
},
handleSubmitNest(name) {
console.log(this.formValidate,"handleSubmitNest")
if (this.formValidate.attr<1){
this.$message.error('规格属性不能为空')
return
}
this.$refs[name].validate(valid => {
if (valid) {
if (this.currentTab++ > 2) this.currentTab = 0
@@ -1198,7 +1215,10 @@ export default {
let [categoryOneId, categoryTwoId] = this.formValidate.categorys
let isRecommendOrNewMark = this.formValidate.recommendOrNewMark == '1' ? 'newMark' : 'recommend'
let siteIds = this.OilStationSelectionList.map(item => item.siteId)
if(siteIds.length==0){
this.$message.error('请选择油站')
return
}
let checkedList = this.formValidate.attr.map(item => {
let attributeId = item.id
let checked = item.sku.value.join(',')
@@ -1224,18 +1244,11 @@ export default {
id
}
})
console.log(this.formValidate, 'formValidate')
console.log(categoryOneId, categoryTwoId, 'categoryOneId categoryTwoId')
console.log(isRecommendOrNewMark, 'isRecommendOrNewMark')
console.log(siteIds, 'siteIds')
console.log(checkedList, 'checkedList')
console.log(images, 'images')
console.log(stockList, 'stockList')
this.formValidate[isRecommendOrNewMark] = '1'
loadingFn.call(
this,
'loading',
productApi[this.$route.params.id ? 'addUpdate' : 'addSave'](
productApi[this.$route.query.id ? 'addUpdate' : 'addSave'](
Object.assign(this.formValidate, {
categoryOneId,
categoryTwoId,
@@ -1248,8 +1261,8 @@ export default {
if (res.code == 20000) {
this.$message.success('操作成功')
setTimeout(() => {
this.$router.push({ path: 'productList' })
this.$destroy()
this.$router.push({ path: 'productList', query: { refresh: true }})
// this.$destroy()
}, 1000)
}
})

View File

@@ -21,7 +21,7 @@
</el-table-column>
<el-table-column label="兑换积分" prop="skuNum">
<template slot-scope="scope">
<el-input maxlength="9" min="0.01" v-model="scope.row.skuNum" class="priceBox" />
<el-input maxlength="9" min="0.01" v-model="scope.row.integral" class="priceBox" />
</template>
</el-table-column>
</el-table>

View File

@@ -41,8 +41,8 @@
</el-form>
</div>
<div class="Button">
<el-button type="primary" class="mr14">添加商品</el-button>
<el-button type="success" class="mr14" @click="onCopy">商品采集</el-button>
<!-- <el-button type="primary" class="mr14">添加商品</el-button>-->
<!-- <el-button type="success" class="mr14" @click="onCopy">商品采集</el-button>-->
<!-- <el-dropdown class="bnt mr14" @command="batchSelect">
<el-button>批量修改<i class="el-icon-arrow-down el-icon--right"></i></el-button>
<el-dropdown-menu slot="dropdown">
@@ -54,9 +54,11 @@
<el-dropdown-item :command="6">活动推荐</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown> -->
<el-button @click="onDismount" v-show="artFrom.type === '1'">批量下架</el-button>
<el-button @click="onShelves" v-show="artFrom.type === '2'">批量上架</el-button>
<el-button class="export" @click="exports">导出</el-button>
<!-- <el-button @click="onDismount" v-show="artFrom.type === '1'">批量下架</el-button>-->
<!-- <el-button @click="onShelves" v-show="artFrom.type === '2'">批量上架</el-button>-->
<!-- <el-button class="export" @click="exports">导出</el-button>-->
<el-button @click="batchShelves('1')">批量上架</el-button>
<el-button @click="batchShelves('2')">批量下架</el-button>
</div>
<el-table
ref="table"
@@ -69,14 +71,14 @@
empty-text="暂无数据"
>
<el-table-column type="selection" width="60" :reserve-selection="true"> </el-table-column>
<el-table-column label="编号">
<el-table-column label="编号" min-width="120">
<template slot-scope="scope">
<span>{{ scope.row.id }}</span>
</template>
</el-table-column>
<el-table-column label="商品类型">
<el-table-column label="商品类型" min-width="70">
<template slot-scope="scope">
<span>{{ scope.row.productType ? '平台' : '店铺' }}</span>
<span>{{ scope.row.productType == '1' ? '平台' : '店铺' }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="商品图" min-width="90">
@@ -86,7 +88,7 @@
</div>
</template>
</el-table-column> -->
<el-table-column label="商品名称" min-width="200" align="center">
<el-table-column label="商品名称" min-width="180" align="center">
<template slot-scope="scope">
<span>{{ scope.row.productName }}</span>
</template>
@@ -97,7 +99,7 @@
<span>货号{{ scope.row.productNum }}</span>
</template>
</el-table-column>
<el-table-column label="标签" min-width="100">
<el-table-column label="标签" min-width="120">
<template slot-scope="scope">
<div>
上架
@@ -126,7 +128,7 @@
<el-table-column label="油站" min-width="150" align="center">
<template slot-scope="scope">
<span>
{{ scope.row.siteName }}
{{ scope.row.siteName || '暂无' }}
</span>
</template>
</el-table-column>
@@ -526,8 +528,6 @@ export default {
}
})
},
getList() {},
batchSub() {},
clearBatchData(status) {},
// 批量设置商品
@@ -588,10 +588,26 @@ export default {
},
getExcelData(excelData) {},
freight() {},
// 批量上架
onShelves() {},
// 批量下架
onDismount() {},
// 批量上
batchShelves(productStatus) {
let selected = this.$refs.table.selection
if (selected && selected.length > 0) {
let selectedIds = selected.map(item => item.id)
productApi
.batchShelves({
list: selectedIds,
productStatus: productStatus
})
.then(res => {
if (res.code === 20000) {
this.$message.success(res.msg)
this.getDataList()
}
})
} else {
this.$message.error('请选择需要操作的数据')
}
},
getRowKey(row) {
return row.id
},
@@ -697,8 +713,8 @@ export default {
edit(row) {
console.log(row)
this.$router.push({
name: 'productAdd',
params: {
path: '/product/productAdd',
query: {
id: row.id
}
})

View File

@@ -45,7 +45,7 @@
</el-table-column>
<el-table-column label="数量比例" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sellScale }}</span>
<span>{{ scope.row.sellScale }}%</span>
</template>
</el-table-column>
@@ -56,7 +56,7 @@
</el-table-column>
<el-table-column label="金额比例" align="center">
<template slot-scope="scope">
<span>{{ scope.row.sellMoneyScale }}</span>
<span>{{ scope.row.sellMoneyScale }}%</span>
</template>
</el-table-column>
</el-table>
@@ -391,12 +391,22 @@ export default {
})
console.log('tableList', this.tableList)
},
// 表格搜索
productSearchs() {
console.log(this.Time)
console.log('time', this.Time)
if (this.Time !== null && this.Time.length !== 0) {
this.createTime = this.Time[0] + '/' + this.Time[1]
if (this.isDate(this.Time[0])) {
this.createTime = this.Time[0] + '/' + this.Time[1]
console.log('-----')
} else {
var time1 = this.getSimpleDate(this.Time[0])
var time2 = this.getSimpleDate(this.Time[1])
this.createTime = time1 + '/' + time2
}
console.log('createTime------', this.createTime)
this.getChartList()
} else {
this.$message.error('请选择要查询的时间段!')
@@ -404,15 +414,43 @@ export default {
},
// 表格搜索
userSearchs() {
console.log('createTime2', this.createTime2)
this.page.currentPage = 1
if (this.createTime2 !== null && this.createTime2.length !== 0) {
this.page.params.startTime = this.createTime2[0]
this.page.params.endTime = this.createTime2[1]
if (this.isDate(this.createTime2[0])) {
this.page.params.startTime = this.createTime2[0]
this.page.params.endTime = this.createTime2[1]
} else {
var time1 = this.getSimpleDate(this.createTime2[0])
var time2 = this.getSimpleDate(this.createTime2[1])
this.page.params.startTime = time1
this.page.params.endTime = time2
}
this.getList()
} else {
this.$message.error('请选择要查询的时间段!')
}
},
isDate(dateStr) {
var pattern = /^\d{4}-\d{2}-\d{2}$/
return pattern.test(dateStr)
},
getSimpleDate(date) {
var y = date.getFullYear()
var m = date.getMonth() + 1
m = m < 10 ? '0' + m : m
var d = date.getDate()
d = d < 10 ? '0' + d : d
// var h = date.getHours()
// var minute = date.getMinutes()
// minute = minute < 10 ? '0' + minute : minute
// var s = date.getSeconds()
// s = s < 10 ? '0' + s : s
return y + '-' + m + '-' + d
},
// 数据导出;
exportData: function() {},

View File

@@ -215,7 +215,7 @@ export default {
const searchParam = { ...this.page }
searchParam.pageSize = endIndex
searchParam.currentPage = this.output.startPage
inspectionApi.exportExcel(searchParam).then(res => {
marketingApi.getByPageNew(searchParam).then(res => {
const link = document.createElement('a')
// 创建Blob对象设置文件类型
const blob = new Blob([res], { type: 'application/vnd.ns-excel' }) // MIME类型