Commit fe53cb09 by 前端

Merge branch 'v3.24.0' into 'master'

上线合并

See merge request !31
2 parents 924c14bd 6c507011
...@@ -1901,51 +1901,6 @@ ...@@ -1901,51 +1901,6 @@
"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.npmjs.org/ssri/-/ssri-8.0.1.tgz", "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz",
...@@ -1954,28 +1909,6 @@ ...@@ -1954,28 +1909,6 @@
"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-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 @@ ...@@ -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": { "vue-router": {
"version": "3.6.5", "version": "3.6.5",
"resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.6.5.tgz",
......
...@@ -43,5 +43,8 @@ export default { ...@@ -43,5 +43,8 @@ export default {
// overflow-y: auto; // overflow-y: auto;
height: 100%; height: 100%;
} }
.message-Z-zinde,.el-message--error{
z-index: 9999999999 !important;
}
</style> </style>
> >
...@@ -173,6 +173,18 @@ const getAllMerchantListApi = params => { ...@@ -173,6 +173,18 @@ const getAllMerchantListApi = params => {
sign: true 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 { export default {
getGoodsListApi, getGoodsListApi,
updateGoodsStatusApi, updateGoodsStatusApi,
...@@ -189,5 +201,6 @@ export default { ...@@ -189,5 +201,6 @@ export default {
exportGoodsApi, exportGoodsApi,
getSelfGoodsDetailApi, getSelfGoodsDetailApi,
getOilCouponListApi, getOilCouponListApi,
getAllMerchantListApi getAllMerchantListApi,
getYzgGoodsListApi
} }
\ No newline at end of file \ 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 { ...@@ -593,7 +593,11 @@ export default {
, ,
closeDialog() { closeDialog() {
if (!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId) { if (!this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId) {
return this.$message.error('请先选择商品') return this.$message({
message: '请选择商品',
type: 'error',
customClass: 'message-Z-zinde'
})
} }
this.merchantDialogVisible = !this.merchantDialogVisible this.merchantDialogVisible = !this.merchantDialogVisible
} }
......
...@@ -2,228 +2,81 @@ ...@@ -2,228 +2,81 @@
<div class="goods-ctnr"> <div class="goods-ctnr">
<div class="global-title">{{ !routeInfo.id ? '新增' : disabled ? '查看' : '编辑' }}商品</div> <div class="global-title">{{ !routeInfo.id ? '新增' : disabled ? '查看' : '编辑' }}商品</div>
<div class="container"> <div class="container">
<glsx-combi-form <glsx-combi-form :isInline="false" class="glsx-combi-form" ref="baseInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="formData" :formRules="myRule">
:isInline="false"
class="glsx-combi-form"
ref="baseInfoRef"
labelWidth="154px"
defaultWidth="432px"
:formObj.sync="formObj"
:formData="formData"
:formRules="myRule"
>
<div slot="selectBtnSlot"> <div slot="selectBtnSlot">
<el-button <el-button :class="['el-icon-plus', { 'disabled-class': disabled }]" size="small" @click="openGoodsDialog">选择商品</el-button>
:class="['el-icon-plus', {'disabled-class':disabled}]"
size="small"
@click="openGoodsDialog"
>
选择商品
</el-button>
</div> </div>
<div <div slot="goodsInfoSlot" class="goods-wrap">
slot="goodsInfoSlot"
class="goods-wrap"
>
<template v-if="formObj.goodsSource != 3"> <template v-if="formObj.goodsSource != 3">
<glsx-combi-form <glsx-combi-form :isInline="false" ref="goodsInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="goodsFormData" :formRules="goodsRule">
:isInline="false" <div slot="uploadSlot" class="upload-class">
ref="goodsInfoRef" <glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.coverList"></glsx-preview>
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> <span class="tip">建议尺寸750*750,图片格式为jpg,jpeg,png,大小2M以内</span>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</template> </template>
<template v-else> <template v-else>
<glsx-combi-form <glsx-combi-form :isInline="false" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="gasFormData">
:isInline="false" <div slot="uploadSlot" class="upload-class">
labelWidth="154px" <el-image v-if="formObj.coverList && formObj.coverList[0]" class="img" :src="formObj.coverList[0]" :preview-src-list="formObj.coverList">
defaultWidth="432px" <div slot="error"></div>
: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> </el-image>
</div> </div>
<template slot="retailPrice"> <template slot="retailPrice">
<div> <div>
{{formObj.retailPrice || '--'}} {{ formObj.retailPrice || '--' }}
</div> </div>
</template> </template>
</glsx-combi-form> </glsx-combi-form>
</template> </template>
</div> </div>
<div slot="saleStoreSlot"> <div slot="saleStoreSlot">
<el-button <el-button v-if="!disabled && formObj.goodsSource != 2" class="el-icon-plus" size="small" @click="closeDialog">选择门店</el-button>
v-if="!disabled && formObj.goodsSource!=2"
class="el-icon-plus"
size="small"
@click="closeDialog"
>选择门店</el-button>
<template v-if="saleMerchantList && saleMerchantList.length"> <template v-if="saleMerchantList && saleMerchantList.length">
<GLTable <GLTable class="selected-table" :hasPage="false" ref="selectedRef" :tableParams="selectedtableParams" :tableData="saleMerchantList">
class="selected-table" <div slot="activityPriceSlot" slot-scope="scope">
:hasPage="false" <format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
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>
<div <div slot="originalPriceSlot" slot-scope="scope">
slot="originalPriceSlot" <format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.originalPrice"></format-input>
slot-scope="scope"
>
<format-input
:disabled="disabled"
:intDigit="6"
:precise="2"
placeholder="请输入"
v-model="scope.scope.originalPrice"
></format-input>
</div> </div>
<div <div slot="giveIntegralSlot" slot-scope="scope">
slot="giveIntegralSlot" <format-input :disabled="disabled" :intDigit="6" :precise="0" placeholder="请输入" v-model="scope.scope.giveIntegral"></format-input>
slot-scope="scope"
>
<format-input
:disabled="disabled"
:intDigit="6"
:precise="0"
placeholder="请输入"
v-model="scope.scope.giveIntegral"
></format-input>
</div> </div>
<div <div slot="integralFlagSlot" slot-scope="scope">
slot="integralFlagSlot" <el-switch :disabled="disabled" v-model="scope.scope.exchangeIntegralFlag" @change="changeIntegralFlagFn($event, scope.scope)" :active-value="1" :inactive-value="0"></el-switch>
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>
<div <div slot="exchangeIntegralSlot" slot-scope="scope">
slot="exchangeIntegralSlot" <format-input :disabled="disabled || scope.scope.exchangeIntegralFlag != 1" :intDigit="6" :precise="0" placeholder="请输入" v-model="scope.scope.exchangeIntegral"></format-input>
slot-scope="scope"
>
<format-input
:disabled="disabled || scope.scope.exchangeIntegralFlag!=1"
:intDigit="6"
:precise="0"
placeholder="请输入"
v-model="scope.scope.exchangeIntegral"
></format-input>
</div> </div>
<!-- 油券 --> <!-- 油券 -->
<template <template slot="activityPrice" slot-scope="scope">
slot="activityPrice" <format-input :intDigit="5" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice" @blur="setDefault(scope.scope, 'activityPrice')" :disabled="disabled"></format-input>
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>
<template <template slot="exchangeIntegralFlag" slot-scope="scope">
slot="exchangeIntegralFlag" <el-switch v-model="scope.scope.exchangeIntegralFlag" @change="integralSwitch($event, scope.scope)" :active-value="1" :inactive-value="0" :disabled="disabled"></el-switch>
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="switch">
<div :class="['text',{'off':scope.scope.exchangeIntegralFlag == 0}]">{{ <div :class="['text', { off: scope.scope.exchangeIntegralFlag == 0 }]">{{ scope.scope.exchangeIntegralFlag == 0 ? '否' : '是' }}</div>
scope.scope.exchangeIntegralFlag == 0 ?'否':'是'
}}</div>
</div> </div>
</template> </template>
<template <template slot="exchangeIntegral" slot-scope="scope">
slot="exchangeIntegral" <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>
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> </template>
<!-- 油券end --> <!-- 油券end -->
<div <!-- 云中鹤平台 -->
slot="auth-button" <template slot="yzhActivityPriceSlot" slot-scope="scope">
slot-scope="scope" <format-input :disabled="disabled" :intDigit="6" :precise="2" placeholder="请输入" v-model="scope.scope.activityPrice"></format-input>
> </template>
<el-button <div slot="auth-button" slot-scope="scope">
v-if="!disabled" <el-button v-if="!disabled" type="text" @click="handleDel(scope.scope)">删除</el-button>
type="text"
@click="handleDel(scope.scope)"
>删除</el-button>
</div> </div>
</GLTable> </GLTable>
</template> </template>
</div> </div>
<div <div slot="propagateCoverSlot" class="propagate-cover-class">
slot="propagateCoverSlot"
class="propagate-cover-class"
>
<div class="upload-wrap"> <div class="upload-wrap">
<glsx-preview <glsx-preview :picOptions="posterOptions" :imageUrlArr="formObj.styleBImgList"></glsx-preview>
:picOptions="posterOptions" <span class="preview" @click="showPreviewDialog = true">预览</span>
:imageUrlArr="formObj.styleBImgList"
></glsx-preview>
<span
class="preview"
@click="showPreviewDialog=true"
>预览</span>
</div> </div>
<span class="tip">分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内</span> <span class="tip">分类布局选择种草样式B时商品宣传大图,建议720*540,大小2M以内</span>
</div> </div>
...@@ -233,49 +86,20 @@ ...@@ -233,49 +86,20 @@
<div class="upload-img"> <div class="upload-img">
<i class="el-icon-plus avatar-uploader-desc-icon"></i> <i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传视频</div> <div class="avatar-uploader-desc-word">上传视频</div>
<input <input type="file" class="upload-video" style="opacity: 0" accept=".mp4" @change="e => handleVideoChange(e)" />
type="file"
class="upload-video"
style="opacity: 0"
accept=".mp4"
@change="e => handleVideoChange(e)"
/>
</div> </div>
</template> </template>
<template v-else> <template v-else>
<div class="video-box"> <div class="video-box">
<video <video id="video" width="100%" height="100%" preload loop muted>
id="video" <source :src="formObj.goodsVideo" type="video/mp4" />
width="100%"
height="100%"
preload
loop
muted
>
<source
:src="formObj.goodsVideo"
type="video/mp4"
/>
</video> </video>
<div class="mask"> <div class="mask">
<div <div class="video-pane-close" @click="handleEnlarge(formObj.goodsVideo, 'video')">
class="video-pane-close" <img src="../../assets/channel/view.png" alt="" />
@click="handleEnlarge(formObj.goodsVideo, 'video')"
>
<img
src="../../assets/channel/view.png"
alt=""
/>
</div> </div>
<div <div class="video-pane-close" @click="close('radio')" v-if="!disabled">
class="video-pane-close" <img src="../../assets/channel/dele.png" alt="" />
@click="close('radio')"
v-if="!disabled"
>
<img
src="../../assets/channel/dele.png"
alt=""
/>
</div> </div>
</div> </div>
</div> </div>
...@@ -285,100 +109,43 @@ ...@@ -285,100 +109,43 @@
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
<div <div style="margin-top: 16px" v-show="formObj.goodsSource < 3">
style="margin-top: 16px;"
v-show="formObj.goodsSource != 3"
>
<div class="global-title">物流信息</div> <div class="global-title">物流信息</div>
<div class="container"> <div class="container">
<glsx-combi-form <glsx-combi-form :isInline="false" ref="expressInfoRef" labelWidth="154px" defaultWidth="432px" :formObj.sync="formObj" :formData="expressInfoFormData" :formRules="myRule">
:isInline="false"
ref="expressInfoRef"
labelWidth="154px"
defaultWidth="432px"
:formObj.sync="formObj"
:formData="expressInfoFormData"
:formRules="myRule"
>
<div slot="expressFeeSlot"> <div slot="expressFeeSlot">
<format-input <format-input class="expressFee-class" :disabled="disabled" :intDigit="4" :precise="2" v-model="formObj.expressFee"></format-input>
class="expressFee-class"
:disabled="disabled"
:intDigit="4"
:precise="2"
v-model="formObj.expressFee"
></format-input>
</div> </div>
<div slot="selfSlot"> <div slot="selfSlot">
<div> <div>
<span style="color: #666666;">配送方式:</span> <span style="color: #666666">配送方式:</span>
<span>{{ formObj.deliveryType==1 ? '到店核销' : '快递发货' }}</span> <span>{{ formObj.deliveryType == 1 ? '到店核销' : '快递发货' }}</span>
</div> </div>
<div> <div>
<span style="color: #666666;">运费/元:</span> <span style="color: #666666">运费/元:</span>
<span>{{ formObj.deliveryType==1 ? '--' : (formObj.expressFee || 0) }}</span> <span>{{ formObj.deliveryType == 1 ? '--' : formObj.expressFee || 0 }}</span>
</div> </div>
<div> <div>
<span style="color: #666666;">服务说明:</span> <span style="color: #666666">服务说明:</span>
<span>{{ formObj.introduction || '--' }}</span> <span>{{ formObj.introduction || '--' }}</span>
</div> </div>
</div> </div>
</glsx-combi-form> </glsx-combi-form>
</div> </div>
</div> </div>
<GLFooter style="margin-top: 16px;"> <GLFooter style="margin-top: 16px">
<el-button @click="handleCancel">取消</el-button> <el-button @click="handleCancel">取消</el-button>
<el-button <el-button v-if="!disabled" type="primary" @click="handleSave">确定</el-button>
v-if="!disabled"
type="primary"
@click="handleSave"
>确定</el-button>
</GLFooter> </GLFooter>
<selectGoods <selectGoods v-if="goodsVisible" :routeInfo="routeInfo" :dialogVisible="goodsVisible" :goodsInfo="formObj" @handleGoodsConfirm="handleGoodsConfirm" @handleGoodsClose="handleGoodsClose"></selectGoods>
v-if="goodsVisible" <selectMerchantDialog @confirmDialog="confirmDialog" @closeDialog="closeDialog" :goodsId="formObj.smartcarlifeInfoId" :selectedList="saleMerchantList" v-if="merchantDialogVisible" :isVisible="merchantDialogVisible"></selectMerchantDialog>
: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 <el-dialog class="image-dialog" :visible.sync="dialogVisibleImg" width="50%">
class="image-dialog" <img :src="dialogSrc" width="100%" v-if="dialogType == 'img'" />
:visible.sync="dialogVisibleImg" <video width="100%" autoplay controls :src="dialogSrc" v-else></video>
width="50%"
>
<img
:src="dialogSrc"
width="100%"
v-if="dialogType == 'img'"
/>
<video
width="100%"
autoplay
controls
:src="dialogSrc"
v-else
></video>
</el-dialog> </el-dialog>
<div <div v-if="showPreviewDialog" class="preview-dialog" @click="showPreviewDialog = false">
v-if="showPreviewDialog" <img class="preview-img" src="@/assets/preview.png" alt="" />
class="preview-dialog"
@click="showPreviewDialog = false"
>
<img
class="preview-img"
src="@/assets/preview.png"
alt=""
/>
</div> </div>
</div> </div>
</template> </template>
...@@ -443,7 +210,7 @@ const GasColumns = [ ...@@ -443,7 +210,7 @@ const GasColumns = [
{ {
label: '门店价/元', label: '门店价/元',
addHtml: 'activityPrice', addHtml: 'activityPrice',
minWidth: 100, minWidth: 100
}, },
{ {
label: '是否支持积分兑换', label: '是否支持积分兑换',
...@@ -456,23 +223,56 @@ const GasColumns = [ ...@@ -456,23 +223,56 @@ const GasColumns = [
addHtml: 'exchangeIntegral' 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 [ return [
{ {
label: '配送方式', label: '配送方式',
name: 'deliveryType', name: 'deliveryType',
type: 'radio', type: 'radio',
optionList: [{ optionList: [
confId: 2, {
confName: '快递发货' confId: 2,
}, { confName: '快递发货'
confId: 1, },
confName: '到店核销' {
}], confId: 1,
confName: '到店核销'
}
],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false, isDisabled: false,
handleRadioChange: (e) => { handleRadioChange: e => {
vn.changeMethod(e, true) vn.changeMethod(e, true)
} }
}, },
...@@ -491,14 +291,14 @@ const defaultExpreeColFn = (vn) => { ...@@ -491,14 +291,14 @@ const defaultExpreeColFn = (vn) => {
isDisabled: false, isDisabled: false,
showLimit: true, showLimit: true,
maxlength: 200 maxlength: 200
}, }
] ]
} }
const selfGoodsExpreeCol = [ const selfGoodsExpreeCol = [
{ {
label: '', label: '',
addHtml: 'selfSlot', addHtml: 'selfSlot'
} }
] ]
import glsxCombiForm from '@/components/glsx-combi-form' import glsxCombiForm from '@/components/glsx-combi-form'
...@@ -513,7 +313,7 @@ export default { ...@@ -513,7 +313,7 @@ export default {
selectGoods, selectGoods,
selectMerchantDialog selectMerchantDialog
}, },
data () { data() {
return { return {
showPreviewDialog: false, showPreviewDialog: false,
dialogVisibleImg: false, dialogVisibleImg: false,
...@@ -546,6 +346,12 @@ export default { ...@@ -546,6 +346,12 @@ export default {
isHide: false isHide: false
}, },
{ {
label: '商品名称',
name: 'goodsSkuName',
type: 'showTxt',
isHide: true
},
{
label: '售价(元)', label: '售价(元)',
name: 'retailPrice', name: 'retailPrice',
type: 'showTxt', type: 'showTxt',
...@@ -557,6 +363,30 @@ export default { ...@@ -557,6 +363,30 @@ export default {
type: 'showTxt', type: 'showTxt',
isHide: false 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: [ gasFormData: [
{ {
...@@ -581,7 +411,7 @@ export default { ...@@ -581,7 +411,7 @@ export default {
{ {
label: '销售价/元', label: '销售价/元',
addHtml: 'retailPrice' addHtml: 'retailPrice'
}, }
], ],
expressInfoFormData: defaultExpreeColFn(this), expressInfoFormData: defaultExpreeColFn(this),
formObj: { formObj: {
...@@ -602,7 +432,12 @@ export default { ...@@ -602,7 +432,12 @@ export default {
coverList: [], coverList: [],
associationClassifyFirstId: '', associationClassifyFirstId: '',
introduction: '', introduction: '',
oilCouponFaceValue: '' oilCouponFaceValue: '',
// 云中鹤
goodsSkuName: '',
goodsSkuCode: '',
marketPrice: '',
sellPrice: ''
}, },
saleMerchantList: [], saleMerchantList: [],
myRule: { myRule: {
...@@ -619,63 +454,91 @@ export default { ...@@ -619,63 +454,91 @@ export default {
trigger: 'change' trigger: 'change'
} }
], ],
goodsInfoSlot: [{ goodsInfoSlot: [
required: true, {
validator: (rule, value, callback) => { required: true,
if (!this.formObj.coverList && !this.formObj.coverList[0]) { validator: (rule, value, callback) => {
callback(new Error('请上传商品图')) if (!this.formObj.coverList && !this.formObj.coverList[0]) {
} else if (!this.formObj.goodsName) { callback(new Error('请上传商品图'))
callback(new Error('请输入商品名称')) } else if (!this.formObj.goodsName) {
} else { callback(new Error('请输入商品名称'))
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的兑换积分'))
} else { } else {
callback() 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' }], associationClassifyFirstId: [{ required: true, message: '请选择关联商品分类', trigger: 'change' }],
goodsSource: [{ required: true, message: '请选择来源', trigger: 'change' }], goodsSource: [{ required: true, message: '请选择来源', trigger: 'change' }],
deliveryType: [{ required: true, message: '请选择配送方式', trigger: 'change' }], deliveryType: [{ required: true, message: '请选择配送方式', trigger: 'change' }],
expressFee: [{ required: true, message: '请输入运费', trigger: 'change' }], expressFee: [{ required: true, message: '请输入运费', trigger: 'change' }]
}, },
formData: [ formData: [
{ {
...@@ -703,12 +566,16 @@ export default { ...@@ -703,12 +566,16 @@ export default {
{ {
confId: 3, confId: 3,
confName: '油券' confName: '油券'
},
{
confId: 4,
confName: '云中鹤平台'
} }
], ],
optionId: 'confId', optionId: 'confId',
optionLabel: 'confName', optionLabel: 'confName',
isDisabled: false, isDisabled: false,
handleRadioChange: (e) => { handleRadioChange: e => {
this.changeSource(e, true) this.changeSource(e, true)
} }
}, },
...@@ -772,7 +639,7 @@ export default { ...@@ -772,7 +639,7 @@ export default {
}, },
watch: { watch: {
'formObj.tencentcloudMediaId': { 'formObj.tencentcloudMediaId': {
handler (nVal, oVal) { handler(nVal, oVal) {
const { goodsSource } = this.formObj, const { goodsSource } = this.formObj,
_target = this.formData.find(item => item.name == 'commerceDescribe') _target = this.formData.find(item => item.name == 'commerceDescribe')
_target.isHide = goodsSource == 3 ? true : !nVal _target.isHide = goodsSource == 3 ? true : !nVal
...@@ -780,17 +647,17 @@ export default { ...@@ -780,17 +647,17 @@ export default {
}, },
deep: true deep: true
}, },
'formObj.goodsSource' (n) { 'formObj.goodsSource'(n) {
const hideList = ['propagateCover', 'productVideo', 'tencentcloudMediaId', 'commerceDescribe'] const hideList = ['propagateCover', 'productVideo', 'tencentcloudMediaId', 'commerceDescribe']
this.formData.forEach(e => { 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.deliveryType[0].required = n != 3
this.myRule.expressFee[0].required = n != 3 this.myRule.expressFee[0].required = n != 3
this.$refs.baseInfoRef.$refs.formRef.clearValidate() this.$refs.baseInfoRef.$refs.formRef.clearValidate()
} }
}, },
created () { created() {
this.getCategory() this.getCategory()
this.getVideoList() this.getVideoList()
const urlParam = this.$route.params const urlParam = this.$route.params
...@@ -813,35 +680,46 @@ export default { ...@@ -813,35 +680,46 @@ export default {
} }
}, },
methods: { methods: {
changeIntegralFlagFn (e, item) { changeIntegralFlagFn(e, item) {
if (e != 1) { if (e != 1) {
item.exchangeIntegral = '' item.exchangeIntegral = ''
} }
}, },
changeMethod (e, isClear) { changeMethod(e, isClear) {
const _target = this.expressInfoFormData.find(item => item.name == 'expressFee') const _target = this.expressInfoFormData.find(item => item.name == 'expressFee')
if (_target) { if (_target) {
_target.isHide = e == 1 _target.isHide = e == 1
if (e == 1 && this.formObj.goodsSource == 1) this.formObj.expressFee = '' if (e == 1 && this.formObj.goodsSource == 1) this.formObj.expressFee = ''
} }
}, },
changeSource (e, isClear) { changeSource(e, isClear) {
this.expressInfoFormData = e == 2 ? selfGoodsExpreeCol : defaultExpreeColFn(this) this.expressInfoFormData = e == 2 ? selfGoodsExpreeCol : defaultExpreeColFn(this)
this.goodsFormData.forEach(item => { 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 = { this.selectedtableParams.tableColumns = {
1: defalutMerchantColumns, 1: defalutMerchantColumns,
2: MerchantColumns, 2: MerchantColumns,
3: GasColumns 3: GasColumns,
4: yzhColumns
}[e] }[e]
if (this.routeInfo.type != 1) this.selectedtableParams.tableOption = e == 2 ? null : { if (this.routeInfo.type != 1)
width: 100 this.selectedtableParams.tableOption =
} e == 2
? null
: {
width: 100
}
if (isClear) this.clearDataFn() if (isClear) this.clearDataFn()
}, },
clearDataFn () { clearDataFn() {
this.formObj = { this.formObj = {
...this.formObj, ...this.formObj,
smartcarlifeInfoId: '', //自营和智享的id字段不一致 smartcarlifeInfoId: '', //自营和智享的id字段不一致
...@@ -854,12 +732,16 @@ export default { ...@@ -854,12 +732,16 @@ export default {
goodsType: '2', goodsType: '2',
expressFee: '', expressFee: '',
introduction: '', introduction: '',
oilCouponFaceValue: '' oilCouponFaceValue: '',
goodsSkuName: '',
goodsSkuCode: '',
marketPrice: '',
sellPrice: ''
} }
this.saleMerchantList = [] this.saleMerchantList = []
}, },
// 上传视频 // 上传视频
handleVideoChange (e) { handleVideoChange(e) {
let file = e.srcElement.files[0] let file = e.srcElement.files[0]
var reader = new FileReader() var reader = new FileReader()
// 默认30MB // 默认30MB
...@@ -895,13 +777,13 @@ export default { ...@@ -895,13 +777,13 @@ export default {
} }
}, },
// 预览图文 // 预览图文
handleEnlarge (src, type) { handleEnlarge(src, type) {
this.dialogVisibleImg = true this.dialogVisibleImg = true
this.dialogSrc = src this.dialogSrc = src
this.dialogType = type ? type : 'img' this.dialogType = type ? type : 'img'
}, },
// 删除图片/视频 // 删除图片/视频
close (type, index) { close(type, index) {
switch (type) { switch (type) {
case 'radio': case 'radio':
this.formObj.goodsVideo = '' this.formObj.goodsVideo = ''
...@@ -910,7 +792,7 @@ export default { ...@@ -910,7 +792,7 @@ export default {
this.formObj.goodsVideo = '' this.formObj.goodsVideo = ''
} }
}, },
getCategory () { getCategory() {
const params = { const params = {
pageSize: 10000, pageSize: 10000,
pageNum: 1, pageNum: 1,
...@@ -923,7 +805,7 @@ export default { ...@@ -923,7 +805,7 @@ export default {
} }
}) })
}, },
getVideoList () { getVideoList() {
this.$apis.case.getVideoListApi({ pageSize: 10000, currentPage: 1, status: 1 }).then(res => { this.$apis.case.getVideoListApi({ pageSize: 10000, currentPage: 1, status: 1 }).then(res => {
if (res?.list?.length) { if (res?.list?.length) {
const _target = this.formData.find(item => item.name == 'tencentcloudMediaId') const _target = this.formData.find(item => item.name == 'tencentcloudMediaId')
...@@ -931,7 +813,7 @@ export default { ...@@ -931,7 +813,7 @@ export default {
} }
}) })
}, },
validateField (field) { validateField(field) {
if (Array.isArray(field)) { if (Array.isArray(field)) {
field.forEach(item => { field.forEach(item => {
this.$refs.baseInfoRef.$refs.formRef.validateField(item) this.$refs.baseInfoRef.$refs.formRef.validateField(item)
...@@ -940,39 +822,44 @@ export default { ...@@ -940,39 +822,44 @@ export default {
this.$refs.baseInfoRef.$refs.formRef.validateField(field) this.$refs.baseInfoRef.$refs.formRef.validateField(field)
} }
}, },
openGoodsDialog () { openGoodsDialog() {
if (this.disabled) return if (this.disabled) return
this.goodsVisible = true this.goodsVisible = true
}, },
handleGoodsClose () { handleGoodsClose() {
this.goodsVisible = false this.goodsVisible = false
}, },
handleGoodsConfirm (e) { handleGoodsConfirm(e) {
const { goodsSource } = this.formObj const { goodsSource } = this.formObj
if (this.formObj.smartcarlifeInfoId != e?.id && goodsSource != 3) this.saleMerchantList = [] // 云中鹤:第三方平台商品特殊
let { id, goodsName, goodsImage, minSellPrice, retailPrice, goodsVideo, goodsId } = e || {} if (goodsSource == 4) {
minSellPrice = minSellPrice ? Number(Number(minSellPrice / 100).toFixed(2)) : 0 this.setYzhGoodsInfo(e)
retailPrice = retailPrice ? Number(Number(retailPrice / 100).toFixed(2)) : 0 } 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 if (goodsVideo) this.formObj.goodsVideo = goodsVideo
this.formObj = { this.formObj = {
...this.formObj, ...this.formObj,
smartcarlifeInfoId: this.formObj.goodsSource == 2 ? goodsId : id, //自营和智享的id字段不一致 smartcarlifeInfoId: this.formObj.goodsSource == 2 ? goodsId : id, //自营和智享的id字段不一致
goodsName, goodsName,
goodsImage, goodsImage,
coverList: [goodsImage], coverList: [goodsImage],
minSellPrice, minSellPrice,
retailPrice retailPrice
}
if (this.formObj.goodsSource == 2) {
this.setSelfGoodsInfo(e)
}
if (this.formObj.goodsSource == 3) this.setGasGoodsInfo(e)
this.validateField(['selectBtnSlot', 'goodsInfoSlot'])
} }
this.handleGoodsClose() 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 || {} let { deliveryType, expressFee, goodsVideo, merchantId, merchantName, retailPrice, originalPrice, serviceDesc: introduction } = row || {}
expressFee = expressFee ? Number(Number(expressFee / 100).toFixed(2)) : 0 expressFee = expressFee ? Number(Number(expressFee / 100).toFixed(2)) : 0
this.formObj = { ...this.formObj, deliveryType, expressFee, goodsVideo, introduction } this.formObj = { ...this.formObj, deliveryType, expressFee, goodsVideo, introduction }
...@@ -980,7 +867,7 @@ export default { ...@@ -980,7 +867,7 @@ export default {
originalPrice = originalPrice ? Number(Number(originalPrice / 100).toFixed(2)) : 0 originalPrice = originalPrice ? Number(Number(originalPrice / 100).toFixed(2)) : 0
this.saleMerchantList = [{ merchantId, merchantName, activityPrice: retailPrice, originalPrice, giveIntegral: '' }] this.saleMerchantList = [{ merchantId, merchantName, activityPrice: retailPrice, originalPrice, giveIntegral: '' }]
}, },
setGasGoodsInfo (row) { setGasGoodsInfo(row) {
const salesPrice = row.salesPrice ? NP.divide(row.salesPrice, 100).toFixed(2) : 0 const salesPrice = row.salesPrice ? NP.divide(row.salesPrice, 100).toFixed(2) : 0
this.formObj = { this.formObj = {
...this.formObj, ...this.formObj,
...@@ -994,45 +881,68 @@ export default { ...@@ -994,45 +881,68 @@ export default {
minSellPrice: row.sellPrice 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 const { saleMerchantList } = this
e && e.map(item => { e &&
if (this.formObj.goodsSource != 3) { e.map(item => {
this.$set(item, 'giveIntegral', '') if (this.formObj.goodsSource != 3) {
this.$set(item, 'exchangeIntegralFlag', 0) this.$set(item, 'exchangeIntegralFlag', 0)
this.$set(item, 'exchangeIntegral', '') this.$set(item, 'exchangeIntegral', '')
} else { if (this.formObj.goodsSource == 4) {
this.$set(item, 'activityPrice', 0) this.$set(item, 'activityPrice', item.sellPrice)
this.$set(item, 'exchangeIntegralFlag', 1) } else {
this.$set(item, 'exchangeIntegral', '') this.$set(item, 'giveIntegral', '')
saleMerchantList.map(i => {
if (i.merchantId === item.merchantId) {
item.activityPrice = i.activityPrice
item.exchangeIntegralFlag = i.exchangeIntegralFlag
item.exchangeIntegral = i.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
}
})
}
})
this.saleMerchantList = e || [] this.saleMerchantList = e || []
this.validateField('saleStoreSlot') this.validateField('saleStoreSlot')
this.closeDialog() this.closeDialog()
}, },
closeDialog () { closeDialog() {
const { goodsSource } = this.formObj const { goodsSource } = this.formObj
if (goodsSource != 3 && !this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId) { if (goodsSource != 3 && !this.merchantDialogVisible && !this.formObj.smartcarlifeInfoId) {
return this.$message.error('请先选择商品') return this.$message.error('请先选择商品')
} }
this.merchantDialogVisible = !this.merchantDialogVisible this.merchantDialogVisible = !this.merchantDialogVisible
}, },
handleDel (row) { handleDel(row) {
const { goodsSource } = this.formObj, const { goodsSource } = this.formObj,
KEY = goodsSource == 3 ? 'merchantNo' : 'merchantId', KEY = goodsSource == 3 ? 'merchantNo' : 'merchantId',
idx = this.saleMerchantList.findIndex(item => item[KEY] == row[KEY]) idx = this.saleMerchantList.findIndex(item => item[KEY] == row[KEY])
if (idx > -1) this.saleMerchantList.splice(idx, 1) if (idx > -1) this.saleMerchantList.splice(idx, 1)
this.validateField('saleStoreSlot') this.validateField('saleStoreSlot')
}, },
getParams () { getParams() {
let obj = JSON.parse(JSON.stringify(this.formObj)) let obj = JSON.parse(JSON.stringify(this.formObj))
obj.goodsImage = obj.coverList[0] obj.goodsImage = obj.coverList[0]
obj.styleBImg = obj.styleBImgList[0] || '' obj.styleBImg = obj.styleBImgList[0] || ''
...@@ -1044,7 +954,7 @@ export default { ...@@ -1044,7 +954,7 @@ export default {
delete obj.id // 油券默认带了id delete obj.id // 油券默认带了id
let saleMerchantList = this.saleMerchantList.map(item => { let saleMerchantList = this.saleMerchantList.map(item => {
let { merchantId, merchantName, activityPrice, giveIntegral, originalPrice, exchangeIntegralFlag, exchangeIntegral } = 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 activityPrice = activityPrice ? Number(Number(activityPrice * 10 * 10).toFixed(0)) : 0
originalPrice = originalPrice ? Number(Number(originalPrice * 10 * 10).toFixed(0)) : 0 originalPrice = originalPrice ? Number(Number(originalPrice * 10 * 10).toFixed(0)) : 0
let saleMerchantItem = { merchantId, merchantName, activityPrice, giveIntegral, originalPrice } let saleMerchantItem = { merchantId, merchantName, activityPrice, giveIntegral, originalPrice }
...@@ -1061,7 +971,7 @@ export default { ...@@ -1061,7 +971,7 @@ export default {
if (this.routeInfo.id) params.id = this.routeInfo.id if (this.routeInfo.id) params.id = this.routeInfo.id
return params return params
}, },
handleSave () { handleSave() {
this.$refs.baseInfoRef.$refs.formRef.validate(valid => { this.$refs.baseInfoRef.$refs.formRef.validate(valid => {
this.$refs.expressInfoRef.$refs.formRef.validate(validate => { this.$refs.expressInfoRef.$refs.formRef.validate(validate => {
if (valid && validate) { if (valid && validate) {
...@@ -1076,10 +986,10 @@ export default { ...@@ -1076,10 +986,10 @@ export default {
}) })
}) })
}, },
handleCancel () { handleCancel() {
this.$router.back() this.$router.back()
}, },
getDetail () { getDetail() {
const params = { const params = {
id: this.routeInfo.id id: this.routeInfo.id
} }
...@@ -1104,21 +1014,27 @@ export default { ...@@ -1104,21 +1014,27 @@ export default {
this.formObj.goodsType = '2' //1配置升级, 2车主优选 this.formObj.goodsType = '2' //1配置升级, 2车主优选
this.formObj.coverList = res.goodsImage ? [res.goodsImage] : [] this.formObj.coverList = res.goodsImage ? [res.goodsImage] : []
this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : [] this.formObj.styleBImgList = res.styleBImg ? [res.styleBImg] : []
this.saleMerchantList = res.saleMerchantList?.map(item => { this.formObj.goodsSkuName = res.goodsName
let activityPrice = item.activityPrice ? Number(Number(item.activityPrice / 100).toFixed(2)) : 0 this.formObj.goodsSkuCode = res.goodsSkuCode
let originalPrice = item.originalPrice ? Number(Number(item.originalPrice / 100).toFixed(2)) : 0 this.formObj.marketPrice = res.marketPrice
if (res.goodsSource == 3) item.merchantNo = String(item.merchantId) this.formObj.sellPrice = res.sellPrice
return { ...item, activityPrice, originalPrice } 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] = Math.abs(e[target])
if (!e[target] || e[target] < min) e[target] = min if (!e[target] || e[target] < min) e[target] = min
if (target == 'activityPrice' && e[target] == 0) e.exchangeIntegralFlag = 1 if (target == 'activityPrice' && e[target] == 0) e.exchangeIntegralFlag = 1
}, },
integralSwitch (e, row) { integralSwitch(e, row) {
if (!e && row.activityPrice == 0) { if (!e && row.activityPrice == 0) {
row.exchangeIntegralFlag = 1 row.exchangeIntegralFlag = 1
this.$message.error('当前门店价不能为0') this.$message.error('当前门店价不能为0')
......
<template> <template>
<div class="select-store"> <div class="select-store">
<GLDialog <GLDialog bigTitle="选择商品" mode="big" :visible.sync="dialogVisible" :before-close="handleClose" :close-on-click-modal="false" @onOk="handleConfirm" @onCancel="handleClose">
bigTitle="选择商品" <glsx-combi-form ref="showSearch" labelWidth="105px" :formObj="searchForm" :formData="searchFormData">
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"> <span slot="footer">
<el-button <el-button :size="size" type="primary" @click="resetTable">查询</el-button>
:size="size" <el-button :size="size" v-if="goodsInfo.goodsSource != 1" @click="resetSearch">重置</el-button>
type="primary"
@click="resetTable"
>查询</el-button>
<el-button
:size="size"
v-if="goodsInfo.goodsSource != 1"
@click="resetSearch"
>重置</el-button>
</span> </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> </glsx-combi-form>
<GLTable <GLTable ref="goodsRef" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @refreshTable="getList" :getListApi="getListApi" :pageSizes="pageSizes" :hasNum="false" :setTableFinishFun="setTableFinishFun">
ref="goodsRef" <div slot="radioHtml" class="store-table" slot-scope="scope">
:noDataImg="url" <el-radio :disabled="scope.scope.shelvesStatus == 1002" v-model="curInfo.id" :label="scope.scope.id" @click.native="handleClick(scope.scope)"></el-radio>
: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>
</div> </div>
<div <div slot="selfRadioHtml" class="store-table" slot-scope="scope">
slot="selfRadioHtml" <el-radio v-model="curInfo.goodsId" :label="scope.scope.goodsId" @click.native="handleClick(scope.scope)"></el-radio>
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>
<div <div slot="imageSlot" slot-scope="scope">
slot="imageSlot" <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
slot-scope="scope" <img class="table-popover-img" :src="scope.scope.goodsImage" />
> <img class="img-36 pointer" slot="reference" :src="scope.scope.goodsImage" />
<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> </el-popover>
</div> </div>
<template <template slot="gasImageSlot" slot-scope="scope">
slot="gasImageSlot" <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
slot-scope="scope" <img class="table-popover-img" :src="scope.scope.aliasUrl" />
> <img class="img-36 pointer" slot="reference" :src="scope.scope.aliasUrl" />
<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> </el-popover>
</template> </template>
<div <div slot="goodsNameSlot" class="goodsNameSlot" slot-scope="scope">
slot="goodsNameSlot" <img :src="scope.scope.goodsImage" alt="" />
class="goodsNameSlot" {{ scope.scope.goodsName }}
slot-scope="scope" </div>
> <!-- 云中鹤平台 -->
<img <div slot="yzhImageSlot" slot-scope="scope">
:src="scope.scope.goodsImage" <el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
alt="" <img class="table-popover-img" :src="scope.scope.goodsImgUrl" />
>{{ scope.scope.goodsName }} <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> </div>
</GLTable> </GLTable>
</GLDialog> </GLDialog>
...@@ -122,6 +58,8 @@ ...@@ -122,6 +58,8 @@
<script> <script>
import url from '@/assets/empty.png' import url from '@/assets/empty.png'
import inputNumRange from '@/components/InputNumRange'
import categoryCascader from '@/components/CategoryCascader'
const MERCHANT_SEARCH_ITEM = { const MERCHANT_SEARCH_ITEM = {
label: '门店名称', label: '门店名称',
name: 'merchantName', name: 'merchantName',
...@@ -130,6 +68,52 @@ const MERCHANT_SEARCH_ITEM = { ...@@ -130,6 +68,52 @@ const MERCHANT_SEARCH_ITEM = {
labelWidth: '10px', labelWidth: '10px',
isClear: true 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 = [ const defaultTableCol = [
{ {
label: '', label: '',
...@@ -219,17 +203,60 @@ const gasGoodsTableCol = [ ...@@ -219,17 +203,60 @@ const gasGoodsTableCol = [
formatter: cellValue => { formatter: cellValue => {
return cellValue.stock - cellValue.usedStock 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 { export default {
name: 'selectStore', name: 'selectStore',
data () { data() {
return { return {
url: url, url: url,
searchForm: { searchForm: {
goodsName: '', goodsName: '',
discoverGoodsId: '', discoverGoodsId: '',
goodsType: '' goodsType: '',
shelvesStatus: ''
}, },
total: 0, total: 0,
storeList: [], storeList: [],
...@@ -258,7 +285,24 @@ export default { ...@@ -258,7 +285,24 @@ export default {
}, },
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
pageSizes: [5, 10, 20, 30, 40], 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: { props: {
...@@ -268,17 +312,21 @@ export default { ...@@ -268,17 +312,21 @@ export default {
}, },
routeInfo: { routeInfo: {
type: Object, type: Object,
default: () => { } default: () => {}
}, },
storeSearchForm: { storeSearchForm: {
type: Object type: Object
}, },
goodsInfo: { goodsInfo: {
required: true, required: true,
default: () => { } default: () => {}
} }
}, },
created () { components: {
inputNumRange,
categoryCascader
},
created() {
// let { smartcarlifeInfoId, goodsName, coverList, goodsImage, minSellPrice, retailPrice } = this.goodsInfo || {} // let { smartcarlifeInfoId, goodsName, coverList, goodsImage, minSellPrice, retailPrice } = this.goodsInfo || {}
// this.curInfo = { // this.curInfo = {
// id: smartcarlifeInfoId, // id: smartcarlifeInfoId,
...@@ -288,65 +336,100 @@ export default { ...@@ -288,65 +336,100 @@ export default {
// retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0, // retailPrice: retailPrice ? Number(Number(retailPrice*10*10).toFixed(0)) : 0,
// } // }
const { goodsSource } = this.goodsInfo const { goodsSource } = this.goodsInfo
this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' //1查看,2编辑,空是新增,编辑进来要传id this.searchForm.discoverGoodsId = this.routeInfo.type == 2 ? this.routeInfo.id : '' //1查看,2编辑,空是新增,编辑进来要传id
this.searchForm.goodsType = this.routeInfo.goodsType // 1是配置 2是车主 this.searchForm.goodsType = this.routeInfo.goodsType // 1是配置 2是车主
if (goodsSource == 2) { //来源是门店自营的搜素和列表字段都要改 if (goodsSource == 2) {
//来源是门店自营的搜素和列表字段都要改
this.searchFormData.push(MERCHANT_SEARCH_ITEM) this.searchFormData.push(MERCHANT_SEARCH_ITEM)
} else if (goodsSource == 4) {
this.searchFormData = [...YZH_SERACH_ITEM]
} }
this.tableParams.tableColumns = { this.tableParams.tableColumns = {
1: defaultTableCol, 1: defaultTableCol,
2: merchantGoodsTableCol, 2: merchantGoodsTableCol,
3: gasGoodsTableCol 3: gasGoodsTableCol,
4: yzhGoodsTableCol
}[goodsSource] }[goodsSource]
this.getListApi = this.$apis.goods[{ this.getListApi =
1: 'getCarlifeGoodsApi', this.$apis.goods[
2: 'getSelfSupportGoodsApi', {
3: 'getOilCouponListApi' 1: 'getCarlifeGoodsApi',
}[goodsSource]] 2: 'getSelfSupportGoodsApi',
3: 'getOilCouponListApi',
4: 'getYzgGoodsListApi'
}[goodsSource]
]
}, },
mounted () { mounted() {
let clientHeight = document.documentElement.clientHeight let clientHeight = document.documentElement.clientHeight
this.heightBox = clientHeight - 0.15 * clientHeight - 425 this.heightBox = clientHeight - 0.15 * clientHeight - 425
}, },
methods: { methods: {
resetTable () { resetTable() {
this.$refs.goodsRef.refreshTable() this.$refs.goodsRef.refreshTable()
}, },
resetSearch () { resetSearch() {
this.searchForm = { this.searchForm = {
goodsName: '', goodsName: '',
discoverGoodsId: '', discoverGoodsId: '',
goodsType: '' goodsType: '',
shelvesStatus: ''
}
this.yzhSearchForm = {
categoryCode: [],
startSellPrice: '',
endSellPrice: '',
startDiffPrice: '',
endDiffPrice: ''
} }
this.resetTable() this.resetTable()
}, },
beforeSearchFn () { beforeSearchFn() {
return new Promise(resolve => { return new Promise(resolve => {
const {goodsSource} = this.goodsInfo const { goodsSource } = this.goodsInfo
if (goodsSource == 2) { if (goodsSource == 2) {
delete this.searchForm.goodsType 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() resolve()
}) })
}, },
setTableFinishFun () { setTableFinishFun() {
this.$refs.goodsRef.tableHeightValues = '460px' this.$refs.goodsRef.tableHeightValues = '460px'
}, },
handleClick (item) { handleClick(item) {
console.log(item) console.log(item)
this.curInfo = item this.curInfo = item
}, },
handleClose () { handleClose() {
this.$emit('handleGoodsClose') this.$emit('handleGoodsClose')
}, },
handleConfirm () { handleConfirm() {
if (Object.keys(this.curInfo).length) this.$emit('handleGoodsConfirm', this.curInfo) 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 { ...@@ -422,4 +505,19 @@ export default {
display: none; 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> </style>
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
}, },
] ]
}, },
isOil: this.$parent.formObj.goodsSource == 3 isOil: this.$parent.formObj.goodsSource == 3 || this.$parent.formObj.goodsSource == 4
} }
}, },
created () { created () {
...@@ -161,6 +161,10 @@ export default { ...@@ -161,6 +161,10 @@ export default {
// } // }
list.map(item => this.$set(item, 'activityPrice', '')) list.map(item => this.$set(item, 'activityPrice', ''))
list.map(item => this.$set(item, 'originalPrice', '')) 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]) this.$emit('confirmDialog', [...list, ...this.copyList])
}, },
handleClose () { handleClose () {
......
...@@ -341,6 +341,10 @@ export default { ...@@ -341,6 +341,10 @@ export default {
id: 3, id: 3,
name: '油券' name: '油券'
}, },
{
id: 4,
name: '云中鹤平台'
},
], ],
optionId: 'id', optionId: 'id',
optionLabel: 'name' optionLabel: 'name'
...@@ -366,7 +370,8 @@ export default { ...@@ -366,7 +370,8 @@ export default {
return { return {
1: '嘀加智享平台', 1: '嘀加智享平台',
2: '门店自营', 2: '门店自营',
3: '油券' 3: '油券',
4: '云中鹤平台'
}[cellValue.goodsSource] }[cellValue.goodsSource]
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!