Commit 03c2ccc8 by zhouzy

1

1 parent 1e8d5092
This diff could not be displayed because it is too large.
......@@ -14,7 +14,7 @@
"el-tree-transfer": "^2.4.7",
"element-ui": "^2.15.6",
"glsx-common": "^1.4.9",
"glsx-components": "^1.2.5",
"glsx-components": "^1.3.7",
"glsx-vue-components": "^1.0.15",
"jquery": "^3.6.0",
"vue": "^2.6.14",
......
......@@ -26,7 +26,7 @@ const getOrderDetail = params => {
params.method = 'scrm.api.equity.order.detail.get'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 开启售后状态修改*/
......@@ -34,7 +34,7 @@ const openRefund = params => {
params.method = 'scrm.api.equity.order.refund.open'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 获取售后订单列表*/
......@@ -49,7 +49,7 @@ const getRefundDetail = params => {
params.method = 'scrm.api.equity.order.refund.list.get'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 获取e代驾订单列表*/
......@@ -78,7 +78,7 @@ const goodsShelves = (params = {}) => {
params.method = 'scrm.api.equity.goods.shelves'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/**商品删除/支持批量*/
......@@ -86,7 +86,7 @@ const deleteGoods = (params = {}) => {
params.method = 'scrm.api.equity.goods.delete'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 商品id获取商品信息*/
......@@ -94,15 +94,15 @@ const getEquityGoodsById = (params = {}) => {
params.method = 'scrm.api.equity.goods.get.by.id'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 第三方商品分页查询*/
const getListWithPageOutGoods = (params = { supplier: 'HW',pageSize: 99999 }) => {
const getListWithPageOutGoods = (params = { supplier: 'HW', pageSize: 99999 }) => {
params.method = 'scrm.api.equity.goods.out.list.with.page'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/**商品编号获取商品信息(第三方)*/
......@@ -110,7 +110,7 @@ const getEquityOutGoodsBySupplierProductId = params => {
params.method = 'scrm.api.equity.goods.out.get'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 同渠道商品编码校验*/
......@@ -118,7 +118,7 @@ const sameGoodsCheck = (params = {}) => {
params.method = 'scrm.api.equity.goods.same.check'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 库存与下架校验*/
......@@ -126,7 +126,7 @@ const stockAndStatusCheck = (params = {}) => {
params.method = 'scrm.api.equity.goods.stock.status.check'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/**商品新增*/
......@@ -134,7 +134,7 @@ const createGoods = params => {
params.method = 'scrm.api.equity.goods.insert'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 商品修改*/
......@@ -142,7 +142,7 @@ const updateGoods = (params = {}) => {
params.method = 'scrm.api.equity.goods.update'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/**导出财务列表Excel*/
......@@ -150,15 +150,31 @@ const exportBalanceList = params => {
params.method = 'scrm.api.equity.order.balance.list.export'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 获取渠道下所有品牌 */
const getAllBrandList = (params = { supplier: 'HW',pageNum: 1,pageSize: 9999 }) => {
const getAllBrandList = (params = { supplier: 'HW', pageNum: 1, pageSize: 9999 }) => {
params.method = 'scrm.api.equity.goods.brand.list.all'
return http({
data: params,
returnAll:true
returnAll: true
})
}
/** 导出权益列表 */
const exportOrderList = params => {
params.method = 'scrm.api.equity.order.list.get.export'
return http({
data: params,
returnAll: true
})
}
/** 导出加油列表 */
const exportGasList = params => {
params.method = 'scrm.api.equity.oil.order.list.with.page.export'
return http({
data: params,
returnAll: true
})
}
export default {
......@@ -182,5 +198,7 @@ export default {
createGoods,
updateGoods,
exportBalanceList,
getAllBrandList
getAllBrandList,
exportOrderList,
exportGasList
}
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
<!-- 搜索 -->
<template>
<div class="glsx-combi-form">
<el-form :ref="formRef" :inline="true" :model="formObj" :label-width="labelWidth" :rules="formRules" size="small" class="glsx-combi-form-block">
<template v-for="(item, index) in formData">
<el-form-item v-if="!item.isHide" :key="index" :id="item.name" :class="{ 'no-label': !item.label, isBlock: isBlock }" :style="{ ...item.style }" :label="item.label ? item.label + ':' : ''" :prop="item.name">
<span v-if="!item.isHide && item.tips" class="tips-block" slot="label">
<span class="tips-label">{{ item.label }}</span>
<el-tooltip popper-class="tooltip-class" effect="dark" :content="item.tips" :placement="item.placement || 'top'">
<span class="tips-icon"></span>
</el-tooltip>
{{ item.label ? ':' : '' }}
</span>
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)" @blur="e => handleInputBlur(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 选择-输入框 -->
<el-input v-else-if="item.type === 'selectInput'" :placeholder="'请输入' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label" :maxlength="item.maxlength" v-model.trim="searchSelectObj[item.selectName].value" :clearable="item.isClear || false" :style="{ width: item.inputWidth || '130px' }" class="input-with-select">
<el-select v-model="searchSelectObj[item.selectName].attr" :style="{ width: item.selectWidth || '130px' }" slot="prepend" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
</el-input>
<!-- 选择-时间选择框 -->
<template v-else-if="item.type === 'selectDatePicker'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-date-picker v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOption[item.pickerOptions]"></el-date-picker>
</template>
<!-- 双选择框 -->
<template v-else-if="item.type === 'selectDouble'">
<el-select v-model="searchSelectObj[item.selectName].attr" style="width: 130px" placeholder="请选择" @change="item.handleSelectChange">
<el-option v-for="(subItem, subIndex) in item.selectOption" :key="subIndex" :label="subItem.label" :value="subItem.name"></el-option>
</el-select>
<el-select v-model="searchSelectObj[item.selectName].value" style="width: calc(100% - 130px)" :placeholder="'请选择' + item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).label">
<el-option label="全部" value=""></el-option>
<el-option v-for="subItem in item.selectOption.find(k => k.name === searchSelectObj[item.selectName].attr).optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]"></el-option>
</el-select>
</template>
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="'请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.selectWidth || defaultWidth }" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :placeholder="item.placeholder || '请选择' + item.label" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]" @change="e => handleDateChange(e, item)"></el-date-picker>
<template v-else-if="item.type === 'uploadBtn'">
<el-button type="primary">
上传
<input type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="upload-img-btn" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</el-button>
<!-- <el-button v-show="formObj[item.name]" type="primary">查看</el-button> -->
<el-button v-show="formObj[item.name]" type="primary" @click="handleImgLook(formObj[item.name], item)">查看</el-button>
</template>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || '100%' }">
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length < item.maxPhotoNum : !formObj[item.name]" class="activity-img img-w-h">
<div class="add">+</div>
<span class="number">{{ formObj[item.name].length }} / {{ item.maxPhotoNum }}</span>
<input v-if="item.uploadType == 'video'" type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="video/mp4" @change="e => handleUploadChange(e, item)" />
<input v-else type="file" style="opacity: 0;" :id="item.name + 'file'" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleUploadChange(e, item)" />
</div>
</div>
<template>
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]">
<span v-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="typeof subItem == 'object' ? subItem.content : subItem"></video>
<img v-else class="img-w-h" :src="typeof subItem == 'object' ? subItem.content : subItem" />
<span class="img-btns">
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem.content : subItem, item)"></i>
</span>
</span>
</span>
</span>
<span v-else class="muti-imgs">
<video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="formObj[item.name]"></video>
<img v-else class="img-w-h" :src="formObj[item.name]" />
<span class="img-btns">
<span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(formObj[item.name], item)"></i>
</span>
</span>
</span>
</div>
</template>
</template>
</el-form-item>
</template>
<slot name="footer"></slot>
</el-form>
<el-dialog :visible.sync="isImgVisible" class="dialog-look">
<video v-if="dialogObj.uploadType == 'video'" class="dialog-video" controls>
<source :src="dialogObj.url" type="video/mp4" />
</video>
<img v-else class="dialog-img" width="100%" :src="dialogObj.url" alt="" />
</el-dialog>
</div>
</template>
<script>
import { beforeRangePickerOptions, afterRangePickerOptions } from './common'
export default {
name: 'glsx-combi-form',
data() {
return {
pickerOption: {
beforeRangePickerOptions: beforeRangePickerOptions,
afterRangePickerOptions: afterRangePickerOptions
},
isImgVisible: false,
dialogObj: {
url: '',
uploadType: 'img'
}
}
},
props: {
isBlock: {
type: Boolean,
default: false
},
defaultWidth: {
type: String,
default: '220px'
},
formRef: {
type: String,
default: 'formRef'
},
labelWidth: {
type: String,
default: '85px'
},
formData: {
type: Array,
default: () => []
},
formObj: {
type: Object,
default: () => {}
},
hasTitle: {
type: Boolean,
default: true
},
formRules: {
type: Object,
default: () => {}
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => {}
}
},
mounted() {},
methods: {
// 选择框-添加其他属性
selectAddAttr(value, targetItem) {
targetItem.changeAttr && targetItem.changeAttr(value, targetItem)
},
handleInputDown(e, item) {
if (e.keyCode === 13 && item.hasOwnProperty('keyFn')) {
item.keyFn()
}
},
handleInputBlur(e, targetItem) {
targetItem.inputBlur && targetItem.inputBlur()
},
handleDateChange(value, targetItem) {
targetItem.handleDateChange && targetItem.handleDateChange(value, targetItem)
},
// 图片
handleUploadChange(e, targetItem) {
var reader = new FileReader()
var file = e.srcElement.files[0]
var uploadType = targetItem.uploadType || 'img'
// console.log(file)
// 默认1MB
const limitSize = targetItem.limitSize || 1
const isLt = file.size / 1024 / 1024 < limitSize
const isType = uploadType == 'img' ? ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type) : ['video/mp4'].includes(file.type)
const maxPhotoNum = targetItem.maxPhotoNum || 1
const wdithLt = targetItem.wdithLt || 300
const heightLt = targetItem.heightLt || 300
if (maxPhotoNum == this.formObj[targetItem.name].length) {
this.$message.error('只能上传' + maxPhotoNum + (uploadType == 'img' ? '张图片' : '个视频'))
return true
}
if (!isType) {
this.$message.error(uploadType == 'img' ? '上传图片不是jpg、jpeg或png的格式!' : '上传视频不是MP4的格式!')
return true
}
if (!isLt) {
this.$message.error('上传' + (uploadType == 'img' ? '图片' : '视频') + '大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
if (uploadType == 'img') {
var image = new Image()
image.src = e.target.result
image.onload = () => {
var imgWidth = image.width
var imgHeight = image.height
if (targetItem.hasPixel && (imgWidth > wdithLt || imgHeight > heightLt)) {
this.$message.error('图片尺寸最大为' + wdithLt + '像素*' + heightLt + '像素')
} else {
targetItem.handleUpload(e, file, targetItem)
}
}
} else {
targetItem.handleUpload(e, file, targetItem)
}
}
},
// 图片删除
handleImgDelete(targetItem, subIndex = -1) {
Array.isArray(this.formObj[targetItem.name]) ? this.formObj[targetItem.name].splice(subIndex, 1) : (this.formObj[targetItem.name] = '')
this.$emit('handleImgDelete', targetItem)
},
// 图片查看
handleImgLook(src, targetItem) {
this.isImgVisible = true
this.dialogObj = {
url: src,
uploadType: targetItem.uploadType || 'img'
}
}
}
}
</script>
<style>
/* .glsx-combi-form {
min-width: 922px;
} */
/* .glsx-combi-form .glsx-combi-form-block {
padding: 16px 40px 0;
} */
.glsx-combi-form.clearfix::after {
content: '';
display: inline-block;
clear: both;
}
.glsx-combi-form .isBlock {
display: block !important;
}
/* .glsx-combi-form .el-form-item {
width: 65%;
} */
.glsx-combi-form .no-label.el-form-item--small .el-form-item__content,
.el-form-item--small .el-form-item__label {
width: 100%;
}
/* .glsx-combi-form .el-form-item--small .el-form-item__content {
width: calc(100% - 85px);
} */
.glsx-combi-form .el-col {
margin-bottom: 10px;
}
.glsx-combi-form .el-select {
width: 100%;
}
.glsx-combi-form .item-height {
height: 37px;
}
.glsx-combi-form input::-webkit-outer-spin-button,
.glsx-combi-form input::-webkit-inner-spin-button {
-webkit-appearance: none !important;
}
.glsx-combi-form input[type='number'] {
-moz-appearance: textfield !important;
}
.glsx-combi-form .input-with-select .el-input-group__prepend {
background-color: #fff;
}
/* 提示图标 */
.glsx-combi-form .tips-block {
position: relative;
}
.glsx-combi-form .tips-label {
margin-right: 20px;
}
.glsx-combi-form .tips-icon {
position: absolute;
display: inline-block;
width: 12px;
height: 12px;
top: 3px;
right: 14px;
margin-right: 4px;
cursor: pointer;
border: 1px solid #7f7f7f;
border-radius: 50%;
}
.glsx-combi-form .tips-icon::before {
content: '?';
position: absolute;
width: 8px;
height: 8px;
top: -8px;
left: 1px;
font-size: 10px;
}
/* .glsx-combi-form .tips {
margin: 0;
} */
.glsx-combi-form .upload-img-btn {
width: 62px;
height: 32px;
position: absolute;
left: 0;
top: 0;
cursor: pointer;
}
/* 图片上传 */
.glsx-combi-form .photo-top-tips {
/* height: 36px; */
margin: 0 0;
color: #999999;
}
.glsx-combi-form .img-w-h {
width: 80px;
height: 80px;
}
.glsx-combi-form .activity-img {
position: relative;
color: #999999;
border: 1px dashed #d9d9d9;
cursor: pointer;
}
.glsx-combi-form .activity-Input {
position: absolute;
top: 0;
left: 0;
}
.glsx-combi-form .muti-imgs {
display: inline-block;
position: relative;
}
.activity-img .add {
position: absolute;
top: 40%;
font-size: 40px;
left: 50%;
transform: translate3d(-50%, -50%, 0);
}
.activity-img .number {
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
}
.muti-imgs .img-btns {
display: none;
height: 100%;
position: absolute;
width: 80px;
height: 80px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.glsx-combi-form .el-icon-delete,
.glsx-combi-form .el-icon-zoom-in {
cursor: pointer;
}
.muti-imgs .img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.muti-imgs .img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.muti-imgs:hover .img-btns {
display: block;
}
.glsx-combi-form .dialog-img {
width: 100%;
height: 100%;
}
.glsx-combi-form .dialog-look {
text-align: center;
z-index: 999;
}
.glsx-combi-form .dialog-video {
width: 50%;
height: 50%;
}
/* 图片上传 */
</style>
<!-- 弹窗 -->
<template>
<div>
<el-dialog :title="title" :visible.sync="isVisible" :show-close="showClose" :before-close="handleClose" :close-on-click-modal="false" :width="width">
<span slot="title">
{{ title }}
<span class="dialog-sub-title">
<slot name="sub-title"></slot>
</span>
</span>
<slot></slot>
<div slot="footer">
<slot name="btn-start"></slot>
<el-button type="primary" :size="btnSize" @click="handleConfirm">{{ btnOkLabel }}</el-button>
<el-button v-if="!noCancel" :size="btnSize" @click="handleClose">取消</el-button>
<slot name="btn-middle"></slot>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'glsx-dialog',
data() {
return {}
},
props: {
title: {
type: String,
default: ''
},
isVisible: {
type: Boolean,
default: false
},
showClose: {
type: Boolean,
default: true
},
btnOkLabel: {
type: String,
default: '确定'
},
noCancel: {
type: Boolean,
default: false
},
width: {
type: String,
default: '580px'
},
btnSize: {
type: String,
default: 'mini'
}
},
methods: {
handleClose() {
this.$emit('closeDialog')
},
handleConfirm() {
this.$emit('confirmDialog')
}
}
}
</script>
<style scoped>
.dialog-sub-title {
font-size: 12px;
color: #666666;
}
</style>
......@@ -17,4 +17,8 @@ Vue.component('d2-table', () =>
import ('./equity-dialog/index.vue'))
Vue.component('table-tooltip', () =>
import ('./table-tooltip/index.vue'))
Vue.component('glsx-dialog', () =>
import ('./glsx-dialog/index.vue'))
Vue.component('glsx-combi-form', () =>
import ('./glsx-combi-form/index.vue'))
......@@ -8,7 +8,7 @@ import 'glsx-components/dist/glsx-components.css'
let routes = []
let router = null
let instance = null
export async function bootstrap({ name, id, history, common, messenger, globalState }) {
export async function bootstrap({ name, id, history, common, messenger, globalState,routerBase }) {
const { response, request, sign, secret } = await fetchConfig(globalState.configSwitch)
Vue.prototype.$history = history
Vue.prototype.$messenger = messenger
......@@ -16,11 +16,12 @@ export async function bootstrap({ name, id, history, common, messenger, globalSt
Vue.prototype.$common = common
Vue.prototype.$http = new common.Http({ response, request, sign, secret, alert: message.error, headers: { token: globalState.session.token } })
// 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)
// routes = getRoutes({ name, id, routesData })
routes = getRoutes(routesData)
subscribe({ messenger })
Vue.use(GLButton, { routes, routerBase})
}
export async function mount(props) {
const insts = render(props.routerBase, routes)
......
......@@ -4,7 +4,7 @@
<div class="tapItem">
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="批次管理" name="first" class="contain" style="margin: 0" id="batch">
<el-button type="primary" size="small" @click="dialogVisible = true">批量生成权益卡</el-button>
<GLButton fn="批量生成权益卡" type="primary" size="small" @click="dialogVisible = true">批量生成权益卡</GLButton>
<el-form :inline="true" label-width="auto" label-position="right" style="margin-top: 20px" class="collectonForm">
<el-row style="align-items: center" class="select">
<el-form-item label="添加时间">
......@@ -447,8 +447,8 @@ export default {
return new Promise(resolve => {
const xhr = new XMLHttpRequest()
xhr.onreadystatechange = () => {
if (xhr.readyState === 4 && xhr.status === 200) {
}
// if (xhr.readyState === 4 && xhr.status === 200) {
// }
}
xhr.open('POST', url)
xhr.send(params)
......
......@@ -53,7 +53,7 @@
<el-form-item size="small" class="fr-mr0">
<el-button :size="size" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="exportExcel">导出</el-button>
<GLButton fn="财务管理导出" :size="size" type="primary" @click="exportExcel">导出</GLButton>
</el-form-item>
</el-row>
</el-form>
......
<template>
<!-- <div class="container">
<div class="box">
<div class="layout">
<div class="search-box">
<div class="top">
<div class="item">
加油供应商:
<el-select size="small" :value="'团油'" class="formItem">
<el-option label="团油" value="团油"></el-option>
</el-select>
</div>
<div class="item">
供应商订单号:
<div class="input">
<el-input v-model="searchObj.orderId" placeholder="" size="small" class="formItem"></el-input>
</div>
</div>
<div class="item">
加油用户:
<div class="input">
<el-input v-model="searchObj.phone" placeholder="" size="small" class="formItem"></el-input>
</div>
</div>
<div class="item">
订单状态:
<el-select v-model="searchObj.orderStatus" placeholder="请选择" size="small" class="formItem" style="margin-left:14px">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item">
加油日期:
<el-date-picker v-model="date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" value-format="yyyy-MM-dd" style="width: 220px"></el-date-picker>
</div>
<div class="item" style="margin-left: auto">
<el-button type="primary" @click="search" size="small">查询</el-button>
<el-button type="default" @click="reset" size="small">重置</el-button>
</div>
</div>
</div>
<div class="tableCtn">
<GLTable v-if="flag" ref="table" :searchForm="searchObj" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf"></GLTable>
</div>
</div>
</div>
</div> -->
<div class="equity-wrap">
<div class="equity-wrap contain">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="90px" label-position="right">
<el-row style="display: flex; align-items: center">
<el-form-item size="small" label="加油日期">
<el-date-picker size="small" v-model="searchForm.daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" label="加油供应商">
<el-select size="small" :value="'团油'" placeholder="请选择">
<!-- <el-option v-for="item in appereanceList" :key="item.value" :label="item.label" :value="item.value"></el-option> -->
<el-option label="团油" value="团油"></el-option>
</el-select>
</el-form-item>
<el-form-item label="加油订单号">
<el-input v-model="searchForm.orderId" placeholder="请输入" size="small"></el-input>
</el-form-item>
</el-row>
<el-row >
<el-form-item label="加油用户">
<el-input v-model="searchForm.phone" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="searchForm.orderStatus" placeholder="请选择" size="small" >
<el-option v-for="item in statusList" :key="item.id" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<div class="equity-wrap">
<div class="equity-wrap contain">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="90px" label-position="right">
<el-row style="display: flex; align-items: center">
<el-form-item size="small" label="加油日期">
<el-date-picker size="small" v-model="searchForm.daterange" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions || {}"></el-date-picker>
</el-form-item>
<el-form-item size="small" label="加油供应商">
<el-select size="small" :value="'团油'" placeholder="请选择">
<!-- <el-option v-for="item in appereanceList" :key="item.value" :label="item.label" :value="item.value"></el-option> -->
<el-option label="团油" value="团油"></el-option>
</el-select>
</el-form-item>
<el-form-item label="加油订单号">
<el-input v-model="searchForm.orderId" placeholder="请输入" size="small"></el-input>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="加油用户">
<el-input v-model="searchForm.phone" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item label="订单状态">
<el-select v-model="searchForm.orderStatus" placeholder="请选择" size="small">
<el-option v-for="item in statusList" :key="item.id" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</el-form-item>
</el-row>
</el-form>
<GLTable v-if="flag" ref="table" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
</div>
</div>
</el-row>
</el-form>
<GLTable v-if="flag" ref="table" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"></GLTable>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import url from "@/assets/empty.png"
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)
}
import url from '@/assets/empty.png'
// import { searchMixin } from '@/mixins'
export default {
name: '',
// mixins: [searchMixin],
data() {
return {
url:url,
getExplorer,
exportFn,
url: url,
size: 'small',
pickerOptions: {
disabledDate(time) {
......@@ -99,26 +92,26 @@ export default {
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
flag: true,
searchForm:{},
searchFormTable: {},
searchForm: {},
searchFormTable: {},
statusList: [
{
id:1,
id: 1,
label: '已支付',
value: 1
},
{
id:2,
id: 2,
label: '退款申请中',
value: 4
},
{
id:3,
id: 3,
label: '已退款',
value: 5
},
{
id:4,
id: 4,
label: '退款失败',
value: 6
}
......@@ -130,11 +123,11 @@ export default {
{
label: '加油时间',
prop: 'orderTime',
width:'95'
width: '95'
},
{
label: '供应商',
formatter: cell => {
return '团油'
}
......@@ -142,17 +135,17 @@ export default {
{
label: '加油油站',
prop: 'gasName',
width:'150'
width: '150'
},
{
label: '油号',
prop: 'oilName'
},
{
label: '加油升数(L)',
prop: 'litre',
width:'100'
width: '100'
},
{
label: '实付金额',
......@@ -177,13 +170,12 @@ export default {
{
label: '用户信息',
prop: 'phone',
width:'120'
width: '120'
},
{
label: '供应商订单号',
prop: 'orderId',
width:'220'
width: '220'
}
]
}
......@@ -198,20 +190,30 @@ export default {
// },
mounted() {},
methods: {
beforeSearchFn() {
formatParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.beginTime = this.searchForm.daterange[0]
params.endTime = this.searchForm.daterange[1]
} else {
if (params.beginTime) delete params.beginTime && delete params.endTime
}
delete params.daterange
return params
},
handleExport() {
var params = this.formatParams()
this.$apis.orderApi.exportGasList(params).then(res => {
this.exportFn(res.data)
})
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) {
this.searchFormTable.beginTime = this.searchForm.daterange[0]
this.searchFormTable.endTime = this.searchForm.daterange[1]
} else {
if (this.searchFormTable.beginTime) delete this.searchFormTable.beginTime && delete this.searchFormTable.endTime
}
delete this.searchFormTable.daterange
this.searchFormTable = this.formatParams()
resolve()
})
},
setTableFinishFun() {
setTableFinishFun() {
// 接收到的数据为空
if (!this.$refs.table.data.length) {
this.$refs.table.setTableHeightFun()
......@@ -226,7 +228,7 @@ export default {
},
handleSearch() {
this.$refs.table.refreshTable()
},
}
}
}
</script>
......@@ -248,5 +250,5 @@ export default {
}
.equity-wrap .contain {
margin-top: 20px;
}
}
</style>
......@@ -51,22 +51,22 @@
<el-input v-model="ruleForm.denomination" maxlength="10"></el-input>
</el-form-item>
<el-form-item label="会员价" prop="salesPrice">
<el-input v-model.number="ruleForm.salesPrice">
<el-input v-model="ruleForm.salesPrice">
<span slot="suffix">元</span>
</el-input>
</el-form-item>
<el-form-item label="非会员价" prop="noMemberPrice">
<el-input v-model.number="ruleForm.noMemberPrice">
<el-input v-model="ruleForm.noMemberPrice">
<span slot="suffix">元</span>
</el-input>
</el-form-item>
<el-form-item label="成本含税价" prop="costPrice">
<el-input v-model.number="ruleForm.costPrice" :disabled="isEdit">
<el-input v-model="ruleForm.costPrice" :disabled="isEdit">
<span slot="suffix">元</span>
</el-input>
</el-form-item>
<el-form-item label="官方价/划线价" prop="lineationPrice">
<el-input v-model.number="ruleForm.lineationPrice">
<el-input v-model="ruleForm.lineationPrice">
<span slot="suffix">元</span>
</el-input>
</el-form-item>
......@@ -114,7 +114,7 @@
<div class="wrap_driver">
<el-button type="primary" @click="onSubmit" size="small">提交</el-button>
</div>
<el-button @click="$router.go(-1)" size="small">取消</el-button>
<el-button @click="$router.go(-1)" size="small">取消</el-button>
</div>
</div>
</template>
......@@ -164,19 +164,57 @@ const validatorgoodsImage = (rule, value, callback) => {
const validatorNoMemberPrice = (rule, value, callback) => {
let { salesPrice } = window.vm.$children[0].$children[0].ruleForm
if (value) {
if (typeof value == 'number') {
var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/
console.log(reg.test(value))
if (reg.test(value)) {
if (salesPrice && value < salesPrice) {
callback('非会员价需 ≥ 会员价!')
} else {
callback()
}
} else {
callback('请输入数字')
callback('请输入正确格式的价格')
}
} else {
callback()
}
}
const validatorSalesPrice = (rule, value, callback) => {
if (value) {
var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/
if (reg.test(value)) {
callback()
} else {
callback('请输入正确格式的价格')
}
} else {
callback('请输入会员价')
}
}
const validatorCostPrice = (rule, value, callback) => {
if (value) {
var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/
if (reg.test(value)) {
callback()
} else {
callback('请输入正确格式的价格')
}
} else {
callback('请输入成本含税价')
}
}
const validatorLineationPrice = (rule, value, callback) => {
if (value) {
var reg = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/
if (reg.test(value)) {
callback()
} else {
callback('请输入正确格式的价格')
}
} else {
callback('请输入官方价/划线价')
}
}
export default {
name: '',
data() {
......@@ -201,7 +239,11 @@ export default {
},
ruleForm: {
supplier: 'HW',
appearance: 1
appearance: 1,
costPrice:'',
lineationPrice:'',
noMemberPrice:'',
salesPrice:''
},
stock: '',
brandNameList: [],
......@@ -211,10 +253,10 @@ export default {
productId: [{ required: true, message: '请输入商品编码', trigger: 'blur' }],
goodsImage: [{ validator: validatorgoodsImage }],
denomination: [{ required: true, message: '请输入直值面额', trigger: 'blur' }],
salesPrice: [{ required: true, type: 'number', message: '请输入会员价', trigger: 'blur' }],
noMemberPrice: [{ validator: validatorNoMemberPrice, type: 'number', trigger: 'blur' }],
costPrice: [{ required: true, type: 'number', message: '请输入成本含税价', trigger: 'blur' }],
lineationPrice: [{ required: true, type: 'number', message: '请输入官方价/划线价', trigger: 'blur' }],
salesPrice: [{ validator: validatorSalesPrice, trigger: 'blur' }],
noMemberPrice: [{ validator: validatorNoMemberPrice, trigger: 'blur' }],
costPrice: [{ validator: validatorCostPrice, trigger: 'blur' }],
lineationPrice: [{ validator: validatorLineationPrice, trigger: 'blur' }],
warrantyPeriod: [{ validator: validatorWarrantyPeriod, type: 'number', trigger: 'blur' }],
buysNotes: [{ validator: validatorbuysNotes }],
useNotes: [{ validator: validatoruseNotes }]
......@@ -228,6 +270,9 @@ export default {
this.getListWithPageOutGoods()
let id = this.$route.query.id
let edit = this.$route.query.edit
// if(!edit){
// edit = true
// }
if (id) {
this.getEquityGoodsById(id)
this.isEdit = !edit
......@@ -289,7 +334,7 @@ export default {
if (code == 0) {
this.ruleForm.brandName = data.brandName
this.ruleForm.productName = data.productName
this.ruleForm.costPrice = Number(data.officialPrice)
this.ruleForm.costPrice = Number(data.salesPrice)
this.resetTime = new Date().getTime()
} else {
this.$message.error(message)
......@@ -300,7 +345,7 @@ export default {
let fileName = file.name
if (file.name.lastIndexOf('.') === -1) {
this.$message.info('路径不正确')
document.getElementById('goodsIconId').value = ''
document.getElementById('goodsIconId').value = ''
return false
}
let AllImgExt = '.jpg|.jpeg|.gif|.bmp|.png|.swf'
......@@ -426,8 +471,8 @@ export default {
</script>
<style lang="scss" scoped>
.allWrap{
padding-bottom: 80px;
.allWrap {
padding-bottom: 80px;
}
.footer-panel {
display: flex;
......@@ -466,10 +511,10 @@ padding-bottom: 80px;
padding: 0 0 20px;
font-weight: 700;
}
.box .baseTitle{
.box .baseTitle {
padding-top: 40px;
}
.box .priceMsgTitle{
.box .priceMsgTitle {
padding-top: 18px;
}
......@@ -490,7 +535,7 @@ padding-bottom: 80px;
.box .el-form-item .el-input__suffix {
right: 20px;
}
.box .el-select{
.box .el-select {
width: 100%;
}
.box .editor {
......
<template>
<div class="equity-wrap">
<el-button class="addGood" type="primary" icon="el-icon-plus" @click="jump">新增商品</el-button>
<GLButton fn="新增商品" class="addGood" type="primary" icon="el-icon-plus" @click="jump">新增商品</GLButton>
<div class="equity-wrap contain">
<el-form :inline="true" style="width: 100%" :model="searchForm" label-width="85px" label-position="right">
<el-row style="display: flex; align-items: center;margin-bottom:2px">
<el-row style="display: flex; align-items: center; margin-bottom: 2px">
<el-form-item size="small" label="品牌名称">
<el-select size="small" v-model="searchForm.brandName" filterable placeholder="请选择">
<el-option v-for="item in goodsBrandList" :key="item.id" :label="item.brandName" :value="item.brandName"></el-option>
......@@ -15,7 +15,7 @@
<!-- <el-form-item label="门店名称">
<el-input v-model="searchForm.productName" placeholder="请输入" size="small" clearable></el-input>
</el-form-item> -->
<el-form-item size="small" label="提供方" style="margin-left:-10px">
<el-form-item size="small" label="提供方" style="margin-left: -10px">
<el-select size="small" v-model="searchForm.supplier">
<el-option v-for="item in supplierList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
......@@ -30,7 +30,7 @@
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item size="small" label="商品ID" style="margin-left:-10px">
<el-form-item size="small" label="商品ID" style="margin-left: -10px">
<el-input v-model="searchForm.id" placeholder="请输入" size="small"></el-input>
</el-form-item>
<el-form-item size="small" class="fr-mr0">
......@@ -40,15 +40,16 @@
</el-row>
</el-form>
<div class="row-btns">
<el-button size="small" @click="toggleAll">全选</el-button>
<el-button size="small" type="primary" @click="batchOperation(1)">上架</el-button>
<el-button size="small" type="primary" @click="batchOperation(2)">下架</el-button>
<el-button size="small" type="primary" @click="batchOperation(-1)">删除</el-button>
<el-button size="small" @click="toggleAll">全选</el-button>
<GLButton fn="上架商品" size="small" type="primary" @click="batchOperation(1)">上架</GLButton>
<GLButton fn="下架商品" size="small" type="primary" @click="batchOperation(2)">下架</GLButton>
<GLButton fn="删除商品" size="small" type="primary" @click="batchOperation(-1)">删除</GLButton>
</div>
<GLTable v-if="flag" ref="table" :noDataImg="url" @setTableFinishFun="setTableFinishFun" :searchForm="searchForm" :tableParams="tableParams" :getListApi="tableParams.getListApi" :pageConf="pageConf">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope)">编辑</el-button>
<el-button type="text" @click="copy(scope.scope)">复制</el-button>
<GLButton fn="编辑商品" type="text" @click="jump(scope.scope)">编辑</GLButton>
<GLButton fn="复制商品" type="text" @click="copy(scope.scope)">复制</GLButton>
<!-- <el-button type="text" @click="copy(scope.scope)">复制</el-button> -->
</span>
</GLTable>
</div>
......@@ -56,14 +57,14 @@
</template>
<script type='text/ecmascript-6'>
import url from "@/assets/empty.png"
// import { searchMixin } from '@/mixins'
import url from '@/assets/empty.png'
import { searchMixin } from '@/mixins'
export default {
name: '',
// mixins: [searchMixin],
mixins: [searchMixin],
data() {
return {
url:url,
url: url,
size: 'small',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
flag: true,
......@@ -158,7 +159,7 @@ export default {
this.goodsBrandList = res.data || []
})
},
jump({ id, status }) {
jump({ id, status }, copy) {
// let params = {}
// if (id) params.id = id
// if (status == 0) params.edit = true
......@@ -166,13 +167,18 @@ export default {
// if (window.$config.axios.environment) {
// target = ['权益卡管理平台', '运营平台', 'SCRM权益平台', '商品管理', '*商品详情']
// }
console.log(copy, 'copy')
let query = {}
if (id) query.id = id
if (status == 0) {
query.edit = true
query.$title = encodeURI('编辑商品')
}
if (copy == true) {
query.edit = true
query.$title = encodeURI('编辑商品')
}
console.log(query.edit, 'edit')
this.$router.push({ path: '/goods/addGoods', query })
},
copy({ id }) {
......@@ -184,10 +190,10 @@ export default {
message: '复制成功!',
type: 'success'
})
this.search(() => {
let [target] = this.$refs.table.data
this.jump(target)
})
let [target] = this.$refs.table.data
let copy = true
console.log(target)
this.jump(target, copy)
} else {
this.$message.error(res.message)
}
......
......@@ -2,25 +2,25 @@
<div class="equity-wrap">
<div class="tableTitle">汽车权益</div>
<div class="equity-wrap contain">
<el-button type="primary" size="small" @click="addEquity(1)">
<i class="el-icon-plus"></i>
<span style="margin-left: 8px">添加汽车权益</span>
</el-button>
<div class="noneOperation">
<GLTable ref="carTable" :tableParams="carTableParams" :pageConf="cardsDatail" :getListApi="getCardListApi">
<div slot="mainPageFlag" slot-scope="scope">
<el-button type="text" @click="carsDisplay(scope.scope)">{{ scope.scope.mainPageFlag == 1 ? '取消首页展示' : '首页展示' }}</el-button>
</div>
<div slot="carImage" slot-scope="scope">
<img class="equity-icon" :src="scope.scope.equityIcon" />
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" class="tableBtn" @click="editEquity(scope.scope, 1)">编辑</el-button>
<el-button type="text" class="tableBtn" @click="updateShelves(scope.scope, 'car')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</el-button>
<el-button type="text" class="tableBtn" @click="setTop(scope.scope.id, 'car')">置顶</el-button>
</span>
</GLTable>
</div>
<GLButton fn="添加汽车权益" type="primary" size="small" @click="addEquity(1)">
<i class="el-icon-plus"></i>
<span style="margin-left: 8px">添加汽车权益</span>
</GLButton>
<div class="noneOperation">
<GLTable ref="carTable" :tableParams="carTableParams" :pageConf="cardsDatail" :getListApi="getCardListApi">
<div slot="mainPageFlag" slot-scope="scope">
<el-button type="text" @click="carsDisplay(scope.scope)">{{ scope.scope.mainPageFlag == 1 ? '取消首页展示' : '首页展示' }}</el-button>
</div>
<div slot="carImage" slot-scope="scope">
<img class="equity-icon" :src="scope.scope.equityIcon" />
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton fn="汽车权益编辑" type="text" class="tableBtn" @click="editEquity(scope.scope, 1)">编辑</GLButton>
<GLButton fn="汽车权益上/下架" type="text" class="tableBtn" @click="updateShelves(scope.scope, 'car')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</GLButton>
<el-button type="text" class="tableBtn" @click="setTop(scope.scope.id, 'car')">置顶</el-button>
</span>
</GLTable>
</div>
</div>
<div class="tableTitle">商品权益</div>
<div class="equity-wrap secondBox">
......@@ -28,7 +28,7 @@
<div class="tagsCtn">
<div class="tags-box">
<template v-for="(item, index) in tags">
<el-tag :key="index" effect="dark" :type="item.active ? '' : 'info'" @click.native="changeGoodsCategory({ id: item.id, index })" :ref="`tag-${index}`" @dblclick.native="showInput(index, item.goodsCategory)" :class="{'tags':true , 'tag-active':tags[index].active}">
<el-tag :key="index" effect="dark" :type="item.active ? '' : 'info'" @click.native="changeGoodsCategory({ id: item.id, index })" :ref="`tag-${index}`" @dblclick.native="showInput(index, item.goodsCategory)" :class="{ tags: true, 'tag-active': tags[index].active }">
<i class="del el-icon-error" @click.stop="categoryDelete(item.id)"></i>
{{ item.goodsCategory }}
<el-input class="input-tag" v-model="inputValue" :ref="`tag-input-${index}`" size="small" @keyup.enter.native="changeTagName({ id: item.id, index })" @blur="changeTagName({ id: item.id, index })"></el-input>
......@@ -41,10 +41,10 @@
<span style="margin-left: 8px; margin-top: 18px">添加分类</span>
</el-button>
</div>
<el-button type="primary" size="small" @click="addEquity(2)" style="margin-top: 20px">
<GLButton fn = '添加门店权益' type="primary" size="small" @click="addEquity(2)" style="margin-top: 20px">
<i class="el-icon-plus"></i>
<span style="margin-left: 8px">添加门店权益</span>
</el-button>
</GLButton>
<div class="noneOperation">
<GLTable ref="goodsTable" :tableParams="goodsTableParams" :tableData="goodsTableData" :tableTotal="tableTotal">
......@@ -55,8 +55,8 @@
<img class="equity-icon" :src="scope.scope.equityIcon" />
</div>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="editEquity(scope.scope, 2)">编辑</el-button>
<el-button type="text" @click="updateShelves(scope.scope, 'goods')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</el-button>
<GLButton fn="商品权益编辑" type="text" @click="editEquity(scope.scope, 2)">编辑</GLButton>
<GLButton fn="商品权益上/下架" type="text" @click="updateShelves(scope.scope, 'goods')">{{ scope.scope.status == 0 ? '上架' : '下架' }}</GLButton>
<el-button type="text" @click="setTop(scope.scope.id, 'goods')">置顶</el-button>
<el-button type="text" @click="deletEquity(scope.scope.id)" :disabled="scope.scope.status == 0 ? false : true">删除</el-button>
</span>
......@@ -265,7 +265,7 @@ export default {
margin-top: 20px;
}
.tableTitle {
margin: 20px 40px;
margin: 20px 40px;
}
.el-table__fixed-right-patch {
position: absolute;
......@@ -285,14 +285,14 @@ export default {
.list {
box-shadow: initial;
}
.tags-box .tag-active{
background: #5850FF !important;
color: #fff;
.tags-box .tag-active {
background: #5850ff !important;
color: #fff;
}
.tags-box .el-tag .del {
position: absolute;
right: -6px;
top: -6px;
color: #5850FF;
.tags-box .el-tag .del {
position: absolute;
right: -6px;
top: -6px;
color: #5850ff;
}
</style>
\ No newline at end of file
......@@ -2,11 +2,11 @@
<div class="layout">
<div class="box topBox">
<!-- <back /> -->
<el-button type="primary" class="backBtn" size="small" @click="$router.push('/order/index')">返回</el-button>
<el-button type="primary" class="backBtn" size="small" @click="$router.push('/order/index')">返回</el-button>
<div class="grid">
<div class="grid-item">订单编号:{{ detailInfo.orderCode }}</div>
<div class="grid-item">下单时间: {{ detailInfo.time }}</div>
<div class="grid-item">海威订单号: {{ detailInfo.thirdOrderCode }}</div>
<div class="grid-item">海威订单号: {{ thirdOrderCode }}</div>
</div>
</div>
<div class="box">
......@@ -29,7 +29,7 @@
</div>
</template>
<template v-if="item.btn">
<div class="grid-btn">
<!-- <div class="grid-btn">
售后:
<template v-if="detailInfo.openRefund == 0">
<el-button type="primary" @click="openRefund" size="small">开启</el-button>
......@@ -37,7 +37,7 @@
<template v-else>
<span>已开启</span>
</template>
</div>
</div> -->
</template>
</div>
</template>
......@@ -71,6 +71,7 @@ export default {
mixins: [orderMixin],
data() {
return {
thirdOrderCode: '',
params: {},
eventBus: new Vue(),
detailInfo: {},
......@@ -146,13 +147,18 @@ export default {
}
},
{
label: '充值账号',
// prop: 'rechargeNumber',
prop: 'rechargeNumber'
},
{
label: '商品形态',
prop: 'appearanceDesc',
prop: 'appearanceDesc'
// minWidth: '200'
},
{
label: '单价/元',
prop: 'orderPrices',
prop: 'orderPrices'
// minWidth: '200'
},
{
......@@ -161,10 +167,10 @@ export default {
formatter: () => {
return 1
}
},
},
{
label: '小计/元',
prop: 'orderPrices',
prop: 'orderPrices'
// minWidth: '200'
},
{
......@@ -179,8 +185,9 @@ export default {
}
},
mounted() {
// console.log(this.$route, '11111111')
console.log(this.$route, '11111111')
this.params = { orderCode: this.$route.query.orderCode }
this.thirdOrderCode = this.$route.query.thirdOrderCode
this.getDetail(this.params)
},
methods: {
......@@ -192,6 +199,10 @@ export default {
data.time = data.orderDate ? new Date(data.orderDate).format('yyyy-MM-dd hh:mm:ss') : ''
this.detailInfo = data
this.tableData = [data]
// 1 卡券,2直充 如果是卡卷列表不显示充值账号一栏
if(data.appearance == 1){
this.tableParams.tableColumns.splice(1,1)
}
}
})
},
......@@ -308,7 +319,7 @@ export default {
font-weight: 500;
color: #333333;
}
.tableWrap{
.tableWrap {
margin-left: -32px;
}
}
......
......@@ -28,6 +28,7 @@
<el-form-item size="small" class="fr-mr0">
<el-button size="small" @click="handleReset">重置</el-button>
<el-button size="small" type="primary" @click="handleSearch">查询</el-button>
<el-button :size="size" type="primary" @click="handleExport">导出</el-button>
</el-form-item>
</el-row>
</el-form>
......@@ -36,13 +37,13 @@
{{ item }}
</div>
</div>
<!-- :noDataImg="url" -->
<GLTable v-if="flag" :noDataImg="url" ref="table" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<!-- :noDataImg="url" -->
<GLTable v-if="flag" :noDataImg="url" ref="table" @setTableFinishFun="setTableFinishFun" :searchForm="searchFormTable" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn">
<span slot="goodsMsg" slot-scope="scope">
<div>{{ scope.scope.brandName }}</div>
<div>{{ scope.scope.appearance == 2 ? scope.scope.productName + scope.scope.denomination : scope.scope.productName }}</div>
</span>
<span slot="orderNum" slot-scope="scope">
<span slot="orderNum" slot-scope="scope">
<div>{{ scope.scope.orderCode }}</div>
</span>
<span slot="priceAmount" slot-scope="scope">
......@@ -50,12 +51,13 @@
<div>{{ scope.scope.goodsQuality }}张</div>
<div></div>
</span>
.
<span slot="userInfo" slot-scope="scope">
<div>{{ scope.scope.accountName }}</div>
<div>{{ scope.scope.mobile }}</div>
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope, 'order')">查看详情</el-button>
<GLButton fn="查看订单详情" type="text" @click="jump(scope.scope, 'order')">查看详情</GLButton>
</span>
</GLTable>
</div>
......@@ -63,14 +65,14 @@
</template>
<script type='text/ecmascript-6'>
import url from "@/assets/empty.png"
import url from '@/assets/empty.png'
import { orderMixin, searchMixin } from '@/mixins'
export default {
name: '',
mixins: [orderMixin, searchMixin],
data() {
return {
url:url,
url: url,
choseList: ['全部', '待收货', '已完成', '退款|售后'],
currentIndex: 0,
size: 'small',
......@@ -95,7 +97,11 @@ export default {
align: 'left',
addHtml: 'goodsMsg'
},
{
{
label: '充值账号',
prop: 'rechargeNumber'
},
{
label: '订单编号',
width: '280',
addHtml: 'orderNum'
......@@ -148,10 +154,10 @@ export default {
// ${cell.mobile || ''}`
// }
},
{
{
label: '海威订单号',
minWidth: '100',
prop : 'thirdOrderCode'
prop: 'thirdOrderCode'
}
]
}
......@@ -159,6 +165,48 @@ export default {
},
mounted() {},
methods: {
handleExport() {
var params = this.formatParams()
this.$apis.orderApi.exportOrderList(params).then(res => {
console.log(res)
this.exportFn(res.data)
})
},
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
},
exportFn(url) {
let browserType = this.getExplorer()
if (browserType == 'QQ') {
window.open(url)
return
}
let iframe = document.createElement('iframe')
iframe.style.display = 'none'
iframe.src = url
document.body.appendChild(iframe)
},
tabClick(index) {
this.currentIndex = index
this.searchForm.orderStatus = ''
......@@ -193,16 +241,20 @@ export default {
}
this.handleSearch()
},
formatParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (params.daterange) {
params.orderDateStart = this.searchForm.daterange[0] + ' 00:00:00'
params.orderDateEnd = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (params.orderDateStart) delete params.orderDateStart && delete params.orderDateEnd
}
delete params.daterange
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchFormTable = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchFormTable.daterange) {
this.searchFormTable.orderDateStart = this.searchForm.daterange[0] + ' 00:00:00'
this.searchFormTable.orderDateEnd = this.searchForm.daterange[1] + ' 23:59:59'
} else {
if (this.searchFormTable.orderDateStart) delete this.searchFormTable.orderDateStart && delete this.searchFormTable.orderDateEnd
}
delete this.searchFormTable.daterange
this.searchFormTable = this.formatParams()
resolve()
})
},
......
......@@ -21,7 +21,7 @@
<div class="tableCtn">
<GLTable ref="recordTable" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :pageConf="pageConf" :noDataImg="url" @setTableFinishFun="setTableFinishFun">
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="edit(scope.scope)" class="tableBtn" size="small">编辑</el-button>
<GLButton fn ='权益卡管理编辑' type="text" @click="edit(scope.scope)" class="tableBtn" size="small">编辑</GLButton>
<el-button type="text" :disabled="scope.scope.tryAble == 0 ? true : false" @click="extension(scope.scope)" class="tableBtn" size="small">推广</el-button>
<el-button type="text" @click="copy(scope.scope)" class="tableBtn" size="small">复制</el-button>
</span>
......@@ -411,15 +411,9 @@ export default {
this.generateOptions = []
}
},
//获取src改变卡片样式
changeStore() {
// this.clearStyle()
var imageId = this.product.filter(item => item.src == this.ruleForm.backgroundImage).id
},
//编辑
edit(row) {
this.ruleForm = row
// this.changeStore()
this.dialogVisible = true
this.ruleForm.effectiveType = row.effectiveType + ''
//赋值时间框
......
......@@ -67,7 +67,7 @@
<div>{{ scope.scope.mobile }}</div>
</span>
<span slot="auth-button" slot-scope="scope" :data="scope.scope">
<el-button type="text" @click="jump(scope.scope, 'sale')" size="small">查看详情</el-button>
<GLButton fn="查看售后详情" type="text" @click="jump(scope.scope, 'sale')" size="small">查看详情</GLButton>
</span>
<span slot="orderNum" slot-scope="scope">
<div class="refund-box">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!