Commit 95d667eb by 徐忆琳

Merge branch 'v3.15.1_10' into 'v3.15.1'

平台商城3.15.1

See merge request !2
2 parents 382a244b 85b92c27
......@@ -1891,6 +1891,51 @@
"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",
......@@ -1899,6 +1944,28 @@
"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@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"
}
}
}
},
......@@ -2612,7 +2679,7 @@
},
"axios": {
"version": "0.21.4",
"resolved": "https://registry.npmmirror.com/axios/-/axios-0.21.4.tgz",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": {
"follow-redirects": "^1.14.0"
......@@ -3324,7 +3391,7 @@
},
"charenc": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/charenc/-/charenc-0.0.2.tgz",
"resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz",
"integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="
},
"check-types": {
......@@ -4158,7 +4225,7 @@
},
"crypt": {
"version": "0.0.2",
"resolved": "https://registry.npmmirror.com/crypt/-/crypt-0.0.2.tgz",
"resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz",
"integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="
},
"crypto-browserify": {
......@@ -6439,9 +6506,9 @@
}
},
"glsx-common": {
"version": "1.4.9",
"resolved": "https://registry.npmmirror.com/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.1.0.tgz",
"integrity": "sha512-wlUFgrZkJODh5MNpnVaT2zswkep1BUnvRgyhUABp2mDrt7d8yemnrdDYCfuBSWT7LCn+httSEieOEtm2XSlc0Q==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
......@@ -6461,6 +6528,19 @@
"vue": "^2.6.11",
"vue-amap": "^0.5.10",
"vuedraggable": "^2.24.3"
},
"dependencies": {
"glsx-common": {
"version": "1.4.9",
"resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-1.4.9.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==",
"requires": {
"axios": "^0.21.3",
"md5": "^2.3.0",
"qs": "^6.10.1",
"sha1": "^1.1.1"
}
}
}
},
"gopd": {
......@@ -8112,7 +8192,7 @@
},
"md5": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/md5/-/md5-2.3.0.tgz",
"resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz",
"integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
"requires": {
"charenc": "0.0.2",
......@@ -10648,9 +10728,9 @@
"dev": true
},
"qs": {
"version": "6.11.1",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.1.tgz",
"integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==",
"version": "6.11.2",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
"integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
"requires": {
"side-channel": "^1.0.4"
}
......@@ -11701,7 +11781,7 @@
},
"sha1": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/sha1/-/sha1-1.1.1.tgz",
"resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz",
"integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==",
"requires": {
"charenc": ">= 0.0.1",
......@@ -13346,75 +13426,6 @@
}
}
},
"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",
......
......@@ -11,7 +11,7 @@
"core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-common": "^2.1.0",
"glsx-components": "^1.5.7",
"lodash": "^4.17.21",
"vue": "^2.6.10",
......
import {http} from "@/main";
const url = 'rop-scrm-entmicro/router'
// 订阅开通商户分页查询
const subscribeMerchant = params => {
params.method = `entmicro.api.system.subscribe.merchant.page`
return http({
url,
method: 'POST',
data: params,
returnAll: true
})
}
const whiteListPage = params =>{
params.method = `stoassistant.api.withdrawal.of.points.page`
return http({
url:'rop-scrm-stoassistant/router',
method: 'POST',
data: params,
returnAll: true
})
}
// 积分提现门店白名单配置校验
const whiteListCheck = params =>{
params.method = `stoassistant.api.withdrawal.of.points.merchant.check`
return http({
url:'rop-scrm-stoassistant/router',
method: 'POST',
data: params,
returnAll: true
})
}
const whiteListSave = params =>{
params.method = `stoassistant.api.withdrawal.of.points.merchant.list.save`
return http({
url:'rop-scrm-stoassistant/router',
method: 'POST',
data: params,
returnAll: true
})
}
const whiteListDelete = params =>{
params.method = `stoassistant.api.withdrawal.of.points.merchant.list.delete`
return http({
url:'rop-scrm-stoassistant/router',
method: 'POST',
data: params,
returnAll: true
})
}
export default {
subscribeMerchant,
whiteListPage,
whiteListCheck,
whiteListSave,
whiteListDelete
}
<template>
<el-cascader placeholder="全部" clearable :props="categoryProps" v-model="categoryCode[key]" :options="categoryList"></el-cascader>
<el-cascader placeholder="全部" clearable :props="categoryProps" v-model="categoryCode[key]"
:options="categoryList"></el-cascader>
</template>
<script>
export default {
name: 'categoryCascader',
props: {
categoryCode:{
type: Array
},
key:{
type: String,
default: 'categoryCode'
}
name: 'categoryCascader',
props: {
categoryCode: {
type: Array
},
data() {
return {
categoryProps: {
lazy: true,
label: 'categoryName',
value: 'categoryCode',
lazyLoad: this.getCategoryList
},
categoryList: []
}
key: {
type: String,
default: 'categoryCode'
},
methods: {
// aa(){
// console.log(this.categoryCode)
// },
getCategoryList(node, resolve){
const params = {
categoryCode: node?.value,
categoryLevel: node?.level + 1
}
this.$apis.platformGoods.getCategoryListApi(params).then(res=>{
if(res){
res.map(item => item.leaf = params.categoryLevel>2)
if(params.categoryLevel == 1) this.categoryList = res
resolve(res)
}
})
},
checkStrictly: {
type: Boolean,
default: false
}
},
data() {
return {
categoryProps: {
lazy: true,
label: 'categoryName',
value: 'categoryCode',
lazyLoad: this.getCategoryList,
checkStrictly: this.checkStrictly
},
categoryList: []
}
},
methods: {
// aa(){
// console.log(this.categoryCode)
// },
getCategoryList(node, resolve) {
const params = {
categoryCode: node?.value,
categoryLevel: node?.level + 1
}
this.$apis.platformGoods.getCategoryListApi(params).then(res => {
if (res) {
res.map(item => item.leaf = params.categoryLevel > 2)
if (params.categoryLevel == 1) this.categoryList = res
resolve(res)
}
})
},
}
}
</script>
<style lang="scss" scoped>
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<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>
</div>
<div class="info-wrap order-info">
<div class="title">订单信息</div>
<div class="detail">
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo" :formData="editFormData"></glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams" :tableData="orderInfo.subOrderGoodsList">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<div class="info-wrap">
<div class="title">发货信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.subOrderGoodsList">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
<div class="ctnr">
<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>
</div>
<div class="info-wrap order-info">
<div class="title">订单信息</div>
<div class="detail">
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo"
:formData="editFormData"></glsxCombiForm>
</div>
</div>
<div class="info-wrap">
<div class="title">商品信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams"
:tableData="orderInfo.subOrderGoodsList">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<div class="info-wrap">
<div class="title">发货信息</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams"
:tableData="orderInfo.subOrderGoodsList">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
</GLTable>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
export default {
name: 'goodsOrderDetail',
data() {
return {
editForm: {
name: 123
},
isLoading: false,
orderInfo:{},
shipmentsParams: {
listName: 'shipments',
tableOption: false,
tableColumns: [
{
label: '发货商品',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '发货数量',
prop: 'sellQty'
},
{
label: '快递公司',
formatter: cell => {
return this.orderInfo.expressName || '--'
}
},
{
label: '快递单号',
prop: 'effectiveDays',
formatter: cell => {
return this.orderInfo.expressNo || '--'
}
},
{
label: '物流状态',
prop: 'effectiveDays',
formatter: cell =>{
return {1000:'待揽件',1001:'已揽件',1002:'运输中',1003:'已签收',1004:'拒收'}[this.orderInfo.logisticsStatus] || '--'
}
}
]
},
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '单价 (元)',
prop: 'salePrice'
},
{
label: '数量',
prop: 'sellQty'
},
{
label: '小计 (元)',
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
},
{
label: '实收金额 (元)',
prop: 'orderAmount',
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
}
]
},
editFormData: [
name: 'goodsOrderDetail',
data() {
return {
editForm: {
name: 123
},
isLoading: false,
orderInfo: {},
shipmentsParams: {
listName: 'shipments',
tableOption: false,
tableColumns: [
{
label: '第三方订单编号',
name: 'thirdSubOrderCode',
type: 'showTxt'
label: '发货商品',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '平台订单编号',
name: 'subOrderCode',
type: 'showTxt'
label: '发货数量',
prop: 'sellQty'
},
{
label: '下单时间',
name: 'orderCreatedDate',
type: 'showTxt'
label: '快递公司',
formatter: cell => {
return this.orderInfo.expressName || '--'
}
},
{
label: '支付金额',
name: 'payPrice',
type: 'showTxt'
label: '快递单号',
prop: 'effectiveDays',
formatter: cell => {
return this.orderInfo.expressNo || '--'
}
},
{
label: '支付时间',
name: 'payDate',
type: 'showTxt'
},
label: '物流状态',
prop: 'effectiveDays',
formatter: cell => {
return {
1000: '待揽件',
1001: '已揽件',
1002: '运输中',
1003: '已签收',
1004: '拒收'
}[this.orderInfo.logisticsStatus] || '--'
}
}
]
},
tableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
label: '商户订单号',
name: 'outTradeNo',
type: 'showTxt'
label: '商品名称',
prop: 'goodsName',
addHtml: 'goodsNameSlot'
},
{
label: '用户名称',
name: 'accountName',
type: 'showTxt'
label: '单价 (元)',
prop: 'salePrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : cell.salePrice
}
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'showTxt'
label: '数量',
prop: 'sellQty'
},
{
label: '用户备注',
name: 'buyerMsg',
type: 'showTxt'
label: '小计 (元)',
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
},
{
label: '收货人信息',
name: 'addInfo',
type: 'showTxt'
label: '实收金额 (元)',
prop: 'orderAmount',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : (cell.salePrice * cell.sellQty).toFixed(2)
}
}
]
}
},
components: {
glsxCombiForm
},
created() {
this.getDetailById()
},
mounted() {
},
methods: {
transfStatus: util.transfStatus,
getDetailById(){
const { id } = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getOrderDetail({subOrderCode:id}).then(res =>{
loading.close()
this.isLoading = false
if(res?.id){
const {receiveName, receiveMobile, provinceName, cityName, townName, address}= res?.receiveAddress || {}
res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${townName}${address}`
res.addInfo = res.addInfo.replaceAll('null','')
res.payPrice = res.payPrice ? res.payPrice + '元' : '--'
res.subOrderGoodsList = res?.subOrderGoodsList?.length ? res?.subOrderGoodsList : []
// res.logisticsStatus = undefined
this.orderInfo = res
}
}).catch(err=>{
this.isLoading = false
loading.close()
console.log(err)
})
},
editFormData: [
{
label: '第三方订单编号',
name: 'thirdSubOrderCode',
type: 'showTxt'
},
{
label: '平台订单编号',
name: 'subOrderCode',
type: 'showTxt'
},
{
label: '下单时间',
name: 'orderCreatedDate',
type: 'showTxt'
},
{
label: '支付金额',
name: 'payPrice',
type: 'showTxt'
},
{
label: '支付时间',
name: 'payDate',
type: 'showTxt'
},
{
label: '商户订单号',
name: 'outTradeNo',
type: 'showTxt'
},
{
label: '用户名称',
name: 'accountName',
type: 'showTxt'
},
{
label: '用户手机号',
name: 'customerPhone',
type: 'showTxt'
},
{
label: '用户备注',
name: 'buyerMsg',
type: 'showTxt'
},
{
label: '收货人信息',
name: 'addInfo',
type: 'showTxt'
}
]
}
},
components: {
glsxCombiForm
},
created() {
this.getDetailById()
},
mounted() {
},
methods: {
transfStatus: util.transfStatus,
getDetailById() {
const {id} = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.isLoading = true
this.$apis.platformGoods.getOrderDetail({subOrderCode: id}).then(res => {
loading.close()
this.isLoading = false
if (res?.id) {
const {receiveName, receiveMobile, provinceName, cityName, townName, address} = res?.receiveAddress || {}
res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${townName}${address}`
res.addInfo = res.addInfo.replaceAll('null', '')
res.payPrice = res.payPrice ? res.payPrice + '元' : '--'
res.subOrderGoodsList = res?.subOrderGoodsList?.length ? res?.subOrderGoodsList : []
// res.logisticsStatus = undefined
this.orderInfo = res
}
}).catch(err => {
this.isLoading = false
loading.close()
console.log(err)
})
},
}
}
</script>
<style scoped lang="scss">
.ctnr{
.stutas-wrap{
background-color: #fff;
height: 72px;
line-height: 72px;
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 0 20px;
.stutas-circle{
display: inline-block;
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
margin-right: 10px;
vertical-align: middle;
}
.ctnr {
.stutas-wrap {
background-color: #fff;
height: 72px;
line-height: 72px;
font-weight: 500;
font-size: 20px;
color: #333333;
padding: 0 20px;
.stutas-circle {
display: inline-block;
border-radius: 50%;
width: 10px;
height: 10px;
background: #FDB757;
margin-right: 10px;
vertical-align: middle;
}
.info-wrap{
background-color: #fff;
margin-top: 16px;
.title{
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
color: #333333;
}
.detail{
padding: 20px;
}
}
.info-wrap {
background-color: #fff;
margin-top: 16px;
.title {
height: 60px;
line-height: 60px;
border-bottom: 1px solid #E5E5E5;
padding: 0 20px;
font-weight: 500;
font-size: 20px;
color: #333333;
}
.order-info{
.detail {
padding: 20px;
}
}
.order-info {
}
}
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<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>
</div>
<div class="table-wrap">
<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">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
<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>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.subOrderCode || '--'}}</p>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
<div class="ctnr">
<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>
</div>
<div class="table-wrap">
<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">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
<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>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.subOrderCode || '--' }}</p>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import {utils} from 'glsx-common'
import util from '@/util/util'
const titleList = [
{
id: 0,
name: '全部'
},
{
id: 2,
name: '待支付'
},
{
id: 1,
name: '待收货'
},
{
id: 4,
name: '已完成'
},
{
id: 3,
name: '退款/售后'
},
{
id: 5,
name: '已关闭'
},
]
export default {
name: 'goodsOrderIndex',
data() {
return {
size: 'small',
titleList,
buttonList: [
{
id: 0,
name: '全部'
},
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '商品订单详情'
},
listeners: {
click: row => this.goOrderDetaillPage(row.scope)
}
}
],
searchForm: {},
orderFormObj: {
customerInfo: '',
searchOrderCode: '',
goodsInfo: '',
requestType: '0',
time: ''
},
orderFormData: [
{
id: 2,
name: '待支付'
label: '用户信息',
name: 'customerInfo',
placeholder: '请输入姓名或手机号',
type: 'input',
isClear: true
},
{
id: 1,
name: '待收货'
label: '商品信息',
name: 'goodsInfo',
type: 'input',
isClear: true
},
{
id: 4,
name: '已完成'
label: '订单编号',
name: 'searchOrderCode',
type: 'input',
isClear: true
},
{
id: 3,
name: '退款/售后'
label: '下单时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
id: 5,
name: '已关闭'
label: '订单类型',
name: 'businessType',
type: 'select',
optionList: [{
id: '0',
value: '普通订单'
},
{
id: '1',
value: '积分订单'
}],
optionId: 'id',
optionLabel: 'value'
},
]
export default {
name: 'goodsOrderIndex',
data() {
return {
size: 'small',
titleList,
buttonList: [
],
getListApi: this.$apis.platformGoods.getOrderList,
pageConf: {pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '商品订单详情'
},
listeners: {
click: row => this.goOrderDetaillPage(row.scope)
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
label: '单价 (元)',
width: 100,
prop: 'salePrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : cell.salePrice
}
}
],
searchForm: {},
orderFormObj: {
customerInfo: '',
searchOrderCode: '',
goodsInfo: '',
requestType: '0',
time: ''
},
orderFormData: [
{
label: '用户信息',
name: 'customerInfo',
placeholder: '请输入姓名或手机号',
type: 'input',
isClear: true
},
{
label: '商品信息',
name: 'goodsInfo',
type: 'input',
isClear: true
},
{
label: '订单编号',
name: 'searchOrderCode',
type: 'input',
isClear: true
},
{
label: '下单时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '数量',
prop: 'sellQty'
},
{
label: '实收金额 (元)',
width: 130,
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : (cell.salePrice * cell.sellQty).toFixed(2)
}
],
getListApi: this.$apis.platformGoods.getOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
label: '单价 (元)',
width: 100,
prop: 'salePrice'
},
{
label: '数量',
prop: 'sellQty'
},
{
label: '实收金额 (元)',
width: 130,
formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2)
}
},
{
label: '用户信息',
width: 150,
addHtml: 'userInfoSlot'
},
{
label: '订单状态',
width: 110,
addHtml: 'orderStatusSlot'
},
{
label: '订单编号',
width: 300,
addHtml: 'orderNoSlot'
},
{
label: '下单时间',
width: 200,
formatter: cellValue => {
return cellValue.orderCreatedDate ? util.dateFormat(cellValue.orderCreatedDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
}
},
{
label: '订单类型',
width: 130,
prop: 'businessType',
formatter: cell => {
return cell.businessType == 1 ? '积分订单' : '普通订单'
}
},
{
label: '用户信息',
width: 150,
addHtml: 'userInfoSlot'
},
{
label: '订单状态',
width: 110,
addHtml: 'orderStatusSlot'
},
{
label: '订单编号',
width: 300,
addHtml: 'orderNoSlot'
},
{
label: '下单时间',
width: 200,
formatter: cellValue => {
return cellValue.orderCreatedDate ? util.dateFormat(cellValue.orderCreatedDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
}
}
},
components: {},
mounted() {
},
methods: {
transfStatus: util.transfStatus,
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
components: {
changeTable(id) {
this.orderFormObj.requestType = id
this.handleSearch()
},
mounted() {
handleReset() {
this.orderFormObj = {
customerInfo: '',
searchOrderCode: '',
goodsInfo: '',
requestType: this.orderFormObj.requestType,
time: ''
}
this.handleSearch()
},
methods: {
transfStatus: util.transfStatus,
setTableFinishFun () {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
changeTable(id){
this.orderFormObj.requestType = id
this.handleSearch()
},
handleReset(){
this.orderFormObj = {
customerInfo: '',
searchOrderCode: '',
goodsInfo: '',
requestType: this.orderFormObj.requestType,
time: ''
}
this.handleSearch()
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
getParams(){
let params = utils.deepClone(this.orderFormObj)
if(params?.time?.length){
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.time
return params
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = this.getParams()
resolve()
})
},
goOrderDetaillPage(item){
this.$router.push({ path: `/goodsOrder/detail/${item.subOrderCode}`})
}
handleSearch() {
this.$refs.tableRef.refreshTable()
},
getParams() {
let params = utils.deepClone(this.orderFormObj)
if (params?.time?.length) {
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.time
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = this.getParams()
resolve()
})
},
goOrderDetaillPage(item) {
this.$router.push({path: `/goodsOrder/detail/${item.subOrderCode}`})
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
.search-wrap{
background-color: #fff;
padding: 20px;
}
.main-wrap{
background-color: #fff;
margin-top: 16px;
.table-wrap{
padding: 20px;
.userInfoSlot{
.name{
font-size: 14px;
color: #666666;
}
.phone{
font-size: 10px;
color: #999999;
}
}
.ctnr {
.search-wrap {
background-color: #fff;
padding: 20px;
}
.main-wrap {
background-color: #fff;
margin-top: 16px;
.table-wrap {
padding: 20px;
.userInfoSlot {
.name {
font-size: 14px;
color: #666666;
}
.phone {
font-size: 10px;
color: #999999;
}
}
}
}
}
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj" :formData="goodsFormData">
<div slot="categorySlot">
<categoryCascader :categoryCode.sync="goodsFormObj"></categoryCascader>
</div>
<div slot="supplyPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startSellPrice', to:'endSellPrice'}"></inputNumRange>
</div>
<div slot="spreadPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startDiffPrice', to:'endDiffPrice'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">仓库商品列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary" plain @click="batchSale({},1)">批量上架</el-button>
<el-button :size="size" type="primary" plain @click="batchPriceChange()">批量改价</el-button>
<el-button :size="size" @click="batchRemove({}, 1)">批量移出</el-button>
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" @sortChange="sortChange" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">
<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>
<div slot="setPriceSlot" slot-scope="scope">
<el-input type="text" v-model="scope.scope.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" @blur="setPriceFn($event, scope.scope)" placeholder="请输入"></el-input>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
<div slot="shelvesStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: scope.scope.shelvesStatus== 1001 ? '#2CCA74' : '#999999'}"></span>
<span>{{scope.scope.shelvesStatus== 1001 ? '可上架': '已下架'}}</span>
</div>
</GLTable>
<setPriceDialog v-if="isVisible" :visible="isVisible" @handleClose="handleClose" @confirm="confirmPriceChange">
</setPriceDialog>
<div class="ctnr">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj"
:formData="goodsFormData">
<div slot="categorySlot">
<categoryCascader :categoryCode.sync="goodsFormObj"></categoryCascader>
</div>
<div slot="supplyPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startSellPrice', to:'endSellPrice'}"></inputNumRange>
</div>
<div slot="spreadPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startDiffPrice', to:'endDiffPrice'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">商品列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary" plain @click="batchSale({},1)">批量上架</el-button>
<el-button :size="size" type="primary" plain @click="batchPriceChange()">批量改价</el-button>
<el-button :size="size" @click="batchRemove({}, 1)">批量移出</el-button>
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" @sortChange="sortChange" :pageConf="pageConf"
:searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">
<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>
<div slot="setPriceSlot" slot-scope="scope">
<el-input type="text" v-model="scope.scope.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"
@blur="setPriceFn($event, scope.scope)" placeholder="请输入"></el-input>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
<div slot="shelvesStatusSlot" slot-scope="scope">
<span class="circle"
:style="{backgroundColor: scope.scope.shelvesStatus== 1001 ? '#2CCA74' : '#999999'}"></span>
<span>{{ scope.scope.shelvesStatus == 1001 ? '可上架' : '已下架' }}</span>
</div>
</GLTable>
<setPriceDialog v-if="isVisible" :visible="isVisible" @handleClose="handleClose" @confirm="confirmPriceChange">
</setPriceDialog>
</div>
</template>
<script>
import inputNumRange from '@/components/inputNumRange'
import categoryCascader from '@/components/categoryCascader.vue'
import setPriceDialog from './setPriceDialog.vue'
import { utils } from 'glsx-common'
import {utils} from 'glsx-common'
export default {
name: 'warehouseIndex',
data() {
return {
size: 'small',
isVisible: false,
batchPrice: '',
goodsFormObj: {
goodsPosition: 1,
goodsSkuName: '',
categoryCode: [],
shelvesStatus: '',
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: '',
orderByGoodsStock: ''
name: 'warehouseIndex',
data() {
return {
size: 'small',
isVisible: false,
batchPrice: '',
goodsFormObj: {
goodsPosition: 1,
goodsSkuName: '',
categoryCode: [],
shelvesStatus: '',
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: '',
orderByGoodsStock: ''
},
searchForm: {},
goodsFormData: [
{
label: '商品名称',
name: 'goodsSkuName',
type: 'input',
maxlength: 50,
isClear: true
},
searchForm: {},
goodsFormData: [
{
label: '商品信息',
name: 'goodsSkuName',
type: 'input',
maxlength: 50,
isClear: true
},
{
label: '商品类型',
addHtml: 'categorySlot'
},
{
label: '商品状态',
name: 'shelvesStatus',
type: 'select',
optionList: [{
id: '',
label: '全部'
},{
id: '1001',
label: '可上架'
},{
id: '1002',
label: '已下架'
}],
optionId: 'id',
optionLabel: 'label',
},
{
label: '供货价',
addHtml: 'supplyPriceSlot'
},
{
label: '差价',
tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot'
},
],
getListApi: this.$apis.platformGoods.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
listName: 'list',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: {
width: 250
},
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
label: '商品分类',
prop: 'goodsName',
width: 250,
formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
}
},
{
label: '设置销售价(元)',
width: 150,
addHtml: 'setPriceSlot'
},
{
label: '供货价(元)',
prop: 'sellPrice'
},
{
label: '市场价(元)',
prop: 'marketPrice'
},
{
label: '库存',
prop: 'goodsStock',
sortable: 'custom',
},
{
label: '商品状态',
prop: 'shelvesStatus',
addHtml: 'shelvesStatusSlot'
}
]
{
label: '商品类型',
addHtml: 'categorySlot'
},
buttonList: [
{
label: '商品状态',
name: 'shelvesStatus',
type: 'select',
optionList: [{
id: '',
label: '全部'
}, {
id: '1001',
label: '可上架'
}, {
id: '1002',
label: '已下架'
}],
optionId: 'id',
optionLabel: 'label',
},
{
label: '供货价',
addHtml: 'supplyPriceSlot'
},
{
label: '差价',
tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot'
},
],
getListApi: this.$apis.platformGoods.getListApi,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: {
listName: 'list',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: {
width: 250
},
tableColumns: [
{
type: 'el-button',
name: '商品详情',
attrs: {
type: 'text',
fn: '商品详情'
},
listeners: {
click: row => this.goDetaillPage(row.scope)
}
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
type: 'el-button',
name: '上架销售',
attrs: {
type: 'text',
fn: '上架销售',
disabled: row => {
return row.scope.shelvesStatus == 1002
}
},
listeners: {
click: row => this.batchSale(row.scope)
label: '商品分类',
prop: 'goodsName',
width: 250,
formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
}
},
{
type: 'el-button',
name: '移出仓库',
attrs: {
type: 'text',
fn: '移出仓库'
},
listeners: {
click: row => this.batchRemove(row.scope)
label: '兑换价',
width: 150,
addHtml: 'setPriceSlot'
},
{
label: '供货价(元)',
prop: 'sellPrice'
},
{
label: '市场价(元)',
prop: 'marketPrice'
},
{
label: '库存',
prop: 'goodsStock',
sortable: 'custom',
},
{
label: '商品状态',
prop: 'shelvesStatus',
addHtml: 'shelvesStatusSlot'
}
]
},
buttonList: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '商品详情'
},
listeners: {
click: row => this.goDetaillPage(row.scope)
}
},
{
type: 'el-button',
name: '上架销售',
attrs: {
type: 'text',
fn: '上架销售',
disabled: row => {
return row.scope.shelvesStatus == 1002
}
},
listeners: {
click: row => this.batchSale(row.scope)
}
},
{
type: 'el-button',
name: '移出',
attrs: {
type: 'text',
fn: '移出仓库'
},
listeners: {
click: row => this.batchRemove(row.scope)
}
],
}
],
}
},
components: {
inputNumRange,
categoryCascader,
setPriceDialog
},
mounted() {
},
methods: {
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
sortChange(e) {
const {order, prop} = e
if (prop == 'goodsStock') {
this.goodsFormObj.orderByGoodsStock = order == 'ascending' ? 1 : order == 'descending' ? 2 : ''
}
this.handleSearch()
},
components: {
inputNumRange,
categoryCascader,
setPriceDialog
//获取复选table数据
getAllData() {
return this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || []
},
mounted() {
// 确认批量改价弹框
confirmPriceChange(e) {
this.batchPrice = e
if (!this.batchPrice && this.batchPrice !== 0 && this.batchPrice !== '0') return this.$message({
message: '请输入金额',
type: 'error',
customClass: 'msgHierarchy'
});
this.setPriceFn({}, {}, true)
this.handleClose()
},
methods: {
setTableFinishFun () {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
sortChange(e){
const {order, prop} = e
if(prop=='goodsStock'){
this.goodsFormObj.orderByGoodsStock = order=='ascending' ? 1 : order=='descending' ? 2 : ''
}
this.handleSearch()
},
//获取复选table数据
getAllData(){
return this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || []
},
// 确认批量改价弹框
confirmPriceChange(e){
this.batchPrice = e
if(!this.batchPrice && this.batchPrice!==0 && this.batchPrice!=='0') return this.$message({
message:'请输入金额',
type: 'error',
customClass: 'msgHierarchy'
});
this.setPriceFn({}, {}, true)
this.handleClose()
},
// 取消批量改价弹框
handleClose(){
this.batchPrice = ''
this.isVisible = false
},
// 点击批量改价打开弹框
batchPriceChange(){
const list = this.getAllData()
if(!list?.length) return this.$message.error(`请选择要批量改价的商品`)
this.isVisible = true
},
setPriceFn(e, item, isAll){
let params = {}
if(isAll){
let list = this.getAllData()
params = {
modifyPriceRequestList : list.map(item => {
let curPrice = item.sellPrice || 0
let addPrice = this.batchPrice || 0
let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return { id: item.id, salePrice: priceAmount}
})
}
}else{
if(!(+e.target.value)){
this.handleClose()
this.handleSearch()
this.$message.error('请输入大于0的金额')
return
}
params = {
modifyPriceRequestList: [{
id: item.id,
salePrice: e.target.value
}],
}
}
this.$apis.platformGoods.modifyPriceApi(params).then(res=>{
// 取消批量改价弹框
handleClose() {
this.batchPrice = ''
this.isVisible = false
},
// 点击批量改价打开弹框
batchPriceChange() {
const list = this.getAllData()
if (!list?.length) return this.$message.error(`请选择要批量改价的商品`)
this.isVisible = true
},
setPriceFn(e, item, isAll) {
let params = {}
if (isAll) {
let list = this.getAllData()
params = {
modifyPriceRequestList: list.map(item => {
let curPrice = item.sellPrice || 0
let addPrice = this.batchPrice || 0
let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return {id: item.id, salePrice: priceAmount}
})
}
} else {
if (!(+e.target.value)) {
this.handleClose()
this.handleSearch()
this.$message.error('请输入大于0的金额')
return
}
params = {
modifyPriceRequestList: [{
id: item.id,
salePrice: e.target.value
}],
}
}
this.$apis.platformGoods.modifyPriceApi(params).then(res => {
this.handleSearch()
if (res) {
this.$message.success('操作成功')
this.handleClose()
}
})
},
// 点击批量上架
batchSale(item, isAll) {
const api = this.$apis.platformGoods.batchSaleApi
this.batchFn(api, '上架销售', item, isAll)
},
// 点击批量移出
batchRemove(item, isAll) {
const api = this.$apis.platformGoods.batchRemoveApi
this.batchFn(api, '移出仓库', item, isAll)
},
batchFn(Api, operate, item, isAll) {
let params = {
ids: [item.id],
}
let tip = `确定把 ${item.goodsSkuName} ${operate}?`
if (isAll) {
const list = this.getAllData()
if (!list?.length) return this.$message.error(`请选择要${operate}的商品`)
params.ids = list.map(item => item.id)
tip = `确定把已选的${list.length}个商品全部${operate}?`
}
this.$confirm(tip, '提示', {
type: 'warning',
callback: action => {
if (action == 'confirm') {
Api(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.handleSearch()
if(res){
this.$message.success('操作成功')
this.handleClose()
}
})
},
// 点击批量上架
batchSale(item, isAll){
const api = this.$apis.platformGoods.batchSaleApi
this.batchFn(api, '上架销售', item ,isAll)
},
// 点击批量移出
batchRemove(item, isAll){
const api = this.$apis.platformGoods.batchRemoveApi
this.batchFn(api, '移出仓库', item ,isAll)
},
batchFn(Api, operate, item, isAll){
let params = {
ids: [item.id],
}
let tip = `确定把 ${item.goodsSkuName} ${operate}?`
if(isAll){
const list = this.getAllData()
if(!list?.length) return this.$message.error(`请选择要${operate}的商品`)
params.ids = list.map(item => item.id)
tip = `确定把已选的${list.length}个商品全部${operate}?`
}
this.$confirm(tip, '提示', {
type: 'warning',
callback: action => {
if(action=='confirm'){
Api(params).then(res=>{
if(res){
this.$message.success('操作成功')
this.handleSearch()
}
})
}
}
}
})
},
handleReset(){
this.goodsFormObj = {
goodsPosition: 1,
goodsSkuName: '',
categoryCode: [],
shelvesStatus: '',
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: ''
}
this.handleSearch()
},
handleSearch(){
this.$refs?.tableRef?.refreshTable()
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = utils.deepClone(this.goodsFormObj)
const { categoryCode } = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve()
})
},
goDetaillPage(item){
this.$router.push({ path: `/goodsWarehouse/wDetail/${item.id}`})
}
}
})
},
handleReset() {
this.goodsFormObj = {
goodsPosition: 1,
goodsSkuName: '',
categoryCode: [],
shelvesStatus: '',
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs?.tableRef?.refreshTable()
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = utils.deepClone(this.goodsFormObj)
const {categoryCode} = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve()
})
},
goDetaillPage(item) {
this.$router.push({path: `/goodsWarehouse/wDetail/${item.id}`})
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
background-color: #fff;
padding: 20px;
.ctnr {
background-color: #fff;
padding: 20px;
}
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<div class="main">
<h2 class="title">商品详情</h2>
<div class="info">
<div class="pic-wrap">
<!-- <img :src="mainUrlInfo.imgUrl" alt=""> -->
<el-image v-if="goodsInfo.imageResponses && goodsInfo.imageResponses.length" class="mian-pic"
:src="goodsInfo.imageResponses[curImgIdx].imgUrl" :preview-src-list="previewImgList">
</el-image>
<div v-if="goodsInfo.imageResponses && goodsInfo.imageResponses.length" class="other-pic">
<img v-for="(item,index) in goodsInfo.imageResponses" :key="index"
:class="['pic-item',{'curActiveImg' : curImgIdx == index}]" :src="item.imgUrl" alt=""
@click="curImgIdx=index">
</div>
</div>
<div class="info-wrap">
<p class="info-title">{{ goodsInfo.brandName }} {{ goodsInfo.goodsSkuName }} {{ goodsInfo.goodsSkuTitle }}</p>
<p class="classify">
分类:{{ goodsInfo.firstCategoryName }}/{{ goodsInfo.secondCategoryName }}/{{
goodsInfo.lastCategoryName
}}</p>
<div class="sale-price">
<div class="set-price">
<label for="">兑换价</label>
<div v-if="!editing" class="edit">
<span class="price">{{ redeemPoints || '--' }}积分</span>
+
<span class="price">{{ salePrice || '--' }}元</span>
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice">
</div>
<!-- <el-input v-else v-focus 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"-->
<!-- @blur="setPriceFn"></el-input>-->
<template v-else>
<!-- v-focus-->
<el-input size="small" clearable v-model="redeemPoints" 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"
@blur="setPriceFn">
<span slot="append">积分</span>
</el-input>
+
<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"
@blur="setPriceFn">
<span slot="append">元</span>
</el-input>
</template>
</div>
<span class="buy-num">起购数量:{{ goodsInfo.startQty }}件</span>
</div>
<ul class="attr-list">
<li v-for="item in attrList" :key="item.key">
<span class="attr-label">{{ item.label }}</span>
<span class="attr-key"><span
v-if="item.key == 'sellPrice' || item.key == 'marketPrice'">¥</span>{{ goodsInfo[item.key] || '--' }}</span>
</li>
<li v-if=" goodsInfo.specificationResponses && goodsInfo.specificationResponses[0] && goodsInfo.specificationResponses[0].specName">
<span class="attr-label">{{ goodsInfo.specificationResponses[0].specName }}</span>
<span class="attr-key">{{ goodsInfo.specificationResponses[0].specValue || '--' }}</span>
</li>
</ul>
<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 class="detail">
<div class="global-title-wrap">
<span :class="['title', {'curTitleCla': curTitle==1}]" @click="changeCurTitle(1)">图文介绍</span>
<span :class="['title', {'curTitleCla': curTitle==2}]" @click="changeCurTitle(2)">产品参数</span>
</div>
<div class="detail-table">
<div class="rich-text" v-if="curTitle==1" v-html="goodsInfo.goodsDescribe"></div>
<div class="grid" v-if="curTitle==2">
<template v-for="(item,index) in goodsInfo.attributeResponses">
<div class="gird-item" v-if="item.attributeName" :key="index">
<span class="label">{{ item.attributeName }}</span>
<span class="value">{{ item.attributeValueName || '--' }}</span>
</div>
</template>
<div v-if="!(goodsInfo.attributeResponses && goodsInfo.attributeResponses.length)">
暂无产品参数
</div>
</div>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
const attrList = [
// {
// label:'商品特点',
// key: 'goodsCharacteristic'
// },
{
label: '供货价',
key: 'sellPrice'
},
{
label: '市场价',
key: 'marketPrice'
},
{
label: '库存',
key: 'goodsStock'
},
// {
// label:'品牌',
// key: 'gongPrice2'
// },
// {
// label:'颜色',
// key: 'gongPrice1'
// },
]
export default {
name: 'warehouseIndex',
data() {
return {
attrList,
salePrice: '',
redeemPoints: '',
curImgIdx: 0,
curTitle: 1,
goodsInfo: {},
editing: false
}
},
computed: {
previewImgList() {
return this.goodsInfo?.imageResponses.map(item => item.imgUrl) || []
}
},
components: {},
created() {
this.getDetailById()
},
directives: {
// focus指令名称
focus: {
inserted(el) {
el.querySelector('input').focus()
},
},
},
mounted() {
},
methods: {
editPrice() {
this.editing = true
},
getDetailById() {
const {id} = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
console.log({id, businessType: 1})
this.$apis.platformGoods.goodsDetailApi({id, businessType: 1}).then(res => {
this.editing = false
loading.close()
if (res?.id) {
this.goodsInfo = res
this.salePrice = res.salePrice
this.redeemPoints = res.redeemPoints
}
}).catch(err => {
this.editing = false
loading.close()
console.log(err)
})
},
setPriceFn(e) {
if (!this.salePrice || !this.redeemPoints) {
this.salePrice = this.goodsInfo.salePrice
this.redeemPoints = this.goodsInfo.redeemPoints
this.$message.error(!this.salePrice ? '请输入大于0的金额' : '请输入大于0的积分')
return
}
let params = {
businessType:1,
modifyPriceRequestList: [{
id: this.goodsInfo.id,
salePrice: this.salePrice,
redeemPoints: Number(this.redeemPoints),
}],
}
this.$apis.platformGoods.modifyPriceApi(params).then(res => {
if (res) {
this.$message.success('操作成功')
}
this.getDetailById()
})
},
handleSale() {
this.operateFn('batchSaleApi', '上架销售')
},
handleOff() {
this.operateFn('batchOffApi', '下架至仓库')
},
handleRemove() {
this.operateFn('batchRemoveApi', '移出仓库')
},
operateFn(Api, operate) {
let tip = `确定把该商品${operate}吗?`
this.$confirm(tip, '提示', {
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.platformGoods[Api]({ids: [this.goodsInfo.id]}).then(res => {
if (res) {
this.$message.success(`${operate}成功`)
if (Api == 'batchRemoveApi') {
this.$router.push({path: `/goodsWarehouse/warehouse`})
return
}
this.getDetailById()
}
})
}
}
})
},
changeCurTitle(type) {
this.curTitle = type
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
.main {
background-color: #fff;
.title {
height: 56px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #EEEDFF;
line-height: 56px;
padding: 0 20px;
}
.info {
display: flex;
padding: 20px;
.pic-wrap {
width: 362px;
flex-shrink: 0;
.mian-pic {
object-fit: contain;
width: 362px;
height: 362px;
}
.other-pic {
margin-top: 12px;
width: 362px;
padding-bottom: 5px;
overflow-x: auto;
display: flex;
flex-wrap: nowrap;
.pic-item {
width: 66px;
height: 66px;
margin-right: 8px;
&:last-child {
margin-right: 0;
}
}
.curActiveImg {
border: 1px solid #5850FF;
}
}
}
.info-wrap {
padding: 10px 0 10px 20px;
flex: 1;
.info-title {
line-height: 28px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 20px;
color: #333333;
}
.classify {
margin: 8px 0 20px;
height: 20px;
font-size: 14px;
color: #999999;
}
.sale-price {
width: 100%;
height: 64px;
line-height: 64px;
padding: 0 20px;
box-sizing: border-box;
background: #F4F6FC;
display: flex;
justify-content: space-between;
align-items: center;
.set-price {
display: flex;
span {
white-space: nowrap;
margin-right: 8px;
}
/deep/ .el-input {
overflow: hidden;
height: 100%;
margin-top: 17px;
//line-height: 64px;
&, .el-input__inner {
width: 100px;
}
.el-input-group__append {
box-sizing: border-box;
padding: 0 11px;
span {
margin: 0;
}
}
}
.edit {
display: flex;
align-items: center;
img {
width: 20px;
height: 20px;
vertical-align: middle;
margin-left: 16px;
cursor: pointer;
}
.price {
font-weight: 500;
font-size: 28px;
color: #EB4E4E;
}
}
label {
white-space: nowrap;
margin-right: 16px;
width: 56px;
flex-shrink: 0;
}
}
.buy-num {
font-weight: 400;
font-size: 14px;
color: #666666;
}
}
.attr-list {
list-style: none;
line-height: 20px;
font-size: 14px;
color: #666666;
padding: 20px;
li {
margin-bottom: 10px;
&:last-child {
margin: 0;
}
.attr-label {
font-weight: 400;
display: inline-block;
width: 70px;
margin-right: 16px;
}
.attr-key {
color: #333333;
}
}
}
.operate-btn {
margin-left: 20px;
.el-button {
width: 160px;
}
}
}
}
}
.detail {
background-color: #fff;
margin-top: 16px;
border-radius: 4px 0 0 0;
.detail-table {
padding: 20px;
/deep/ .rich-text {
img {
// width: 362px;
// height: 362px;
// object-fit: contain;
}
}
.grid {
display: grid;
grid-template-columns: 500px 500px;
.gird-item {
display: flex;
.label, .value {
display: inline-block;
border: 1px solid #E5E5E5;
height: 36px;
line-height: 36px;
font-size: 14px;
color: #333333;
padding: 0 12px;
margin-right: -1px;
margin-bottom: -1px;
}
.label {
width: 118px;
background: #F4F6FC;
}
.value {
width: 100%;
}
}
}
}
}
}
</style>
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj"
:formData="goodsFormData">
<div slot="categorySlot">
<categoryCascader :checkStrictly="true" :categoryCode.sync="goodsFormObj"></categoryCascader>
</div>
<div slot="supplyPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startSellPrice', to:'endSellPrice'}"></inputNumRange>
</div>
<div slot="spreadPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startDiffPrice', to:'endDiffPrice'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">商品列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary" plain @click="handleShelf({}, true)">批量下架</el-button>
<el-button :size="size" type="primary" plain @click="batchPriceChange">批量改价</el-button>
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" @sortChange="sortChange"
:searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">
<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>
<div class="setPriceSlot" slot="setPriceSlot" slot-scope="scope">
<!-- <el-input ref="priceRef" v-focus v-if="curEditId==scope.scope.id" v-model="scope.scope.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"-->
<!-- clearable @blur="setPriceFn($event, scope.scope)"></el-input>-->
<span class="unedited">
{{ scope.scope.redeemPoints }}积分 + {{ scope.scope.salePrice }}元
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice(scope.scope)">
</span>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<setPriceDialog v-if="isVisible" :isConversionRate="isConversionRate" :visible="isVisible"
@handleClose="handleClose" @confirm="confirmPriceChange">
</setPriceDialog>
</div>
</template>
<script>
import inputNumRange from '@/components/inputNumRange'
import categoryCascader from '@/components/categoryCascader.vue'
import setPriceDialog from './setPriceDialog.vue'
import {utils} from 'glsx-common'
import util from '@/util/util'
export default {
name: 'warehouseIndex',
data() {
return {
size: 'small',
curEditId: '',
isVisible: false,
batchPrice: '',
batchCount: '',
searchForm: {},
editParams: {},
isConversionRate: false,
goodsFormObj: {
goodsPosition: 2,
goodsSkuName: '',
categoryCode: [],
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: '',
orderBySalePrice: '',
orderBySaleAmount: ''
},
goodsFormData: [
{
label: '商品信息',
name: 'goodsSkuName',
type: 'input',
maxlength: 50,
isClear: true
},
{
label: '商品类型',
addHtml: 'categorySlot'
},
// {
// label: '销售状态',
// name: 'saleFlag',
// type: 'select',
// optionList: [{
// id: '',
// label: '全部'
// },{
// id: '1',
// label: '开放销售'
// },{
// id: '2',
// label: '关闭销售'
// }],
// optionId: 'id',
// optionLabel: 'label',
// },
{
label: '供货价',
addHtml: 'supplyPriceSlot'
},
{
label: '差价',
tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot'
},
],
getListApi: this.$apis.platformGoods.getListApi,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: {
listName: 'list',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: true,
tableColumns: [
{
label: '商品名称',
minWidth: 300,
addHtml: 'goodsNameSlot'
},
{
label: '商品分类',
prop: 'goodsName',
width: 250,
formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
}
},
{
label: '设置销售价(元)',
width: 180,
addHtml: 'setPriceSlot',
prop: 'salePrice',
sortable: 'custom',
},
{
label: '供货价(元)',
prop: 'sellPrice',
width: 150
},
{
label: '市场价(元)',
width: 150,
prop: 'marketPrice'
},
{
label: '真实销量',
width: 150,
prop: 'saleAmount',
sortable: 'custom',
},
{
label: '库存',
width: 150,
prop: 'goodsStock'
},
{
label: '上架时间',
width: 200,
formatter: cellValue => {
return cellValue.saleDate ? util.dateFormat(cellValue.saleDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
// {
// label: '销售状态',
// prop: 'shelvesStatus',
// formatter: cellValue => {
// return cellValue.shelvesStatus== 1001 ? '上架': '下架'
// }
// }
]
},
buttonList: [
{
type: 'el-button',
name: '商品详情',
attrs: {
type: 'text',
fn: '商品详情'
},
listeners: {
click: row => this.goDetaillPage(row.scope)
}
},
{
type: 'el-button',
name: '下架至仓库',
attrs: {
type: 'text',
fn: '下架至仓库'
},
listeners: {
click: row => this.handleShelf(row.scope)
}
}
],
}
},
components: {
inputNumRange,
categoryCascader,
setPriceDialog
},
directives: {
// focus指令名称
focus: {
inserted(el) {
el.querySelector('input').focus()
},
},
},
mounted() {
},
methods: {
editPrice(scope) {
this.editParams = {
id: scope.id,
sellPrice: scope.sellPrice
}
this.isConversionRate = true
this.isVisible = true
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
sortChange(e) {
const {order, prop} = e
if (prop == 'saleAmount') {
this.goodsFormObj.orderBySaleAmount = order == 'ascending' ? 1 : order == 'descending' ? 2 : ''
this.goodsFormObj.orderBySalePrice = ''
}
if (prop == 'salePrice') {
this.goodsFormObj.orderBySalePrice = order == 'ascending' ? 1 : order == 'descending' ? 2 : ''
this.goodsFormObj.orderBySaleAmount = ''
}
this.handleSearch()
},
// editPrice(row) {
// this.curEditId = row.id
// // this.$nextTick(()=>{
// // this.$refs.priceRef.focus()
// // })
// },
//获取复选table数据
getAllData() {
return this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || []
},
// 确认批量改价弹框
confirmPriceChange(e) {
this.batchPrice = e.batchPrice
this.batchCount = e.batchCount
if (!this.batchPrice && this.batchPrice !== 0 && this.batchPrice !== '0') return this.$message({
message: '请输入金额',
type: 'error',
customClass: 'msgHierarchy'
});
this.setPriceFn({}, {}, !this.isConversionRate)
this.handleClose()
},
// 取消批量改价弹框
handleClose() {
this.batchPrice = ''
this.isVisible = false
this.curEditId = ''
},
// 点击批量改价打开弹框
batchPriceChange() {
this.isConversionRate = false
const list = this.getAllData()
if (!list?.length) return this.$message.error(`请选择要批量改价的商品`)
this.isVisible = true
},
handleShelf(item, isAll) {
const api = this.$apis.platformGoods.batchOffApi
this.batchFn(api, '下架至仓库', item, isAll)
},
batchFn(Api, operate, item, isAll) {
let params = {
businessType: 1,
ids: [item.id],
}
let tip = `确定把 ${item.goodsSkuName} ${operate}?`
if (isAll) {
const list = this.getAllData()
if (!list?.length) return this.$message.error(`请选择要${operate}的商品`)
params.ids = list.map(item => item.id)
tip = `确定把已选的${list.length}个商品全部${operate}?`
}
this.$confirm(tip, '提示', {
type: 'warning',
callback: action => {
if (action == 'confirm') {
Api(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.handleSearch()
}
})
}
}
})
},
setPriceFn(e, item, isAll) {
let params = {}
if (isAll) {
let list = this.getAllData()
params = {
modifyPriceRequestList: list.map(item => {
let curPrice = Math.ceil(item.sellPrice) || 0
let disposePrice = this.batchPrice || 0
let count = this.batchCount || 0
let disposeCount = Number(((+count) + (+curPrice)).toFixed(2))
// let addPrice = this.batchPrice || 0
// let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return {id: item.id, salePrice: disposePrice, redeemPoints: disposeCount}
})
}
} else {
// if (!(+e.target.value)) {
// this.handleClose()
// this.handleSearch()
// this.$message.error('请输入大于0的金额')
// return
// }
params = {
modifyPriceRequestList: [{
id: this.editParams.id,
redeemPoints: Number(((+Math.ceil(this.editParams.sellPrice)) + (+this.batchCount)).toFixed(2)),
salePrice: this.batchPrice
}],
}
}
this.$apis.platformGoods.modifyPriceApi({...params, businessType: 1}).then(res => {
this.handleSearch()
if (res) {
this.$message.success('操作成功')
this.handleClose()
}
})
},
handleReset() {
this.goodsFormObj = {
goodsPosition: 2,
goodsSkuName: '',
categoryCode: [],
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: '',
orderBySalePrice: this.goodsFormObj.orderBySalePrice,
orderBySaleAmount: this.goodsFormObj.orderBySaleAmount
}
this.handleSearch()
},
handleSearch() {
this.$refs.tableRef.refreshTable()
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = utils.deepClone(this.goodsFormObj)
const {categoryCode} = this.searchForm
this.searchForm.businessType = 1
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve()
})
},
goDetaillPage(item) {
this.$router.push({path: `/pointProducts/detail/${item.id}`})
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
background-color: #fff;
padding: 20px;
.setPriceSlot {
.unedited {
display: flex;
align-items: center;
}
img {
width: 16px;
height: 16px;
vertical-align: middle;
margin-left: 8px;
cursor: pointer;
}
}
}
</style>
<template>
<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>
<el-input size="small" type="number" onkeyup="value=value.replace(/[^\d]/g,'')"
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="请输入金额">
<span slot="append">元</span>
</el-input>
</div>
</GLDialog>
</template>
<script>
export default {
name: 'setPriceDialog',
props: {
isConversionRate: {
type: Boolean,
default: false
},
visible: {
type: Boolean,
default: false
}
},
data() {
return {
batchCount: '',
batchPrice: ''
}
},
methods: {
confirmPriceChange() {
const batchParams ={
batchPrice:this.batchPrice,
batchCount:this.batchCount
}
this.$emit('confirm',batchParams )
},
handleClose() {
this.$emit('handleClose')
}
}
}
</script>
<style lang="scss" scoped>
.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>
<div class="ctnr">
<div class="main">
<h2 class="title">商品详情</h2>
<div class="info">
<div class="pic-wrap">
<!-- <img :src="mainUrlInfo.imgUrl" alt=""> -->
<el-image v-if="goodsInfo.imageResponses && goodsInfo.imageResponses.length" class="mian-pic"
:src="goodsInfo.imageResponses[curImgIdx].imgUrl" :preview-src-list="previewImgList">
</el-image>
<div v-if="goodsInfo.imageResponses && goodsInfo.imageResponses.length" class="other-pic">
<img v-for="(item,index) in goodsInfo.imageResponses" :key="index"
:class="['pic-item',{'curActiveImg' : curImgIdx == index}]" :src="item.imgUrl" alt=""
@click="curImgIdx=index">
</div>
</div>
<div class="info-wrap">
<p class="info-title">{{ goodsInfo.brandName }} {{ goodsInfo.goodsSkuName }} {{ goodsInfo.goodsSkuTitle }}</p>
<p class="classify">
分类:{{ goodsInfo.firstCategoryName }}/{{ goodsInfo.secondCategoryName }}/{{
goodsInfo.lastCategoryName
}}</p>
<div class="sale-price">
<div class="set-price">
<label for="">兑换价</label>
<div v-if="!editing" class="edit">
<span class="price">{{ redeemPoints || '--' }}积分</span>
<span>+</span>
<span class="price">{{ salePrice || '--' }}元</span>
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice">
</div>
<template v-else>
<!-- v-focus-->
<el-input size="small" clearable v-model="redeemPoints" 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"
@blur="setPriceFn('redeemPoints')">
<span slot="append">积分</span>
</el-input>
<div>+</div>
<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"
@blur="setPriceFn('salePrice')">
<span slot="append">元</span>
</el-input>
</template>
</div>
<span class="buy-num">起购数量:{{ goodsInfo.startQty }}件</span>
</div>
<ul class="attr-list">
<li v-for="item in attrList" :key="item.key">
<span class="attr-label">{{ item.label }}</span>
<span class="attr-key"><span
v-if="item.key == 'sellPrice' || item.key == 'marketPrice'">¥</span>{{ goodsInfo[item.key] || '--' }}</span>
</li>
<li v-if=" goodsInfo.specificationResponses && goodsInfo.specificationResponses[0] && goodsInfo.specificationResponses[0].specName">
<span class="attr-label">{{ goodsInfo.specificationResponses[0].specName }}</span>
<span class="attr-key">{{ goodsInfo.specificationResponses[0].specValue || '--' }}</span>
</li>
</ul>
<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 class="detail">
<div class="global-title-wrap">
<span :class="['title', {'curTitleCla': curTitle==1}]" @click="changeCurTitle(1)">图文介绍</span>
<span :class="['title', {'curTitleCla': curTitle==2}]" @click="changeCurTitle(2)">产品参数</span>
</div>
<div class="detail-table">
<div class="rich-text" v-if="curTitle==1" v-html="goodsInfo.goodsDescribe"></div>
<div class="grid" v-if="curTitle==2">
<template v-for="(item,index) in goodsInfo.attributeResponses">
<div class="gird-item" v-if="item.attributeName" :key="index">
<span class="label">{{ item.attributeName }}</span>
<span class="value">{{ item.attributeValueName || '--' }}</span>
</div>
</template>
<div v-if="!(goodsInfo.attributeResponses && goodsInfo.attributeResponses.length)">
暂无产品参数
</div>
</div>
</div>
</div>
<GLFooter>
<el-button style="margin-top: 16px;" @click="$router.back()" size="medium">取消</el-button>
</GLFooter>
</div>
</template>
<script>
const attrList = [
// {
// label:'商品特点',
// key: 'goodsCharacteristic'
// },
{
label: '供货价',
key: 'sellPrice'
},
{
label: '市场价',
key: 'marketPrice'
},
{
label: '库存',
key: 'goodsStock'
},
// {
// label:'品牌',
// key: 'gongPrice2'
// },
// {
// label:'颜色',
// key: 'gongPrice1'
// },
]
export default {
name: 'warehouseIndex',
data() {
return {
attrList,
salePrice: '',
redeemPoints: '',
curImgIdx: 0,
curTitle: 1,
goodsInfo: {},
editing: false
}
},
computed: {
previewImgList() {
return this.goodsInfo?.imageResponses.map(item => item.imgUrl) || []
}
},
components: {},
created() {
this.getDetailById()
},
directives: {
// focus指令名称
focus: {
inserted(el) {
el.querySelector('input').focus()
},
},
},
mounted() {
},
methods: {
editPrice() {
this.editing = true
},
getDetailById() {
const {id} = this.$route.params
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.3)'
})
this.$apis.platformGoods.goodsDetailApi({id, businessType: 1}).then(res => {
this.editing = false
loading.close()
if (res?.id) {
this.goodsInfo = res
this.salePrice = res.salePrice
this.redeemPoints = res.redeemPoints
}
}).catch(err => {
this.editing = false
loading.close()
console.log(err)
})
},
setPriceFn(type,e) {
console.log(type)
if (!this.salePrice || !this.redeemPoints) {
this.salePrice = this.goodsInfo.salePrice
this.redeemPoints = this.goodsInfo.redeemPoints
this.$message.error(!this.salePrice ? '请输入大于0的金额' : '请输入大于0的积分')
return
}
// if (!(+e.target.value)) {
// this.salePrice = this.goodsInfo.salePrice
// this.$message.error('请输入大于0的金额')
// return
// }
// goodsInfo
let params = {
businessType:1,
modifyPriceRequestList: [{
id: this.goodsInfo.id,
salePrice: this.salePrice,
redeemPoints: Number(this.redeemPoints),
}],
}
this.$apis.platformGoods.modifyPriceApi(params).then(res => {
if (res) {
this.$message.success('操作成功')
}
this.getDetailById()
})
},
handleSale() {
this.operateFn('batchSaleApi', '上架销售')
},
handleOff() {
this.operateFn('batchOffApi', '下架至仓库')
},
handleRemove() {
this.operateFn('batchRemoveApi', '移出仓库')
},
operateFn(Api, operate) {
let tip = `确定把该商品${operate}吗?`
this.$confirm(tip, '提示', {
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.platformGoods[Api]({ids: [this.goodsInfo.id],businessType:1}).then(res => {
if (res) {
this.$message.success(`${operate}成功`)
if (Api == 'batchRemoveApi') {
this.$router.push({path: `/pointProducts/warehouse`})
return
}
this.getDetailById()
}
})
}
}
})
},
changeCurTitle(type) {
this.curTitle = type
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
.main {
background-color: #fff;
.title {
height: 56px;
font-size: 16px;
color: #333;
font-weight: 600;
border-bottom: 1px solid #EEEDFF;
line-height: 56px;
padding: 0 20px;
}
.info {
display: flex;
padding: 20px;
.pic-wrap {
width: 362px;
flex-shrink: 0;
.mian-pic {
object-fit: contain;
width: 362px;
height: 362px;
}
.other-pic {
margin-top: 12px;
width: 362px;
padding-bottom: 5px;
overflow-x: auto;
display: flex;
flex-wrap: nowrap;
.pic-item {
width: 66px;
height: 66px;
margin-right: 8px;
&:last-child {
margin-right: 0;
}
}
.curActiveImg {
border: 1px solid #5850FF;
}
}
}
.info-wrap {
padding: 10px 0 10px 20px;
flex: 1;
.info-title {
line-height: 28px;
font-family: PingFangSC-Medium;
font-weight: 600;
font-size: 20px;
color: #333333;
}
.classify {
margin: 8px 0 20px;
height: 20px;
font-size: 14px;
color: #999999;
}
.sale-price {
width: 100%;
height: 64px;
line-height: 64px;
padding: 20px;
box-sizing: border-box;
background: #F4F6FC;
display: flex;
justify-content: space-between;
align-items: center;
label{
//margin-top: -18px;
}
.set-price {
display: flex;
span {
white-space: nowrap;
margin-right: 8px;
}
/deep/ .el-input {
overflow: hidden;
height: 100%;
margin-top: 17px;
//line-height: 64px;
&, .el-input__inner {
width: 100px;
}
.el-input-group__append {
box-sizing: border-box;
padding: 0 11px;
span {
margin: 0;
}
}
}
.edit {
display: flex;
align-items: center;
img {
width: 20px;
height: 20px;
vertical-align: middle;
margin-left: 16px;
cursor: pointer;
}
.price {
font-weight: 500;
font-size: 28px;
color: #EB4E4E;
}
}
label {
white-space: nowrap;
margin-right: 16px;
width: 56px;
flex-shrink: 0;
}
}
.buy-num {
font-weight: 400;
font-size: 14px;
color: #666666;
}
}
.attr-list {
list-style: none;
line-height: 20px;
font-size: 14px;
color: #666666;
padding: 20px;
li {
margin-bottom: 10px;
&:last-child {
margin: 0;
}
.attr-label {
font-weight: 400;
display: inline-block;
width: 70px;
margin-right: 16px;
}
.attr-key {
color: #333333;
}
}
}
.operate-btn {
margin-left: 20px;
.el-button {
width: 160px;
}
}
}
}
}
.detail {
background-color: #fff;
margin-top: 16px;
border-radius: 4px 0 0 0;
.detail-table {
padding: 20px;
/deep/ .rich-text {
img {
// width: 362px;
// height: 362px;
// object-fit: contain;
}
}
.grid {
display: grid;
grid-template-columns: 500px 500px;
.gird-item {
display: flex;
.label, .value {
display: inline-block;
border: 1px solid #E5E5E5;
height: 36px;
line-height: 36px;
font-size: 14px;
color: #333333;
padding: 0 12px;
margin-right: -1px;
margin-bottom: -1px;
}
.label {
width: 118px;
background: #F4F6FC;
}
.value {
width: 100%;
}
}
}
}
}
}
</style>
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj"
:formData="goodsFormData">
<div slot="categorySlot">
<categoryCascader :categoryCode.sync="goodsFormObj"></categoryCascader>
</div>
<div slot="supplyPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startSellPrice', to:'endSellPrice'}"></inputNumRange>
</div>
<div slot="spreadPriceSlot">
<inputNumRange :formData="goodsFormObj" :keyObj="{from: 'startDiffPrice', to:'endDiffPrice'}"></inputNumRange>
</div>
</GLCombiForm>
<div class="operate-wrap">
<span class="table-title">商品列表</span>
<div class="operate-btn">
<el-button :size="size" type="primary" plain @click="batchSale({},1)">批量上架</el-button>
<el-button :size="size" type="primary" plain @click="batchPriceChange()">批量改价</el-button>
<el-button :size="size" @click="batchRemove({}, 1)">批量移出</el-button>
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" @sortChange="sortChange" :pageConf="pageConf"
:searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi"
:beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt="">
<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>
<div slot="setPriceSlot" slot-scope="scope" class="setPriceSlot">
<span class="unedited">
{{ scope.scope.redeemPoints }}积分 + {{ scope.scope.salePrice }}元
<img :src="require('@/assets/images/edit.png')" alt="" @click="editPrice(scope.scope)">
</span>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
<div slot="shelvesStatusSlot" slot-scope="scope">
<span class="circle"
:style="{backgroundColor: scope.scope.shelvesStatus== 1001 ? '#2CCA74' : '#999999'}"></span>
<span>{{ scope.scope.shelvesStatus == 1001 ? '可上架' : '已下架' }}</span>
</div>
</GLTable>
<setPriceDialog v-if="isVisible" :isConversionRate="isConversionRate" :visible="isVisible"
@handleClose="handleClose" @confirm="confirmPriceChange">
</setPriceDialog>
</div>
</template>
<script>
import inputNumRange from '@/components/inputNumRange'
import categoryCascader from '@/components/categoryCascader.vue'
import setPriceDialog from './setPriceDialog.vue'
import {utils} from 'glsx-common'
export default {
name: 'warehouseIndex',
data() {
return {
size: 'small',
isVisible: false,
batchPrice: '',
batchCount: '',
editParams: {},
isConversionRate: false,
goodsFormObj: {
goodsPosition: 1,
goodsSkuName: '',
categoryCode: [],
shelvesStatus: '',
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: '',
orderByGoodsStock: ''
},
searchForm: {},
goodsFormData: [
{
label: '商品信息',
name: 'goodsSkuName',
type: 'input',
maxlength: 50,
isClear: true
},
{
label: '商品类型',
addHtml: 'categorySlot'
},
{
label: '商品状态',
name: 'shelvesStatus',
type: 'select',
optionList: [{
id: '',
label: '全部'
}, {
id: '1001',
label: '可上架'
}, {
id: '1002',
label: '已下架'
}],
optionId: 'id',
optionLabel: 'label',
},
{
label: '供货价',
addHtml: 'supplyPriceSlot'
},
{
label: '差价',
tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot'
},
],
getListApi: this.$apis.platformGoods.getListApi,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: {
listName: 'list',
mutiSelectName: 'goodsIndex',
mutiSelectUniqueKey: 'id',
tableOption: {
width: 250
},
tableColumns: [
{
label: '商品名称',
width: 300,
addHtml: 'goodsNameSlot'
},
{
label: '商品分类',
prop: 'goodsName',
width: 250,
formatter: cellValue => {
return `${cellValue.firstCategoryName}/${cellValue.secondCategoryName}/${cellValue.lastCategoryName}`
}
},
{
label: '兑换价',
width: 150,
addHtml: 'setPriceSlot'
},
{
label: '供货价(元)',
prop: 'sellPrice'
},
{
label: '市场价(元)',
prop: 'marketPrice'
},
{
label: '库存',
prop: 'goodsStock',
sortable: 'custom',
},
{
label: '商品状态',
prop: 'shelvesStatus',
addHtml: 'shelvesStatusSlot'
}
]
},
buttonList: [
{
type: 'el-button',
name: '商品详情',
attrs: {
type: 'text',
fn: '商品详情'
},
listeners: {
click: row => this.goDetaillPage(row.scope)
}
},
{
type: 'el-button',
name: '上架销售',
attrs: {
type: 'text',
fn: '上架销售',
disabled: row => {
return row.scope.shelvesStatus == 1002
}
},
listeners: {
click: row => this.batchSale(row.scope)
}
},
{
type: 'el-button',
name: '移出仓库',
attrs: {
type: 'text',
fn: '移出仓库'
},
listeners: {
click: row => this.batchRemove(row.scope)
}
}
],
}
},
components: {
inputNumRange,
categoryCascader,
setPriceDialog
},
mounted() {
},
methods: {
editPrice(scope) {
this.editParams = {
id: scope.id,
sellPrice: scope.sellPrice
}
this.isConversionRate = true
this.isVisible = true
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
sortChange(e) {
const {order, prop} = e
if (prop == 'goodsStock') {
this.goodsFormObj.orderByGoodsStock = order == 'ascending' ? 1 : order == 'descending' ? 2 : ''
}
this.handleSearch()
},
//获取复选table数据
getAllData() {
return this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || []
},
// 确认批量改价弹框
confirmPriceChange(e) {
this.batchPrice = e.batchPrice
this.batchCount = e.batchCount
if (!this.batchPrice && this.batchPrice !== 0 && this.batchPrice !== '0') return this.$message({
message: '请输入金额',
type: 'error',
customClass: 'msgHierarchy'
});
this.setPriceFn({}, {}, !this.isConversionRate)
this.handleClose()
},
// 取消批量改价弹框
handleClose() {
this.batchPrice = ''
this.isVisible = false
},
// 点击批量改价打开弹框
batchPriceChange() {
this.isConversionRate = false
const list = this.getAllData()
if (!list?.length) return this.$message.error(`请选择要批量改价的商品`)
this.isVisible = true
},
setPriceFn(e, item, isAll) {
let params = {}
if (isAll) {
let list = this.getAllData()
params = {
modifyPriceRequestList: list.map(item => {
let curPrice = Math.ceil(item.sellPrice) || 0
let disposePrice = this.batchPrice || 0
let count = this.batchCount || 0
let disposeCount = Number(((+count) + (+curPrice)).toFixed(2))
// let addPrice = this.batchPrice || 0
// let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return {id: item.id, salePrice: disposePrice, redeemPoints: disposeCount}
})
}
} else {
// if (!(+e.target.value)) {
// this.handleClose()
// this.handleSearch()
// this.$message.error('请输入大于0的金额')
// return
// }
params = {
modifyPriceRequestList: [{
id: this.editParams.id,
redeemPoints: Number(((+Math.ceil(this.editParams.sellPrice)) + (+this.batchCount)).toFixed(2)),
salePrice: this.batchPrice
}],
}
}
this.$apis.platformGoods.modifyPriceApi({...params, businessType: 1}).then(res => {
this.handleSearch()
if (res) {
this.$message.success('操作成功')
this.handleClose()
}
})
},
// 点击批量上架
batchSale(item, isAll) {
const api = this.$apis.platformGoods.batchSaleApi
this.batchFn(api, '上架销售', item, isAll)
},
// 点击批量移出
batchRemove(item, isAll) {
const api = this.$apis.platformGoods.batchRemoveApi
this.batchFn(api, '移出仓库', item, isAll)
},
batchFn(Api, operate, item, isAll) {
let params = {
ids: [item.id],
businessType: 1
}
let tip = `确定把 ${item.goodsSkuName} ${operate}?`
if (isAll) {
const list = this.getAllData()
if (!list?.length) return this.$message.error(`请选择要${operate}的商品`)
params.ids = list.map(item => item.id)
tip = `确定把已选的${list.length}个商品全部${operate}?`
}
this.$confirm(tip, '提示', {
type: 'warning',
callback: action => {
if (action == 'confirm') {
Api(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.handleSearch()
}
})
}
}
})
},
handleReset() {
this.goodsFormObj = {
goodsPosition: 1,
goodsSkuName: '',
categoryCode: [],
shelvesStatus: '',
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs?.tableRef?.refreshTable()
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = utils.deepClone(this.goodsFormObj)
this.searchForm.businessType = 1
const {categoryCode} = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve()
})
},
goDetaillPage(item) {
this.$router.push({path: `/pointProducts/wDetail/${item.id}`})
}
}
}
</script>
<style scoped lang="scss">
.ctnr {
background-color: #fff;
padding: 20px;
.setPriceSlot {
.unedited {
display: flex;
align-items: center;
img {
width: 16px;
height: 16px;
vertical-align: middle;
margin-left: 8px;
cursor: pointer;
}
}
}
}
</style>
......@@ -34,7 +34,7 @@
<div class="title">商品寄回</div>
<div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.expressInfo">
</GLTable>
</div>
</div>
......@@ -43,7 +43,7 @@
</GLFooter>
</div>
</template>
<script>
import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util'
......@@ -93,7 +93,10 @@ export default {
},
{
label: '申请金额 (元)',
prop: 'refundPrice'
prop: 'refundPrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.refundPrice + '元' : cell.refundPrice + '元'
}
},
{
label: '平台订单编号',
......@@ -154,7 +157,7 @@ export default {
]
}
},
components: {
glsxCombiForm
},
......@@ -163,7 +166,7 @@ export default {
},
mounted() {
},
methods: {
getDetailById(){
const { id } = this.$route.params
......@@ -180,7 +183,7 @@ export default {
if(res?.id){
let {applyQty, refundPrice, outRefundType, refundStatus, tparReturnOrderCode, returnType, returnReasonType, returnTime} = res || {}
const {brandName, goodsSkuName, goodsImageUrl} = res.orderGoods || {}
this.showEmailInfo = returnType == 1001
this.showEmailInfo = returnType == 1001
res.returnType = {1001: '退货退款', 1002: '仅退款', 1003:'退货换货'}[returnType] || '--'
res.returnReasonType = reasonObj[returnReasonType]
refundStatus = refundStatus!=1003 ? refundStatusObj[refundStatus] : outRefundTypeObj[outRefundType]
......@@ -199,7 +202,7 @@ export default {
}
}
</script>
<style scoped lang="scss">
.ctnr{
.stutas-wrap{
......@@ -244,8 +247,7 @@ export default {
}
}
.order-info{
}
}
</style>
\ No newline at end of file
<!-- 秒杀活动 -->
<template>
<div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="2" 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>
</div>
<div class="table-wrap">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
<p class="phone">{{ scope.scope.customerPhone}}</p>
</div>
<div slot="orderStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span>
<span>{{ (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '售后完成': '售后中' }}</span>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.returnOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.tparReturnOrderCode || '--'}}</p>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
<div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="2" 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>
</div>
<div class="table-wrap">
<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">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip>
</div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p>
<p class="phone">{{ scope.scope.customerPhone }}</p>
</div>
<div slot="orderStatusSlot" slot-scope="scope">
<span class="circle"
:style="{backgroundColor: (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span>
<span>{{
(scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '售后完成' : '售后中'
}}</span>
</div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.returnOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.tparReturnOrderCode || '--' }}</p>
</div>
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
</div>
</div>
</div>
</template>
<script>
import { utils } from 'glsx-common'
import {utils} from 'glsx-common'
import util from '@/util/util'
const titleList = [
{
id: 0,
name: '全部'
},
{
id: 1,
name: '售后中'
},
{
id: 2,
name: '售后完成'
}
]
export default {
name: 'goodsOrderIndex',
data() {
return {
size: 'small',
titleList,
searchForm: {},
buttonList: [
{
id: 0,
name: '全部'
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '售后订单详情'
},
listeners: {
click: row => this.goOrderDetaillPage(row.scope)
}
}
],
orderFormObj: {
requestType: '0',
customerInfo: '',
goodsInfo: '',
searchOrderCode: '',
returnType: '',
time: ''
},
orderFormData: [
{
label: '用户信息',
name: 'customerInfo',
placeholder: '请输入姓名或手机号',
type: 'input',
isClear: true
},
{
id: 1,
name: '售后中'
label: '商品信息',
name: 'goodsInfo',
type: 'input',
isClear: true
},
{
id: 2,
name: '售后完成'
}
]
export default {
name: 'goodsOrderIndex',
data() {
return {
size: 'small',
titleList,
searchForm: {},
buttonList: [
{
type: 'el-button',
name: '详情',
attrs: {
type: 'text',
fn: '售后订单详情'
},
listeners: {
click: row => this.goOrderDetaillPage(row.scope)
}
}
],
orderFormObj: {
requestType: '0',
customerInfo: '',
goodsInfo: '',
searchOrderCode: '',
returnType: '',
time: ''
label: '售后编号',
name: 'searchOrderCode',
type: 'input',
isClear: true
},
orderFormData: [
{
label: '售后类型',
name: 'returnType',
type: 'select',
optionList: [
{
label: '用户信息',
name: 'customerInfo',
placeholder: '请输入姓名或手机号',
type: 'input',
isClear: true
label: '全部',
value: '1000'
},
{
label: '商品信息',
name: 'goodsInfo',
type: 'input',
isClear: true
label: '退货退款',
value: '1001'
},
{
label: '售后编号',
name: 'searchOrderCode',
type: 'input',
isClear: true
label: '仅退款',
value: '1002'
},
{
label: '售后类型',
name: 'returnType',
type: 'select',
optionList: [
{
label: '全部',
value: '1000'
},
{
label: '退货退款',
value: '1001'
},
{
label: '仅退款',
value: '1002'
},
{
label: '退货换货',
value: '1003'
},
],
optionId: 'value',
optionLabel: 'label',
label: '退货换货',
value: '1003'
},
],
optionId: 'value',
optionLabel: 'label',
},
{
label: '申请时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '订单类型',
name: 'businessType',
type: 'select',
optionList: [{
id: '0',
value: '普通订单'
},
{
label: '申请时间',
name: 'time',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
id: '1',
value: '积分订单'
}],
optionId: 'id',
optionLabel: 'value'
},
],
getListApi: this.$apis.platformGoods.getSaleOrderList,
pageConf: {pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
minWidth: 300,
addHtml: 'goodsNameSlot'
},
{
label: '申请数量',
width: 130,
prop: 'applyQty'
},
{
label: '申请金额 (元)',
width: 130,
prop: 'refundPrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.refundPrice + '元' : cell.refundPrice + '元'
}
],
getListApi: this.$apis.platformGoods.getSaleOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' },
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
minWidth: 300,
addHtml: 'goodsNameSlot'
},
{
label: '申请数量',
width: 130,
prop: 'applyQty'
},
{
label: '申请金额 (元)',
width: 130,
prop: 'refundPrice'
},
{
label: '售后类型',
width: 130,
prop: 'returnType',
formatter: cell => {
let obj = {1001: '退货退款', 1002: '仅退款', 1003:'退货换货'}
return obj[cell.returnType] || '--'
}
},
{
label: '用户信息',
width: 110,
addHtml: 'userInfoSlot'
},
{
label: '售后状态',
width: 110,
addHtml: 'orderStatusSlot'
},
{
label: '售后编号',
width: 300,
addHtml: 'orderNoSlot'
},
{
label: '申请时间',
width: 200,
formatter: cellValue => {
return cellValue.createdDate ? util.dateFormat(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
}
},
{
label: '售后类型',
width: 130,
prop: 'returnType',
formatter: cell => {
let obj = {1001: '退货退款', 1002: '仅退款', 1003: '退货换货'}
return obj[cell.returnType] || '--'
}
},
{
label: '订单类型',
width: 130,
prop: 'businessType',
formatter: cell => {
return cell.businessType == 1 ? '积分订单' : '普通订单'
}
},
{
label: '用户信息',
width: 110,
addHtml: 'userInfoSlot'
},
{
label: '售后状态',
width: 110,
addHtml: 'orderStatusSlot'
},
{
label: '售后编号',
width: 300,
addHtml: 'orderNoSlot'
},
{
label: '申请时间',
width: 200,
formatter: cellValue => {
return cellValue.createdDate ? util.dateFormat(cellValue.createdDate, 'YYYY-MM-DD HH:mm:ss') : '--'
}
}
]
}
}
},
components: {},
mounted() {
},
methods: {
setTableFinishFun() {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
components: {
changeTable(id) {
this.orderFormObj.requestType = id
this.handleSearch()
},
mounted() {
handleReset() {
this.orderFormObj = {
requestType: this.orderFormObj.requestType,
customerInfo: '',
goodsInfo: '',
searchOrderCode: '',
returnType: '',
time: ''
}
this.handleSearch()
},
handleSearch() {
this.$refs.tableRef.refreshTable()
},
getParams() {
let params = utils.deepClone(this.orderFormObj)
if (params?.time?.length) {
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.time
return params
},
beforeSearchFn() {
return new Promise((resolve, reject) => {
this.searchForm = this.getParams()
resolve()
})
},
goOrderDetaillPage(item) {
this.$router.push({path: `/saleOrder/detail/${item.tparReturnOrderCode}`})
},
methods: {
setTableFinishFun () {
//接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
},
changeTable(id){
this.orderFormObj.requestType = id
this.handleSearch()
},
handleReset(){
this.orderFormObj = {
requestType: this.orderFormObj.requestType,
customerInfo: '',
goodsInfo: '',
searchOrderCode: '',
returnType: '',
time: ''
}
this.handleSearch()
},
handleSearch(){
this.$refs.tableRef.refreshTable()
},
getParams(){
let params = utils.deepClone(this.orderFormObj)
if(params?.time?.length){
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.time
return params
},
beforeSearchFn(){
return new Promise((resolve, reject)=>{
this.searchForm = this.getParams()
resolve()
})
},
goOrderDetaillPage(item){
this.$router.push({ path: `/saleOrder/detail/${item.tparReturnOrderCode}`})
},
}
}
}
</script>
<style scoped lang="scss">
.ctnr{
.search-wrap{
background-color: #fff;
padding: 20px;
}
.main-wrap{
background-color: #fff;
margin-top: 16px;
.table-wrap{
padding: 20px;
.userInfoSlot{
.name{
font-size: 14px;
color: #666666;
}
.phone{
font-size: 10px;
color: #999999;
}
}
.ctnr {
.search-wrap {
background-color: #fff;
padding: 20px;
}
.main-wrap {
background-color: #fff;
margin-top: 16px;
.table-wrap {
padding: 20px;
.userInfoSlot {
.name {
font-size: 14px;
color: #666666;
}
.phone {
font-size: 10px;
color: #999999;
}
}
}
}
}
</style>
\ No newline at end of file
<template>
<glsx-dialog bigTitle="选择商户" mode="big" :isVisible.sync="relateStoreVisible" width="70%" btnOkLabel="确定" @confirmDialog="handleRelateStoreConfirm" @closeDialog="handleRelateStoreClose" class="relateStore">
<slot></slot>
<el-row>
<el-col :span="14" style="margin-right:16px;">
<el-table ref="seletingTable" class="table hightline" :data="selectingData" border height="464px" @select="handleChange" @select-all="handleAll">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column type="selection" width="55" align="center" :selectable="selectable"></el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
</el-table>
<el-pagination small background @current-change="handleCurrentChange" :page-sizes="[20, 30, 40, 50, 100]" @size-change="handleSizeChange" :current-page.sync="pageNum" :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total"></el-pagination>
</el-col>
<el-col :span="9" class="select-wrap">
<div class="select-title">
<div>已选({{ selectedData.length }})</div>
<el-link :underline="false" class="select-clear" style="color:#5850FF" @click="batchDelete">清空</el-link>
</div>
<div class="select-list">
<div class="select-item" v-for="(item, index) in selectedData" :key="index">
{{ item.merchantName }}
<i class="el-icon-error" @click="handleDelete(item)"></i>
</div>
</div>
<!-- <el-table :data="selectedData" class="table hightline" height="464px">
<el-table-column fixed="left" width="5">
<template slot-scope="scope">
<span :scope="scope"></span>
</template>
</el-table-column>
<el-table-column prop="merchantName" label="商户名称" align="center"></el-table-column>
<el-table-column align="center" width="120">
<template slot="header">
<el-link :underline="false" icon="el-icon-delete" @click="batchDelete">清空</el-link>
</template>
<template slot-scope="scope">
<el-button style="padding: 0" class="el-icon-delete" @click="handleDelete(scope.row)" type="text"></el-button>
</template>
</el-table-column>
</el-table> -->
</el-col>
</el-row>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'relateStoreDialog',
data() {
return {
merchantIds: [],
selectedData: [],
selectingData: [],
// needTip: ['editProduct'],
// 分页
total: 0,
pageNum: 1,
pageSize: 20
}
},
props: {
relateStoreVisible: {
type: Boolean,
default: false
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
storeApi: {
type: Function,
default: () => {}
},
apiParams: {
type: Object,
default: () => {}
},
storeSelected: {
type: Array,
default: () => []
},
storeSearchForm: {
type: Object,
default: () => {}
}
// 去掉表格中某些字段
// noTableField: {
// type: Array,
// default: () => []
// }
},
components: {
glsxDialog
},
mounted() {
this.selectedData = this.storeSelected
this.selectedData.forEach(item => {
item.merchantNo = item.merchantId ? item.merchantId + '' : item.merchantNo
})
this.getSelectingList()
},
methods: {
batchDelete() {
this.selectedData = []
this.recoverySelection()
},
selectable(row, index) {
var isSelect = row.hasOwnProperty('isOpen') ? !row.isOpen : true
return isSelect
},
recoverySelection() {
var exitIds = this.selectedData.map(item => item.merchantNo + '')
this.selectingData.forEach(item => {
if (exitIds.includes(item.merchantNo + '')) {
this.$refs.seletingTable.toggleRowSelection(item, true)
} else {
this.$refs.seletingTable.toggleRowSelection(item, false)
}
})
},
getSelectingList() {
var params = JSON.parse(JSON.stringify(this.storeSearchForm))
if (this.storeSearchForm.select == 1) {
params.subMerchantName = this.storeSearchForm.selectInput
params.subMerchantId = ''
} else {
params.subMerchantId = this.storeSearchForm.selectInput
params.subMerchantName = ''
}
if (this.apiParams && this.apiParams.serviceType) {
params.serviceType = this.apiParams.serviceType
params.merchantId = params.subMerchantId
params.merchantName = params.subMerchantName
delete params.subMerchantId
delete params.subMerchantName
}
this.storeApi({
...params,
pageNum: this.pageNum,
pageSize: this.pageSize
}).then(res => {
if (res.code == '33') {
this.$message.error('请正确输入商户号')
}
this.selectingData = res.data.data
for (var a = 0; a < this.selectingData.length; a++) {
this.selectingData[a].merchantNo = this.selectingData[a].merchantId + ''
}
this.total = res.data.count
this.$nextTick(() => {
this.recoverySelection()
})
})
},
handleChange(selection, row) {
var addOrDelete = !!selection.find(item => item.merchantNo === row.merchantNo)
addOrDelete ? this.selectedData.push(row) : (this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo))
},
handleAll(selection) {
// this.selectedData=[]
let data = selection.length > 0 ? selection : this.selectingData
data.forEach(item => {
var isExit = this.selectedData.findIndex(subItem => subItem.merchantNo === item.merchantNo && !item.isOpen)
// var isServed = item.hasOwnProperty('beServed') ? item.beServed : false
if (selection.length && isExit === -1) {
this.selectedData.push(item)
} else if (!selection.length && isExit !== -1) {
this.selectedData.splice(isExit, 1)
}
})
},
handleDelete(row) {
this.selectedData = this.selectedData.filter(item => item.merchantNo !== row.merchantNo)
this.recoverySelection()
},
handleCurrentChange(val) {
this.pageNum = val
this.getSelectingList()
},
handleSizeChange(val) {
this.pageSize = val
this.getSelectingList()
},
handleRelateStoreConfirm() {
if (!this.selectedData.length) {
this.$message({
message: '请选择关联门店',
type: 'warning',
showClose: true,
customClass: 'message-Z-zinde'
})
return true
}
this.$emit('handleRelateStoreConfirm', this.selectedData)
},
handleRelateStoreClose() {
this.$emit('handleRelateStoreClose')
}
}
}
</script>
<style lang="scss">
.relateStore .table {
margin: 0 auto 20px !important;
width: 98%;
}
.relateStore .el-input--suffix {
width: 100px;
}
/* .service-store .relateStore .el-table .cell,
.d2-form .relateStore .el-table .cell {
line-height: 26px !important;
} */
.service-store .relateStore .el-table--medium td,
.d2-form .relateStore .el-table--medium td {
padding: 6px 8px !important;
}
.relateStore .red {
color: red;
}
.relateStore .tip-icon {
position: absolute;
display: inline-block;
height: 10px;
width: 10px;
line-height: 10px;
color: #ffffff;
background-color: red;
border: 1px solid red;
border-radius: 50%;
cursor: pointer;
font-size: 6px;
margin-left: 2px;
}
.select-wrap {
border: 1px solid #e5e5e5;
height: 464px;
}
.select-title {
display: flex;
justify-content: space-between;
padding: 0 16px;
border-bottom: 1px solid #e5e5e5;
font-size: 16px;
height: 48px;
line-height: 48px;
color: #333333;
}
.select-clear {
font-size: 14px;
color: #5850ff;
}
.select-list {
padding: 8px;
box-sizing: border-box;
overflow-y: scroll;
height: calc(100% - 48px);
}
.select-item {
height: 32px;
background: #f2f1ff;
padding: 8px;
width: 100%;
box-sizing: border-box;
font-size: 14px;
color: #666666;
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 8px;
}
.el-icon-error {
color: #b2b2b2;
font-size: 12px;
cursor: pointer;
}
</style>
<template>
<div>
<el-button type="primary" :size="'small'" @click="handleOpen">添加白名单
</el-button>
<div class="ctnr">
<GLCombiForm ref="showSearch" :rowNumber="1" :formObj="searchFormWhite" :searchSelectObj="searchSelectObj"
:formData="searchFormData" @handleOk="selConfig" @handleRest="selConfig('reset')"></GLCombiForm>
<div class="operate-wrap">
<span class="table-title">白名单列表</span>
<div class="operate-btn">
</div>
</div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="table" :pageConf="pageConf" :searchForm="searchFormWhite"
:tableParams="tableParams" :getListApi="getListApi">
<div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div>
</GLTable>
<whiteStore v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible"
:storeApi="storeApi" :storeSearchForm="searchForm" :storeSelected="tableData"
@handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<div slot class="header">
<el-form :model="searchForm" ref="relate" :inline="true" label-width="90px" class="configDialog">
<el-form-item>
<el-input placeholder="请输入内容" clear v-model="searchForm.selectInput" class="input-with-select"
size="small">
<el-select v-model="searchForm.select" slot="prepend" placeholder="请选择">
<el-option label="商户名称" value="1"></el-option>
<el-option label="商户号" value="2"></el-option>
</el-select>
</el-input>
</el-form-item>
<el-form-item style="margin-top: -1px;margin-left:-16px;">
<el-button size="small" type="primary" @click="handleSearchStore">查询</el-button>
</el-form-item>
</el-form>
</div>
</whiteStore>
</div>
</div>
</template>
<script>
import whiteStore from "views/whiteList/components/whiteStore";
export default {
name: "index",
components: {
whiteStore
},
data() {
return {
searchForm: {},
searchFormWhite: {},
storeApi: this.$apis.whiteList.subscribeMerchant,
tableData: [],
selectedList: [],
relateStoreVisible: false,
searchSelectObj: {
idOrName: {
attr: 'selectMerchantName',
value: ''
}
},
searchFormData: [
{
type: 'selectInput',
selectName: 'idOrName',
isClear: true,
inputWidth: '325px',
selectWidth: '110px',
selectOption: [
{
label: '商户名称',
name: 'selectMerchantName'
},
{
label: '商户号',
name: 'selectMerchantId'
}
],
handleSelectChange: value => {
this.searchSelectObj.idOrName.value = ''
}
},
],
getListApi: this.$apis.whiteList.whiteListPage,
pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: {
listName: 'data.list',
tableOption: true,
tableColumns: [
{
label: '门店名称',
minWidth: 300,
prop: 'merchantName'
},
{
label: '商户号',
prop: 'merchantId',
width: 250,
},
{
label: '配置时间',
prop: 'configTime',
width: 180
}
]
},
buttonList: [
{
type: 'el-button',
name: '删除',
attrs: {
type: 'text',
fn: '删除'
},
listeners: {
click: row => this.handleDel(row.scope)
}
}
],
}
},
methods: {
handleDel(scope) {
const params = {
ids: [scope.id]
}
this.$confirm(`是否确认删除${scope.merchantName} ?`, '提示', {
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis.whiteList.whiteListDelete(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.selConfig()
}
})
}
}
})
},
selConfig(e) {
if (e == 'reset') {
this.searchSelectObj = {
idOrName: {
attr: 'selectMerchantName',
value: ''
}
}
}
this.searchFormWhite[this.searchSelectObj.idOrName.attr] = this.searchSelectObj.idOrName.value
this.$refs.table.refreshTable()
},
handleOpen() {
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(selectedData) {
this.merchantList = []
selectedData.forEach(item => {
this.merchantList.push({
merchantId: item.merchantId,
merchantName: item.merchantName,
})
})
this.tableData = selectedData
const params = {
merchantList: [...this.merchantList]
}
this.$apis.whiteList.whiteListSave(params).then(res => {
if (res) {
this.$message.success('操作成功')
this.selConfig()
}
})
this.handleRelateStoreClose()
},
//搜索门店table
handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1)
},
handleRelateStoreClose() {
this.relateStoreVisible = false
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.table.data.length ? (this.$refs.table.tableHeightValues = '') : this.$refs.table.setTableHeightFun()
},
}
}
</script>
<style scoped lang="scss">
.ctnr {
margin-top: 16px;
background-color: #fff;
padding: 20px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!