Commit 4315b62f by 胡悦

Merge branch 'v1.0.1' of http://192.168.3.233:8090/saas/scrm-micro-marketing into v1.0.1

2 parents b447e831 5e02edce
......@@ -31,6 +31,11 @@ html {
box-shadow: 0 1px 5px 0 rgba(38, 38, 38, 0.10);
}
.fr-mr0 {
float: right;
margin-right: 0!important;
}
//输入框后置文字(如 “元”)
.suffix-label {
font-size: 14px;
......
......@@ -31,6 +31,52 @@ function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, max
}
}
function getExplorer() {
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
function exportFn(url) {
let browserType = getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
}
// function aToExport(url) {
// var a = document.createElement('a')
// a.setAttribute('id', 'exportToExport')
// a.setAttribute('href', url)
// a.setAttribute('target', '_blank')
// document.body.appendChild(a)
// a.click()
// }
const orderManageStatusList = [
{ confId: '1', confName: '未支付' },
{ confId: '2', confName: '已支付' },
......@@ -151,6 +197,9 @@ const stateList = [{
export {
limitPrice,
getExplorer,
exportFn,
// aToExport,
orderManageStatusList,
orderSourceList,
deliveryTypeList,
......
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLTable v-loading="loading" ref="mutiProRef" :tableData="productList" :hasPage="false" :noDataImg="url" :tableParams="tableParams" @refreshTable="getList">
<glsx-dialog
class="muti-pro"
title="选择商品"
:isVisible.sync="isMutiSelectVisible"
:btnOkLabel="productList.length ? '确定' : '创建商品'"
width="70%"
@confirmDialog="handleMutiSelectConfirm"
@closeDialog="handleMutiSelectClose"
v-loading="loading"
>
<div class="noproDiv" v-show="!productList.length && fnCallBack">
<img src="@/assets/noPro.png" />
<p class="noproP">系统暂无已创建的商品</p>
</div>
<div v-show="productList.length">
<slot name="search"></slot>
<GLTable
v-loading="loading"
ref="mutiProRef"
:tableData="productList"
:hasPage="false"
:noDataImg="url"
:tableParams="tableParams"
@refreshTable="getList"
>
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
</GLTable>
</div>
</glsx-dialog>
</template>
<script>
// import { getGoodsList } from '@/api/modules/common'
import url from "@/assets/empty.png"
import url from '@/assets/empty.png'
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
......@@ -19,7 +43,9 @@ export default {
return {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
userInfo: {},
productList: [],
fnCallBack: false,
url: url,
loading: true,
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
......@@ -58,6 +84,10 @@ export default {
type: Boolean,
default: false
},
searchForm: {
type: Object,
default: () => {}
},
selectedProList: {
type: Array,
default: () => []
......@@ -68,23 +98,26 @@ export default {
glsxDialog
},
created() {
mounted() {
this.userInfo = this.$globalState.session
this.getList(true)
},
methods: {
getList(isMounted = false) {
getList(isReset = false) {
var params = {
...this.searchForm,
goodsStatus: 1,
goodsSource: 1,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
pageNum: isReset ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isReset ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
this.loading = true
this.$apis.common.getGoodsListApi(params).then(res => {
this.productList = res
this.loading = false
this.fnCallBack = true
// this.$refs.mutiProRef.tableTotal = res.total
this.productList.forEach(function(item) {
item.saleAmount = item.goodsStatistics.saleAmount
......@@ -123,8 +156,19 @@ export default {
}
},
handleMutiSelectConfirm() {
if (!this.productList.length) {
var params = {
addOrEdit: 1,
groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
$title: '新建商品'
}
this.$router.push({
path: '/productGroup/editProduct',
query: params
})
return true
}
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
// console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
......@@ -137,4 +181,14 @@ export default {
.muti-pro .m-t-10 {
margin-top: 10px;
}
.muti-pro .noproP {
width: 100%;
height: 20px;
font-family: PingFangSC-Medium;
font-size: 16px;
color: #666666;
line-height: 20px;
font-weight: 500;
text-align: center;
}
</style>
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose" :noClose="false" :noCancel="true" :showClose="true">
<glsx-dialog
class="muti-pro"
title="选择商品"
:isVisible.sync="isMutiSelectVisible"
:btnOkLabel="productList.length ? '确定' : '创建商品'"
width="70%"
@confirmDialog="handleMutiSelectConfirm"
@closeDialog="handleMutiSelectClose"
:noClose="false"
:noCancel="true"
:showClose="true"
>
<div style="max-height:60vh">
<div class="noproDiv" v-if="!productList.length && fnCallBack">
<img src="@/assets/noPro.png" />
......@@ -9,14 +20,26 @@
<div v-if="productList.length">
<el-form :inline="true" :model="searchProForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchProForm.name" placeholder="请输入商品名称" maxlength="20" clearable></el-input>
<el-input
:size="size"
v-model="searchProForm.name"
placeholder="请输入商品名称"
maxlength="20"
clearable
></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleConfigSearch">查询</el-button>
<el-button :size="size" @click="handleConfigReset">重置</el-button>
</el-form-item>
</el-form>
<GLTable ref="mutiProRef" :tableData="productList" :hasPage="false" :tableParams="tableParams" @refreshTable="getList">
<GLTable
ref="mutiProRef"
:tableData="productList"
:hasPage="false"
:tableParams="tableParams"
@refreshTable="getList"
>
<span slot="goodsImage" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.goodsImage" />
</span>
......@@ -36,6 +59,7 @@ export default {
// 表格组件
// getListApi: this.$apis.common.getGoodsListApi,
productList: [],
userInfo: {},
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
searchProForm: {
name: ''
......@@ -87,6 +111,7 @@ export default {
},
mounted() {
this.userInfo = this.$globalState.session
this.getList(true)
},
......@@ -147,12 +172,24 @@ export default {
}
},
handleMutiSelectConfirm() {
if(!this.productList.length) {
var params = {
addOrEdit: 1,
groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
$title: '新建商品'
}
this.$router.push({
path: '/productGroup/editProduct',
query: params
})
return true
}
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
if (!selectedData) {
this.$message({
message: '未选择商品',
type: 'error'
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
......
......@@ -102,7 +102,15 @@ export default {
},
handleSingleSelectConfirm() {
if(!this.productList.length) {
this.$history.push(this.userInfo.accountLevel == 4 ? '/marketing/productGroup/editProduct/1/2' : '/marketing/productGroup/editProduct/1/1')
var params = {
addOrEdit: 1,
groupOrStore: this.userInfo.accountLevel == 4 ? 2 : 1,
$title: '新建商品'
}
this.$router.push({
path: '/productGroup/editProduct',
query: params
})
return true
}
if (!this.infoId) {
......
......@@ -24,7 +24,7 @@
<el-button type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
<select-muti-pro-dialog v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose">
<select-muti-pro-dialog ref="classMutiProRef" v-if="isMutiSelectVisible" :isMutiSelectVisible="isMutiSelectVisible" :searchForm="searchProForm" :selectedProList="selectedProList" @handleMutiSelectConfirm="handleMutiSelectConfirm" @handleMutiSelectClose="handleMutiSelectClose">
<!-- <template slot="search">
<div class="flex">
<el-form :inline="true" :model="searchProForm">
......@@ -150,8 +150,16 @@ export default {
})
})
},
handleConfigSearch() {
this.$refs.classMutiProRef.getList()
},
handleConfigReset() {
this.searchProForm = {
name: ''
}
this.handleConfigSearch()
},
handleMutiProClose(targetItem) {
// console.log(targetItem)
this.selectedProList = this.$common.utils.deepClone(this.editForm.goodsRefList)
this.handleMutiSelectClose()
},
......
......@@ -45,6 +45,7 @@
<script>
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'coupon',
data() {
......@@ -349,11 +350,7 @@ export default {
handleExport(row) {
var params = this.getParams()
this.$apis.couponManage.couponExportApi(params).then(res => {
var a = document.createElement('a')
a.setAttribute('href', res)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
exportFn(res)
})
},
......
......@@ -55,6 +55,7 @@
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'writeOffDetail',
data() {
......@@ -258,11 +259,7 @@ export default {
handleExport(row) {
var params = this.getParams()
this.$apis.couponManage.verificationExportApi(params).then(res => {
var a = document.createElement('a')
a.setAttribute('href', res)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
exportFn(res)
})
},
......
......@@ -79,7 +79,7 @@
<el-date-picker :size="size" v-model="searchForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
......
......@@ -24,7 +24,7 @@
<el-date-picker :size="size" v-model="searchForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
......@@ -53,7 +53,7 @@
</template>
<script>
import { orderTypesList, orderStatusList } from '@/common/constant'
import { orderTypesList, orderStatusList, exportFn } from '@/common/constant'
import url from '@/assets/empty.png'
import { getOrderListApi, orderExportApi } from '@/api/modules/order'
export default {
......@@ -215,11 +215,7 @@ export default {
handleExport(row) {
var params = this.getParams()
orderExportApi(params).then(res => {
var a = document.createElement('a')
a.setAttribute('href', res)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
exportFn(res)
})
},
......
......@@ -30,7 +30,7 @@
<el-date-picker :size="size" v-model="searchForm.daterange" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" style="float: right">
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="openDialog">核销</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
......@@ -63,6 +63,7 @@ import glsxDialog from '@/components/glsx-dialog'
import { getRecordListApi,getVerificationCode,verificationExportApi } from '@/api/modules/record'
import url from "@/assets/empty.png"
import { dateFormat } from '@/utils/index.js'
import { exportFn } from '@/common/constant'
export default {
name: 'record',
components: {
......@@ -241,11 +242,7 @@ export default {
handleExport(row) {
var params = this.getParams()
verificationExportApi(params).then(res => {
var a = document.createElement('a')
a.setAttribute('href', res)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
exportFn(res)
})
},
......
......@@ -6,14 +6,14 @@
<el-form :inline="true" style="width:100%" :model="searchForm" label-width="70px" label-position="right">
<el-row>
<!-- <el-form-item size="small"> -->
<!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button> -->
<!-- <el-button :size="size" type="primary" icon="el-icon-plus" @click="handleCreate">创建服务</el-button>display="disabled" -->
<GLButton type="primary" @click="handleCreate" style="margin-right:30px" size="small" icon="el-icon-plus" fn="创建服务" mode="el-button">创建服务</GLButton>
<!-- </el-form-item> -->
<el-form-item size="small" label="服务名称">
<el-input :size="size" v-model="searchForm.couponName" placeholder="请输入服务名称" clearable></el-input>
</el-form-item>
<el-form-item size="small" style="float:right">
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
......
......@@ -112,7 +112,7 @@
<script>
import * as dayjs from 'dayjs'
import url from "@/assets/empty.png"
import { orderManageStatusList, orderSourceList, deliveryTypeList } from '@/common/constant'
import { orderManageStatusList, orderSourceList, deliveryTypeList, exportFn } from '@/common/constant'
export default {
name: 'orderManage',
data() {
......@@ -654,12 +654,7 @@ export default {
handleExport(row) {
var params = this.getParams()
this.$apis.orderManage.orderExportApi(params).then(res => {
// window.open(res)
var a = document.createElement('a')
a.setAttribute('href', res)
a.setAttribute('target', '_blank')
document.body.appendChild(a)
a.click()
exportFn(res)
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!