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 @@ ...@@ -1891,6 +1891,51 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true "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": { "ssri": {
"version": "8.0.1", "version": "8.0.1",
"resolved": "https://registry.npmmirror.com/ssri/-/ssri-8.0.1.tgz", "resolved": "https://registry.npmmirror.com/ssri/-/ssri-8.0.1.tgz",
...@@ -1899,6 +1944,28 @@ ...@@ -1899,6 +1944,28 @@
"requires": { "requires": {
"minipass": "^3.1.1" "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 @@ ...@@ -2612,7 +2679,7 @@
}, },
"axios": { "axios": {
"version": "0.21.4", "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==", "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": { "requires": {
"follow-redirects": "^1.14.0" "follow-redirects": "^1.14.0"
...@@ -3324,7 +3391,7 @@ ...@@ -3324,7 +3391,7 @@
}, },
"charenc": { "charenc": {
"version": "0.0.2", "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==" "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA=="
}, },
"check-types": { "check-types": {
...@@ -4158,7 +4225,7 @@ ...@@ -4158,7 +4225,7 @@
}, },
"crypt": { "crypt": {
"version": "0.0.2", "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==" "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow=="
}, },
"crypto-browserify": { "crypto-browserify": {
...@@ -6439,9 +6506,9 @@ ...@@ -6439,9 +6506,9 @@
} }
}, },
"glsx-common": { "glsx-common": {
"version": "1.4.9", "version": "2.1.0",
"resolved": "https://registry.npmmirror.com/glsx-common/-/glsx-common-1.4.9.tgz", "resolved": "https://registry.npmjs.org/glsx-common/-/glsx-common-2.1.0.tgz",
"integrity": "sha512-RQWGOGEXUPNmHkZn7n+eukkXp6L/mOfsgMo4gFtrt80ZDxGaznHMg7Isi4+IrEdvVdzp8Cju0eiCTddnZfdsJg==", "integrity": "sha512-wlUFgrZkJODh5MNpnVaT2zswkep1BUnvRgyhUABp2mDrt7d8yemnrdDYCfuBSWT7LCn+httSEieOEtm2XSlc0Q==",
"requires": { "requires": {
"axios": "^0.21.3", "axios": "^0.21.3",
"md5": "^2.3.0", "md5": "^2.3.0",
...@@ -6461,6 +6528,19 @@ ...@@ -6461,6 +6528,19 @@
"vue": "^2.6.11", "vue": "^2.6.11",
"vue-amap": "^0.5.10", "vue-amap": "^0.5.10",
"vuedraggable": "^2.24.3" "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": { "gopd": {
...@@ -8112,7 +8192,7 @@ ...@@ -8112,7 +8192,7 @@
}, },
"md5": { "md5": {
"version": "2.3.0", "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==", "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==",
"requires": { "requires": {
"charenc": "0.0.2", "charenc": "0.0.2",
...@@ -10648,9 +10728,9 @@ ...@@ -10648,9 +10728,9 @@
"dev": true "dev": true
}, },
"qs": { "qs": {
"version": "6.11.1", "version": "6.11.2",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.1.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
"integrity": "sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==", "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
"requires": { "requires": {
"side-channel": "^1.0.4" "side-channel": "^1.0.4"
} }
...@@ -11701,7 +11781,7 @@ ...@@ -11701,7 +11781,7 @@
}, },
"sha1": { "sha1": {
"version": "1.1.1", "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==", "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==",
"requires": { "requires": {
"charenc": ">= 0.0.1", "charenc": ">= 0.0.1",
...@@ -13346,75 +13426,6 @@ ...@@ -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": { "vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmmirror.com/vue-router/-/vue-router-3.6.5.tgz",
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^2.1.0",
"glsx-components": "^1.5.7", "glsx-components": "^1.5.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"vue": "^2.6.10", "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> <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> </template>
<script> <script>
export default { export default {
name: 'categoryCascader', name: 'categoryCascader',
props: { props: {
categoryCode:{ categoryCode: {
type: Array type: Array
}, },
key:{ key: {
type: String, type: String,
default: 'categoryCode' default: 'categoryCode'
},
checkStrictly: {
type: Boolean,
default: false
} }
}, },
...@@ -21,7 +26,8 @@ export default { ...@@ -21,7 +26,8 @@ export default {
lazy: true, lazy: true,
label: 'categoryName', label: 'categoryName',
value: 'categoryCode', value: 'categoryCode',
lazyLoad: this.getCategoryList lazyLoad: this.getCategoryList,
checkStrictly: this.checkStrictly
}, },
categoryList: [] categoryList: []
} }
...@@ -31,22 +37,21 @@ export default { ...@@ -31,22 +37,21 @@ export default {
// aa(){ // aa(){
// console.log(this.categoryCode) // console.log(this.categoryCode)
// }, // },
getCategoryList(node, resolve){ getCategoryList(node, resolve) {
const params = { const params = {
categoryCode: node?.value, categoryCode: node?.value,
categoryLevel: node?.level + 1 categoryLevel: node?.level + 1
} }
this.$apis.platformGoods.getCategoryListApi(params).then(res=>{ this.$apis.platformGoods.getCategoryListApi(params).then(res => {
if(res){ if (res) {
res.map(item => item.leaf = params.categoryLevel>2) res.map(item => item.leaf = params.categoryLevel > 2)
if(params.categoryLevel == 1) this.categoryList = res if (params.categoryLevel == 1) this.categoryList = res
resolve(res) resolve(res)
} }
}) })
}, },
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
</style> </style>
\ No newline at end of file \ No newline at end of file
...@@ -3,22 +3,26 @@ ...@@ -3,22 +3,26 @@
<div class="ctnr"> <div class="ctnr">
<div class="stutas-wrap"> <div class="stutas-wrap">
<span>订单状态:</span> <span>订单状态:</span>
<span v-if="!isLoading" class="stutas-circle" :style="{backgroundColor: transfStatus(orderInfo.payStatus,orderInfo.orderStatus).color}"></span> <span v-if="!isLoading" class="stutas-circle"
<span v-if="!isLoading">{{transfStatus(orderInfo.payStatus, orderInfo.orderStatus).name}}</span> :style="{backgroundColor: transfStatus(orderInfo.payStatus,orderInfo.orderStatus).color}"></span>
<span v-if="!isLoading">{{ transfStatus(orderInfo.payStatus, orderInfo.orderStatus).name }}</span>
</div> </div>
<div class="info-wrap order-info"> <div class="info-wrap order-info">
<div class="title">订单信息</div> <div class="title">订单信息</div>
<div class="detail"> <div class="detail">
<glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo" :formData="editFormData"></glsxCombiForm> <glsxCombiForm ref="editFormRef" labelWidth="154px" defaultWidth="214px" :formObj="orderInfo"
:formData="editFormData"></glsxCombiForm>
</div> </div>
</div> </div>
<div class="info-wrap"> <div class="info-wrap">
<div class="title">商品信息</div> <div class="title">商品信息</div>
<div class="detail"> <div class="detail">
<GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams" :tableData="orderInfo.subOrderGoodsList"> <GLTable :hasPage="false" ref="goodsTableRef" :tableParams="tableParams"
:tableData="orderInfo.subOrderGoodsList">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt=""> <img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -28,10 +32,12 @@ ...@@ -28,10 +32,12 @@
<div class="info-wrap"> <div class="info-wrap">
<div class="title">发货信息</div> <div class="title">发货信息</div>
<div class="detail"> <div class="detail">
<GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams" :tableData="orderInfo.subOrderGoodsList"> <GLTable :hasPage="false" ref="shipmentsRef" :tableParams="shipmentsParams"
:tableData="orderInfo.subOrderGoodsList">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt=""> <img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
...@@ -47,6 +53,7 @@ ...@@ -47,6 +53,7 @@
<script> <script>
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
import util from '@/util/util' import util from '@/util/util'
export default { export default {
name: 'goodsOrderDetail', name: 'goodsOrderDetail',
data() { data() {
...@@ -55,7 +62,7 @@ export default { ...@@ -55,7 +62,7 @@ export default {
name: 123 name: 123
}, },
isLoading: false, isLoading: false,
orderInfo:{}, orderInfo: {},
shipmentsParams: { shipmentsParams: {
listName: 'shipments', listName: 'shipments',
tableOption: false, tableOption: false,
...@@ -85,8 +92,14 @@ export default { ...@@ -85,8 +92,14 @@ export default {
{ {
label: '物流状态', label: '物流状态',
prop: 'effectiveDays', prop: 'effectiveDays',
formatter: cell =>{ formatter: cell => {
return {1000:'待揽件',1001:'已揽件',1002:'运输中',1003:'已签收',1004:'拒收'}[this.orderInfo.logisticsStatus] || '--' return {
1000: '待揽件',
1001: '已揽件',
1002: '运输中',
1003: '已签收',
1004: '拒收'
}[this.orderInfo.logisticsStatus] || '--'
} }
} }
] ]
...@@ -102,7 +115,10 @@ export default { ...@@ -102,7 +115,10 @@ export default {
}, },
{ {
label: '单价 (元)', label: '单价 (元)',
prop: 'salePrice' prop: 'salePrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : cell.salePrice
}
}, },
{ {
label: '数量', label: '数量',
...@@ -118,7 +134,7 @@ export default { ...@@ -118,7 +134,7 @@ export default {
label: '实收金额 (元)', label: '实收金额 (元)',
prop: 'orderAmount', prop: 'orderAmount',
formatter: cell => { formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2) return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : (cell.salePrice * cell.sellQty).toFixed(2)
} }
} }
] ]
...@@ -189,8 +205,8 @@ export default { ...@@ -189,8 +205,8 @@ export default {
methods: { methods: {
transfStatus: util.transfStatus, transfStatus: util.transfStatus,
getDetailById(){ getDetailById() {
const { id } = this.$route.params const {id} = this.$route.params
const loading = this.$loading({ const loading = this.$loading({
lock: true, lock: true,
text: 'Loading', text: 'Loading',
...@@ -198,31 +214,31 @@ export default { ...@@ -198,31 +214,31 @@ export default {
background: 'rgba(0, 0, 0, 0.3)' background: 'rgba(0, 0, 0, 0.3)'
}) })
this.isLoading = true this.isLoading = true
this.$apis.platformGoods.getOrderDetail({subOrderCode:id}).then(res =>{ this.$apis.platformGoods.getOrderDetail({subOrderCode: id}).then(res => {
loading.close() loading.close()
this.isLoading = false this.isLoading = false
if(res?.id){ if (res?.id) {
const {receiveName, receiveMobile, provinceName, cityName, townName, address}= res?.receiveAddress || {} const {receiveName, receiveMobile, provinceName, cityName, townName, address} = res?.receiveAddress || {}
res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${townName}${address}` res.addInfo = `${receiveName} ${receiveMobile} ${provinceName}${cityName}${townName}${address}`
res.addInfo = res.addInfo.replaceAll('null','') res.addInfo = res.addInfo.replaceAll('null', '')
res.payPrice = res.payPrice ? res.payPrice + '元' : '--' res.payPrice = res.payPrice ? res.payPrice + '元' : '--'
res.subOrderGoodsList = res?.subOrderGoodsList?.length ? res?.subOrderGoodsList : [] res.subOrderGoodsList = res?.subOrderGoodsList?.length ? res?.subOrderGoodsList : []
// res.logisticsStatus = undefined // res.logisticsStatus = undefined
this.orderInfo = res this.orderInfo = res
} }
}).catch(err=>{ }).catch(err => {
this.isLoading = false this.isLoading = false
loading.close() loading.close()
console.log(err) console.log(err)
}) })
}, },
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.ctnr{ .ctnr {
.stutas-wrap{ .stutas-wrap {
background-color: #fff; background-color: #fff;
height: 72px; height: 72px;
line-height: 72px; line-height: 72px;
...@@ -230,7 +246,8 @@ export default { ...@@ -230,7 +246,8 @@ export default {
font-size: 20px; font-size: 20px;
color: #333333; color: #333333;
padding: 0 20px; padding: 0 20px;
.stutas-circle{
.stutas-circle {
display: inline-block; display: inline-block;
border-radius: 50%; border-radius: 50%;
width: 10px; width: 10px;
...@@ -240,10 +257,12 @@ export default { ...@@ -240,10 +257,12 @@ export default {
vertical-align: middle; vertical-align: middle;
} }
} }
.info-wrap{
.info-wrap {
background-color: #fff; background-color: #fff;
margin-top: 16px; margin-top: 16px;
.title{
.title {
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;
border-bottom: 1px solid #E5E5E5; border-bottom: 1px solid #E5E5E5;
...@@ -252,13 +271,14 @@ export default { ...@@ -252,13 +271,14 @@ export default {
font-size: 20px; font-size: 20px;
color: #333333; color: #333333;
} }
.detail{
.detail {
padding: 20px; padding: 20px;
} }
} }
.order-info{
.order-info {
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 --> <!-- 秒杀活动 -->
<template> <template>
<div class="ctnr"> <div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData"> <GLCombiForm class="search-wrap" rowNumber="1" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset"
:formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm> </GLCombiForm>
<div class="main-wrap"> <div class="main-wrap">
<div class="global-title-wrap"> <div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{item.name}}</span> <span v-for="item in titleList" :key="item.id"
:class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]"
@click="changeTable(item.id)">{{ item.name }}</span>
</div> </div>
<div class="table-wrap"> <div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm"
:tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt=""> <img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }}{{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p> <p class="name">{{ scope.scope.accountName || '--' }}</p>
<p class="phone">{{ scope.scope.customerPhone}}</p> <p class="phone">{{ scope.scope.customerPhone }}</p>
</div> </div>
<div slot="orderStatusSlot" slot-scope="scope"> <div slot="orderStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: transfStatus(scope.scope.payStatus,scope.scope.orderStatus).color}"></span> <span class="circle"
<span>{{ transfStatus(scope.scope.payStatus,scope.scope.orderStatus).name }}</span> :style="{backgroundColor: transfStatus(scope.scope.payStatus,scope.scope.orderStatus).color}"></span>
<span>{{ transfStatus(scope.scope.payStatus, scope.scope.orderStatus).name }}</span>
</div> </div>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p> <p class="name">第三方:{{ scope.scope.thirdSubOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.subOrderCode || '--'}}</p> <p class="name">平台:{{ scope.scope.subOrderCode || '--' }}</p>
</div> </div>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
...@@ -37,8 +43,9 @@ ...@@ -37,8 +43,9 @@
</template> </template>
<script> <script>
import { utils } from 'glsx-common' import {utils} from 'glsx-common'
import util from '@/util/util' import util from '@/util/util'
const titleList = [ const titleList = [
{ {
id: 0, id: 0,
...@@ -64,7 +71,7 @@ const titleList = [ ...@@ -64,7 +71,7 @@ const titleList = [
id: 5, id: 5,
name: '已关闭' name: '已关闭'
}, },
] ]
export default { export default {
name: 'goodsOrderIndex', name: 'goodsOrderIndex',
data() { data() {
...@@ -118,10 +125,25 @@ export default { ...@@ -118,10 +125,25 @@ export default {
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true,
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'beforeRangePickerOptions'
} },
{
label: '订单类型',
name: 'businessType',
type: 'select',
optionList: [{
id: '0',
value: '普通订单'
},
{
id: '1',
value: '积分订单'
}],
optionId: 'id',
optionLabel: 'value'
},
], ],
getListApi: this.$apis.platformGoods.getOrderList, getListApi: this.$apis.platformGoods.getOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: {pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
...@@ -134,7 +156,10 @@ export default { ...@@ -134,7 +156,10 @@ export default {
{ {
label: '单价 (元)', label: '单价 (元)',
width: 100, width: 100,
prop: 'salePrice' prop: 'salePrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : cell.salePrice
}
}, },
{ {
label: '数量', label: '数量',
...@@ -144,7 +169,15 @@ export default { ...@@ -144,7 +169,15 @@ export default {
label: '实收金额 (元)', label: '实收金额 (元)',
width: 130, width: 130,
formatter: cell => { formatter: cell => {
return (cell.salePrice * cell.sellQty).toFixed(2) return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.salePrice + '元' : (cell.salePrice * cell.sellQty).toFixed(2)
}
},
{
label: '订单类型',
width: 130,
prop: 'businessType',
formatter: cell => {
return cell.businessType == 1 ? '积分订单' : '普通订单'
} }
}, },
{ {
...@@ -174,23 +207,22 @@ export default { ...@@ -174,23 +207,22 @@ export default {
} }
}, },
components: { components: {},
},
mounted() { mounted() {
}, },
methods: { methods: {
transfStatus: util.transfStatus, transfStatus: util.transfStatus,
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun() this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
}, },
changeTable(id){ changeTable(id) {
this.orderFormObj.requestType = id this.orderFormObj.requestType = id
this.handleSearch() this.handleSearch()
}, },
handleReset(){ handleReset() {
this.orderFormObj = { this.orderFormObj = {
customerInfo: '', customerInfo: '',
searchOrderCode: '', searchOrderCode: '',
...@@ -200,48 +232,52 @@ export default { ...@@ -200,48 +232,52 @@ export default {
} }
this.handleSearch() this.handleSearch()
}, },
handleSearch(){ handleSearch() {
this.$refs.tableRef.refreshTable() this.$refs.tableRef.refreshTable()
}, },
getParams(){ getParams() {
let params = utils.deepClone(this.orderFormObj) let params = utils.deepClone(this.orderFormObj)
if(params?.time?.length){ if (params?.time?.length) {
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' 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' params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.time delete params.time
return params return params
}, },
beforeSearchFn(){ beforeSearchFn() {
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject) => {
this.searchForm = this.getParams() this.searchForm = this.getParams()
resolve() resolve()
}) })
}, },
goOrderDetaillPage(item){ goOrderDetaillPage(item) {
this.$router.push({ path: `/goodsOrder/detail/${item.subOrderCode}`}) this.$router.push({path: `/goodsOrder/detail/${item.subOrderCode}`})
}
} }
} }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.ctnr{ .ctnr {
.search-wrap{ .search-wrap {
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
} }
.main-wrap{
.main-wrap {
background-color: #fff; background-color: #fff;
margin-top: 16px; margin-top: 16px;
.table-wrap{
.table-wrap {
padding: 20px; padding: 20px;
.userInfoSlot{
.name{ .userInfoSlot {
.name {
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
} }
.phone{
.phone {
font-size: 10px; font-size: 10px;
color: #999999; color: #999999;
} }
...@@ -250,4 +286,3 @@ export default { ...@@ -250,4 +286,3 @@ export default {
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 --> <!-- 秒杀活动 -->
<template> <template>
<div class="ctnr"> <div class="ctnr">
<GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj" :formData="goodsFormData"> <GLCombiForm ref="goodsRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="goodsFormObj"
:formData="goodsFormData">
<div slot="categorySlot"> <div slot="categorySlot">
<categoryCascader :categoryCode.sync="goodsFormObj"></categoryCascader> <categoryCascader :categoryCode.sync="goodsFormObj"></categoryCascader>
</div> </div>
...@@ -13,30 +14,35 @@ ...@@ -13,30 +14,35 @@
</div> </div>
</GLCombiForm> </GLCombiForm>
<div class="operate-wrap"> <div class="operate-wrap">
<span class="table-title">仓库商品列表</span> <span class="table-title">商品列表</span>
<div class="operate-btn"> <div class="operate-btn">
<el-button :size="size" type="primary" plain @click="batchSale({},1)">批量上架</el-button> <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" type="primary" plain @click="batchPriceChange()">批量改价</el-button>
<el-button :size="size" @click="batchRemove({}, 1)">批量移出</el-button> <el-button :size="size" @click="batchRemove({}, 1)">批量移出</el-button>
</div> </div>
</div> </div>
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" @sortChange="sortChange" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <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"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImgUrl" alt=""> <img :src="scope.scope.goodsImgUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div slot="setPriceSlot" slot-scope="scope"> <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('.', '$#$') <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> .replace(/\./g, '').replace('$#$', '.').replace(/^(-)*(\d+)\.(\d\d).*$/, '$1$2.$3') : value"
@blur="setPriceFn($event, scope.scope)" placeholder="请输入"></el-input>
</div> </div>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
</div> </div>
<div slot="shelvesStatusSlot" slot-scope="scope"> <div slot="shelvesStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: scope.scope.shelvesStatus== 1001 ? '#2CCA74' : '#999999'}"></span> <span class="circle"
<span>{{scope.scope.shelvesStatus== 1001 ? '可上架': '已下架'}}</span> :style="{backgroundColor: scope.scope.shelvesStatus== 1001 ? '#2CCA74' : '#999999'}"></span>
<span>{{ scope.scope.shelvesStatus == 1001 ? '可上架' : '已下架' }}</span>
</div> </div>
</GLTable> </GLTable>
<setPriceDialog v-if="isVisible" :visible="isVisible" @handleClose="handleClose" @confirm="confirmPriceChange"> <setPriceDialog v-if="isVisible" :visible="isVisible" @handleClose="handleClose" @confirm="confirmPriceChange">
...@@ -48,7 +54,8 @@ ...@@ -48,7 +54,8 @@
import inputNumRange from '@/components/inputNumRange' import inputNumRange from '@/components/inputNumRange'
import categoryCascader from '@/components/categoryCascader.vue' import categoryCascader from '@/components/categoryCascader.vue'
import setPriceDialog from './setPriceDialog.vue' import setPriceDialog from './setPriceDialog.vue'
import { utils } from 'glsx-common' import {utils} from 'glsx-common'
export default { export default {
name: 'warehouseIndex', name: 'warehouseIndex',
data() { data() {
...@@ -70,7 +77,7 @@ export default { ...@@ -70,7 +77,7 @@ export default {
searchForm: {}, searchForm: {},
goodsFormData: [ goodsFormData: [
{ {
label: '商品信息', label: '商品名称',
name: 'goodsSkuName', name: 'goodsSkuName',
type: 'input', type: 'input',
maxlength: 50, maxlength: 50,
...@@ -87,10 +94,10 @@ export default { ...@@ -87,10 +94,10 @@ export default {
optionList: [{ optionList: [{
id: '', id: '',
label: '全部' label: '全部'
},{ }, {
id: '1001', id: '1001',
label: '可上架' label: '可上架'
},{ }, {
id: '1002', id: '1002',
label: '已下架' label: '已下架'
}], }],
...@@ -108,7 +115,7 @@ export default { ...@@ -108,7 +115,7 @@ export default {
}, },
], ],
getListApi: this.$apis.platformGoods.getListApi, getListApi: this.$apis.platformGoods.getListApi,
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: {pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total'},
tableParams: { tableParams: {
listName: 'list', listName: 'list',
mutiSelectName: 'goodsIndex', mutiSelectName: 'goodsIndex',
...@@ -131,7 +138,7 @@ export default { ...@@ -131,7 +138,7 @@ export default {
} }
}, },
{ {
label: '设置销售价(元)', label: '兑换价',
width: 150, width: 150,
addHtml: 'setPriceSlot' addHtml: 'setPriceSlot'
}, },
...@@ -158,7 +165,7 @@ export default { ...@@ -158,7 +165,7 @@ export default {
buttonList: [ buttonList: [
{ {
type: 'el-button', type: 'el-button',
name: '商品详情', name: '详情',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '商品详情' fn: '商品详情'
...@@ -183,7 +190,7 @@ export default { ...@@ -183,7 +190,7 @@ export default {
}, },
{ {
type: 'el-button', type: 'el-button',
name: '移出仓库', name: '移出',
attrs: { attrs: {
type: 'text', type: 'text',
fn: '移出仓库' fn: '移出仓库'
...@@ -206,26 +213,26 @@ export default { ...@@ -206,26 +213,26 @@ export default {
}, },
methods: { methods: {
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun() this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
}, },
sortChange(e){ sortChange(e) {
const {order, prop} = e const {order, prop} = e
if(prop=='goodsStock'){ if (prop == 'goodsStock') {
this.goodsFormObj.orderByGoodsStock = order=='ascending' ? 1 : order=='descending' ? 2 : '' this.goodsFormObj.orderByGoodsStock = order == 'ascending' ? 1 : order == 'descending' ? 2 : ''
} }
this.handleSearch() this.handleSearch()
}, },
//获取复选table数据 //获取复选table数据
getAllData(){ getAllData() {
return this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || [] return this.$refs?.tableRef?.mutiSelectArr[this.tableParams.mutiSelectName] || []
}, },
// 确认批量改价弹框 // 确认批量改价弹框
confirmPriceChange(e){ confirmPriceChange(e) {
this.batchPrice = e this.batchPrice = e
if(!this.batchPrice && this.batchPrice!==0 && this.batchPrice!=='0') return this.$message({ if (!this.batchPrice && this.batchPrice !== 0 && this.batchPrice !== '0') return this.$message({
message:'请输入金额', message: '请输入金额',
type: 'error', type: 'error',
customClass: 'msgHierarchy' customClass: 'msgHierarchy'
}); });
...@@ -233,30 +240,30 @@ export default { ...@@ -233,30 +240,30 @@ export default {
this.handleClose() this.handleClose()
}, },
// 取消批量改价弹框 // 取消批量改价弹框
handleClose(){ handleClose() {
this.batchPrice = '' this.batchPrice = ''
this.isVisible = false this.isVisible = false
}, },
// 点击批量改价打开弹框 // 点击批量改价打开弹框
batchPriceChange(){ batchPriceChange() {
const list = this.getAllData() const list = this.getAllData()
if(!list?.length) return this.$message.error(`请选择要批量改价的商品`) if (!list?.length) return this.$message.error(`请选择要批量改价的商品`)
this.isVisible = true this.isVisible = true
}, },
setPriceFn(e, item, isAll){ setPriceFn(e, item, isAll) {
let params = {} let params = {}
if(isAll){ if (isAll) {
let list = this.getAllData() let list = this.getAllData()
params = { params = {
modifyPriceRequestList : list.map(item => { modifyPriceRequestList: list.map(item => {
let curPrice = item.sellPrice || 0 let curPrice = item.sellPrice || 0
let addPrice = this.batchPrice || 0 let addPrice = this.batchPrice || 0
let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2)) let priceAmount = Number(((+curPrice) + (+addPrice)).toFixed(2))
return { id: item.id, salePrice: priceAmount} return {id: item.id, salePrice: priceAmount}
}) })
} }
}else{ } else {
if(!(+e.target.value)){ if (!(+e.target.value)) {
this.handleClose() this.handleClose()
this.handleSearch() this.handleSearch()
this.$message.error('请输入大于0的金额') this.$message.error('请输入大于0的金额')
...@@ -269,41 +276,41 @@ export default { ...@@ -269,41 +276,41 @@ export default {
}], }],
} }
} }
this.$apis.platformGoods.modifyPriceApi(params).then(res=>{ this.$apis.platformGoods.modifyPriceApi(params).then(res => {
this.handleSearch() this.handleSearch()
if(res){ if (res) {
this.$message.success('操作成功') this.$message.success('操作成功')
this.handleClose() this.handleClose()
} }
}) })
}, },
// 点击批量上架 // 点击批量上架
batchSale(item, isAll){ batchSale(item, isAll) {
const api = this.$apis.platformGoods.batchSaleApi const api = this.$apis.platformGoods.batchSaleApi
this.batchFn(api, '上架销售', item ,isAll) this.batchFn(api, '上架销售', item, isAll)
}, },
// 点击批量移出 // 点击批量移出
batchRemove(item, isAll){ batchRemove(item, isAll) {
const api = this.$apis.platformGoods.batchRemoveApi const api = this.$apis.platformGoods.batchRemoveApi
this.batchFn(api, '移出仓库', item ,isAll) this.batchFn(api, '移出仓库', item, isAll)
}, },
batchFn(Api, operate, item, isAll){ batchFn(Api, operate, item, isAll) {
let params = { let params = {
ids: [item.id], ids: [item.id],
} }
let tip = `确定把 ${item.goodsSkuName} ${operate}?` let tip = `确定把 ${item.goodsSkuName} ${operate}?`
if(isAll){ if (isAll) {
const list = this.getAllData() const list = this.getAllData()
if(!list?.length) return this.$message.error(`请选择要${operate}的商品`) if (!list?.length) return this.$message.error(`请选择要${operate}的商品`)
params.ids = list.map(item => item.id) params.ids = list.map(item => item.id)
tip = `确定把已选的${list.length}个商品全部${operate}?` tip = `确定把已选的${list.length}个商品全部${operate}?`
} }
this.$confirm(tip, '提示', { this.$confirm(tip, '提示', {
type: 'warning', type: 'warning',
callback: action => { callback: action => {
if(action=='confirm'){ if (action == 'confirm') {
Api(params).then(res=>{ Api(params).then(res => {
if(res){ if (res) {
this.$message.success('操作成功') this.$message.success('操作成功')
this.handleSearch() this.handleSearch()
} }
...@@ -312,7 +319,7 @@ export default { ...@@ -312,7 +319,7 @@ export default {
} }
}) })
}, },
handleReset(){ handleReset() {
this.goodsFormObj = { this.goodsFormObj = {
goodsPosition: 1, goodsPosition: 1,
goodsSkuName: '', goodsSkuName: '',
...@@ -325,28 +332,27 @@ export default { ...@@ -325,28 +332,27 @@ export default {
} }
this.handleSearch() this.handleSearch()
}, },
handleSearch(){ handleSearch() {
this.$refs?.tableRef?.refreshTable() this.$refs?.tableRef?.refreshTable()
}, },
beforeSearchFn(){ beforeSearchFn() {
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject) => {
this.searchForm = utils.deepClone(this.goodsFormObj) this.searchForm = utils.deepClone(this.goodsFormObj)
const { categoryCode } = this.searchForm const {categoryCode} = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : '' this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
resolve() resolve()
}) })
}, },
goDetaillPage(item){ goDetaillPage(item) {
this.$router.push({ path: `/goodsWarehouse/wDetail/${item.id}`}) this.$router.push({path: `/goodsWarehouse/wDetail/${item.id}`})
}
} }
} }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.ctnr{ .ctnr {
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
} }
</style> </style>
\ No newline at end of file \ 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>
...@@ -93,7 +93,10 @@ export default { ...@@ -93,7 +93,10 @@ export default {
}, },
{ {
label: '申请金额 (元)', label: '申请金额 (元)',
prop: 'refundPrice' prop: 'refundPrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.refundPrice + '元' : cell.refundPrice + '元'
}
}, },
{ {
label: '平台订单编号', label: '平台订单编号',
...@@ -248,4 +251,3 @@ export default { ...@@ -248,4 +251,3 @@ export default {
} }
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
<!-- 秒杀活动 --> <!-- 秒杀活动 -->
<template> <template>
<div class="ctnr"> <div class="ctnr">
<GLCombiForm class="search-wrap" rowNumber="2" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset" :formObj="orderFormObj" :formData="orderFormData"> <GLCombiForm class="search-wrap" rowNumber="2" ref="orderRef" @handleOk="handleSearch" @handleRest="handleReset"
:formObj="orderFormObj" :formData="orderFormData">
</GLCombiForm> </GLCombiForm>
<div class="main-wrap"> <div class="main-wrap">
<div class="global-title-wrap"> <div class="global-title-wrap">
<span v-for="item in titleList" :key="item.id" :class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]" @click="changeTable(item.id)">{{item.name}}</span> <span v-for="item in titleList" :key="item.id"
:class="['title', {'curTitleCla': orderFormObj.requestType==item.id}]"
@click="changeTable(item.id)">{{ item.name }}</span>
</div> </div>
<div class="table-wrap"> <div class="table-wrap">
<GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm" :tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn"> <GLTable @setTableFinishFun="setTableFinishFun" ref="tableRef" :pageConf="pageConf" :searchForm="searchForm"
:tableParams="tableParams" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn">
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope"> <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImageUrl" alt=""> <img :src="scope.scope.goodsImageUrl" alt="">
<el-tooltip class="item" effect="dark" :content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top"> <el-tooltip class="item" effect="dark"
:content="(scope.scope.brandName || '') + (scope.scope.goodsSkuName || '')" placement="top">
<span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span> <span class="name">{{ scope.scope.brandName }} {{ scope.scope.goodsSkuName }}</span>
</el-tooltip> </el-tooltip>
</div> </div>
<div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="userInfoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">{{ scope.scope.accountName || '--' }}</p> <p class="name">{{ scope.scope.accountName || '--' }}</p>
<p class="phone">{{ scope.scope.customerPhone}}</p> <p class="phone">{{ scope.scope.customerPhone }}</p>
</div> </div>
<div slot="orderStatusSlot" slot-scope="scope"> <div slot="orderStatusSlot" slot-scope="scope">
<span class="circle" :style="{backgroundColor: (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '#2CCA74': '#5850FF'}"></span> <span class="circle"
<span>{{ (scope.scope.returnOrderStatus == 1003 || scope.scope.returnOrderStatus == 1006) ? '售后完成': '售后中' }}</span> :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>
<div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope"> <div slot="orderNoSlot" class="userInfoSlot" slot-scope="scope">
<p class="name">第三方:{{ scope.scope.returnOrderCode || '--' }}</p> <p class="name">第三方:{{ scope.scope.returnOrderCode || '--' }}</p>
<p class="name">平台:{{ scope.scope.tparReturnOrderCode || '--'}}</p> <p class="name">平台:{{ scope.scope.tparReturnOrderCode || '--' }}</p>
</div> </div>
<div slot="auth-button" slot-scope="scope"> <div slot="auth-button" slot-scope="scope">
<GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope" :buttonNum="3"></GLTableButton>
...@@ -37,8 +45,9 @@ ...@@ -37,8 +45,9 @@
</template> </template>
<script> <script>
import { utils } from 'glsx-common' import {utils} from 'glsx-common'
import util from '@/util/util' import util from '@/util/util'
const titleList = [ const titleList = [
{ {
id: 0, id: 0,
...@@ -52,7 +61,7 @@ const titleList = [ ...@@ -52,7 +61,7 @@ const titleList = [
id: 2, id: 2,
name: '售后完成' name: '售后完成'
} }
] ]
export default { export default {
name: 'goodsOrderIndex', name: 'goodsOrderIndex',
data() { data() {
...@@ -132,10 +141,25 @@ export default { ...@@ -132,10 +141,25 @@ export default {
type: 'datePicker', type: 'datePicker',
isClear: true, isClear: true,
pickerOptions: 'beforeRangePickerOptions' pickerOptions: 'beforeRangePickerOptions'
} },
{
label: '订单类型',
name: 'businessType',
type: 'select',
optionList: [{
id: '0',
value: '普通订单'
},
{
id: '1',
value: '积分订单'
}],
optionId: 'id',
optionLabel: 'value'
},
], ],
getListApi: this.$apis.platformGoods.getSaleOrderList, getListApi: this.$apis.platformGoods.getSaleOrderList,
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }, pageConf: {pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total'},
tableParams: { tableParams: {
listName: 'list', listName: 'list',
tableOption: true, tableOption: true,
...@@ -153,18 +177,29 @@ export default { ...@@ -153,18 +177,29 @@ export default {
{ {
label: '申请金额 (元)', label: '申请金额 (元)',
width: 130, width: 130,
prop: 'refundPrice' prop: 'refundPrice',
formatter: cell => {
return cell.businessType == 1 ? cell.redeemPoints + '积分' + cell.refundPrice + '元' : cell.refundPrice + '元'
}
}, },
{ {
label: '售后类型', label: '售后类型',
width: 130, width: 130,
prop: 'returnType', prop: 'returnType',
formatter: cell => { formatter: cell => {
let obj = {1001: '退货退款', 1002: '仅退款', 1003:'退货换货'} let obj = {1001: '退货退款', 1002: '仅退款', 1003: '退货换货'}
return obj[cell.returnType] || '--' return obj[cell.returnType] || '--'
} }
}, },
{ {
label: '订单类型',
width: 130,
prop: 'businessType',
formatter: cell => {
return cell.businessType == 1 ? '积分订单' : '普通订单'
}
},
{
label: '用户信息', label: '用户信息',
width: 110, width: 110,
addHtml: 'userInfoSlot' addHtml: 'userInfoSlot'
...@@ -191,22 +226,21 @@ export default { ...@@ -191,22 +226,21 @@ export default {
} }
}, },
components: { components: {},
},
mounted() { mounted() {
}, },
methods: { methods: {
setTableFinishFun () { setTableFinishFun() {
//接收到的数据为空 //接收到的数据为空
this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun() this.$refs.tableRef.data.length ? (this.$refs.tableRef.tableHeightValues = '') : this.$refs.tableRef.setTableHeightFun()
}, },
changeTable(id){ changeTable(id) {
this.orderFormObj.requestType = id this.orderFormObj.requestType = id
this.handleSearch() this.handleSearch()
}, },
handleReset(){ handleReset() {
this.orderFormObj = { this.orderFormObj = {
requestType: this.orderFormObj.requestType, requestType: this.orderFormObj.requestType,
customerInfo: '', customerInfo: '',
...@@ -217,48 +251,52 @@ export default { ...@@ -217,48 +251,52 @@ export default {
} }
this.handleSearch() this.handleSearch()
}, },
handleSearch(){ handleSearch() {
this.$refs.tableRef.refreshTable() this.$refs.tableRef.refreshTable()
}, },
getParams(){ getParams() {
let params = utils.deepClone(this.orderFormObj) let params = utils.deepClone(this.orderFormObj)
if(params?.time?.length){ if (params?.time?.length) {
params.createdStartTime = new Date(params.time[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00' 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' params.createdEndTime = new Date(params.time[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
} }
delete params.time delete params.time
return params return params
}, },
beforeSearchFn(){ beforeSearchFn() {
return new Promise((resolve, reject)=>{ return new Promise((resolve, reject) => {
this.searchForm = this.getParams() this.searchForm = this.getParams()
resolve() resolve()
}) })
}, },
goOrderDetaillPage(item){ goOrderDetaillPage(item) {
this.$router.push({ path: `/saleOrder/detail/${item.tparReturnOrderCode}`}) this.$router.push({path: `/saleOrder/detail/${item.tparReturnOrderCode}`})
}, },
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.ctnr{ .ctnr {
.search-wrap{ .search-wrap {
background-color: #fff; background-color: #fff;
padding: 20px; padding: 20px;
} }
.main-wrap{
.main-wrap {
background-color: #fff; background-color: #fff;
margin-top: 16px; margin-top: 16px;
.table-wrap{
.table-wrap {
padding: 20px; padding: 20px;
.userInfoSlot{
.name{ .userInfoSlot {
.name {
font-size: 14px; font-size: 14px;
color: #666666; color: #666666;
} }
.phone{
.phone {
font-size: 10px; font-size: 10px;
color: #999999; color: #999999;
} }
...@@ -267,4 +305,3 @@ export default { ...@@ -267,4 +305,3 @@ export default {
} }
} }
</style> </style>
\ No newline at end of file \ 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!