Commit b5daf7ed by 前端

Merge branch 'SAAS+V4.56.0-0908' into 'master'

上线合并

See merge request !29
2 parents a4411d2b 534e6e0f
......@@ -1891,51 +1891,6 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"ssri": {
"version": "8.0.1",
"resolved": "https://registry.npmmirror.com/ssri/-/ssri-8.0.1.tgz",
......@@ -1944,28 +1899,6 @@
"requires": {
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader-v16@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
......@@ -13431,6 +13364,75 @@
}
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"resolved": "https://registry.npmmirror.com/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
},
"dependencies": {
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmmirror.com/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
}
}
},
"vue-router": {
"version": "3.6.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",
......
......@@ -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
}
......@@ -85,6 +85,25 @@ const modifyPriceApi = params => {
sign: true
})
}
// 平台商品置顶
const goodsUpdatePoinnt = params => {
params.method = 'scrm.api.shopmall.scrm.glgoods.updatePoinnted'
return http({
url,
data: params,
sign: true,
returnAll: true
})
}
// 门店列表
const getCurMerList = params => {
params.method = `scrm.api.shopmall.points.order.merchant.list`
return http({
url,
data: params,
sign: true
})
}
// 订单列表
const getOrderList = params => {
......@@ -104,6 +123,15 @@ const getOrderDetail = params => {
sign: true
})
}
// 子订单商品发货(自营商品)
const subOrderExpress = params => {
params.method = 'scrm.api.shopmall.points.sub.order.express'
return http({
url,
data: params,
returnAll: true
})
}
// 售后列表
const getSaleOrderList = params => {
......@@ -114,6 +142,32 @@ const getSaleOrderList = params => {
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 => {
......@@ -125,7 +179,7 @@ const getSaleOrderDetail = params => {
})
}
/**
* 获取油劵列表
* 获取油劵列表
*/
const getOilCouponList = params => {
params.method = 'scrm.api.shopmall.goods.oil.coupon.list'
......@@ -162,6 +216,102 @@ const exportOilCouponOrderList = 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 {
getCategoryListApi,
getGoodsListApi,
......@@ -172,12 +322,29 @@ export default {
batchOffApi,
goodsDetailApi,
modifyPriceApi,
goodsUpdatePoinnt,
getCurMerList,
getOrderList,
getOrderDetail,
subOrderExpress,
getSaleOrderList,
getAfterSalesDetail,
getYZHAfterSalesDetail,
checkSubOrder,
getSaleOrderDetail,
getOilCouponList,
updateOilCoupon,
getOilCouponOrderList,
exportOilCouponOrderList
exportOilCouponOrderList,
getFrontendcategoryList,
getFrontendcategoryOpt,
editFrontendCategory,
deleteFrontendCategory,
upFrontendCategory,
insertOrUpdateProApi,
goodsUpdateFrocategory,
getBrowseRecordList,
exportBrowseRecordList,
getUseRecordList,
exportUseRecordList
}
......@@ -56,7 +56,36 @@ function uploadImg (e, _this, maxSize = 2) {
}
})
}
export {
exportFn,
uploadImg
}
\ No newline at end of file
// 新值,旧值,整数部分位数,小数部分位数,最小值,最大值,规则
function limitPrice(newValue, oldValue, intergerDigit, pointDigit, minValue, maxValue, regRule) {
/* 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
const categoryList = [
{
id: '1',
label: '云中鹤'
},
{
id: '2',
label: '广联自营'
}
]
export { categoryList }
......@@ -73,12 +73,12 @@
<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" />
<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[item.subName || '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>
<i class="el-icon-zoom-in" @click="handleImgLook(typeof subItem == 'object' ? subItem[item.subName || 'content'] : subItem, item)"></i>
</span>
</span>
</span>
......@@ -133,7 +133,7 @@ export default {
},
props: {
formDisable:{
formDisable: {
type: Boolean,
default: false
},
......@@ -172,7 +172,7 @@ export default {
},
formObj: {
type: Object,
default: () => {}
default: () => { }
},
hasTitle: {
type: Boolean,
......@@ -180,16 +180,16 @@ export default {
},
formRules: {
type: Object,
default: () => {}
default: () => { }
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => {}
default: () => { }
}
},
mounted() {},
mounted() { },
methods: {
// 选择框-添加其他属性
......@@ -285,7 +285,7 @@ export default {
width: 65%;
} */
.glsx-combi-form .no-label.el-form-item--small .el-form-item__content {
width: 100%;
width: 100% !important;
}
.glsx-combi-form .el-form-item--small.el-form-item {
......@@ -327,7 +327,7 @@ export default {
.glsx-combi-form .tips-label {
margin-right: 20px;
}
.glsx-combi-form .tips-icon {
.glsx-combi-form .tips-icon {
position: absolute;
display: inline-block;
width: 12px;
......@@ -339,7 +339,7 @@ export default {
border: 1px dotted #7f7f7f;
border-radius: 50%;
}
.glsx-combi-form .tips-icon::before {
.glsx-combi-form .tips-icon::before {
content: '?';
position: absolute;
width: 8px;
......@@ -371,6 +371,7 @@ export default {
background-color: #f7f7f7;
border: 1px dotted #d9d9d9;
cursor: pointer;
border-radius: 4px;
}
.glsx-combi-form .activity-Input {
......
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="70%" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<div class="flex">
<el-form :inline="true" :model="searchForm">
<el-form-item label="商品名称:">
<el-input :size="size" v-model="searchForm.name" placeholder="请输入商品名称" clearable></el-input>
</el-form-item>
<el-form-item>
<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>
<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>
<glsx-dialog class="muti-pro" title="选择商品" :isVisible.sync="isMutiSelectVisible" width="1380px" @confirmDialog="handleMutiSelectConfirm" @closeDialog="handleMutiSelectClose">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj" :formData="goodsFormData"></GLCombiForm>
<GLTable class="pointTable" @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" @sortChange="sortChange" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div class="setPriceSlot" slot="setPriceSlot" slot-scope="scope">
<span class="unedited">{{ scope.scope.redeemPoints }}积分 + {{ scope.scope.salePrice }}元</span>
</div>
</GLTable>
</glsx-dialog>
</template>
......@@ -31,7 +21,32 @@ export default {
// 表格组件
// getListApi: getGoodsList,
productList: [],
// pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
getListApi: this.$apis.platformGoods.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
goodsFormObj: {
goodsPosition: 2,
businessType: 1,
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: {
listName: 'list',
......@@ -42,23 +57,41 @@ export default {
tableColumns: [
{
label: '商品名称',
prop: 'name'
prop: 'goodsSkuName'
},
{
label: '缩略图',
prop: 'coverImgUrl',
addHtml: 'coverImgUrl'
label: '兑换价',
width: 220,
addHtml: 'setPriceSlot',
prop: 'salePrice'
},
{
label: '价格(元)',
prop: 'price1',
label: '商品来源',
prop: 'goodsSource',
width: 150,
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 this.baseData.goodsSourceList.find(item => item.confId == cellValue.goodsSource)?.confLabel || '--'
}
},
{
label: '来源门店',
prop: 'merchantName'
label: '库存',
width: 150,
prop: 'goodsStock',
formatter: cellValue => {
return cellValue.goodsStock != null ? cellValue.goodsStock : cellValue.minGoodsStock + '-' + cellValue.maxGoodsStock
}
}
]
},
baseData: {
goodsSourceList: [
{
confId: '1',
confLabel: '云中鹤'
},
{
confId: '2',
confLabel: '广联自营'
}
]
}
......@@ -74,13 +107,13 @@ export default {
type: Array,
default: () => []
},
getListApi: {
type: Function,
default: () => {}
},
// getListApi: {
// type: Function,
// default: () => { }
// },
searchForm: {
type: Object,
default: () => {}
default: () => { }
}
},
......@@ -89,39 +122,90 @@ export default {
},
mounted() {
this.getList(true)
this.getOptionsList('goodsFormData')
},
methods: {
getList(isMounted = false) {
var params = {
// goodsStatus: 1,
// goodsSource: 1,
...this.searchForm,
pageNum: isMounted ? 1 : this.$refs.mutiProRef.page.pageNum,
pageSize: isMounted ? 10 : this.$refs.mutiProRef.page.pageSize
}
var that = this
this.getListApi(params).then(res => {
// console.log(res)
this.productList = res.list
this.$refs.mutiProRef.tableTotal = res.total
this.recoverySelected()
beforeSearchFn() {
return new Promise((resolve, reject) => {
var selectedData = this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || []
let list = this.productList || []
this.selectedProList.forEach(item => {
if (!list?.map(k => k.id).includes(item.id) && !selectedData?.map(k => k.id).includes(item.id)) {
selectedData.push(item)
}
})
this.selectedProList = this.$common.utils.deepClone(selectedData)
this.searchForm = this.$common.utils.deepClone(this.goodsFormObj)
resolve()
})
},
setTableFinishFun(list) {
this.productList = list
this.recoverySelected()
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
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)
}
} 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() {
this.searchForm.name = ''
this.getList()
this.goodsFormObj = {
goodsPosition: 2,
businessType: 1,
goodsSkuName: '',
goodsSource: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs.tableRef.refreshTable()
},
recoverySelected() {
if (this.selectedProList.length) {
this.selectedProList.forEach(row => {
this.$refs.mutiProRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(row)
const obj = this.productList.find(item => item.id == row.id)
obj && this.$refs.tableRef.$refs[this.tableParams.mutiSelectName + 'MutiTable'].toggleRowSelection(obj, true)
})
}
},
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
var selectedData = this.$refs.tableRef.mutiSelectArr[this.tableParams.mutiSelectName]
this.selectedProList.forEach(item => {
if (!this.productList.map(k => k.id).includes(item.id) && !selectedData.map(k => k.id).includes(item.id)) {
selectedData.push(item)
}
})
if (selectedData && selectedData.length > 100) {
this.$message({
message: '最多选择100件商品',
type: 'error',
customClass: 'msgHierarchy'
})
return true
}
console.log(this.$common.utils.deepClone(selectedData), 'selectedData===')
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
......
......@@ -11,15 +11,17 @@
let cfg = require('./conf.js')
let timeout = 30000 //超时时间
import { Http } from 'glsx-common'
export const fetchConfig = function(isEnv = true) {
export const fetchConfig = function(common) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// 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')
//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' })
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())
// request({ url: 'https://oss-config.test.glsx.com.cn/mock/5be17454f31545347559d499/config/oss_commodity_center', method: 'get' })
}
export const config = {
install(vue, cfg) {
......
......@@ -11,6 +11,7 @@ import Vue from 'vue'
import apis from './api'
import './public-path'
import '@/assets/css/public.scss'
import '@/assets/css/edit.scss'
// import 'glsx-components/dist/glsx-components.css'
import { start } from '@/setup'
Vue.config.productionTip = false
......
......@@ -11,7 +11,7 @@ let router = null
let instance = null
Vue.use(GLTable).use(GLCombiForm).use(GLTableButton).use(GLDialog)
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_brand.baseURL = 'https://scrm.dev.glsx.com.cn'
// request.baseURL = 'http://192.168.1.53:7226'
......
......@@ -38,49 +38,60 @@ util.getDateStr = function(num) {
let now = new Date()
now.setDate(now.getDate() + num)
util.dateFormat(now)
// let y = now.getFullYear()
// let m = (now.getMonth() + 1) < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1)
// let d = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
// let y = now.getFullYear()
// let m = (now.getMonth() + 1) < 10 ? '0' + (now.getMonth() + 1) : (now.getMonth() + 1)
// let d = now.getDate() < 10 ? '0' + now.getDate() : now.getDate()
// return y + "-" + m + "-" + d
return util.dateFormat(now)
}
util.getExplorer = function() {
var ua = navigator.userAgent.toLocaleLowerCase();
var browserType = null;
var ua = navigator.userAgent.toLocaleLowerCase()
var browserType = null
if (ua.match(/msie/) != null || ua.match(/trident/) != null) {
browserType = "IE";
browserType = 'IE'
} else if (ua.match(/firefox/) != null) {
browserType = "火狐";
browserType = '火狐'
} else if (ua.match(/ubrowser/) != null) {
browserType = "UC";
browserType = 'UC'
} else if (ua.match(/opera/) != null) {
browserType = "欧朋";
browserType = '欧朋'
} else if (ua.match(/bidubrowser/) != null) {
browserType = "百度";
browserType = '百度'
} else if (ua.match(/metasr/) != null) {
browserType = "搜狗";
browserType = '搜狗'
} else if (ua.match(/tencenttraveler/) != null || ua.match(/qqbrowse/) != null) {
browserType = "QQ";
browserType = 'QQ'
} else if (ua.match(/maxthon/) != null) {
browserType = "遨游";
browserType = '遨游'
} else {
browserType = '谷歌'
}
return browserType
}
util.transfStatus = function(firstKey, key) {
if(firstKey==1001) return {name: '待支付', color: '#FDB757'}
let arr1 = [1002,1006,1007,1008]
let arr2 = [1003,1004,1005,1012]
if(arr1.includes(+key)){
return {name: '待收货', color: '#5850FF'}
}else if(arr2.includes(+key)){
return {name: '已关闭', color: '#999999'}
}else if(key==1009){
return {name: '已完成', color: '#2CCA74'}
}else{
return {name: '售后/退款', color: '#EB4E4E'}
util.transfStatus = function(payStatus, orderStatus, goodsSource) {
if (payStatus == 1001) return { name: '待支付', color: '#FDB757' }
let arr1 = [1008]
let arr2 = [1003, 1004, 1005, 1012]
if ([1002, 1006, 1007].includes(orderStatus)) {
return { name: '待发货', color: '#5850FF' }
}
if (arr1.includes(+orderStatus)) {
return { name: '待收货', color: '#5850FF' }
} else if (arr2.includes(+orderStatus)) {
return { name: '已关闭', color: '#999999' }
} else if (orderStatus == 1009) {
return { name: '已完成', color: '#2CCA74' }
} else {
return { name: '售后/退款', color: '#EB4E4E' }
}
}
util.checkPhone = function(mobile) {
const myreg = /^(13[0-9]|15[0-9]|16[0-9]|17[0-9]|18[0-9]|19[0-9]|14[0-9])[0-9]{8}$/
return myreg.test(mobile)
}
util.validationInput = function(str) {
const reg = /[^\w\.\/]/gi // eslint-disable-line
return reg.test(str)
}
export default util
\ No newline at end of file
export default util
......@@ -4,8 +4,8 @@
<div class="stutas-wrap">
<span>订单状态:</span>
<span v-if="!isLoading" class="stutas-circle"
:style="{backgroundColor: transfStatus(orderInfo.payStatus,orderInfo.orderStatus).color}"></span>
<span v-if="!isLoading">{{ transfStatus(orderInfo.payStatus, orderInfo.orderStatus).name }}</span>
:style="{ backgroundColor: transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).color }"></span>
<span v-if="!isLoading">{{ transfStatus(orderInfo.payStatus, orderInfo.orderStatus, orderInfo.orderType).name }}</span>
</div>
<div class="info-wrap order-info">
<div class="title">订单信息</div>
......@@ -212,6 +212,11 @@ export default {
label: '收货人信息',
name: 'addInfo',
type: 'showTxt'
},
{
label: '运费',
name: 'freightAmount',
type: 'showTxt'
}
]
}
......
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset"
:formObj="orderFormObj" :formData="orderFormData">
<GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm>
<div class="main-wrap">
<div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id"
:class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]"
@click="changeTable(item.id)">{{ item.name }}</span>
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{ item.name }}</span>
</div>
<div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm"
:tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
......@@ -25,9 +20,8 @@
<p class="phone">{{ scope.scope.customerPhone }}</p>
</div>
<div slot="orderStatusSlot" slot-scope="scope">
<span class="circle"
:style="{backgroundColor: transfStatus(scope.scope.payStatus,scope.scope.orderStatus).color}"></span>
<span>{{ transfStatus(scope.scope.payStatus, scope.scope.orderStatus).name }}</span>
<span class="circle" :style="{ backgroundColor: transfStatus(scope.scope.payStatus, scope.scope.orderStatus, scope.scope.goodsSource).color }"></span>
<span>{{ transfStatus(scope.scope.payStatus, scope.scope.orderStatus, scope.scope.goodsSource).name }}</span>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p>
......@@ -39,12 +33,14 @@
</GLTable>
</div>
</div>
<SelectDialog v-if="isSelectVisible" :loading="batchLoading" :dialogConfig="dialogConfig" :batchForm="batchForm" :editFormData="batchEditForm" :editRules="batchEditRules" :visible="isSelectVisible" @handleClose="selectVisible" @confirm="handleExpressConfirm"></SelectDialog>
</div>
</template>
<script>
import {utils} from 'glsx-common'
import { utils } from 'glsx-common'
import util from '@/util/util'
import SelectDialog from '../pointProducts/components/SelectDialog'
const titleList = [
{
......@@ -56,6 +52,10 @@ const titleList = [
name: '待支付'
},
{
id: 6,
name: '待发货'
},
{
id: 1,
name: '待收货'
},
......@@ -89,6 +89,18 @@ export default {
listeners: {
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: {},
......@@ -120,6 +132,14 @@ export default {
isClear: true
},
{
label: '门店字段',
name: 'merchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName'
},
{
label: '下单时间',
name: 'time',
type: 'datePicker',
......@@ -141,20 +161,20 @@ export default {
{
id: '1',
value: 'B端积分订单'
},{
id: '2',
value: 'C端积分订单'
}, {
id: '2',
value: 'C端积分订单'
}],
optionId: 'id',
optionLabel: 'value'
},
],
getListApi: this.$apis.platformGoods.getOrderList,
pageConf: {pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: {
width: 80
width: 140
},
tableColumns: [
{
......@@ -169,7 +189,7 @@ export default {
prop: 'salePrice',
align: 'right',
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 +203,8 @@ export default {
align: 'right',
formatter: cell => {
let price = 0
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) + '元'
if (cell.payStatus == 1002) {
price = cell.goodsSource ? (cell.redeemPoints * cell.sellQty).toFixed(0) + '积分' : (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 cell.businessType == 1 || cell.businessType == 2 ? (cell.redeemPoints * cell.sellQty) + '积分' + '+' + +(cell.salePrice * cell.sellQty).toFixed(2) + '元' : +(cell.salePrice * cell.sellQty).toFixed(2) + '元'
......@@ -195,7 +215,7 @@ export default {
width: 130,
prop: 'businessType',
formatter: cell => {
return cell.businessType == 1 || cell.businessType == 2? '积分订单' : '普通订单'
return cell.businessType == 1 || cell.businessType == 2 ? '积分订单' : '普通订单'
}
},
{
......@@ -214,6 +234,11 @@ export default {
addHtml: 'orderNoSlot'
},
{
label: '门店字段',
width: 300,
prop: 'merchantName'
},
{
label: '下单时间',
width: 200,
formatter: cellValue => {
......@@ -221,13 +246,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() {
this.getCurMerList()
},
methods: {
......@@ -240,6 +297,17 @@ export default {
this.orderFormObj.requestType = id
this.handleSearch()
},
getCurMerList() {
this.$apis.platformGoods.getCurMerList({ pageSize: 9999, currentPage: 1 }).then(res => {
console.log(res)
this.orderFormData[3].optionList = res
this.orderFormData[3].optionList.unshift({
merchantId: '',
merchantName: '全部'
})
})
},
handleReset() {
this.orderFormObj = {
customerInfo: '',
......@@ -269,7 +337,36 @@ export default {
})
},
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
})
}
}
}
......@@ -296,7 +393,7 @@ export default {
}
.phone {
font-size: 10px;
font-size: 12px;
color: #999999;
}
}
......
<template>
<GLDialog class="select-dialog" :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" :labelWidth="labelWidth" labelPaddingRight="0" :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
},
labelWidth: {
type: String,
default: '154px'
}
},
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">
.select-dialog {
.dialog-wrap {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
span {
white-space: nowrap;
}
/deep/ .el-input {
&,
.el-input__inner {
width: 100px;
}
}
}
}
</style>
<!-- 浏览明细 -->
<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',
customClass: 'msgHierarchy'
})
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 class="select-dialog" :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" :labelWidth="labelWidth" labelPaddingRight="0" :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
},
labelWidth: {
type: String,
default: '154px'
}
},
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">
.select-dialog {
.dialog-wrap {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
span {
white-space: nowrap;
}
/deep/ .el-input {
&,
.el-input__inner {
width: 100px;
}
}
}
}
</style>
......@@ -44,7 +44,7 @@
<span>+</span>
<!-- v-focus-->
<el-input size="small" clearable v-model="salePrice" 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" type="text"
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" type="text" disabled
@blur="setPriceFn">
<span slot="append">元</span>
</el-input>
......@@ -68,7 +68,7 @@
<el-button type="primary" :disabled="goodsInfo.shelvesStatus == 1002" v-if="goodsInfo.goodsPosition==1"
@click="handleSale">上架销售
</el-button>
<el-button type="primary" v-if="goodsInfo.goodsPosition==2" plain @click="handleOff">下架</el-button>
<!-- <el-button type="primary" v-if="goodsInfo.goodsPosition==2" plain @click="handleOff">下架</el-button> -->
<el-button type="primary" v-if="goodsInfo.goodsPosition==1" plain @click="handleRemove">移出</el-button>
</div>
</div>
......@@ -101,6 +101,7 @@
</template>
<script>
import { limitPrice } from '@/common/constant'
const attrList = [
// {
// label:'商品特点',
......@@ -158,6 +159,11 @@ export default {
},
},
},
watch: {
redeemPoints(newValue, oldValue) {
this.redeemPoints = limitPrice(newValue, oldValue, 5, 0, 1, 99999)
}
},
mounted() {
},
......@@ -215,9 +221,9 @@ export default {
handleSale() {
this.operateFn('batchSaleApi', '上架销售')
},
handleOff() {
this.operateFn('batchOffApi', '下架')
},
// handleOff() {
// this.operateFn('batchOffApi', '下架')
// },
handleRemove() {
this.operateFn('batchRemoveApi', '移出')
},
......
<template>
<GLDialog :title="isConversionRate ? '兑换价' : '批量改价'" mode="small" :visible.sync="visible" :show-close="true"
:before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" okText="提交"
cancelText="取消">
<GLDialog :title="isConversionRate ? '兑换价' : '批量改价'" mode="small" :visible.sync="visible" :show-close="true" :before-close="handleClose" @onOk="confirmPriceChange" @onCancel="handleClose" okText="提交" cancelText="取消">
<div class="dialog-wrap">
<span>
{{ isConversionRate ? '兑换价 = ' : '兑换价 = 供货价1:1积分 +' }}
</span>
<span>
{{ isConversionRate ? '兑换价 = ' : '兑换价 = 供货价1:1积分 +' }}
</span>
<el-input v-if="isConversionRate" size="small" type="text"
onkeyup="value = value.replace(/[^\d]/g,'').replace(/^[0]+[0-9]*$/gi,'')"
v-model="batchCount" placeholder="请输入积分">
<el-input v-if="isConversionRate" size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^[0]+[0-9]*$/gi,'')" v-model="batchCount" placeholder="请输入积分">
<span slot="append">积分</span>
</el-input>
<el-input v-else size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^0\d/g, '0')"
v-model="batchCount" placeholder="请输入积分">
<el-input v-else size="small" type="text" onkeyup="value = value.replace(/[^\d]/g,'').replace(/^0\d/g, '0')" v-model="batchCount" placeholder="请输入积分">
<span slot="append">积分</span>
</el-input>
<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('.', '$#$')
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
v-model="batchPrice" placeholder="请输入金额">
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" v-model="batchPrice" placeholder="请输入金额" disabled="true">
<span slot="append">元</span>
</el-input>
</div>
......@@ -27,6 +21,7 @@
</template>
<script>
import { limitPrice } from '@/common/constant'
export default {
name: 'setPriceDialog',
props: {
......@@ -51,6 +46,11 @@ export default {
batchPrice: this.isConversionRate ? this.echoParams.salePrice : '',
}
},
watch: {
batchCount(newValue, oldValue) {
this.batchCount = limitPrice(newValue, oldValue, 5, 0, 1, 99999)
}
},
methods: {
confirmPriceChange() {
......@@ -80,7 +80,8 @@ export default {
}
/deep/ .el-input {
&, .el-input__inner {
&,
.el-input__inner {
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: 'browseCount',
formatter: cellValue => {
return cellValue.browseCount + '次'
}
},
{
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>
......@@ -40,7 +40,7 @@
<span>+</span>
<!-- v-focus-->
<el-input size="small" clearable v-model="salePrice" 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" type="text"
.replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value" type="text" disabled
@blur="setPriceFn('salePrice')">
<span slot="append">元</span>
</el-input>
......@@ -61,13 +61,13 @@
<span class="attr-key">{{ goodsInfo.specificationResponses[0].specValue || '--' }}</span>
</li>
</ul>
<div class="operate-btn">
<!-- <div class="operate-btn">
<el-button type="primary" :disabled="goodsInfo.shelvesStatus == 1002" v-if="goodsInfo.goodsPosition==1"
@click="handleSale">上架销售
</el-button>
<el-button type="primary" v-if="goodsInfo.goodsPosition==2" plain @click="handleOff">下架</el-button>
<el-button type="primary" v-if="goodsInfo.goodsPosition==1" plain @click="handleRemove">移出</el-button>
</div>
</div> -->
</div>
</div>
</div>
......@@ -98,6 +98,7 @@
</template>
<script>
import { limitPrice } from '@/common/constant'
const attrList = [
// {
// label:'商品特点',
......@@ -154,6 +155,11 @@ export default {
},
},
},
watch: {
redeemPoints(newValue, oldValue) {
this.redeemPoints = limitPrice(newValue, oldValue, 5, 0, 1, 99999)
}
},
mounted() {
},
......
......@@ -231,7 +231,7 @@ export default {
this.showEmailInfo = returnType == 1001
res.returnType = {1001: '退货退款', 1002: '仅退款', 1003: '退货换货'}[returnType] || '--'
res.returnReasonType = reasonObj[returnReasonType]
refundStatus = returnOrderStatus != 1003 ? refundStatusObj[returnOrderStatus] : outRefundTypeObj[outRefundType]
refundStatus = outRefundType != null ? (returnOrderStatus != 1003 ? refundStatusObj[returnOrderStatus] : outRefundTypeObj[outRefundType]) : refundStatusObj[returnOrderStatus]
res.goodsInfoTableDate = [{
brandName,
goodsSkuName,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!