Commit 45e2ae63 by zhangquan

创建&列表开发

1 parent 70fb686f
import { http, other_http } from '@/main'
const url = 'rop-scrm-coupon/router'
/**商品分页查询*/
const getCouponsList = params => {
params.method = 'scrm.api.coupon.equity.list.merchant'
return other_http({
url,
data: params
})
}
const createCoupons = params => {
params.method = 'scrm.api.coupon.equity.batch.create'
return other_http({
url,
data: params
})
}
const getExportApi = params => {
params.method = `scrm.api.coupon.equity.list.merchant.export`
return other_http({
url,
data: params,
sign: true
})
}
//领取记录列表
const getListReceiveRecordApi = params => {
params.method = `scrm.api.coupon.listReceiveRecordByCouponId`
return other_http({
url,
method: 'GET',
data: params,
sign: true
})
}
export default {
getCouponsList,
createCoupons,
getExportApi,
getListReceiveRecordApi
}
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
import {Http } from 'glsx-common' import { Http } from 'glsx-common'
let cfg = require('./conf.js') let cfg = require('./conf.js')
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(isEnv = true) {
// if (isEnv) { // if (isEnv) {
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/616e90b11072f92988f05a09/equity/config') return new Http().get('https://oss-config.dev.glsx.com.cn/mock/616e90b11072f92988f05a09/equity/config')
// return new Http().get('https://oss-config.dev.glsx.com.cn/mock/616e90b11072f92988f05a09/equity/config') // return new Http().get('https://oss-config.dev.glsx.com.cn/mock/616e90b11072f92988f05a09/equity/config')
//return window.fetch('https://', {}).then(res => res.json()) //return window.fetch('https://', {}).then(res => res.json())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' }) // request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
......
...@@ -21,7 +21,5 @@ start() ...@@ -21,7 +21,5 @@ start()
export { bootstrap, mount, unmount } from '@/setup' export { bootstrap, mount, unmount } from '@/setup'
export const http = params => Vue.prototype.$http(params) export const http = params => Vue.prototype.$http(params)
export const new_http = params => Vue.prototype.$new_http(params) export const new_http = params => Vue.prototype.$new_http(params)
export const other_http = params => Vue.prototype.$other_http(params)
import './utils/util.js' import './utils/util.js'
import Vue from 'vue' import Vue from 'vue'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { message,messageBox } from '@/plugins/element.js' import { message, messageBox } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import { GLButton,GLTable, GLCombiForm, GLTableButton,GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable, GLCombiForm, GLTableButton, GLDialog } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import render from './render' import render from './render'
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
...@@ -17,10 +17,10 @@ Vue.use(GLCombiForm) ...@@ -17,10 +17,10 @@ Vue.use(GLCombiForm)
Vue.use(GLTableButton) Vue.use(GLTableButton)
Vue.use(GLDialog) Vue.use(GLDialog)
export async function bootstrap({history, common, messenger, globalState,routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch) const { response, request, other_request, sign, secret } = await fetchConfig(globalState.configSwitch)
let newrequest = Object.assign({},request) let newrequest = Object.assign({}, request)
newrequest.baseURL = juedeDomain(request.baseURL) newrequest.baseURL = juedeDomain(request.baseURL)
Vue.prototype.$history = history Vue.prototype.$history = history
Vue.prototype.$messenger = messenger Vue.prototype.$messenger = messenger
Vue.prototype.$globalState = globalState Vue.prototype.$globalState = globalState
...@@ -28,14 +28,15 @@ export async function bootstrap({history, common, messenger, globalState,routerB ...@@ -28,14 +28,15 @@ export async function bootstrap({history, common, messenger, globalState,routerB
Vue.prototype.$message = message Vue.prototype.$message = message
Vue.prototype.$messageBox = messageBox Vue.prototype.$messageBox = messageBox
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$new_http = new common.Http({ response, request:newrequest, sign, secret, alert: message.error, headers: { token: globalState.session.token } }) Vue.prototype.$other_http = new common.Http({ response, request: other_request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
Vue.prototype.$new_http = new common.Http({ response, request: newrequest, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// Vue.prototype.$setGlobalState = globalState.actions.setGlobalState // Vue.prototype.$setGlobalState = globalState.actions.setGlobalState
// Vue.use(GLButton,GLTable, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] }) // Vue.use(GLButton,GLTable, { permissions: globalState.permissions || ['1-1-1-1', '2-1-1-1', '3-1-1-1'] })
const routesData = common.utils.deepClone(globalState.routers) const routesData = common.utils.deepClone(globalState.routers)
// routes = getRoutes({ name, id, routesData }) // routes = getRoutes({ name, id, routesData })
routes = getRoutes(routesData) routes = getRoutes(routesData)
subscribe({ messenger }) subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase}) Vue.use(GLButton, { routes, routerBase })
} }
export async function mount(props) { export async function mount(props) {
const insts = render(props.routerBase, routes) const insts = render(props.routerBase, routes)
...@@ -55,35 +56,35 @@ function subscribe({ messenger }) { ...@@ -55,35 +56,35 @@ function subscribe({ messenger }) {
console.log(`监听到子应用${v.from}发来消息:`, v) console.log(`监听到子应用${v.from}发来消息:`, v)
}) })
} }
function juedeDomain(url){ function juedeDomain(url) {
const val = { const val = {
environment:'test', environment: 'test',
channel:1, channel: 1,
envVersion:'trial'//要打开的小程序版本。正式版为:release,体验版为:trial,开发版为:develop,仅在微信外打开时生效 envVersion: 'trial' //要打开的小程序版本。正式版为:release,体验版为:trial,开发版为:develop,仅在微信外打开时生效
} }
const TEST = url.indexOf('scrm.test.glsx')>-1 const TEST = url.indexOf('scrm.test.glsx') > -1
const GL_PRODUCT = url.indexOf('scrm.glsx.com')>-1 const GL_PRODUCT = url.indexOf('scrm.glsx.com') > -1
const GH_PRODUCT = url.indexOf('scrm.cgacar')>-1 const GH_PRODUCT = url.indexOf('scrm.cgacar') > -1
const DEV = url.indexOf('scrm.dev.glsx')>-1 const DEV = url.indexOf('scrm.dev.glsx') > -1
const BETA = url.indexOf('scrm.beta.glsx')>-1 const BETA = url.indexOf('scrm.beta.glsx') > -1
if(TEST){ if (TEST) {
val.environment = 'test' val.environment = 'test'
}else if(GL_PRODUCT){ } else if (GL_PRODUCT) {
val.environment = 'product' val.environment = 'product'
val.envVersion = 'release' val.envVersion = 'release'
val.channel = 1 val.channel = 1
}else if(GH_PRODUCT){ } else if (GH_PRODUCT) {
val.environment = 'product' val.environment = 'product'
val.envVersion = 'release' val.envVersion = 'release'
val.channel = 2 val.channel = 2
}else if(DEV){ } else if (DEV) {
val.environment = 'dev' val.environment = 'dev'
val.envVersion = 'develop' val.envVersion = 'develop'
}else if(BETA){ } else if (BETA) {
val.environment = 'beta' val.environment = 'beta'
val.channel = 1 val.channel = 1
} }
Vue.prototype.$custom_env = val Vue.prototype.$custom_env = val
let baseURL = url.match(/(\S*)\/rop/)[1]; let baseURL = url.match(/(\S*)\/rop/)[1]
return baseURL return baseURL
} }
...@@ -98,8 +98,33 @@ const exportFn = function(api, params) { ...@@ -98,8 +98,33 @@ const exportFn = function(api, params) {
}) })
} }
const dateFormat = function(dateTime, format = 'YYYY-MM-DD') {
const date = new Date(dateTime)
const config = {
YYYY: date.getFullYear(),
MM: appendZero(date.getMonth() + 1), //getMonth() 方法根据本地时间返回指定日期的月份(从 0 到 11)
DD: appendZero(date.getDate()),
HH: appendZero(date.getHours()),
mm: appendZero(date.getMinutes()),
ss: appendZero(date.getSeconds())
}
for (const key in config) {
format = format.replace(key, config[key])
}
return format
}
function appendZero(int) {
if (int < 10) {
return '0' + `${int}`
} else {
return int
}
}
import Vue from 'vue' import Vue from 'vue'
const utils = { const utils = {
dateFormat,
getParams, getParams,
decimal, decimal,
getHttpsImgUrl, getHttpsImgUrl,
......
<template>
<div class="container">
<GLDialog bigTitle="选择商品优惠券" mode="big" :visible.sync="isVisible" :show-close="true" :before-close="handleClose" :close-on-click-modal="false" @onOk="onOk" @onCancel="onCancel">
<div class="dialog_body">
<GLCombiForm :rowNumber="1" class="dialog_search" ref="searchRef" :formObj="dialogSearchForm" :formData="dialogFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<div class="conpon_type">
<span :class="['type', { active_type: curType == '1' }]" @click="changeConponType(1)">卡券</span>
<span :class="['type', { active_type: curType == '2' }]" @click="changeConponType(2)">直充</span>
</div>
<div class="dialog_table">
<GLTable :pageSizes="pageSizes" ref="tableRef" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun" :searchForm="dialogSearchForm" :tableParams="tableParams" :getListApi="getListApi">
<div class="good_name" slot="goodName" slot-scope="scope">
<img v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.productName + (scope.scope.denomination || '') : scope.scope.productName }}
</div>
<div slot="spreadPrice" slot-scope="scope">
<span>{{ Number((scope.scope.lineationPrice - scope.scope.costPrice).toFixed(2)) }}</span>
</div>
</GLTable>
</div>
</div>
</GLDialog>
</div>
</template>
<script>
const dialogColumns = [
{
label: '品牌',
width: 150,
prop: 'brandName'
},
{
label: '商品名称',
minWidth: 220,
addHtml: 'goodName'
},
{
label: '差价/元',
width: 110,
align: 'right',
addHtml: 'spreadPrice',
renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [
h('span', '差价/元'),
h('table-tooltip', {
props: { content: '差价=官方价-成本价' }
})
])
}
},
{
label: '官方价/元',
width: 110,
align: 'right',
prop: 'lineationPrice'
},
{
label: '成本价/元',
width: 110,
align: 'right',
prop: 'costPrice'
},
{
label: '会员价/元',
width: 110,
align: 'right',
prop: 'salesPrice'
}
]
const dialogColumns1 = [
{
label: '品牌',
width: 150,
prop: 'brandName'
},
{
label: '商品名称',
minWidth: 220,
addHtml: 'goodName'
},
{
label: '直充面额',
width: 110,
prop: 'denomination'
},
{
label: '差价/元',
width: 110,
align: 'right',
renderHeader: h => {
return h('div', { class: 'table-header specHeader' }, [
h('span', '差价/元'),
h('table-tooltip', {
props: { content: '差价=官方价-成本价' }
})
])
},
addHtml: 'spreadPrice'
},
{
label: '官方价/元',
width: 110,
align: 'right',
prop: 'lineationPrice'
},
{
label: '成本价/元',
width: 110,
align: 'right',
prop: 'costPrice'
},
{
label: '会员价/元',
width: 110,
align: 'right',
prop: 'salesPrice'
}
]
export default {
name: 'index',
props: ['isVisible', 'selectedGoodsList'],
data() {
return {
curType: 1,
copyList: [],
pageSizes: [5, 10, 20, 30, 40],
dialogSearchForm: {
brandName: '',
productName: '',
appearance: 1
},
dialogFormData: [
{
label: '商品品牌',
name: 'brandName',
type: 'select',
optionList: [],
optionId: 'brandName',
optionLabel: 'brandName',
isClear: true
},
{
label: '商品名称',
name: 'productName',
type: 'input',
isClear: true
}
],
getListApi: this.$apis.orderApi.getGoodsList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'list',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: false,
tableColumns: dialogColumns
}
}
},
created() {
this.getAllBrandList()
},
methods: {
getAllBrandList() {
this.$apis.orderApi.getAllBrandList().then(res => {
const item = this.dialogFormData.find(item => item.name === 'brandName')
item.optionList = [...res.data]
})
},
handleOk() {
this.$refs.tableRef.refreshTable()
},
handleRest(type) {
let { appearance } = this.dialogSearchForm
this.dialogSearchForm = {
brandName: '',
productName: '',
appearance: type || appearance
}
this.handleOk()
},
changeConponType(type) {
if (this.curType == type) return
this.curType = type
this.$set(this.tableParams, 'tableColumns', type == 2 ? [...dialogColumns1] : [...dialogColumns])
this.handleRest(type)
},
onOk() {
let list = this.$refs?.tableRef?.mutiSelectArr?.[this.tableParams?.mutiSelectName] || []
list.map(item => this.$set(item, 'newCost', Number((item.lineationPrice - item.costPrice).toFixed(2))))
this.$emit('confirmDialog', [...list])
this.handleClose()
},
onCancel() {
this.handleClose()
},
handleClose() {
this.$emit('closeDialog')
},
setTableFinishFun() {
this.copyList = [...this.selectedGoodsList]
this.copyList.forEach(row => {
this.$nextTick(() => {
let idx = this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data.findIndex(item => item.id == row.id)
console.log(idx)
if (idx > -1) {
try {
this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].data[idx], true)
let id = this.copyList.findIndex(item => item.id == row.id)
if (id > -1) this.copyList.splice(id, 1)
} catch (err) {
console.log(err)
}
}
})
})
}
}
}
</script>
<style lang="scss" scoped>
.container {
/deep/ .table-header {
display: inline-flex !important;
align-items: center;
justify-content: center;
padding: 0 !important;
.el-button {
min-width: 0;
}
}
.good_name {
img {
width: 40px;
height: 20px;
vertical-align: text-bottom;
}
}
.dialog_body {
border: 1px solid #e5e5e5;
.dialog_search {
padding: 20px 20px 0;
/deep/ .el-form-item {
width: 312px;
}
}
.conpon_type {
width: 100%;
display: inline-block;
border-bottom: 1px solid #eee;
.type {
display: inline-block;
height: 40px;
width: 70px;
line-height: 40px;
font-weight: 500;
text-align: center;
font-size: 16px;
cursor: pointer;
}
.active_type {
color: #5850ff;
border-bottom: 2px solid #5850ff;
}
}
.dialog_table {
padding: 20px;
}
}
}
</style>
<template> <template>
<div class="container"> <div class="container">
<GLCombiForm ref="searchRef" :formObj="searchForm" :formData="searchFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm> <GLCombiForm ref="searchRef" :formObj="searchForm" :formData="searchFormData" @handleOk="handleOk" @handleRest="handleRest"></GLCombiForm>
<GLButton fn="新增商品优惠券" plain size="small" style="float:left;margin-bottom:10px;" @click="addConpon">创建商品优惠券</GLButton> <div class="operate_wrap">
<el-button plain size="small" style="float:right;margin-bottom:10px;" @click="handleExport">导出</el-button> <span class="table_title">商品优惠券列表</span>
<div class="operate_btn">
<GLButton fn="新增商品优惠券" plain size="small" @click="addConpon">创建优惠券</GLButton>
<el-button class="export_btn" size="small" @click="handleExport">导出</el-button>
</div>
</div>
<GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi"> <GLTable ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi">
<div slot="table-btns" slot-scope="scope"> <div class="good_name" slot="goodsName" slot-scope="scope">
<img class="conpon_type" v-if="scope.scope.appearance == 1" src="@/assets/conpon.png" alt="" />
<img class="conpon_type" v-else src="@/assets/directCharge.png" alt="" />
{{ scope.scope.appearance == 2 ? scope.scope.goodsName + (scope.scope.denomination ? (Number(scope.scope.denomination) / 100).toFixed(2) + '元' : '0元') : scope.scope.goodsName }}
</div>
<div class="good_status" slot="goodStatus" slot-scope="scope">
<span class="circle" :style="{ 'background-color': scope.scope.status == 2 ? '#5850FF' : '#999999' }"></span>
<span>
{{ scope.scope.status == 2 ? '生效中' : '已失效' }}
</span>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div> </div>
</GLTable> </GLTable>
...@@ -17,13 +33,13 @@ export default { ...@@ -17,13 +33,13 @@ export default {
name: 'index', name: 'index',
data() { data() {
return { return {
getListApi: this.$apis.orderApi.getGoodsList, getListApi: this.$apis.goodsConponApi.getCouponsList,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchForm: { searchForm: {
brand: '0', brandName: '',
goodsName: '', goodsName: '',
type: '0', appearance: '',
status: '0' status: ''
}, },
buttonList: [ buttonList: [
{ {
...@@ -35,6 +51,9 @@ export default { ...@@ -35,6 +51,9 @@ export default {
type: 'text', type: 'text',
fn: '生效' fn: '生效'
}, },
condition: row => {
return row.scope.status != 2
},
listeners: { listeners: {
click: row => this.changeStatus(row.scope) click: row => this.changeStatus(row.scope)
} }
...@@ -49,7 +68,7 @@ export default { ...@@ -49,7 +68,7 @@ export default {
fn: '失效' fn: '失效'
}, },
condition: row => { condition: row => {
return false return row.scope.status == 2
}, },
listeners: { listeners: {
click: row => this.changeStatus(row.scope) click: row => this.changeStatus(row.scope)
...@@ -65,95 +84,71 @@ export default { ...@@ -65,95 +84,71 @@ export default {
fn: '领取详情' fn: '领取详情'
}, },
listeners: { listeners: {
click: row => this.goDetailPage(row.scope) click: row => this.goDetailPage(row)
} }
} }
], ],
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: false, tableOption: true,
tableColumns: [ tableColumns: [
{ {
label: '品牌', label: '品牌',
width: 150, width: 150,
formatter: cell => { prop: 'brandName'
return '海威'
}
}, },
{ {
label: '商品名称', label: '商品名称',
minWidth: 150, width: 280,
formatter: cell => { line: 1,
let str = cell.appearance == 1 ? `${cell.brandName || ''}${cell.productName || ''}` : `${cell.brandName || ''}${cell.productName || ''}${cell.denomination || ''}` addHtml: 'goodsName'
return str
}
},
{
label: '商品形态',
width: 150,
prop: 'salesPrice',
formatter(cell) {
return parseFloat(cell.salesPrice).toFixed(2)
}
}, },
{ {
label: '券面额', label: '券面额/元',
width: 110, width: 110,
align: 'right', align: 'right',
formatter: cell => { formatter: cell => {
return cell.stock == -1 ? '无限制' : cell.stock return cell.denomination ? Number((Number(cell.denomination) / 100).toFixed(2)) : 0
} }
}, },
{ {
label: '有效期', label: '有效期/天',
prop: 'salesPrice' width: 110,
prop: 'effectiveDays'
}, },
{ {
label: '状态', label: '状态',
prop: 'salesPrice' width: 110,
addHtml: 'goodStatus'
}, },
{ {
label: '已领取', label: '已领取',
prop: 'salesPrice' width: 110,
prop: 'getAmount'
}, },
{ {
label: '已使用', label: '已使用',
prop: 'salesPrice' width: 110,
prop: 'usedAmount'
}, },
{ {
label: '创建日期', label: '创建日期',
width: 150, width: 180,
prop: 'salesPrice' prop: 'createdDate',
}, formatter: cell => {
{ return this.dateFormat(cell.createdDate, 'YYYY-MM-DD HH:mm:ss')
label: '操作', }
width: 170,
fixed: 'right',
addHtml: 'table-btns'
} }
] ]
}, },
searchFormData: [ searchFormData: [
{ {
label: '商品品牌', label: '商品品牌',
name: 'brand', name: 'brandName',
type: 'select', type: 'select',
optionList: [ optionList: [],
{ optionId: 'brandName',
id: '0', optionLabel: 'brandName',
label: '全部'
},
{
id: '1',
label: '益禾堂'
},
{
id: '2',
label: '肯德基'
}
],
optionId: 'id',
optionLabel: 'label',
isClear: true isClear: true
}, },
{ {
...@@ -164,11 +159,11 @@ export default { ...@@ -164,11 +159,11 @@ export default {
}, },
{ {
label: '商品形态', label: '商品形态',
name: 'type', name: 'appearance',
type: 'select', type: 'select',
optionList: [ optionList: [
{ {
id: '0', id: '',
label: '全部' label: '全部'
}, },
{ {
...@@ -190,15 +185,15 @@ export default { ...@@ -190,15 +185,15 @@ export default {
type: 'select', type: 'select',
optionList: [ optionList: [
{ {
id: '0', id: '',
label: '全部' label: '全部'
}, },
{ {
id: '1', id: '2',
label: '生效中' label: '生效中'
}, },
{ {
id: '2', id: '3',
label: '已失效' label: '已失效'
} }
], ],
...@@ -209,23 +204,32 @@ export default { ...@@ -209,23 +204,32 @@ export default {
] ]
} }
}, },
created() {
this.getAllBrandList()
},
methods: { methods: {
handleOk() { handleOk() {
this.$refs.tableRef.refreshTable() this.$refs.tableRef.refreshTable()
}, },
getAllBrandList() {
this.$apis.orderApi.getAllBrandList().then(res => {
const item = this.searchFormData.find(item => item.name === 'brandName')
item.optionList = [...res.data]
})
},
handleRest() { handleRest() {
this.searchForm = { this.searchForm = {
brand: '0', brandName: '',
goodsName: '', goodsName: '',
type: '0', appearance: '',
status: '0' status: ''
} }
this.handleOk() this.handleOk()
}, },
// 导出 // 导出
handleExport() { handleExport() {
var params = { ...this.searchForm } var params = { ...this.searchForm }
this.$apis.beforeSale.getExportApi(params).then(res => { this.$apis.goodsConponApi.getExportApi(params).then(res => {
let tempaa = utils.getExplorer() let tempaa = utils.getExplorer()
if (tempaa == 'QQ') { if (tempaa == 'QQ') {
window.open(res) window.open(res)
...@@ -237,8 +241,8 @@ export default { ...@@ -237,8 +241,8 @@ export default {
} }
}) })
}, },
goDetailPage() { goDetailPage(row) {
this.$router.push('/goodsConpon/receivedDetail') this.$router.push('/goodsConpon/receivedDetail', { id: row.scope.id })
}, },
changeStatus() {}, changeStatus() {},
addConpon() { addConpon() {
...@@ -250,6 +254,42 @@ export default { ...@@ -250,6 +254,42 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.container { .container {
background-color: #fff; background-color: #fff;
padding: 30px; padding: 20px;
.good_name {
.conpon_type {
width: 40px;
height: 20px;
vertical-align: text-bottom;
}
}
.good_status {
.circle {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 50%;
vertical-align: middle;
margin-right: 4px;
}
}
.operate_wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
.table_title {
height: 32px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 16px;
color: #333333;
line-height: 32px;
}
.operate_btn {
.export_btn {
margin-left: 8px;
}
}
}
} }
</style> </style>
...@@ -68,7 +68,7 @@ export default { ...@@ -68,7 +68,7 @@ export default {
received: { required: true, message: '', trigger: 'change' }, received: { required: true, message: '', trigger: 'change' },
used: { required: true, message: '', trigger: 'change' } used: { required: true, message: '', trigger: 'change' }
}, },
getListApi: this.$apis.orderApi.getGoodsList, getListApi: this.$apis.goodsConponApi.getListReceiveRecordApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: { tableParams: {
listName: 'list', listName: 'list',
...@@ -110,7 +110,8 @@ export default { ...@@ -110,7 +110,8 @@ export default {
userInfo: '', userInfo: '',
merchant: '', merchant: '',
status: '0', status: '0',
receivedDate: '' receivedDate: '',
couponId: ''
}, },
searchFormData: [ searchFormData: [
{ {
...@@ -161,6 +162,11 @@ export default { ...@@ -161,6 +162,11 @@ export default {
] ]
} }
}, },
mounted() {
let id = this.$route.query.id
console.log(this.$route)
this.searchForm.couponId = id
},
methods: { methods: {
handleOk() { handleOk() {
this.$refs.tableRef.refreshTable() this.$refs.tableRef.refreshTable()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!