Commit ca39bf88 by 李伟康

提交

1 parent 896d6276
......@@ -1966,7 +1966,7 @@
}
},
"vue-loader-v16": {
"version": "npm:vue-loader@16.8.3",
"version": "npm:vue-loader-v16@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
......@@ -8787,6 +8787,11 @@
"integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
"dev": true
},
"number-precision": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/number-precision/-/number-precision-1.6.0.tgz",
"integrity": "sha512-05OLPgbgmnixJw+VvEh18yNPUo3iyp4BEWJcrLu4X9W05KmMifN7Mu5exYvQXqxxeNWhvIF+j3Rij+HmddM/hQ=="
},
"oauth-sign": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
......
......@@ -15,6 +15,7 @@
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.5.4",
"number-precision": "^1.6.0",
"vue": "^2.6.10",
"vue-router": "^3.1.3",
"vuex": "^3.1.2",
......
......@@ -129,7 +129,7 @@ const exportBrowseApi = (params, TYPE = 1) => {
data: params,
sign: true
})
}
}
const exportGoodsApi = params => {
params.method = 'scrm.api.shopmall.goods.configuration.export'
......@@ -151,6 +151,17 @@ const getSelfGoodsDetailApi = params => {
})
}
/**
* 获取油劵列表
*/
const getOilCouponListApi = params => {
params.method = 'scrm.api.shopmall.goods.oil.coupon.list'
params.status = 1
return http({
url,
data: params
})
}
export default {
getGoodsListApi,
updateGoodsStatusApi,
......@@ -165,5 +176,6 @@ export default {
getSharedListApi,
exportBrowseApi,
exportGoodsApi,
getSelfGoodsDetailApi
getSelfGoodsDetailApi,
getOilCouponListApi
}
\ No newline at end of file
<template>
<div class="select-store">
<GLDialog bigTitle="选择商品"
<GLDialog
bigTitle="选择商品"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose">
<glsx-combi-form ref="showSearch"
@onCancel="handleClose"
>
<glsx-combi-form
ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData">
:formData="searchFormData"
>
<span slot="footer">
<el-button :size="size"
<el-button
:size="size"
type="primary"
@click="resetTable">查询</el-button>
<el-button :size="size" v-if="goodsInfo.goodsSource==2"
@click="resetSearch">重置</el-button>
@click="resetTable"
>查询</el-button>
<el-button
:size="size"
v-if="goodsInfo.goodsSource==2"
@click="resetSearch"
>重置</el-button>
</span>
</glsx-combi-form>
<GLTable ref="goodsRef"
<GLTable
ref="goodsRef"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
......@@ -29,29 +39,81 @@
:getListApi="getListApi"
:pageSizes="pageSizes"
:hasNum="false"
:setTableFinishFun="setTableFinishFun">
<div slot="radioHtml"
:setTableFinishFun="setTableFinishFun"
>
<div
slot="radioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="curInfo.id"
slot-scope="scope"
>
<el-radio
v-model="curInfo.id"
:label="scope.scope.id"
@click.native="handleClick(scope.scope)"></el-radio>
@click.native="handleClick(scope.scope)"
></el-radio>
</div>
<div slot="selfRadioHtml"
<div
slot="selfRadioHtml"
class="store-table"
slot-scope="scope">
<el-radio v-model="curInfo.goodsId"
slot-scope="scope"
>
<el-radio
v-model="curInfo.goodsId"
:label="scope.scope.goodsId"
@click.native="handleClick(scope.scope)"></el-radio>
@click.native="handleClick(scope.scope)"
></el-radio>
</div>
<div slot="imageSlot" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImage" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
<div
slot="imageSlot"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.goodsImage"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.goodsImage"
/>
</el-popover>
</div>
<div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImage" alt="">{{ scope.scope.goodsName }}
<template
slot="gasImageSlot"
slot-scope="scope"
>
<el-popover
placement="top"
width="160"
trigger="hover"
popper-class="table-popover-block"
>
<img
class="table-popover-img"
:src="scope.scope.aliasUrl"
/>
<img
class="img-36 pointer"
slot="reference"
:src="scope.scope.aliasUrl"
/>
</el-popover>
</template>
<div
slot="goodsNameSlot"
class="goodsNameSlot"
slot-scope="scope"
>
<img
:src="scope.scope.goodsImage"
alt=""
>{{ scope.scope.goodsName }}
</div>
</GLTable>
</GLDialog>
......@@ -67,7 +129,7 @@ const MERCHANT_SEARCH_ITEM = {
width: '200px',
labelWidth: '10px',
isClear: true
}
}
const defaultTableCol = [
{
label: '',
......@@ -86,10 +148,10 @@ const defaultTableCol = [
{
label: '价格(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice / 100).toFixed(2)) : '--'
}
}
]
]
const merchantGoodsTableCol = [
{
......@@ -109,19 +171,57 @@ const merchantGoodsTableCol = [
{
label: '零售价(元)',
formatter: cellValue => {
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice/100).toFixed(2)) : '--'
return cellValue.retailPrice ? Number(Number(cellValue.retailPrice / 100).toFixed(2)) : '--'
}
},
{
label: '划线价(元)',
formatter: cellValue => {
return cellValue.originalPrice ? Number(Number(cellValue.originalPrice/100).toFixed(2)) : '--'
return cellValue.originalPrice ? Number(Number(cellValue.originalPrice / 100).toFixed(2)) : '--'
}
}
]
]
const gasGoodsTableCol = [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品编码',
prop: 'alias'
},
{
label: '商品图片',
addHtml: 'gasImageSlot'
},
{
label: '商品信息',
prop: 'aliasName'
},
{
label: '销售价/元',
formatter: cellValue => {
return cellValue.salesPrice ? Number(Number(cellValue.salesPrice / 100).toFixed(2)) : '--'
}
},
{
label: '面额/元',
prop: 'faceValue'
},
{
label: '成本/元',
prop: 'sellPrice'
},
{
label: '库存',
prop: 'stock'
},
]
export default {
name: 'selectStore',
data() {
data () {
return {
url: url,
searchForm: {
......@@ -149,17 +249,16 @@ export default {
pageSize: 10,
pageNum: 1
},
getListApi: this.$apis.goods.getCarlifeGoodsApi,
getListApi: null,
tableParams: {
listName: 'list',
tableColumns:defaultTableCol
tableColumns: {}
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [5, 10, 20, 30, 40],
baseData: {}
}
},
props: {
dialogVisible: {
type: Boolean,
......@@ -167,17 +266,17 @@ export default {
},
routeInfo: {
type: Object,
default: ()=> {}
default: () => { }
},
storeSearchForm: {
type: Object
},
goodsInfo: {
required: true,
default: ()=> {}
default: () => { }
}
},
created() {
created () {
// let { smartcarlifeInfoId, goodsName, coverList, goodsImage, minSellPrice, retailPrice } = this.goodsInfo || {}
// this.curInfo = {
// id: smartcarlifeInfoId,
......@@ -186,25 +285,34 @@ export default {
// minSellPrice: minSellPrice ? Number(Number(minSellPrice*10*10).toFixed(0)) : 0,
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// }
const { goodsSource } = this.goodsInfo
this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' //1查看,2编辑,空是新增,编辑进来要传id
this.searchForm.goodsType = this.routeInfo.goodsType // 1是配置 2是车主
if(this.goodsInfo.goodsSource==2){ //来源是门店自营的搜素和列表字段都要改
if (goodsSource == 2) { //来源是门店自营的搜素和列表字段都要改
this.searchFormData.push(MERCHANT_SEARCH_ITEM)
this.tableParams.tableColumns = merchantGoodsTableCol
this.getListApi = this.$apis.goods.getSelfSupportGoodsApi
}
this.tableParams.tableColumns = {
1: defaultTableCol,
2: merchantGoodsTableCol,
3: gasGoodsTableCol
}[goodsSource]
this.getListApi = this.$apis.goods[{
1: 'getCarlifeGoodsApi',
2: 'getSelfSupportGoodsApi',
3: 'getOilCouponListApi'
}[goodsSource]]
},
mounted() {
mounted () {
let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425
},
methods: {
resetTable() {
resetTable () {
this.$refs.goodsRef.refreshTable()
},
resetSearch(){
resetSearch () {
this.searchForm = {
goodsName: '',
discoverGoodsId: '',
......@@ -212,44 +320,44 @@ export default {
}
this.resetTable()
},
beforeSearchFn() {
beforeSearchFn () {
return new Promise(resolve => {
if(this.goodsInfo.goodsSource==2){
if (this.goodsInfo.goodsSource == 2) {
delete this.searchForm.goodsType
}
resolve()
})
},
setTableFinishFun() {
setTableFinishFun () {
this.$refs.goodsRef.tableHeightValues = '460px'
},
handleClick(item) {
handleClick (item) {
console.log(item)
this.curInfo = item
},
handleClose() {
handleClose () {
this.$emit('handleGoodsClose')
},
handleConfirm() {
this.$emit('handleGoodsConfirm', this.curInfo)
handleConfirm () {
if (Object.keys(this.curInfo).length) this.$emit('handleGoodsConfirm', this.curInfo)
}
}
}
</script>
<style lang="scss" scoped>
/deep/.glsx-combi-form .el-form{
.el-form-item{
margin-right: 12px!important;
/deep/.glsx-combi-form .el-form {
.el-form-item {
margin-right: 12px !important;
}
.el-button {
margin-top: 1px;
}
}
.goodsNameSlot{
img{
.goodsNameSlot {
img {
width: 36px;
height: 36px;
vertical-align: middle;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!