Commit fe53cb09 by 前端

Merge branch 'v3.24.0' into 'master'

上线合并

See merge request !31
2 parents 924c14bd 6c507011
......@@ -1901,51 +1901,6 @@
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
"dev": true
},
"ansi-styles": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
"dev": true,
"optional": true,
"requires": {
"color-convert": "^2.0.1"
}
},
"chalk": {
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"optional": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
"dev": true,
"optional": true,
"requires": {
"color-name": "~1.1.4"
}
},
"color-name": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
"dev": true,
"optional": true
},
"has-flag": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
"dev": true,
"optional": true
},
"ssri": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
......@@ -1954,28 +1909,6 @@
"requires": {
"minipass": "^3.1.1"
}
},
"supports-color": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
"dev": true,
"optional": true,
"requires": {
"has-flag": "^4.0.0"
}
},
"vue-loader-v16": {
"version": "npm:vue-loader-v16@16.8.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-16.8.3.tgz",
"integrity": "sha512-7vKN45IxsKxe5GcVCbc2qFU5aWzyiLrYJyUuMz4BQLKctCj/fmCa0w6fGiiQ2cLFetNcek1ppGJQDCup0c1hpA==",
"dev": true,
"optional": true,
"requires": {
"chalk": "^4.1.0",
"hash-sum": "^2.0.0",
"loader-utils": "^2.0.0"
}
}
}
},
......@@ -13294,6 +13227,75 @@
}
}
},
"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"
},
"dependencies": {
"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
},
"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-router": {
"version": "3.6.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz",
......
......@@ -43,5 +43,8 @@ export default {
// overflow-y: auto;
height: 100%;
}
.message-Z-zinde,.el-message--error{
z-index: 9999999999 !important;
}
</style>
>
......@@ -173,6 +173,18 @@ const getAllMerchantListApi = params => {
sign: true
})
}
/**
* 获取云中鹤商品列表
*/
const getYzgGoodsListApi = params => {
params.method = 'scrm.api.shopmall.platform.goods.stockroom.page'
return http({
url,
method: 'POST',
data: params,
sign: true
})
}
export default {
getGoodsListApi,
updateGoodsStatusApi,
......@@ -189,5 +201,6 @@ export default {
exportGoodsApi,
getSelfGoodsDetailApi,
getOilCouponListApi,
getAllMerchantListApi
getAllMerchantListApi,
getYzgGoodsListApi
}
\ No newline at end of file
import { http } from '@/main'
const defaultPath = 'scrm.api.shopmall.platform.'
const url = 'rop-scrm-shopmall/router'
// 获取平台商品分类
const getCategoryListApi = params => {
params.method = `${defaultPath}goods.category.list`
return http({
url,
data: params,
sign: true
})
}
export default {
getCategoryListApi
}
<template>
<el-cascader popper-class="my_cascader" placeholder="全部" clearable :props="categoryProps" v-model="categoryCode[key]" :options="categoryList"></el-cascader>
</template>
<script>
export default {
name: 'categoryCascader',
props: {
categoryCode: {
type: Array
},
key: {
type: String,
default: 'categoryCode'
},
checkStrictly: {
type: Boolean,
default: false
}
},
data() {
return {
categoryProps: {
lazy: true,
label: 'categoryName',
value: 'categoryCode',
lazyLoad: this.getCategoryList,
checkStrictly: this.checkStrictly
},
categoryList: []
}
},
methods: {
// aa(){
// console.log(this.categoryCode)
// },
getCategoryList(node, resolve) {
const params = {
categoryCode: node?.value,
categoryLevel: node?.level + 1
}
this.$apis.platformGoods.getCategoryListApi(params).then(res => {
if (res) {
res.map(item => (item.leaf = params.categoryLevel > 2))
if (params.categoryLevel == 1) this.categoryList = res
resolve(res)
}
})
}
}
}
</script>
<style lang="scss">
.my_cascader .el-cascader-panel {
height: 250px !important;
}
</style>
<template>
<div>
<div class="input-number-range" :class="{ 'is-disabled': disabled }">
<div class="flex">
<div class="from">
<el-input ref="input_from" v-model="formData[keyObj.from]" :disabled="disabled" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" placeholder="" @input="handleInputChangeFrom"></el-input>
</div>
<div class="center">
<span>至</span>
</div>
<div class="to">
<el-input ref="input_to" v-model="formData[keyObj.to]" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" :disabled="disabled" placeholder="" @input="handleInputChangeTo"></el-input>
</div>
<div class="unit">
<span>元</span>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'InputNumberRange',
props: {
// 是否禁用
disabled: {
type: Boolean,
default: false
},
formData: {
type: Object,
default: () => {
return {}
}
},
keyObj: {
type: Object,
default: () => {
return {
from: 'a',
to: 'b'
}
}
}
},
data() {
return {}
},
methods: {
// from输入框change事件
handleInputChangeFrom(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
},
// to输入框change事件
handleInputChangeTo(value) {
// let from = this.formData[this.keyObj.from]
// let to = this.formData[this.keyObj.to]
// if(from > to){
// this.formData[this.keyObj.to] = from
// }
}
}
}
</script>
<style lang="scss" scoped>
.input-number-range {
background-color: #fff;
border: 1px solid #dcdfe6;
border-radius: 4px;
}
.flex {
display: flex;
flex-direction: row;
width: 100%;
justify-content: center;
align-items: center;
/deep/ .el-input .el-input__inner {
border: 0px;
margin: 0;
padding: 0 10px;
background-color: transparent;
}
.center {
margin-top: 1px;
color: #666;
}
.unit {
margin-right: 10px;
color: #666;
}
}
.is-disabled {
background-color: #eef0f6;
border-color: #e4e7ed;
color: #c0c4cc;
cursor: not-allowed;
}
</style>
......@@ -593,7 +593,11 @@ export default {
,
closeDialog() {
if (!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId) {
return this.$message.error('请先选择商品')
return this.$message({
message: '请选择商品',
type: 'error',
customClass: 'message-Z-zinde'
})
}
this.merchantDialogVisible = !this.merchantDialogVisible
}
......
......@@ -2,228 +2,81 @@
<div class="goods-ctnr">
<div class="global-title">{{ !routeInfo.id ? '新增' : disabled ? '查看' : '编辑' }}商品</div>
<div class="container">
<glsx-combi-form
:isInline="false"
class="glsx-combi-form"
ref="baseInfoRef"
labelWidth="154px"
defaultWidth="432px"
:formObj.sync="formObj"
:formData="formData"
:formRules="myRule"
>
<glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
<div slot="selectBtnSlot">
<el-button
:class="['el-icon-plus', {'disabled-class':disabled}]"
size="small"
@click="openGoodsDialog"
>
选择商品
</el-button>
<el-button :class="['el-icon-plus', { 'disabled-class': disabled }]" size="small" @click="openGoodsDialog">选择商品</el-button>
</div>
<div
slot="goodsInfoSlot"
class="goods-wrap"
>
<div slot="goodsInfoSlot" class="goods-wrap">
<template v-if="formObj.goodsSource != 3">
<glsx-combi-form
:isInline="false"
ref="goodsInfoRef"
labelWidth="154px"
defaultWidth="432px"
:formObj.sync="formObj"
:formData="goodsFormData"
:formRules="goodsRule"
>
<div
slot="uploadSlot"
class="upload-class"
>
<glsx-preview
:picOptions="posterOptions"
:imageUrlArr="formObj.coverList"
></glsx-preview>
<glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule">
<div slot="uploadSlot" class="upload-class">
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList"></glsx-preview>
<span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span>
</div>
</glsx-combi-form>
</template>
<template v-else>
<glsx-combi-form
:isInline="false"
labelWidth="154px"
defaultWidth="432px"
:formObj.sync="formObj"
:formData="gasFormData"
>
<div
slot="uploadSlot"
class="upload-class"
>
<el-image
v-if="formObj.coverList && formObj.coverList[0]"
class="img"
:src="formObj.coverList[0]"
:preview-src-list="formObj.coverList"
>
<div slot="error">
</div>
<glsx-combi-form :isInline="false" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="gasFormData">
<div slot="uploadSlot" class="upload-class">
<el-image v-if="formObj.coverList && formObj.coverList[0]" class="img" :src="formObj.coverList[0]" :preview-src-list="formObj.coverList">
<div slot="error"></div>
</el-image>
</div>
<template slot="retailPrice">
<div>
{{formObj.retailPrice || '--'}}
{{ formObj.retailPrice || '--' }}
</div>
</template>
</glsx-combi-form>
</template>
</div>
<div slot="saleStoreSlot">
<el-button
v-if="!disabled && formObj.goodsSource!=2"
class="el-icon-plus"
size="small"
@click="closeDialog"
>选择门店</el-button>
<el-button v-if="!disabled && formObj.goodsSource != 2" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
<template v-if="saleMerchantList && saleMerchantList.length">
<GLTable
class="selected-table"
:hasPage="false"
ref="selectedRef"
:tableParams="selectedtableParams"
:tableData="saleMerchantList"
>
<div
slot="activityPriceSlot"
slot-scope="scope"
>
<format-input
:disabled="disabled"
:intDigit="6"
:precise="2"
placeholder="请输入"
v-model="scope.scope.activityPrice"
></format-input>
<GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="saleMerchantList">
<div slot="activityPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
</div>
<div
slot="originalPriceSlot"
slot-scope="scope"
>
<format-input
:disabled="disabled"
:intDigit="6"
:precise="2"
placeholder="请输入"
v-model="scope.scope.originalPrice"
></format-input>
<div slot="originalPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.originalPrice"></format-input>
</div>
<div
slot="giveIntegralSlot"
slot-scope="scope"
>
<format-input
:disabled="disabled"
:intDigit="6"
:precise="0"
placeholder="请输入"
v-model="scope.scope.giveIntegral"
></format-input>
<div slot="giveIntegralSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="0" placeholder="请输入" v-model="scope.scope.giveIntegral"></format-input>
</div>
<div
slot="integralFlagSlot"
slot-scope="scope"
>
<el-switch
:disabled="disabled"
v-model="scope.scope.exchangeIntegralFlag"
@change="changeIntegralFlagFn($event, scope.scope)"
:active-value="1"
:inactive-value="0"
></el-switch>
<div slot="integralFlagSlot" slot-scope="scope">
<el-switch :disabled="disabled" v-model="scope.scope.exchangeIntegralFlag" @change="changeIntegralFlagFn($event, scope.scope)" :active-value="1" :inactive-value="0"></el-switch>
</div>
<div
slot="exchangeIntegralSlot"
slot-scope="scope"
>
<format-input
:disabled="disabled || scope.scope.exchangeIntegralFlag!=1"
:intDigit="6"
:precise="0"
placeholder="请输入"
v-model="scope.scope.exchangeIntegral"
></format-input>
<div slot="exchangeIntegralSlot" slot-scope="scope">
<format-input :disabled="disabled || scope.scope.exchangeIntegralFlag != 1" :intDigit="6" :precise="0" placeholder="请输入" v-model="scope.scope.exchangeIntegral"></format-input>
</div>
<!-- 油券 -->
<template
slot="activityPrice"
slot-scope="scope"
>
<format-input
:intDigit="5"
:precise="2"
placeholder="请输入"
v-model="scope.scope.activityPrice"
@blur="setDefault(scope.scope,'activityPrice')"
:disabled="disabled"
></format-input>
<template slot="activityPrice" slot-scope="scope">
<format-input :intDigit="5" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice" @blur="setDefault(scope.scope, 'activityPrice')" :disabled="disabled"></format-input>
</template>
<template
slot="exchangeIntegralFlag"
slot-scope="scope"
>
<el-switch
v-model="scope.scope.exchangeIntegralFlag"
@change="integralSwitch($event, scope.scope)"
:active-value="1"
:inactive-value="0"
:disabled="disabled"
>
</el-switch>
<template slot="exchangeIntegralFlag" slot-scope="scope">
<el-switch v-model="scope.scope.exchangeIntegralFlag" @change="integralSwitch($event, scope.scope)" :active-value="1" :inactive-value="0" :disabled="disabled"></el-switch>
<div class="switch">
<div :class="['text',{'off':scope.scope.exchangeIntegralFlag == 0}]">{{
scope.scope.exchangeIntegralFlag == 0 ?'否':'是'
}}</div>
<div :class="['text', { off: scope.scope.exchangeIntegralFlag == 0 }]">{{ scope.scope.exchangeIntegralFlag == 0 ? '否' : '是' }}</div>
</div>
</template>
<template
slot="exchangeIntegral"
slot-scope="scope"
>
<format-input
:disabled="disabled || scope.scope.exchangeIntegralFlag == 0"
:intDigit="5"
:precise="0"
placeholder="请输入"
v-model="scope.scope.exchangeIntegral"
@blur="setDefault(scope.scope,'exchangeIntegral','')"
></format-input>
<template slot="exchangeIntegral" slot-scope="scope">
<format-input :disabled="disabled || scope.scope.exchangeIntegralFlag == 0" :intDigit="5" :precise="0" placeholder="请输入" v-model="scope.scope.exchangeIntegral" @blur="setDefault(scope.scope, 'exchangeIntegral', '')"></format-input>
</template>
<!-- 油券end -->
<div
slot="auth-button"
slot-scope="scope"
>
<el-button
v-if="!disabled"
type="text"
@click="handleDel(scope.scope)"
>删除</el-button>
<!-- 云中鹤平台 -->
<template slot="yzhActivityPriceSlot" slot-scope="scope">
<format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
</template>
<div slot="auth-button" slot-scope="scope">
<el-button v-if="!disabled" type="text" @click="handleDel(scope.scope)">删除</el-button>
</div>
</GLTable>
</template>
</div>
<div
slot="propagateCoverSlot"
class="propagate-cover-class"
>
<div slot="propagateCoverSlot" class="propagate-cover-class">
<div class="upload-wrap">
<glsx-preview
:picOptions="posterOptions"
:imageUrlArr="formObj.styleBImgList"
></glsx-preview>
<span
class="preview"
@click="showPreviewDialog=true"
>预览</span>
<glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.styleBImgList"></glsx-preview>
<span class="preview" @click="showPreviewDialog = true">预览</span>
</div>
<span class="tip">分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内</span>
</div>
......@@ -233,49 +86,20 @@
<div class="upload-img">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传视频</div>
<input
type="file"
class="upload-video"
style="opacity: 0"
accept=".mp4"
@change="e => handleVideoChange(e)"
/>
<input type="file" class="upload-video" style="opacity: 0" accept=".mp4" @change="e => handleVideoChange(e)" />
</div>
</template>
<template v-else>
<div class="video-box">
<video
id="video"
width="100%"
height="100%"
preload
loop
muted
>
<source
:src="formObj.goodsVideo"
type="video/mp4"
/>
<video id="video" width="100%" height="100%" preload loop muted>
<source :src="formObj.goodsVideo" type="video/mp4" />
</video>
<div class="mask">
<div
class="video-pane-close"
@click="handleEnlarge(formObj.goodsVideo, 'video')"
>
<img
src="../../assets/channel/view.png"
alt=""
/>
<div class="video-pane-close" @click="handleEnlarge(formObj.goodsVideo, 'video')">
<img src="../../assets/channel/view.png" alt="" />
</div>
<div
class="video-pane-close"
@click="close('radio')"
v-if="!disabled"
>
<img
src="../../assets/channel/dele.png"
alt=""
/>
<div class="video-pane-close" @click="close('radio')" v-if="!disabled">
<img src="../../assets/channel/dele.png" alt="" />
</div>
</div>
</div>
......@@ -285,100 +109,43 @@
</div>
</glsx-combi-form>
</div>
<div
style="margin-top: 16px;"
v-show="formObj.goodsSource != 3"
>
<div style="margin-top: 16px" v-show="formObj.goodsSource < 3">
<div class="global-title">物流信息</div>
<div class="container">
<glsx-combi-form
:isInline="false"
ref="expressInfoRef"
labelWidth="154px"
defaultWidth="432px"
:formObj.sync="formObj"
:formData="expressInfoFormData"
:formRules="myRule"
>
<glsx-combi-form :isInline="false" ref="expressInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="expressInfoFormData" :formRules="myRule">
<div slot="expressFeeSlot">
<format-input
class="expressFee-class"
:disabled="disabled"
:intDigit="4"
:precise="2"
v-model="formObj.expressFee"
></format-input>
<format-input class="expressFee-class" :disabled="disabled" :intDigit="4" :precise="2" v-model="formObj.expressFee"></format-input>
</div>
<div slot="selfSlot">
<div>
<span style="color: #666666;">配送方式:</span>
<span>{{ formObj.deliveryType==1 ? '到店核销' : '快递发货' }}</span>
<span style="color: #666666">配送方式:</span>
<span>{{ formObj.deliveryType == 1 ? '到店核销' : '快递发货' }}</span>
</div>
<div>
<span style="color: #666666;">运费/元:</span>
<span>{{ formObj.deliveryType==1 ? '--' : (formObj.expressFee || 0) }}</span>
<span style="color: #666666">运费/元:</span>
<span>{{ formObj.deliveryType == 1 ? '--' : formObj.expressFee || 0 }}</span>
</div>
<div>
<span style="color: #666666;">服务说明:</span>
<span style="color: #666666">服务说明:</span>
<span>{{ formObj.introduction || '--' }}</span>
</div>
</div>
</glsx-combi-form>
</div>
</div>
<GLFooter style="margin-top: 16px;">
<GLFooter style="margin-top: 16px">
<el-button @click="handleCancel">取消</el-button>
<el-button
v-if="!disabled"
type="primary"
@click="handleSave"
>确定</el-button>
<el-button v-if="!disabled" type="primary" @click="handleSave">确定</el-button>
</GLFooter>
<selectGoods
v-if="goodsVisible"
:routeInfo="routeInfo"
:dialogVisible="goodsVisible"
:goodsInfo="formObj"
@handleGoodsConfirm="handleGoodsConfirm"
@handleGoodsClose="handleGoodsClose"
></selectGoods>
<selectMerchantDialog
@confirmDialog="confirmDialog"
@closeDialog="closeDialog"
:goodsId="formObj.smartcarlifeInfoId"
:selectedList="saleMerchantList"
v-if="merchantDialogVisible"
:isVisible="merchantDialogVisible"
></selectMerchantDialog>
<selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" :goodsInfo="formObj" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
<selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog>
<el-dialog
class="image-dialog"
:visible.sync="dialogVisibleImg"
width="50%"
>
<img
:src="dialogSrc"
width="100%"
v-if="dialogType == 'img'"
/>
<video
width="100%"
autoplay
controls
:src="dialogSrc"
v-else
></video>
<el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
<img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
<video width="100%" autoplay controls :src="dialogSrc" v-else></video>
</el-dialog>
<div
v-if="showPreviewDialog"
class="preview-dialog"
@click="showPreviewDialog = false"
>
<img
class="preview-img"
src="@/assets/preview.png"
alt=""
/>
<div v-if="showPreviewDialog" class="preview-dialog" @click="showPreviewDialog = false">
<img class="preview-img" src="@/assets/preview.png" alt="" />
</div>
</div>
</template>
......@@ -443,7 +210,7 @@ const GasColumns = [
{
label: '门店价/元',
addHtml: 'activityPrice',
minWidth: 100,
minWidth: 100
},
{
label: '是否支持积分兑换',
......@@ -456,23 +223,56 @@ const GasColumns = [
addHtml: 'exchangeIntegral'
}
]
const defaultExpreeColFn = (vn) => {
const yzhColumns = [
{
label: '门店名称',
prop: 'merchantName'
},
{
label: '市场价/元',
prop: 'marketPrice'
},
{
label: '供货价/元',
width: 180,
prop: 'sellPrice'
},
{
label: '门店价/元',
width: 180,
addHtml: 'yzhActivityPriceSlot'
},
{
label: '是否支持积分兑换',
width: 150,
addHtml: 'integralFlagSlot'
},
{
label: '兑换积分',
width: 180,
addHtml: 'exchangeIntegralSlot'
}
]
const defaultExpreeColFn = vn => {
return [
{
label: '配送方式',
name: 'deliveryType',
type: 'radio',
optionList: [{
confId: 2,
confName: '快递发货'
}, {
confId: 1,
confName: '到店核销'
}],
optionList: [
{
confId: 2,
confName: '快递发货'
},
{
confId: 1,
confName: '到店核销'
}
],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
handleRadioChange: (e) => {
handleRadioChange: e => {
vn.changeMethod(e, true)
}
},
......@@ -491,14 +291,14 @@ const defaultExpreeColFn = (vn) => {
isDisabled: false,
showLimit: true,
maxlength: 200
},
}
]
}
const selfGoodsExpreeCol = [
{
label: '',
addHtml: 'selfSlot',
addHtml: 'selfSlot'
}
]
import glsxCombiForm from '@/components/glsx-combi-form'
......@@ -513,7 +313,7 @@ export default {
selectGoods,
selectMerchantDialog
},
data () {
data() {
return {
showPreviewDialog: false,
dialogVisibleImg: false,
......@@ -546,6 +346,12 @@ export default {
isHide: false
},
{
label: '商品名称',
name: 'goodsSkuName',
type: 'showTxt',
isHide: true
},
{
label: '售价(元)',
name: 'retailPrice',
type: 'showTxt',
......@@ -557,6 +363,30 @@ export default {
type: 'showTxt',
isHide: false
},
{
label: '供货价/元',
name: 'sellPrice',
type: 'showTxt',
isHide: true
},
{
label: '市场价/元',
name: 'marketPrice',
type: 'showTxt',
isHide: true
},
{
label: '库存',
name: 'goodsStock',
type: 'showTxt',
isHide: true
}
// {
// label: '颜色',
// name: 'goodsSkuName',
// type: 'showTxt',
// isHide: true
// }
],
gasFormData: [
{
......@@ -581,7 +411,7 @@ export default {
{
label: '销售价/元',
addHtml: 'retailPrice'
},
}
],
expressInfoFormData: defaultExpreeColFn(this),
formObj: {
......@@ -602,7 +432,12 @@ export default {
coverList: [],
associationClassifyFirstId: '',
introduction: '',
oilCouponFaceValue: ''
oilCouponFaceValue: '',
// 云中鹤
goodsSkuName: '',
goodsSkuCode: '',
marketPrice: '',
sellPrice: ''
},
saleMerchantList: [],
myRule: {
......@@ -619,63 +454,91 @@ export default {
trigger: 'change'
}
],
goodsInfoSlot: [{
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.coverList && !this.formObj.coverList[0]) {
callback(new Error('请上传商品图'))
} else if (!this.formObj.goodsName) {
callback(new Error('请输入商品名称'))
} else {
callback()
}
},
trigger: 'change'
}],
saleStoreSlot: [{
required: true,
validator: (rule, value, callback) => {
if (!this.saleMerchantList.length) {
callback(new Error('请选择门店'))
}
const { goodsSource } = this.formObj
if (goodsSource == 3) {
const _exchangeIntegral = this.saleMerchantList.find(item => !item.exchangeIntegral && item.exchangeIntegralFlag)
if (_exchangeIntegral) {
callback(new Error('请输入兑换积分'))
} else callback()
} else {
const _target = this.saleMerchantList.find(item => {
let originalPrice = item.originalPrice || 0
return !(+originalPrice)
})
const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral && item.giveIntegral !== 0)
const _exchangeintegralTarget = this.saleMerchantList.find(item => this.formObj.goodsSource == 1 && item.exchangeIntegralFlag && (!item.exchangeIntegral || item.exchangeIntegral == 0))
const hasTarget = this.saleMerchantList.find(item => {
let originalPrice = item.originalPrice || 0
let activityPrice = item.activityPrice || 0
let minSellPrice = this.formObj.minSellPrice || 0
return (+activityPrice > +originalPrice || +originalPrice < minSellPrice)
})
if (_target) {
callback(new Error(`门店${this.formObj.goodsSource == 2 ? '零售价' : '原价'}请填写大于0的数值`))
} else if (this.formObj.goodsSource != 2 && hasTarget) {
callback(new Error('原价不能小于最低售价和活动价'))
} else if (_integralTarget) {
callback(new Error('请输入赠送积分'))
} else if (_exchangeintegralTarget) {
callback(new Error('请输入大于0的兑换积分'))
goodsInfoSlot: [
{
required: true,
validator: (rule, value, callback) => {
if (!this.formObj.coverList && !this.formObj.coverList[0]) {
callback(new Error('请上传商品图'))
} else if (!this.formObj.goodsName) {
callback(new Error('请输入商品名称'))
} else {
callback()
}
}
},
trigger: 'change'
}],
},
trigger: 'change'
}
],
saleStoreSlot: [
{
required: true,
validator: (rule, value, callback) => {
if (!this.saleMerchantList.length) {
callback(new Error('请选择门店'))
}
const { goodsSource } = this.formObj
if (goodsSource == 3) {
const _exchangeIntegral = this.saleMerchantList.find(item => !item.exchangeIntegral && item.exchangeIntegralFlag)
if (_exchangeIntegral) {
callback(new Error('请输入兑换积分'))
} else callback()
} else {
const _target = this.saleMerchantList.find(item => {
if (goodsSource == 4) {
let activityPrice = item.activityPrice || 0
return !+activityPrice
} else {
let originalPrice = item.originalPrice || 0
return !+originalPrice
}
})
const _integralTarget = this.saleMerchantList.find(item => !item.giveIntegral && item.giveIntegral !== 0)
const _exchangeintegralTarget = this.saleMerchantList.find(item => this.formObj.goodsSource == 1 && item.exchangeIntegralFlag && (!item.exchangeIntegral || item.exchangeIntegral == 0))
const hasTarget = this.saleMerchantList.find(item => {
if (goodsSource == 4) {
let activityPrice = item.activityPrice || 0
let sellPrice = item.sellPrice || 0
return +activityPrice < +sellPrice
} else {
let originalPrice = item.originalPrice || 0
let activityPrice = item.activityPrice || 0
let minSellPrice = this.formObj.minSellPrice || 0
return +activityPrice > +originalPrice || +originalPrice < minSellPrice
}
})
const _yzhTarget = this.saleMerchantList.find(item => goodsSource == 4 && item.exchangeIntegralFlag&&(!item.activityPrice || item.activityPrice==0)&&item.exchangeIntegral>0)
const _yzhTargetExchangeInter = this.saleMerchantList.find(item => goodsSource == 4 && item.exchangeIntegralFlag&&(!item.exchangeIntegral || item.exchangeIntegral == 0))
if(_yzhTarget) callback()
if(_yzhTargetExchangeInter)callback(new Error('请输入大于0的兑换积分'))
if (_target) {
const errTextMap = {
1: '原价',
2: '零售价',
3: '原价',
4: '价'
}
const text = errTextMap[goodsSource]
callback(new Error(`门店${text}请填写大于0的数值`))
} else if (this.formObj.goodsSource == 4 && hasTarget) {
callback(new Error('门店价不能小于供货价'))
} else if (this.formObj.goodsSource != 2 && hasTarget) {
callback(new Error('原价不能小于最低售价和活动价'))
} else if (_integralTarget && goodsSource != 4) {
callback(new Error('请输入赠送积分'))
} else if (_exchangeintegralTarget) {
callback(new Error('请输入大于0的兑换积分'))
} else {
callback()
}
}
},
trigger: 'change'
}
],
associationClassifyFirstId: [{ required: true, message: '请选择关联商品分类', trigger: 'change' }],
goodsSource: [{ required: true, message: '请选择来源', trigger: 'change' }],
deliveryType: [{ required: true, message: '请选择配送方式', trigger: 'change' }],
expressFee: [{ required: true, message: '请输入运费', trigger: 'change' }],
expressFee: [{ required: true, message: '请输入运费', trigger: 'change' }]
},
formData: [
{
......@@ -703,12 +566,16 @@ export default {
{
confId: 3,
confName: '油券'
},
{
confId: 4,
confName: '云中鹤平台'
}
],
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
handleRadioChange: (e) => {
handleRadioChange: e => {
this.changeSource(e, true)
}
},
......@@ -772,7 +639,7 @@ export default {
},
watch: {
'formObj.tencentcloudMediaId': {
handler (nVal, oVal) {
handler(nVal, oVal) {
const { goodsSource } = this.formObj,
_target = this.formData.find(item => item.name == 'commerceDescribe')
_target.isHide = goodsSource == 3 ? true : !nVal
......@@ -780,17 +647,17 @@ export default {
},
deep: true
},
'formObj.goodsSource' (n) {
'formObj.goodsSource'(n) {
const hideList = ['propagateCover', 'productVideo', 'tencentcloudMediaId', 'commerceDescribe']
this.formData.forEach(e => {
if (hideList.includes(e.name)) e.isHide = n == 3
if (hideList.includes(e.name)) e.isHide = n == 3 || n == 4
})
this.myRule.deliveryType[0].required = n != 3
this.myRule.expressFee[0].required = n != 3
this.$refs.baseInfoRef.$refs.formRef.clearValidate()
}
},
created () {
created() {
this.getCategory()
this.getVideoList()
const urlParam = this.$route.params
......@@ -813,35 +680,46 @@ export default {
}
},
methods: {
changeIntegralFlagFn (e, item) {
changeIntegralFlagFn(e, item) {
if (e != 1) {
item.exchangeIntegral = ''
}
},
changeMethod (e, isClear) {
changeMethod(e, isClear) {
const _target = this.expressInfoFormData.find(item => item.name == 'expressFee')
if (_target) {
_target.isHide = e == 1
if (e == 1 && this.formObj.goodsSource == 1) this.formObj.expressFee = ''
}
},
changeSource (e, isClear) {
changeSource(e, isClear) {
this.expressInfoFormData = e == 2 ? selfGoodsExpreeCol : defaultExpreeColFn(this)
this.goodsFormData.forEach(item => {
item.isHide = (item.name == 'retailPrice' || item.name == 'minSellPrice') && e == 2
item.isHide = (item.name == 'retailPrice' || item.name == 'minSellPrice') && (e == 2 || e == 4)
if ((item.name == 'marketPrice' || item.name == 'sellPrice' || item.name == 'goodsSkuName' || item.name=='goodsStock') && e == 4) {
item.isHide = false
} else if ((item.name == 'marketPrice' || item.name == 'sellPrice' || item.name == 'goodsSkuName' || item.name=='goodsStock') && e != 4) {
item.isHide = true
} else if (e == 4 && item.name == 'goodsName') {
item.isHide = true
}
})
this.selectedtableParams.tableColumns = {
1: defalutMerchantColumns,
2: MerchantColumns,
3: GasColumns
3: GasColumns,
4: yzhColumns
}[e]
if (this.routeInfo.type != 1) this.selectedtableParams.tableOption = e == 2 ? null : {
width: 100
}
if (this.routeInfo.type != 1)
this.selectedtableParams.tableOption =
e == 2
? null
: {
width: 100
}
if (isClear) this.clearDataFn()
},
clearDataFn () {
clearDataFn() {
this.formObj = {
...this.formObj,
smartcarlifeInfoId: '', //自营和智享的id字段不一致
......@@ -854,12 +732,16 @@ export default {
goodsType: '2',
expressFee: '',
introduction: '',
oilCouponFaceValue: ''
oilCouponFaceValue: '',
goodsSkuName: '',
goodsSkuCode: '',
marketPrice: '',
sellPrice: ''
}
this.saleMerchantList = []
},
// 上传视频
handleVideoChange (e) {
handleVideoChange(e) {
let file = e.srcElement.files[0]
var reader = new FileReader()
// 默认30MB
......@@ -895,13 +777,13 @@ export default {
}
},
// 预览图文
handleEnlarge (src, type) {
handleEnlarge(src, type) {
this.dialogVisibleImg = true
this.dialogSrc = src
this.dialogType = type ? type : 'img'
},
// 删除图片/视频
close (type, index) {
close(type, index) {
switch (type) {
case 'radio':
this.formObj.goodsVideo = ''
......@@ -910,7 +792,7 @@ export default {
this.formObj.goodsVideo = ''
}
},
getCategory () {
getCategory() {
const params = {
pageSize: 10000,
pageNum: 1,
......@@ -923,7 +805,7 @@ export default {
}
})
},
getVideoList () {
getVideoList() {
this.$apis.case.getVideoListApi({ pageSize: 10000, currentPage: 1, status: 1 }).then(res => {
if (res?.list?.length) {
const _target = this.formData.find(item => item.name == 'tencentcloudMediaId')
......@@ -931,7 +813,7 @@ export default {
}
})
},
validateField (field) {
validateField(field) {
if (Array.isArray(field)) {
field.forEach(item => {
this.$refs.baseInfoRef.$refs.formRef.validateField(item)
......@@ -940,39 +822,44 @@ export default {
this.$refs.baseInfoRef.$refs.formRef.validateField(field)
}
},
openGoodsDialog () {
openGoodsDialog() {
if (this.disabled) return
this.goodsVisible = true
},
handleGoodsClose () {
handleGoodsClose() {
this.goodsVisible = false
},
handleGoodsConfirm (e) {
handleGoodsConfirm(e) {
const { goodsSource } = this.formObj
if (this.formObj.smartcarlifeInfoId != e?.id && goodsSource != 3) this.saleMerchantList = []
let { id, goodsName, goodsImage, minSellPrice, retailPrice, goodsVideo, goodsId } = e || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice / 100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice / 100).toFixed(2)) : 0
// 云中鹤:第三方平台商品特殊
if (goodsSource == 4) {
this.setYzhGoodsInfo(e)
} else {
if (this.formObj.smartcarlifeInfoId != e?.id && goodsSource != 3) this.saleMerchantList = []
let { id, goodsName, goodsImage, minSellPrice, retailPrice, goodsVideo, goodsId } = e || {}
minSellPrice = minSellPrice ? Number(Number(minSellPrice / 100).toFixed(2)) : 0
retailPrice = retailPrice ? Number(Number(retailPrice / 100).toFixed(2)) : 0
// 若选择的商品素材包含了视频,则带入对应的视频文件
if (goodsVideo) this.formObj.goodsVideo = goodsVideo
this.formObj = {
...this.formObj,
smartcarlifeInfoId: this.formObj.goodsSource == 2 ? goodsId : id, //自营和智享的id字段不一致
goodsName,
goodsImage,
coverList: [goodsImage],
minSellPrice,
retailPrice
// 若选择的商品素材包含了视频,则带入对应的视频文件
if (goodsVideo) this.formObj.goodsVideo = goodsVideo
this.formObj = {
...this.formObj,
smartcarlifeInfoId: this.formObj.goodsSource == 2 ? goodsId : id, //自营和智享的id字段不一致
goodsName,
goodsImage,
coverList: [goodsImage],
minSellPrice,
retailPrice
}
if (this.formObj.goodsSource == 2) {
this.setSelfGoodsInfo(e)
}
if (this.formObj.goodsSource == 3) this.setGasGoodsInfo(e)
this.validateField(['selectBtnSlot', 'goodsInfoSlot'])
}
this.handleGoodsClose()
if (this.formObj.goodsSource == 2) {
this.setSelfGoodsInfo(e)
}
if (this.formObj.goodsSource == 3) this.setGasGoodsInfo(e)
this.validateField(['selectBtnSlot', 'goodsInfoSlot'])
},
setSelfGoodsInfo (row) {
setSelfGoodsInfo(row) {
let { deliveryType, expressFee, goodsVideo, merchantId, merchantName, retailPrice, originalPrice, serviceDesc: introduction } = row || {}
expressFee = expressFee ? Number(Number(expressFee / 100).toFixed(2)) : 0
this.formObj = { ...this.formObj, deliveryType, expressFee, goodsVideo, introduction }
......@@ -980,7 +867,7 @@ export default {
originalPrice = originalPrice ? Number(Number(originalPrice / 100).toFixed(2)) : 0
this.saleMerchantList = [{ merchantId, merchantName, activityPrice: retailPrice, originalPrice, giveIntegral: '' }]
},
setGasGoodsInfo (row) {
setGasGoodsInfo(row) {
const salesPrice = row.salesPrice ? NP.divide(row.salesPrice, 100).toFixed(2) : 0
this.formObj = {
...this.formObj,
......@@ -994,45 +881,68 @@ export default {
minSellPrice: row.sellPrice
}
},
confirmDialog (e) {
setYzhGoodsInfo(e) {
const { goodsSkuName, goodsImgUrl, goodsSkuCode, marketPrice, sellPrice,goodsStock } = e
this.formObj = {
...this.formObj,
goodsSource: 4,
goodsSkuName,
goodsName: goodsSkuName,
goodsImage: goodsImgUrl,
deliveryType: 2,
expressFee: 0,
goodsSkuCode,
marketPrice,
sellPrice,
coverList: [goodsImgUrl],
smartcarlifeInfoId: e.id,
goodsStock
}
},
confirmDialog(e) {
const { saleMerchantList } = this
e && e.map(item => {
if (this.formObj.goodsSource != 3) {
this.$set(item, 'giveIntegral', '')
this.$set(item, 'exchangeIntegralFlag', 0)
this.$set(item, 'exchangeIntegral', '')
} else {
this.$set(item, 'activityPrice', 0)
this.$set(item, 'exchangeIntegralFlag', 1)
this.$set(item, 'exchangeIntegral', '')
saleMerchantList.map(i => {
if (i.merchantId === item.merchantId) {
item.activityPrice = i.activityPrice
item.exchangeIntegralFlag = i.exchangeIntegralFlag
item.exchangeIntegral = i.exchangeIntegral
e &&
e.map(item => {
if (this.formObj.goodsSource != 3) {
this.$set(item, 'exchangeIntegralFlag', 0)
this.$set(item, 'exchangeIntegral', '')
if (this.formObj.goodsSource == 4) {
this.$set(item, 'activityPrice', item.sellPrice)
} else {
this.$set(item, 'giveIntegral', '')
}
})
}
})
} else {
this.$set(item, 'activityPrice', 0)
this.$set(item, 'exchangeIntegralFlag', 1)
this.$set(item, 'exchangeIntegral', '')
saleMerchantList.map(i => {
if (i.merchantId === item.merchantId) {
item.activityPrice = i.activityPrice
item.exchangeIntegralFlag = i.exchangeIntegralFlag
item.exchangeIntegral = i.exchangeIntegral
}
})
}
})
this.saleMerchantList = e || []
this.validateField('saleStoreSlot')
this.closeDialog()
},
closeDialog () {
closeDialog() {
const { goodsSource } = this.formObj
if (goodsSource != 3 && !this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId) {
return this.$message.error('请先选择商品')
}
this.merchantDialogVisible = !this.merchantDialogVisible
},
handleDel (row) {
handleDel(row) {
const { goodsSource } = this.formObj,
KEY = goodsSource == 3 ? 'merchantNo' : 'merchantId',
idx = this.saleMerchantList.findIndex(item => item[KEY] == row[KEY])
if (idx > -1) this.saleMerchantList.splice(idx, 1)
this.validateField('saleStoreSlot')
},
getParams () {
getParams() {
let obj = JSON.parse(JSON.stringify(this.formObj))
obj.goodsImage = obj.coverList[0]
obj.styleBImg = obj.styleBImgList[0] || ''
......@@ -1044,7 +954,7 @@ export default {
delete obj.id // 油券默认带了id
let saleMerchantList = this.saleMerchantList.map(item => {
let { merchantId, merchantName, activityPrice, giveIntegral, originalPrice, exchangeIntegralFlag, exchangeIntegral } = item
if (obj.goodsSource == 3) merchantId = item.merchantNo
if (obj.goodsSource == 3 || obj.goodsSource == 4) merchantId = item.merchantNo
activityPrice = activityPrice ? Number(Number(activityPrice * 10 * 10).toFixed(0)) : 0
originalPrice = originalPrice ? Number(Number(originalPrice * 10 * 10).toFixed(0)) : 0
let saleMerchantItem = { merchantId, merchantName, activityPrice, giveIntegral, originalPrice }
......@@ -1061,7 +971,7 @@ export default {
if (this.routeInfo.id) params.id = this.routeInfo.id
return params
},
handleSave () {
handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
this.$refs.expressInfoRef.$refs.formRef.validate(validate => {
if (valid && validate) {
......@@ -1076,10 +986,10 @@ export default {
})
})
},
handleCancel () {
handleCancel() {
this.$router.back()
},
getDetail () {
getDetail() {
const params = {
id: this.routeInfo.id
}
......@@ -1104,21 +1014,27 @@ export default {
this.formObj.goodsType = '2' //1配置升级, 2车主优选
this.formObj.coverList = res.goodsImage ? [res.goodsImage] : []
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
this.saleMerchantList = res.saleMerchantList?.map(item => {
let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0
let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0
if (res.goodsSource == 3) item.merchantNo = String(item.merchantId)
return { ...item, activityPrice, originalPrice }
}) || []
this.formObj.goodsSkuName = res.goodsName
this.formObj.goodsSkuCode = res.goodsSkuCode
this.formObj.marketPrice = res.marketPrice
this.formObj.sellPrice = res.sellPrice
this.formObj.goodsStock = res.goodsStock
this.saleMerchantList =
res.saleMerchantList?.map(item => {
let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0
let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0
if (res.goodsSource == 3 || res.goodsSource == 4) item.merchantNo = String(item.merchantId)
return { ...item, activityPrice, originalPrice }
}) || []
}
})
},
setDefault (e, target, min = 0) {
setDefault(e, target, min = 0) {
if (e[target]) e[target] = Math.abs(e[target])
if (!e[target] || e[target] < min) e[target] = min
if (target == 'activityPrice' && e[target] == 0) e.exchangeIntegralFlag = 1
},
integralSwitch (e, row) {
integralSwitch(e, row) {
if (!e && row.activityPrice == 0) {
row.exchangeIntegralFlag = 1
this.$message.error('当前门店价不能为0')
......
<template>
<div class="select-store">
<GLDialog
bigTitle="选择商品"
mode="big"
:visible.sync="dialogVisible"
:before-close="handleClose"
:close-on-click-modal="false"
@onOk="handleConfirm"
@onCancel="handleClose"
>
<glsx-combi-form
ref="showSearch"
labelWidth="105px"
:formObj="searchForm"
:formData="searchFormData"
>
<GLDialog bigTitle="选择商品" mode="big" :visible.sync="dialogVisible" :before-close="handleClose" :close-on-click-modal="false" @onOk="handleConfirm" @onCancel="handleClose">
<glsx-combi-form ref="showSearch" labelWidth="105px" :formObj="searchForm" :formData="searchFormData">
<span slot="footer">
<el-button
:size="size"
type="primary"
@click="resetTable"
>查询</el-button>
<el-button
:size="size"
v-if="goodsInfo.goodsSource != 1"
@click="resetSearch"
>重置</el-button>
<el-button :size="size" type="primary" @click="resetTable">查询</el-button>
<el-button :size="size" v-if="goodsInfo.goodsSource != 1" @click="resetSearch">重置</el-button>
</span>
<div class="categorySlot" slot="categorySlot">
<categoryCascader :checkStrictly="true" :categoryCode.sync="yzhSearchForm"></categoryCascader>
</div>
<div class="supplyPriceSlot" slot="supplyPriceSlot">
<inputNumRange :formData="yzhSearchForm" :keyObj="{ from: 'startSellPrice', to: 'endSellPrice' }"></inputNumRange>
</div>
<div class="spreadPriceSlot" slot="spreadPriceSlot">
<inputNumRange :formData="yzhSearchForm" :keyObj="{ from: 'startDiffPrice', to: 'endDiffPrice' }"></inputNumRange>
</div>
</glsx-combi-form>
<GLTable
ref="goodsRef"
:noDataImg="url"
:searchForm="searchForm"
:tableParams="tableParams"
:beforeSearchFn="beforeSearchFn"
:pageConf="pageConf"
@refreshTable="getList"
:getListApi="getListApi"
:pageSizes="pageSizes"
:hasNum="false"
:setTableFinishFun="setTableFinishFun"
>
<div
slot="radioHtml"
class="store-table"
slot-scope="scope"
>
<el-radio
v-model="curInfo.id"
:label="scope.scope.id"
@click.native="handleClick(scope.scope)"
></el-radio>
<GLTable ref="goodsRef" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @refreshTable="getList" :getListApi="getListApi" :pageSizes="pageSizes" :hasNum="false" :setTableFinishFun="setTableFinishFun">
<div slot="radioHtml" class="store-table" slot-scope="scope">
<el-radio :disabled="scope.scope.shelvesStatus == 1002" v-model="curInfo.id" :label="scope.scope.id" @click.native="handleClick(scope.scope)"></el-radio>
</div>
<div
slot="selfRadioHtml"
class="store-table"
slot-scope="scope"
>
<el-radio
v-model="curInfo.goodsId"
:label="scope.scope.goodsId"
@click.native="handleClick(scope.scope)"
></el-radio>
<div slot="selfRadioHtml" class="store-table" slot-scope="scope">
<el-radio v-model="curInfo.goodsId" :label="scope.scope.goodsId" @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>
<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"
/>
<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 slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
<img :src="scope.scope.goodsImage" alt="" />
{{ scope.scope.goodsName }}
</div>
<!-- 云中鹤平台 -->
<div slot="yzhImageSlot" slot-scope="scope">
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goodsImgUrl" />
<img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImgUrl" />
</el-popover>
</div>
<div slot="goodscategorySlot" class="goodscategorySlot" slot-scope="scope">{{ scope.scope.firstCategoryName }}/{{ scope.scope.secondCategoryName }}/{{ scope.scope.lastCategoryName }}</div>
<div slot="yzhGoodsStatus" slot-scope="scope" class="yzhGoodsStatus">
<div class="yzhstatusClass" :style="yzhStatusMap[scope.scope.shelvesStatus].color"></div>
{{ yzhStatusMap[scope.scope.shelvesStatus].name }}
</div>
</GLTable>
</GLDialog>
......@@ -122,6 +58,8 @@
<script>
import url from '@/assets/empty.png'
import inputNumRange from '@/components/InputNumRange'
import categoryCascader from '@/components/CategoryCascader'
const MERCHANT_SEARCH_ITEM = {
label: '门店名称',
name: 'merchantName',
......@@ -130,6 +68,52 @@ const MERCHANT_SEARCH_ITEM = {
labelWidth: '10px',
isClear: true
}
const YZH_SERACH_ITEM = [
{
label: '商品名称',
name: 'goodsSkuName',
type: 'input',
placeholder: '请输入商品名称',
width: '200px',
labelWidth: '10px',
isClear: true
},
{
label: '商品类型',
addHtml: 'categorySlot'
},
{
label: '商品状态',
name: 'shelvesStatus',
type: 'select',
width: '200px',
optionList: [
{
id: '',
label: '全部'
},
{
id: '1001',
label: '可上架'
},
{
id: '1002',
label: '不可上架'
}
],
optionId: 'id',
optionLabel: 'label'
},
{
label: '供货价',
addHtml: 'supplyPriceSlot'
},
{
label: '差价',
tips: '市场价和供货价的价格差',
addHtml: 'spreadPriceSlot'
}
]
const defaultTableCol = [
{
label: '',
......@@ -219,17 +203,60 @@ const gasGoodsTableCol = [
formatter: cellValue => {
return cellValue.stock - cellValue.usedStock
}
}
]
const yzhGoodsTableCol = [
{
label: '',
prop: '',
width: 80,
addHtml: 'radioHtml'
},
{
label: '商品图片',
addHtml: 'yzhImageSlot'
},
{
label: '商品名称',
prop: 'goodsSkuName'
},
{
label: '分类',
addHtml: 'goodscategorySlot'
},
{
label: '供货价/元',
prop: 'sellPrice'
// formatter: cellValue => {
// return cellValue.retailPrice ? Number(Number(cellValue.retailPrice / 100).toFixed(2)) : '--'
// }
},
{
label: '市场价/元',
prop: 'marketPrice'
// formatter: cellValue => {
// return cellValue.originalPrice ? Number(Number(cellValue.originalPrice / 100).toFixed(2)) : '--'
// }
},
{
label: '库存',
prop: 'goodsStock'
},
{
label: '商品状态',
addHtml: 'yzhGoodsStatus'
}
]
export default {
name: 'selectStore',
data () {
data() {
return {
url: url,
searchForm: {
goodsName: '',
discoverGoodsId: '',
goodsType: ''
goodsType: '',
shelvesStatus: ''
},
total: 0,
storeList: [],
......@@ -258,7 +285,24 @@ export default {
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [5, 10, 20, 30, 40],
baseData: {}
baseData: {},
yzhStatusMap: {
1001: {
name: '可上架',
color: 'background:#fdb757'
},
1002: {
name: '不可上架',
color: 'background:#ee3527'
}
},
yzhSearchForm: {
categoryCode: [],
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: ''
}
}
},
props: {
......@@ -268,17 +312,21 @@ export default {
},
routeInfo: {
type: Object,
default: () => { }
default: () => {}
},
storeSearchForm: {
type: Object
},
goodsInfo: {
required: true,
default: () => { }
default: () => {}
}
},
created () {
components: {
inputNumRange,
categoryCascader
},
created() {
// let { smartcarlifeInfoId, goodsName, coverList, goodsImage, minSellPrice, retailPrice } = this.goodsInfo || {}
// this.curInfo = {
// id: smartcarlifeInfoId,
......@@ -288,65 +336,100 @@ export default {
// 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 (goodsSource == 2) { //来源是门店自营的搜素和列表字段都要改
this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' //1查看,2编辑,空是新增,编辑进来要传id
this.searchForm.goodsType = this.routeInfo.goodsType // 1是配置 2是车主
if (goodsSource == 2) {
//来源是门店自营的搜素和列表字段都要改
this.searchFormData.push(MERCHANT_SEARCH_ITEM)
} else if (goodsSource == 4) {
this.searchFormData = [...YZH_SERACH_ITEM]
}
this.tableParams.tableColumns = {
1: defaultTableCol,
2: merchantGoodsTableCol,
3: gasGoodsTableCol
3: gasGoodsTableCol,
4: yzhGoodsTableCol
}[goodsSource]
this.getListApi = this.$apis.goods[{
1: 'getCarlifeGoodsApi',
2: 'getSelfSupportGoodsApi',
3: 'getOilCouponListApi'
}[goodsSource]]
this.getListApi =
this.$apis.goods[
{
1: 'getCarlifeGoodsApi',
2: 'getSelfSupportGoodsApi',
3: 'getOilCouponListApi',
4: 'getYzgGoodsListApi'
}[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: '',
goodsType: ''
goodsType: '',
shelvesStatus: ''
}
this.yzhSearchForm = {
categoryCode: [],
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: ''
}
this.resetTable()
},
beforeSearchFn () {
beforeSearchFn() {
return new Promise(resolve => {
const {goodsSource} = this.goodsInfo
const { goodsSource } = this.goodsInfo
if (goodsSource == 2) {
delete this.searchForm.goodsType
}
if (goodsSource == 3)this.searchForm.aliasName = this.searchForm.goodsName
if (goodsSource == 3) this.searchForm.aliasName = this.searchForm.goodsName
if (goodsSource == 4) {
this.searchForm = {
...this.searchForm,
...this.$common.utils.deepClone(this.yzhSearchForm)
}
const { categoryCode } = this.searchForm
this.searchForm.categoryCode = categoryCode && categoryCode.length ? categoryCode.pop() : ''
const categoryCodeLength = this.searchForm.categoryCode.length
if (categoryCodeLength > 0 && categoryCodeLength < 6) {
const name = categoryCodeLength === 2 ? 'categoryCode1' : 'categoryCode2'
this.searchForm[name] = this.searchForm.categoryCode
delete this.searchForm.categoryCode
}
}
resolve()
})
},
setTableFinishFun () {
setTableFinishFun() {
this.$refs.goodsRef.tableHeightValues = '460px'
},
handleClick (item) {
handleClick(item) {
console.log(item)
this.curInfo = item
},
handleClose () {
handleClose() {
this.$emit('handleGoodsClose')
},
handleConfirm () {
handleConfirm() {
if (Object.keys(this.curInfo).length) this.$emit('handleGoodsConfirm', this.curInfo)
else this.$message.error('请选择商品')
else
this.$message({
message: '请选择商品',
type: 'error',
customClass: 'message-Z-zinde'
})
}
}
}
......@@ -422,4 +505,19 @@ export default {
display: none;
}
}
.yzhGoodsStatus {
display: flex;
align-items: center;
}
.yzhstatusClass {
width: 6px;
height: 6px;
background: #fdb757;
border-radius: 8px;
margin-right: 8px;
}
.supplyPriceSlot,
.spreadPriceSlot {
width: 200px;
}
</style>
......@@ -121,7 +121,7 @@ export default {
},
]
},
isOil: this.$parent.formObj.goodsSource == 3
isOil: this.$parent.formObj.goodsSource == 3 || this.$parent.formObj.goodsSource == 4
}
},
created () {
......@@ -161,6 +161,10 @@ export default {
// }
list.map(item => this.$set(item, 'activityPrice', ''))
list.map(item => this.$set(item, 'originalPrice', ''))
if(this.$parent.formObj.goodsSource == 4){
list.map(item => this.$set(item, 'marketPrice', this.$parent.formObj.marketPrice))
list.map(item => this.$set(item, 'sellPrice', this.$parent.formObj.sellPrice))
}
this.$emit('confirmDialog', [...list, ...this.copyList])
},
handleClose () {
......
......@@ -341,6 +341,10 @@ export default {
id: 3,
name: '油券'
},
{
id: 4,
name: '云中鹤平台'
},
],
optionId: 'id',
optionLabel: 'name'
......@@ -366,7 +370,8 @@ export default {
return {
1: '嘀加智享平台',
2: '门店自营',
3: '油券'
3: '油券',
4: '云中鹤平台'
}[cellValue.goodsSource]
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!