Commit 807064c3 by chenwq

feat: 新增积分商城分类管理、浏览明细和访客明细功能

新增分类管理页面,支持分类的增删改查和置顶操作
添加浏览明细和访客明细页面,支持数据导出
优化订单状态显示逻辑,区分自营和云中鹤订单
新增商品发货和售后审核功能
1 parent a4411d2b
...@@ -68,4 +68,15 @@ const uploadFileApi = (params, callback) => { ...@@ -68,4 +68,15 @@ const uploadFileApi = (params, callback) => {
}) })
} }
export default { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload, uploadFileApi } const uploadImgApi = params => {
params.method = 'scrm.api.carlife.common.uploadImg'
return http({
url: 'rop-scrm-carlife/router',
method: 'POST',
data: params,
sign: true,
noSignAttr: ['file']
})
}
export default { getGoodsList, uploadImg, getMerchantList, getZoneList, pictureUpload, uploadFileApi, uploadImgApi }
import { http } from '@/main'
const url = 'rop-scrm-shopmall/router'
// 查询配置
const getMallmini = params => {
params.method = 'scrm.api.shopmall.scrm.mallmini.findByType'
return http({
url,
data: params,
sign: true
})
}
/** 新增或者修改积分商城首页配置 */
const insertOrUpdateMallmini = params => {
params.method = 'scrm.api.shopmall.scrm.mallmini.insertorupdate'
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
export default {
getMallmini,
insertOrUpdateMallmini
}
...@@ -104,6 +104,15 @@ const getOrderDetail = params => { ...@@ -104,6 +104,15 @@ const getOrderDetail = params => {
sign: true sign: true
}) })
} }
// 子订单商品发货(自营商品)
const subOrderExpress = params => {
params.method = 'scrm.api.shopmall.points.sub.order.express'
return http({
url,
data: params,
returnAll: true
})
}
// 售后列表 // 售后列表
const getSaleOrderList = params => { const getSaleOrderList = params => {
...@@ -114,6 +123,32 @@ const getSaleOrderList = params => { ...@@ -114,6 +123,32 @@ const getSaleOrderList = params => {
sign: true sign: true
}) })
} }
// 自营售后订单详情
const getAfterSalesDetail = params => {
params.method = 'scrm.api.shopmall.points.afterSales.detail'
return http({
url,
data: params,
returnAll: true
})
}
// 售后订单详情【云中鹤】
const getYZHAfterSalesDetail = params => {
params.method = 'scrm.api.shopmall.platform.after.sales.order.detail'
return http({
url,
data: params
})
}
// 自营订单退款审核
const checkSubOrder = params => {
params.method = 'scrm.api.shopmall.points.afterSales.sub.order.check'
return http({
url,
data: params,
returnAll: true
})
}
// 订单详情 // 订单详情
const getSaleOrderDetail = params => { const getSaleOrderDetail = params => {
...@@ -162,6 +197,102 @@ const exportOilCouponOrderList = params => { ...@@ -162,6 +197,102 @@ const exportOilCouponOrderList = params => {
data: params data: params
}) })
} }
/** 查询所有分类分页列表 */
const getFrontendcategoryList = params => {
params.method = 'scrm.api.shopmall.scrm.frontendcategory.listWithPage'
return http({
url,
data: params
})
}
/** 查询所有分类分页 */
const getFrontendcategoryOpt = params => {
params.method = 'scrm.api.shopmall.scrm.frontendcategory.listAll'
return http({
url,
data: params
})
}
/** 保存或修改分类 */
const editFrontendCategory = params => {
params.method = 'scrm.api.shopmall.scrm.frontendcategory.saveOrUpdate'
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
/** 删除分类 */
const deleteFrontendCategory = params => {
params.method = 'scrm.api.shopmall.scrm.frontendcategory.deleteCategory'
return http({
url,
data: params,
returnAll: true
})
}
/** 置顶分类 */
const upFrontendCategory = params => {
params.method = 'scrm.api.shopmall.scrm.frontendcategory.upCategory'
return http({
url,
data: params,
returnAll: true
})
}
/** 新增商品 */
const insertOrUpdateProApi = params => {
params.method = 'scrm.api.shopmall.scrm.glgoods.addOrUpdatePlatformGLGoods'
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
/** 修改商品的前端分类 */
const goodsUpdateFrocategory = params => {
params.method = 'scrm.api.shopmall.scrm.glgoods.updatefrocategory'
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
/** 获取浏览明细 */
const getBrowseRecordList = params => {
params.method = 'scrm.api.shopmall.scrm.customer.dynamic.record.getbrowseRecordResponses'
return http({
url,
data: params
})
}
/** 导出浏览明细 */
const exportBrowseRecordList = params => {
params.method = 'scrm.api.shopmall.scrm.customer.dynamic.record.getbrowseRecordResponsesexport'
return http({
url,
data: params
})
}
/** 获取访客数据 */
const getUseRecordList = params => {
params.method = 'scrm.api.shopmall.scrm.customer.dynamic.record.getUseRecordResponses'
return http({
url,
data: params
})
}
/** 导出访客数据 */
const exportUseRecordList = params => {
params.method = 'scrm.api.shopmall.scrm.customer.dynamic.record.getUseRecordResponsesexport'
return http({
url,
data: params
})
}
export default { export default {
getCategoryListApi, getCategoryListApi,
getGoodsListApi, getGoodsListApi,
...@@ -174,10 +305,25 @@ export default { ...@@ -174,10 +305,25 @@ export default {
modifyPriceApi, modifyPriceApi,
getOrderList, getOrderList,
getOrderDetail, getOrderDetail,
subOrderExpress,
getSaleOrderList, getSaleOrderList,
getAfterSalesDetail,
getYZHAfterSalesDetail,
checkSubOrder,
getSaleOrderDetail, getSaleOrderDetail,
getOilCouponList, getOilCouponList,
updateOilCoupon, updateOilCoupon,
getOilCouponOrderList, getOilCouponOrderList,
exportOilCouponOrderList exportOilCouponOrderList,
getFrontendcategoryList,
getFrontendcategoryOpt,
editFrontendCategory,
deleteFrontendCategory,
upFrontendCategory,
insertOrUpdateProApi,
goodsUpdateFrocategory,
getBrowseRecordList,
exportBrowseRecordList,
getUseRecordList,
exportUseRecordList
} }
...@@ -56,7 +56,36 @@ function uploadImg (e, _this, maxSize = 2) { ...@@ -56,7 +56,36 @@ function uploadImg (e, _this, maxSize = 2) {
} }
}) })
} }
export { // 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
exportFn, function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
uploadImg /* eslint-disable */
var reg = {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/,
zNumReg: /^\d*$/
}
/* eslint-enable */
regRule = regRule || 'priceReg'
if (newValue && ((minValue && newValue < minValue) || (maxValue && newValue > maxValue))) {
return oldValue || ''
}
if (newValue && reg[regRule].test(newValue + '')) {
if (/\./.test(newValue)) {
newValue = newValue + ''
var interger = newValue.split('.')[0]
var point = newValue.split('.')[1]
var intergerNum = interger.length > intergerDigit ? oldValue.split('.')[0] : interger
var pointNum = point.length > pointDigit ? point.slice(0, pointDigit) : point
newValue = pointDigit ? intergerNum + '.' + pointNum : newValue.split('.')[0]
} else {
newValue = newValue.length > intergerDigit ? oldValue.slice(0, intergerDigit) : newValue
if (regRule == 'zNumReg') {
newValue = newValue.split('')[0] == '0' ? '0' : newValue
}
}
return newValue
} else {
return newValue ? oldValue : ''
}
} }
export { exportFn, uploadImg, limitPrice }
\ No newline at end of file \ No newline at end of file
const categoryList = [
{
id: '1',
label: '云中鹤'
},
{
id: '2',
label: '广联自营'
}
]
export { categoryList }
...@@ -73,12 +73,12 @@ ...@@ -73,12 +73,12 @@
<div v-if="Array.isArray(formObj[item.name]) ? formObj[item.name].length : formObj[item.name]"> <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-if="Array.isArray(formObj[item.name])">
<span v-for="(subItem, subIndex) in formObj[item.name]" :key="subIndex" class="muti-imgs img-w-h"> <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> <video v-if="item.uploadType == 'video'" class="img-w-h activity-img" :src="typeof subItem == 'object' ? subItem[item.subName || 'content'] : subItem"></video>
<img v-else class="img-w-h" :src="typeof subItem == 'object' ? subItem.content : subItem" /> <img v-else class="img-w-h" :src="typeof subItem == 'object' ? subItem[item.subName || 'content'] : subItem" />
<span class="img-btns"> <span class="img-btns">
<span class="btn-item"> <span class="btn-item">
<i v-show="!item.isDisabled" class="el-icon-delete" @click="handleImgDelete(item, subIndex)"></i> <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> <i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem[item.subName || 'content'] : subItem, item)"></i>
</span> </span>
</span> </span>
</span> </span>
......
...@@ -2,20 +2,12 @@ ...@@ -2,20 +2,12 @@
<template> <template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose"> <glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<div class="flex"> <div class="flex">
<el-form :inline="true" :model="searchForm"> <GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj" :formData="goodsFormData"></GLCombiForm>
<el-form-item label="商品名称:"> </div>
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input> <GLTable class="pointTable" @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
</el-form-item> <div class="setPriceSlot" slot="setPriceSlot" slot-scope="scope">
<el-form-item> <span class="unedited">{{ scope.scope.redeemPoints }}积分 + {{ scope.scope.salePrice }}元</span>
<el-button :size="size" type="primary" @click="getList(true)">查询</el-button>
<el-button :size="size" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</div> </div>
<GLTable ref="mutiProRef" :tableData="productList" :searchForm="searchForm" :tableParams="tableParams" @refreshTable="getList">
<span slot="coverImgUrl" slot-scope="scope">
<img class="m-t-10 img-60" :src="scope.scope.coverImgUrl" />
</span>
</GLTable> </GLTable>
</glsx-dialog> </glsx-dialog>
</template> </template>
...@@ -31,7 +23,30 @@ export default { ...@@ -31,7 +23,30 @@ export default {
// 表格组件 // 表格组件
// getListApi: getGoodsList, // getListApi: getGoodsList,
productList: [], productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, getListApi: this.$apis.platformGoods.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
goodsFormObj: {
goodsSkuName: '',
goodsSource: ''
},
goodsFormData: [
{
label: '商品名称',
name: 'goodsSkuName',
type: 'input',
maxlength: 50,
isClear: true
},
{
label: '商品来源',
name: 'goodsSource',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'goodsSourceList'
}
],
// 表格参数 // 表格参数
tableParams: { tableParams: {
listName: 'list', listName: 'list',
...@@ -42,23 +57,41 @@ export default { ...@@ -42,23 +57,41 @@ export default {
tableColumns: [ tableColumns: [
{ {
label: '商品名称', label: '商品名称',
prop: 'name' prop: 'goodsSkuName'
},
{
label: '兑换价',
width: 220,
addHtml: 'setPriceSlot',
prop: 'salePrice'
}, },
{ {
label: '缩略图', label: '商品来源',
prop: 'coverImgUrl', prop: 'goodsSource',
addHtml: 'coverImgUrl' width: 150,
formatter: cellValue => {
return this.baseData.goodsSourceList.find(item => item.confId == cellValue.goodsSource)?.confLabel || '--'
}
}, },
{ {
label: '价格(元)', label: '库存',
prop: 'price1', width: 150,
prop: 'goodsStock',
formatter: cellValue => { formatter: cellValue => {
return cellValue.price2 && cellValue.price1 != cellValue.price2 ? (cellValue.price1 / 100).toFixed(2) + '-' + (cellValue.price2 / 100).toFixed(2) : (cellValue.price1 / 100).toFixed(2) return cellValue.goodsStock != null ? cellValue.goodsStock : cellValue.minGoodsStock + '-' + cellValue.maxGoodsStock
}
} }
]
},
baseData: {
goodsSourceList: [
{
confId: '1',
confLabel: '云中鹤'
}, },
{ {
label: '来源门店', confId: '2',
prop: 'merchantName' confLabel: '广联自营'
} }
] ]
} }
...@@ -74,13 +107,13 @@ export default { ...@@ -74,13 +107,13 @@ export default {
type: Array, type: Array,
default: () => [] default: () => []
}, },
getListApi: { // getListApi: {
type: Function, // type: Function,
default: () => {} // default: () => { }
}, // },
searchForm: { searchForm: {
type: Object, type: Object,
default: () => {} default: () => { }
} }
}, },
...@@ -89,39 +122,60 @@ export default { ...@@ -89,39 +122,60 @@ export default {
}, },
mounted() { mounted() {
this.getList(true) this.getOptionsList('goodsFormData')
}, },
methods: { methods: {
getList(isMounted = false) { beforeSearchFn() {
var params = { return new Promise((resolve, reject) => {
// goodsStatus: 1, this.searchForm = this.$common.utils.deepClone(this.goodsFormObj)
// goodsSource: 1, resolve()
...this.searchForm, })
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum, },
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize getOptionsList(formName, hasAll = true, refreshSigle) {
} if (refreshSigle) {
var that = this var item = this[formName].find(k => k.name == refreshSigle)
this.getListApi(params).then(res => { var index = this[formName].findIndex(k => k.name == refreshSigle)
// console.log(res) this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
this.productList = res.list if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
this.$refs.mutiProRef.tableTotal = res.total const temp = {}
this.recoverySelected() temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== "全部") {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
}) })
}
}, },
handleReset() { handleReset() {
this.searchForm.name = '' this.goodsFormObj = {
this.getList() goodsSkuName: '',
goodsSource: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs.tableRef.refreshTable()
}, },
recoverySelected() { recoverySelected() {
if (this.selectedProList.length) { if (this.selectedProList.length) {
this.selectedProList.forEach(row => { this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row) this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
}) })
} }
}, },
handleMutiSelectConfirm() { handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName] var selectedData = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName]
this.$emit('handleMutiSelectConfirm', selectedData) this.$emit('handleMutiSelectConfirm', selectedData)
}, },
handleMutiSelectClose() { handleMutiSelectClose() {
......
...@@ -11,13 +11,15 @@ ...@@ -11,13 +11,15 @@
let cfg = require('./conf.js') let cfg = require('./conf.js')
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
export const fetchConfig = function(isEnv = true) { export const fetchConfig = function(common) {
// if (isEnv) { // if (isEnv) {
// let { request } = cfg // let { request } = cfg
// Object.assign(request, { timeout }) // Object.assign(request, { timeout })
// return Promise.resolve(cfg) // return Promise.resolve(cfg)
// } // }
return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/config') let params = { moduleName: 'mall', mockUrl: 'https://oss-config.glsx.com.cn/mock/643e06c7ea3da3a974f54357/mall/config', httpOptions: { Headers: { refererurl: location.href }, request: { timeout: 30000 } } }
return common.utils.getConfig(params)
// return new Http({ Headers: { refererurl: location.href }, request: { timeout: 30000 } }).get('https://oss-config.test.glsx.com.cn/mock/618f5cc91072f92988f05a26/services/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' })
} }
......
...@@ -11,6 +11,7 @@ import Vue from 'vue' ...@@ -11,6 +11,7 @@ import Vue from 'vue'
import apis from './api' import apis from './api'
import './public-path' import './public-path'
import '@/assets/css/public.scss' import '@/assets/css/public.scss'
import '@/assets/css/edit.scss'
// import 'glsx-components/dist/glsx-components.css' // import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup' import { start } from '@/setup'
Vue.config.productionTip = false Vue.config.productionTip = false
......
...@@ -11,7 +11,7 @@ let router = null ...@@ -11,7 +11,7 @@ let router = null
let instance = null let instance = null
Vue.use(GLTable).use(GLCombiForm).use(GLTableButton).use(GLDialog) Vue.use(GLTable).use(GLCombiForm).use(GLTableButton).use(GLDialog)
export async function bootstrap({ history, common, messenger, globalState, routerBase }) { export async function bootstrap({ history, common, messenger, globalState, routerBase }) {
const { response, request, other_request, sign, secret } = await fetchConfig() const { response, request, other_request, sign, secret } = await fetchConfig(common)
// request.baseURL = 'https://scrm.dev.glsx.com.cn' // request.baseURL = 'https://scrm.dev.glsx.com.cn'
// request_brand.baseURL = 'https://scrm.dev.glsx.com.cn' // request_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
// request.baseURL = 'http://192.168.1.53:7226' // request.baseURL = 'http://192.168.1.53:7226'
......
...@@ -46,41 +46,44 @@ util.getDateStr = function(num) { ...@@ -46,41 +46,44 @@ util.getDateStr = function(num) {
return util.dateFormat(now) return util.dateFormat(now)
} }
util.getExplorer = function() { util.getExplorer = function() {
var ua = navigator.userAgent.toLocaleLowerCase(); var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null; var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) { if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = "IE"; browserType = 'IE'
} else if (ua.match(/firefox/) != null) { } else if (ua.match(/firefox/) != null) {
browserType = "火狐"; browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) { } else if (ua.match(/ubrowser/) != null) {
browserType = "UC"; browserType = 'UC'
} else if (ua.match(/opera/) != null) { } else if (ua.match(/opera/) != null) {
browserType = "欧朋"; browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) { } else if (ua.match(/bidubrowser/) != null) {
browserType = "百度"; browserType = '百度'
} else if (ua.match(/metasr/) != null) { } else if (ua.match(/metasr/) != null) {
browserType = "搜狗"; browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) { } else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = "QQ"; browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) { } else if (ua.match(/maxthon/) != null) {
browserType = "遨游"; browserType = '遨游'
} else { } else {
browserType = '谷歌' browserType = '谷歌'
} }
return browserType return browserType
} }
util.transfStatus = function(firstKey, key) { util.transfStatus = function(payStatus, orderStatus, goodsSource) {
if(firstKey==1001) return {name: '待支付', color: '#FDB757'} if (payStatus == 1001) return { name: '待支付', color: '#FDB757' }
let arr1 = [1002,1006,1007,1008] let arr1 = [1008]
let arr2 = [1003,1004,1005,1012] let arr2 = [1003, 1004, 1005, 1012]
if(arr1.includes(+key)){ if ([1002, 1006, 1007].includes(orderStatus)) {
return {name: '待收货', color: '#5850FF'} return { name: '待发货', color: '#5850FF' }
}else if(arr2.includes(+key)){ }
return {name: '已关闭', color: '#999999'} if (arr1.includes(+orderStatus)) {
}else if(key==1009){ return { name: '待收货', color: '#5850FF' }
return {name: '已完成', color: '#2CCA74'} } else if (arr2.includes(+orderStatus)) {
}else{ return { name: '已关闭', color: '#999999' }
return {name: '售后/退款', color: '#EB4E4E'} } else if (orderStatus == 1009) {
return { name: '已完成', color: '#2CCA74' }
} else {
return { name: '售后/退款', color: '#EB4E4E' }
} }
} }
export default util export default util
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
<div class="stutas-wrap"> <div class="stutas-wrap">
<span>订单状态:</span> <span>订单状态:</span>
<span v-if="!isLoading" class="stutas-circle" <span v-if="!isLoading" class="stutas-circle"
:style="{backgroundColor: transfStatus(orderInfo.payStatus,orderInfo.orderStatus).color}"></span> :style="{ backgroundColor: transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).color }"></span>
<span v-if="!isLoading">{{ transfStatus(orderInfo.payStatus, orderInfo.orderStatus).name }}</span> <span v-if="!isLoading">{{ transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).name }}</span>
</div> </div>
<div class="info-wrap order-info"> <div class="info-wrap order-info">
<div class="title">订单信息</div> <div class="title">订单信息</div>
......
<!-- 秒杀活动 --> <!-- 秒杀活动 -->
<template> <template>
<div class="ctnr"> <div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" <GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData">
:formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm> </GLCombiForm>
<div class="main-wrap"> <div class="main-wrap">
<div class="global-title-wrap"> <div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" <span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{ item.name }}</span>
:class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]"
@click="changeTable(item.id)">{{ item.name }}</span>
</div> </div>
<div class="table-wrap"> <div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" <GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
:tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt=""> <img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" <el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -25,9 +20,8 @@ ...@@ -25,9 +20,8 @@
<p class="phone">{{ scope.scope.customerPhone }}</p> <p class="phone">{{ scope.scope.customerPhone }}</p>
</div> </div>
<div slot="orderStatusSlot" slot-scope="scope"> <div slot="orderStatusSlot" slot-scope="scope">
<span class="circle" <span class="circle" :style="{ backgroundColor: transfStatus(scope.scope.payStatus, scope.scope.orderStatus, scope.scope.goodsSource).color }"></span>
:style="{backgroundColor: transfStatus(scope.scope.payStatus,scope.scope.orderStatus).color}"></span> <span>{{ transfStatus(scope.scope.payStatus, scope.scope.orderStatus, scope.scope.goodsSource).name }}</span>
<span>{{ transfStatus(scope.scope.payStatus, scope.scope.orderStatus).name }}</span>
</div> </div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p> <p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p>
...@@ -39,12 +33,14 @@ ...@@ -39,12 +33,14 @@
</GLTable> </GLTable>
</div> </div>
</div> </div>
<SelectDialog v-if="isSelectVisible" :loading="batchLoading" :dialogConfig="dialogConfig" :batchForm="batchForm" :editFormData="batchEditForm" :editRules="batchEditRules" :visible="isSelectVisible" @handleClose="selectVisible" @confirm="handleExpressConfirm"></SelectDialog>
</div> </div>
</template> </template>
<script> <script>
import {utils} from 'glsx-common' import { utils } from 'glsx-common'
import util from '@/util/util' import util from '@/util/util'
import SelectDialog from '../pointProducts/components/SelectDialog'
const titleList = [ const titleList = [
{ {
...@@ -56,6 +52,10 @@ const titleList = [ ...@@ -56,6 +52,10 @@ const titleList = [
name: '待支付' name: '待支付'
}, },
{ {
id: 6,
name: '待发货'
},
{
id: 1, id: 1,
name: '待收货' name: '待收货'
}, },
...@@ -89,6 +89,18 @@ export default { ...@@ -89,6 +89,18 @@ export default {
listeners: { listeners: {
click: row => this.goOrderDetaillPage(row.scope) click: row => this.goOrderDetaillPage(row.scope)
} }
},
{
type: 'el-button',
name: '商品发货',
attrs: {
type: 'text',
fn: '商品发货'
},
condition: row => row.scope.goodsSource == 2 && row.scope.orderStatus == 1007,
listeners: {
click: row => this.handleOrderExpress(row.scope)
}
} }
], ],
searchForm: {}, searchForm: {},
...@@ -141,7 +153,7 @@ export default { ...@@ -141,7 +153,7 @@ export default {
{ {
id: '1', id: '1',
value: 'B端积分订单' value: 'B端积分订单'
},{ }, {
id: '2', id: '2',
value: 'C端积分订单' value: 'C端积分订单'
}], }],
...@@ -150,11 +162,11 @@ export default { ...@@ -150,11 +162,11 @@ export default {
}, },
], ],
getListApi: this.$apis.platformGoods.getOrderList, getListApi: this.$apis.platformGoods.getOrderList,
pageConf: {pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'}, pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: { tableOption: {
width: 80 width: 140
}, },
tableColumns: [ tableColumns: [
{ {
...@@ -169,7 +181,7 @@ export default { ...@@ -169,7 +181,7 @@ export default {
prop: 'salePrice', prop: 'salePrice',
align: 'right', align: 'right',
formatter: cell => { formatter: cell => {
return cell.businessType == 1 || cell.businessType == 2 ? cell.redeemPoints + '积分' + '+' + cell.salePrice + '元' : cell.salePrice + '元' return cell.goodsSource ? cell.redeemPoints + '积分' : (cell.businessType == 1 || cell.businessType == 2 ? cell.redeemPoints + '积分' + '+' + cell.salePrice + '元' : cell.salePrice + '元')
} }
}, },
{ {
...@@ -183,8 +195,8 @@ export default { ...@@ -183,8 +195,8 @@ export default {
align: 'right', align: 'right',
formatter: cell => { formatter: cell => {
let price = 0 let price = 0
if(cell.payStatus==1002){ if (cell.payStatus == 1002) {
price = cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元' price = cell.goodsSource ? cell.redeemPoints + '积分' : (cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元')
} }
return price return price
// return cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元' // return cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元'
...@@ -195,7 +207,7 @@ export default { ...@@ -195,7 +207,7 @@ export default {
width: 130, width: 130,
prop: 'businessType', prop: 'businessType',
formatter: cell => { formatter: cell => {
return cell.businessType == 1 || cell.businessType == 2? '积分订单' : '普通订单' return cell.businessType == 1 || cell.businessType == 2 ? '积分订单' : '普通订单'
} }
}, },
{ {
...@@ -221,15 +233,45 @@ export default { ...@@ -221,15 +233,45 @@ export default {
} }
} }
] ]
},
// 发货弹窗
isSelectVisible: false,
batchLoading: false,
dialogConfig: {
title: '商品发货',
okText: '提交',
cancelText: '取消'
},
batchForm: {},
batchEditRules: {
expressName: [{ required: true, message: '请输入快递公司', trigger: 'change' }],
expressNo: [{ required: true, message: '请输入快递单号', trigger: 'change' }]
},
batchEditForm: [
{
label: '快递公司',
name: 'expressName',
type: 'input',
placeholder: '请输入快递公司',
maxlength: 20
},
{
label: '快递单号',
name: 'expressNo',
type: 'input',
placeholder: '请输入快递单号',
maxlength: 20
} }
]
} }
}, },
components: {}, components: {
SelectDialog
mounted() {
}, },
mounted() { },
methods: { methods: {
transfStatus: util.transfStatus, transfStatus: util.transfStatus,
setTableFinishFun() { setTableFinishFun() {
...@@ -269,7 +311,36 @@ export default { ...@@ -269,7 +311,36 @@ export default {
}) })
}, },
goOrderDetaillPage(item) { goOrderDetaillPage(item) {
this.$router.push({path: `/goodsOrder/detail/${item.subOrderCode}`}) this.$router.push({ path: `/goodsOrder/detail/${item.subOrderCode}` })
},
selectVisible() {
this.isSelectVisible = !this.isSelectVisible
},
handleOrderExpress(row) {
this.batchForm = {
subOrderCode: row.subOrderCode,
expressName: '',
expressNo: ''
}
this.selectVisible()
},
handleExpressConfirm(obj) {
this.batchLoading = true
this.$apis.platformGoods
.subOrderExpress(obj)
.then(res => {
let { code, message } = res
if (code == 0) {
this.$message.success('操作成功')
this.selectVisible()
this.handleSearch()
} else {
this.$message.error(message)
}
})
.finally(() => {
this.batchLoading = false
})
} }
} }
} }
......
<!-- 浏览明细 -->
<template>
<div class="ctnr">
<div class="title">{{ routeInfo.goodsSkuName }}</div>
<div class="p-20">
<div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="operate-wrap">
<span class="table-title"></span>
<div class="operate-btn">
<el-button :size="size" @click="handleExport()">导出</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="tableRef" :getListApi="getListApi" :noDataImg="url" :pageConf="pageConf" :searchForm="tableSearchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/images/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'browseRecordList',
data() {
return {
size: 'small',
url: url,
routeInfo: {},
searchForm: {
customerName: '',
customerMobile: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '客户名称',
name: 'customerName',
type: 'input',
maxlength: 50
},
{
label: '手机号',
name: 'customerMobile',
type: 'input',
maxlength: 20
}
],
// 表格
getListApi: this.$apis.platformGoods.getBrowseRecordList,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'customerName'
},
{
label: '手机号',
prop: 'customerMobile'
},
{
label: '浏览时长',
prop: 'browseDuration',
formatter: cellValue => {
return cellValue.browseDuration + '秒'
}
},
{
label: '进入页面时间',
prop: 'enterDate',
formatter: cellValue => {
return dayjs(cellValue.enterDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '离开页面时间',
prop: 'leaveDate',
formatter: cellValue => {
return dayjs(cellValue.leaveDate).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
mounted() {
this.routeInfo = this.$route.query
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.goodsId = this.$route.query.id
// 浏览类型:1.商品浏览
params.goodsType = '1'
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
handleSearch() {
this.$refs.tableRef.refreshTable()
},
handleReset() {
this.searchForm = {
customerName: '',
customerMobile: ''
}
this.handleSearch()
},
handleExport() {
const params = this.getParams()
this.$apis.platformGoods.exportBrowseRecordList(params).then(res => {
exportFn(res)
})
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
background-color: #fff;
.p-20 {
padding: 20px;
}
.title {
color: #333333;
font-size: 20px;
font-weight: bold;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
}
}
</style>
<!-- 分类管理 -->
<template>
<div class="ctnr">
<div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="operate-wrap">
<span class="table-title">分类列表</span>
<div class="operate-btn">
<GLButton :size="size" type="primary" fn="新增分类" @click="handleEdit('add')">新增分类</GLButton>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="classifyRef" :getListApi="getListApi" :noDataImg="url" :pageConf="pageConf" :searchForm="tableSearchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="tableButtonList" :buttonItem="scope.scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<!-- 表格区域 end -->
<SelectDialog v-if="isSelectVisible" :loading="batchLoading" :dialogConfig="dialogConfig" :batchForm="batchForm" :editFormData="batchEditForm" :editRules="batchEditRules" :visible="isSelectVisible" @handleClose="selectVisible" @confirm="handleSelectConfirm"></SelectDialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/images/empty.png'
import SelectDialog from './components/SelectDialog'
export default {
name: 'classifyList',
data() {
return {
size: 'small',
url: url,
isSelectVisible: false,
batchLoading: false,
dialogConfig: {
title: '新增分类',
okText: '提交',
cancelText: '取消'
},
batchForm: {},
batchEditRules: {
categoryName: [{ required: true, message: '请选择分类名称', trigger: 'change' }]
},
batchEditForm: [
{
label: '分类名称',
name: 'categoryName',
type: 'input',
placeholder: '请输入分类名称',
maxlength: 20
}
],
searchForm: {
categoryName: '',
createDate: []
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '分类名称',
name: 'categoryName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
// isClear: true,
pickerOptions: 'beforeRangePickerOptions'
}
],
// 表格按钮
tableButtonList: [
{
type: 'GLButton',
name: '编辑',
attrs: {
type: 'text',
fn: '编辑'
},
listeners: {
click: row => this.handleEdit('edit', row)
}
},
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text'
},
listeners: {
click: this.handleDelete
}
},
{
type: 'el-button',
name: '置顶',
attrs: {
type: 'text'
},
listeners: {
click: this.handleTop
}
}
],
// 表格
getListApi: this.$apis.platformGoods.getFrontendcategoryList,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '分类名称',
prop: 'categoryName'
},
{
label: '创建日期',
prop: 'createdAt',
formatter: cellValue => {
return dayjs(cellValue.createdAt).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
components: {
SelectDialog
},
mounted() { },
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.StartTime = dayjs(this.searchForm.createDate[0]).format('YYYY-MM-DD')
params.endTime = dayjs(this.searchForm.createDate[1]).format('YYYY-MM-DD')
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
selectVisible() {
this.isSelectVisible = !this.isSelectVisible
},
handleSelectConfirm(obj) {
this.batchLoading = true
this.$apis.platformGoods
.editFrontendCategory(obj)
.then(res => {
let { code, message } = res
if (code == 0) {
this.$message.success('操作成功')
this.selectVisible()
this.handleSearch()
} else {
this.$message.error(message)
}
})
.finally(() => {
this.batchLoading = false
})
},
findIdx(formName, name) {
return this[formName].findIndex(item => item.name == name)
},
//操作类型 optType: add,edit
handleEdit(optType, row) {
this.batchForm = {}
this.dialogConfig.title = optType == 'add' ? '新增分类' : '编辑'
if (optType == 'edit') {
this.$set(this.batchForm, 'id', row.id)
this.$set(this.batchForm, 'categoryName', row.categoryName)
}
this.selectVisible()
},
handleDelete(row) {
this.secondConfirm('提示', '此功能只删除小程序对应分类区,不会删除分类下的商品,是否确定删除此分类?', 'platformGoods', 'deleteFrontendCategory', { id: row.id, deletedFlag: 'D' })
},
handleTop(row) {
this.secondConfirm('置顶', '确定置顶此分类?', 'platformGoods', 'upFrontendCategory', { id: row.id, isPinned: 1 })
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun()
},
handleSearch() {
this.$refs.classifyRef.refreshTable()
},
handleReset() {
this.searchForm = {
categoryName: '',
createDate: []
}
this.handleSearch()
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
background-color: #fff;
padding: 20px;
}
</style>
<template>
<GLDialog :title="dialogConfig.title" mode="small" :visible.sync="visible" :show-close="true" :before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" :okText="dialogConfig.okText" :cancelText="dialogConfig.cancelText">
<div class="dialog-wrap" v-loading="loading">
<glsxCombiForm ref="editFormRef" :formObj="batchForm" :formData="editFormData" :formRules="editRules" formRef="editChildRef"></glsxCombiForm>
</div>
</GLDialog>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
export default {
name: 'SelectDialog',
props: {
dialogConfig: {
type: Object,
default: () => {
return {
title: '提示',
okText: '确定',
cancelText: '取消'
}
}
},
visible: {
type: Boolean,
default: false
},
batchForm: {
type: Object,
default: () => { }
},
editFormData: {
type: Array,
default: () => []
},
editRules: {
type: Object,
default: () => { }
},
loading: {
type: Boolean,
default: false
}
},
components: {
glsxCombiForm
},
data() {
return {}
},
methods: {
confirmPriceChange() {
this.$refs.editFormRef.$refs.editChildRef.validate(valid => {
if (valid) {
this.$emit('confirm', this.batchForm)
}
})
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss">
.dialog-wrap {
display: flex;
// align-items: center;
justify-content: center;
height: 100%;
width: 100%;
span {
white-space: nowrap;
margin-right: 8px;
}
// /deep/ .el-input {
// &,
// .el-input__inner {
// width: 100px;
// }
// .el-input-group__append {
// box-sizing: border-box;
// padding: 0 11px;
// span {
// margin: 0;
// }
// }
// }
}
</style>
<template> <template>
<GLDialog :title="isConversionRate ? '兑换价' : '批量改价'" mode="small" :visible.sync="visible" :show-close="true" <GLDialog :title="isConversionRate ? '兑换价' : '批量改价'" mode="small" :visible.sync="visible" :show-close="true" :before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" okText="提交" cancelText="取消">
:before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" okText="提交"
cancelText="取消">
<div class="dialog-wrap"> <div class="dialog-wrap">
<span> <span>
{{ isConversionRate ? '兑换价 = ' : '兑换价 = 供货价1:1积分 +' }} {{ isConversionRate ? '兑换价 = ' : '兑换价 = 供货价1:1积分 +' }}
</span> </span>
<el-input v-if="isConversionRate" size="small" type="text" <el-input v-if="isConversionRate" size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^[0]+[0-9]*$/gi,'')" v-model="batchCount" placeholder="请输入积分">
onkeyup="value = value.replace(/[^\d]/g,'').replace(/^[0]+[0-9]*$/gi,'')"
v-model="batchCount" placeholder="请输入积分">
<span slot="append">积分</span> <span slot="append">积分</span>
</el-input> </el-input>
<el-input v-else size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^0\d/g, '0')" <el-input v-else size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^0\d/g, '0')" v-model="batchCount" placeholder="请输入积分">
v-model="batchCount" placeholder="请输入积分">
<span slot="append">积分</span> <span slot="append">积分</span>
</el-input> </el-input>
<span>&nbsp; +</span> <span>&nbsp; +</span>
<el-input size="small" type="text" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$') <el-input size="small" type="text" onkeyup="value = value ? value.replace(/^0\d/g, '0').replace(/[^\d.]/g, '').replace(/^\./g, '').replace(/^\d{6}\d+(\.\d+)?/g, value.substr(0,6)).replace(/\.{2,}/g, '').replace('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" .replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" v-model="batchPrice" placeholder="请输入金额" :disabled="echoParams.goodsSource == 2">
v-model="batchPrice" placeholder="请输入金额">
<span slot="append">元</span> <span slot="append">元</span>
</el-input> </el-input>
</div> </div>
...@@ -80,7 +74,8 @@ export default { ...@@ -80,7 +74,8 @@ export default {
} }
/deep/ .el-input { /deep/ .el-input {
&, .el-input__inner { &,
.el-input__inner {
width: 100px; width: 100px;
} }
......
<!-- 访客明细 -->
<template>
<div class="ctnr">
<div class="title">{{ routeInfo.goodsSkuName }}</div>
<div class="p-20">
<div>
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchForm" :formData="searchFormData" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
</div>
<div class="operate-wrap">
<span class="table-title"></span>
<div class="operate-btn">
<el-button :size="size" @click="handleExport()">导出</el-button>
</div>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="tableRef" :getListApi="getListApi" :noDataImg="url" :pageConf="pageConf" :searchForm="tableSearchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun"></GLTable>
<!-- 表格区域 end -->
</div>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/images/empty.png'
import { exportFn } from '@/common/constant'
export default {
name: 'useRecordList',
data() {
return {
size: 'small',
url: url,
routeInfo: {},
searchForm: {
customerName: '',
customerMobile: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '客户名称',
name: 'customerName',
type: 'input',
maxlength: 50
},
{
label: '手机号',
name: 'customerMobile',
type: 'input',
maxlength: 20
}
],
// 表格
getListApi: this.$apis.platformGoods.getUseRecordList,
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '客户名称',
prop: 'customerName'
},
{
label: '手机号',
prop: 'customerMobile'
},
{
label: '浏览次数',
prop: 'visitorCount',
formatter: cellValue => {
return cellValue.visitorCount + '次'
}
},
{
label: '最后浏览时间',
prop: 'lastBrowseTime',
formatter: cellValue => {
return dayjs(cellValue.lastBrowseTime).format('YYYY-MM-DD HH:mm:ss')
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }
}
},
mounted() {
this.routeInfo = this.$route.query
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
params.goodsId = this.$route.query.id
// 浏览类型:1.商品浏览
params.goodsType = '1'
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
handleSearch() {
this.$refs.tableRef.refreshTable()
},
handleReset() {
this.searchForm = {
customerName: '',
customerMobile: ''
}
this.handleSearch()
},
handleExport() {
const params = this.getParams()
this.$apis.platformGoods.exportUseRecordList(params).then(res => {
exportFn(res)
})
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
background-color: #fff;
.p-20 {
padding: 20px;
}
.title {
color: #333333;
font-size: 20px;
font-weight: bold;
padding: 14px 20px;
border-bottom: 1px solid #e5e5e5;
}
}
</style>
...@@ -16,7 +16,9 @@ ...@@ -16,7 +16,9 @@
</GLCombiForm> </GLCombiForm>
</div> </div>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">选品库</span> <el-tabs v-model="activeTab">
<el-tab-pane v-for="item in baseData.tabList" :key="item.name" :label="item.label" :name="item.name"></el-tab-pane>
</el-tabs>
<el-button :size="size" type="primary" plain @click="addWarehouseFn({}, 1)">当页添加进仓库</el-button> <el-button :size="size" type="primary" plain @click="addWarehouseFn({}, 1)">当页添加进仓库</el-button>
</div> </div>
<div class="goods-wrap" v-if="goodsList && goodsList.length"> <div class="goods-wrap" v-if="goodsList && goodsList.length">
...@@ -54,15 +56,7 @@ ...@@ -54,15 +56,7 @@
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
<div class="pagination"> <div class="pagination">
<el-pagination <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="pageObj.pageNum" :page-sizes="pageObj.pageSizes" :page-size="pageObj.pageSize" :total="pageObj.total" layout="total, sizes, prev, pager, next, jumper">
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageObj.pageNum"
:page-sizes="pageObj.pageSizes"
:page-size="pageObj.pageSize"
:total="pageObj.total"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
...@@ -76,7 +70,8 @@ export default { ...@@ -76,7 +70,8 @@ export default {
data() { data() {
return { return {
size: 'small', size: 'small',
page:{}, activeTab: '1',
page: {},
goodsList: [], goodsList: [],
categoryVal: [], categoryVal: [],
categoryList: [], categoryList: [],
...@@ -87,7 +82,7 @@ export default { ...@@ -87,7 +82,7 @@ export default {
lazyLoad: this.getCategoryList lazyLoad: this.getCategoryList
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageObj :{ pageObj: {
total: 0, total: 0,
pageSize: 50, pageSize: 50,
pageSizes: [40, 50, 60, 70], pageSizes: [40, 50, 60, 70],
...@@ -140,6 +135,12 @@ export default { ...@@ -140,6 +135,12 @@ export default {
addHtml: 'spreadPriceSlot' addHtml: 'spreadPriceSlot'
}, },
], ],
baseData: {
tabList: [{
name: '1',
label: '云中鹤'
}]
}
} }
}, },
...@@ -147,7 +148,7 @@ export default { ...@@ -147,7 +148,7 @@ export default {
inputNumRange, inputNumRange,
categoryCascader categoryCascader
}, },
created(){ created() {
this.getGoodsList() this.getGoodsList()
// this.getCategoryList() // this.getCategoryList()
}, },
...@@ -156,15 +157,15 @@ export default { ...@@ -156,15 +157,15 @@ export default {
}, },
methods: { methods: {
handleSizeChange(e){ handleSizeChange(e) {
this.pageObj.pageSize = e this.pageObj.pageSize = e
this.getGoodsList() this.getGoodsList()
}, },
handleCurrentChange(e){ handleCurrentChange(e) {
this.pageObj.pageNum = e this.pageObj.pageNum = e
this.getGoodsList() this.getGoodsList()
}, },
getGoodsList(){ getGoodsList() {
const { pageSize, pageNum } = this.pageObj const { pageSize, pageNum } = this.pageObj
const { goodsSkuName, categoryCode, priceOrderType, startSellPrice, endSellPrice, endDiffPrice, startDiffPrice } = this.goodsFormObj const { goodsSkuName, categoryCode, priceOrderType, startSellPrice, endSellPrice, endDiffPrice, startDiffPrice } = this.goodsFormObj
const params = { const params = {
...@@ -176,7 +177,7 @@ export default { ...@@ -176,7 +177,7 @@ export default {
startDiffPrice, startDiffPrice,
pageNum, pageNum,
pageSize, pageSize,
categoryCode: categoryCode && categoryCode.length ? categoryCode[categoryCode.length-1] : '' categoryCode: categoryCode && categoryCode.length ? categoryCode[categoryCode.length - 1] : ''
} }
// if (0 < params.categoryCode.length && params.categoryCode.length < 6) { // if (0 < params.categoryCode.length && params.categoryCode.length < 6) {
...@@ -192,9 +193,9 @@ export default { ...@@ -192,9 +193,9 @@ export default {
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)' background: 'rgba(0, 0, 0, 0.3)'
}) })
this.$apis.platformGoods.getGoodsListApi(params).then(res=>{ this.$apis.platformGoods.getGoodsListApi(params).then(res => {
loading.close() loading.close()
if(res){ if (res) {
this.goodsList = res.list this.goodsList = res.list
this.pageObj.total = res.total this.pageObj.total = res.total
} }
...@@ -203,20 +204,20 @@ export default { ...@@ -203,20 +204,20 @@ export default {
console.log(err) console.log(err)
}) })
}, },
getCategoryList(node, resolve){ getCategoryList(node, resolve) {
const params = { const params = {
categoryCode: node?.value, categoryCode: node?.value,
categoryLevel: node?.level + 1 categoryLevel: node?.level + 1
} }
this.$apis.platformGoods.getCategoryListApi(params).then(res=>{ this.$apis.platformGoods.getCategoryListApi(params).then(res => {
if(res){ if (res) {
res.map(item => item.leaf = params.categoryLevel>2) res.map(item => item.leaf = params.categoryLevel > 2)
if(params.categoryLevel == 1) this.categoryList = res if (params.categoryLevel == 1) this.categoryList = res
resolve(res) resolve(res)
} }
}) })
}, },
handleReset(){ handleReset() {
this.goodsFormObj = { this.goodsFormObj = {
goodsSkuName: '', goodsSkuName: '',
categoryCode: '', categoryCode: '',
...@@ -234,25 +235,25 @@ export default { ...@@ -234,25 +235,25 @@ export default {
} }
this.getGoodsList() this.getGoodsList()
}, },
handleSearch(){ handleSearch() {
this.pageObj.pageNum = 1 this.pageObj.pageNum = 1
this.getGoodsList() this.getGoodsList()
}, },
addWarehouseFn(item, isAll){ addWarehouseFn(item, isAll) {
let params = { let params = {
goodsSkuCodes: [item.goodsSkuCode], goodsSkuCodes: [item.goodsSkuCode],
} }
let tip = `是否把 ${item.goodsSkuName} 添加到仓库?` let tip = `是否把 ${item.goodsSkuName} 添加到仓库?`
if(isAll){ if (isAll) {
params.goodsSkuCodes = this.goodsList.map(item => item.goodsSkuCode) params.goodsSkuCodes = this.goodsList.map(item => item.goodsSkuCode)
tip = `是否把当前页${this.goodsList.length}个商品全部添加到仓库?` tip = `是否把当前页${this.goodsList.length}个商品全部添加到仓库?`
} }
this.$confirm(tip, '提示', { this.$confirm(tip, '提示', {
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if(action=='confirm'){ if (action == 'confirm') {
this.$apis.platformGoods.addWarehouseApi(params).then(res=>{ this.$apis.platformGoods.addWarehouseApi(params).then(res => {
if(res){ if (res) {
this.$message.success('操作成功') this.$message.success('操作成功')
this.getGoodsList() this.getGoodsList()
} }
...@@ -262,15 +263,42 @@ export default { ...@@ -262,15 +263,42 @@ export default {
}) })
} }
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.ctnr{ .ctnr {
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
.noData{ .operate-wrap {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
/deep/ .el-tabs__header {
margin-bottom: 0;
}
/deep/ .el-tabs__nav {
border-radius: 4px;
}
/deep/ .el-tabs__item {
box-sizing: border-box;
padding: 0 32px;
border: 4px solid #f0f2f5;
line-height: 32px;
font-weight: bold;
}
/deep/ .el-tabs__active-bar {
display: none;
}
}
.noData {
height: calc(100vh - 310px); height: calc(100vh - 310px);
min-height: 300px; min-height: 300px;
display: flex; display: flex;
...@@ -279,57 +307,57 @@ export default { ...@@ -279,57 +307,57 @@ export default {
flex-direction: column; flex-direction: column;
text-align: center; text-align: center;
color: #666; color: #666;
img{ img {
width: 320px; width: 320px;
height: 94px; height: 94px;
} }
} }
.goods-wrap{ .goods-wrap {
// display: flex; // display: flex;
// flex-wrap: wrap; // flex-wrap: wrap;
// overflow-y: auto; // overflow-y: auto;
// height: 700px; // height: 700px;
display: grid; display: grid;
grid-template-columns: 20% 20% 20% 20% 20%; grid-template-columns: 20% 20% 20% 20% 20%;
.goods-box{ .goods-box {
// flex: 0 1 216px; // flex: 0 1 216px;
// width: 216px; // width: 216px;
height: 346px; height: 346px;
background: #F9F9F9; background: #f9f9f9;
border-radius: 4px; border-radius: 4px;
margin-left: 16px; margin-left: 16px;
margin-bottom: 20px; margin-bottom: 20px;
padding: 12px; padding: 12px;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
&:nth-last-child(5n){ &:nth-last-child(5n) {
margin-left: 0; margin-left: 0;
} }
&:nth-last-child(-n+5){ &:nth-last-child(-n + 5) {
margin-bottom: 0; margin-bottom: 0;
} }
.mask{ .mask {
display: none; display: none;
position: absolute; position: absolute;
top: 0; top: 0;
right: 0; right: 0;
left: 0; left: 0;
bottom: 0; bottom: 0;
background: rgba(0,0,0,.3); background: rgba(0, 0, 0, 0.3);
border-radius: 4px; border-radius: 4px;
z-index: 2; z-index: 2;
.add-warehouse{ .add-warehouse {
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
&:hover{ &:hover {
background: #8A85FF; background: #8a85ff;
border-color: #8A85FF; border-color: #8a85ff;
} }
} }
} }
.status-label{ .status-label {
z-index: 2; z-index: 2;
width: 50px; width: 50px;
height: 50px; height: 50px;
...@@ -337,23 +365,23 @@ export default { ...@@ -337,23 +365,23 @@ export default {
right: 0; right: 0;
top: 0; top: 0;
} }
.goods-img{ .goods-img {
width: 100%; width: 100%;
height: 192px; height: 192px;
border-radius: 2px; border-radius: 2px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
img{ img {
object-fit: contain; object-fit: contain;
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 2px; border-radius: 2px;
} }
} }
.info{ .info {
margin-top: 12px; margin-top: 12px;
.title{ .title {
font-weight: 500; font-weight: 500;
font-size: 14px; font-size: 14px;
color: #333; color: #333;
...@@ -363,45 +391,43 @@ export default { ...@@ -363,45 +391,43 @@ export default {
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
text-overflow:ellipsis; text-overflow: ellipsis;
} }
p{ p {
margin: 4px 0 0; margin: 4px 0 0;
line-height: 18px; line-height: 18px;
font-size: 12px; font-size: 12px;
color: #666; color: #666;
} }
.inventory{ .inventory {
color: #333; color: #333;
} }
.supply{ .supply {
color: #EB4E4E; color: #eb4e4e;
font-weight: 500; font-weight: 500;
} }
.market{ .market {
font-weight: 500; font-weight: 500;
font-size: 13px; font-size: 13px;
color: #333; color: #333;
} }
} }
} }
.optional:hover{ .optional:hover {
.mask{ .mask {
display: block; display: block;
} }
} }
.in-warehouse{ .in-warehouse {
cursor: not-allowed; cursor: not-allowed;
.mask{ .mask {
display: block; display: block;
background: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, 0.5);
.add-warehouse{ .add-warehouse {
display: none; display: none;
} }
} }
} }
} }
} }
</style> </style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!