Commit 9e9a4bc2 by 前端

Merge branch 'chenwq_dev_v2.1.0' into 'v2.1.0'

Chenwq dev v2.1.0 to v2.1.0

See merge request !119
2 parents 1c8a7ba0 e20d8c13
......@@ -168,9 +168,29 @@ html {
border: 0;
}
.marketing .table-show-img {
width: 160px;
height: 160px;
.table-popover-block {
position: relative;
height: 160px !important;
overflow: hidden;
border-width: 0 !important;
padding: 0 !important;
margin-bottom: 10px !important;
}
.table-popover-block.el-popper .popper__arrow {
display: none !important;
}
.table-popover-img {
width: 100%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.marketing .pointer {
cursor: pointer;
}
.marketing .img-w-100 {
......
......@@ -17,7 +17,7 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
......@@ -48,16 +48,16 @@
</template> -->
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :disabled="subItem.isDisabled" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
</el-radio-group>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<el-date-picker v-else-if="item.type === 'datePicker'" v-model="formObj[item.name]" v-bind="item.attrs ? item.attrs : {}" v-on="item.listeners ? item.listeners : {}" :type="item.dateType || 'daterange'" :disabled="item.isDisabled" :value-format="item.valueFormat" :style="{ width: item.width || defaultWidth }" :clearable="item.isClear || false" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="item.customPickerOptions || pickerOption[item.pickerOptions]"></el-date-picker>
<template v-else-if="item.type === 'upload'">
<p class="photo-top-tips">{{ item.topTips }}</p>
<div v-if="!item.isDisabled" :style="{ width: item.width || defaultWidth }">
......@@ -161,7 +161,7 @@ export default {
},
formObj: {
type: Object,
default: () => {}
default: () => { }
},
hasTitle: {
type: Boolean,
......@@ -169,16 +169,16 @@ export default {
},
formRules: {
type: Object,
default: () => {}
default: () => { }
},
// 搜索+输入框/搜索组合组件,搜索栏绑值
searchSelectObj: {
type: Object,
default: () => {}
default: () => { }
}
},
mounted() {},
mounted() { },
methods: {
// 选择框-添加其他属性
......
......@@ -76,6 +76,32 @@ const staticRoutes = Object.freeze([
component: resolve => require([`@/views/productStore/editProductDh.vue`], resolve),
meta: {}
},
// 广汇-删
{
name: 'productGroupGH',
path: '/productGroupGH/index',
component: resolve => require([`@/views/productGroupGH/index.vue`], resolve),
meta: {}
},
{
name: 'editProductGH',
path: '/productGroupGH/editProduct',
component: resolve => require([`@/views/productGroupGH/editProduct.vue`], resolve),
meta: {}
},
{
name: 'productStoreGH',
path: '/productStoreGH/index',
component: resolve => require([`@/views/productStoreGH/index.vue`], resolve),
meta: {}
},
{
name: 'editProductDhGH',
path: '/productStoreGH/editProductDh',
component: resolve => require([`@/views/productStoreGH/editProductDh.vue`], resolve),
meta: {}
},
// 广汇-删
{
name: 'couponManage',
path: '/couponManage/index',
......
......@@ -17,10 +17,16 @@
<!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="logoUrl" class="table-image" slot-scope="scope">
<img class="img-60" :src="scope.scope.logoUrl" />
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.logoUrl" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.logoUrl" />
</el-popover>
</div>
<div slot="showImageUrl" class="table-image" slot-scope="scope">
<img class="img-60" :src="scope.scope.showImageUrl" />
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.showImageUrl" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.showImageUrl" />
</el-popover>
</div>
<!-- <div class="table-btns" slot="auth-button" slot-scope="scope">
<GLButton type="text" fn="编辑" @click="handleEdit(2, scope.scope)">编辑</GLButton>
......
......@@ -649,6 +649,7 @@ export default {
name: 'erpMaterialNo',
type: 'input',
width: '320px',
maxlength: 20,
isHide: true,
isDisabled: false
},
......@@ -657,6 +658,7 @@ export default {
name: 'serviceCode',
type: 'input',
width: '320px',
maxlength: 20,
isHide: true,
isDisabled: false
},
......
......@@ -18,7 +18,10 @@
<!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="goodsImage" class="table-image" slot-scope="scope">
<img class="img-60" :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-60 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleUpOrDown(scope.scope)">{{ scope.scope.goodsStatus ? '下架' : '上架' }}</el-button>
......@@ -333,10 +336,10 @@ export default {
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
let stockeList = item.specificationDetailList.sort(function (a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
......
<!-- 查看产品 - 评价信息 -->
<template>
<div class="comment-detail container edit-container">
<div style="padding: 20px">
<!-- 表格区域 开始 -->
<GLTable ref="commentRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :beforeSearchFn="beforeSearchFn" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="starLevel" slot-scope="scope">
<img v-for="(item, index) in scope.scope.starLevel" :key="index" class="icon-star" src="@/assets/icon-star.png" />
</div>
<div slot="goodsImage" class="table-image" slot-scope="scope">
<span v-if="!scope.scope.imgUrls">-</span>
<img v-else class="img-60" :src="scope.scope.imgUrls[0]" @click="handleImgLook(scope.scope.imgUrls)" />
</div>
</GLTable>
<el-dialog v-if="isImgVisible" title="查看" :visible.sync="isImgVisible" :close-on-click-modal="false">
<div class="dialog-look">
<span v-for="(item, index) in dialogObj.imgUrls" :key="index">
<el-image style="width: 200px; height: 200px; margin-right: 10px" :src="item" :preview-src-list="[item]"></el-image>
</span>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import url from '@/assets/empty.png'
export default {
name: 'commentDetail',
data() {
return {
size: 'small',
url: url,
searchForm: {
goodsId: ''
},
isImgVisible: false,
// imgUrls: [],,
dialogObj: {
imgUrls: [],
uploadType: 'img'
},
// 表格
getListApi: this.$apis.proManage.getGoodsCommentListApi,
tableParams: {
listName: 'list',
tableColumns: [
{
label: '评价用户名称',
prop: 'customerName'
},
{
label: '评价时间',
prop: 'createdDateStr'
},
{
label: '评价星级',
prop: 'starLevel',
addHtml: 'starLevel'
},
{
label: '评价内容',
prop: 'commentContent',
line: 3
},
{
label: '图片',
prop: 'goodsImage',
addHtml: 'goodsImage'
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'currentPage', totalCount: 'total' }
}
},
props: {
goodsId: {
type: Object,
default: () => {}
}
},
methods: {
beforeSearchFn() {
return new Promise(resolve => {
this.searchForm.goodsId = this.goodsId
resolve()
})
},
setTableFinishFun() {
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
},
handleImgLook(imgUrls) {
this.isImgVisible = !this.isImgVisible
this.dialogObj = {
imgUrls: imgUrls,
uploadType: 'img'
}
}
}
}
</script>
<style></style>
<!-- 分享弹窗 -->
<template>
<glsx-dialog title="分享" width="806px" :noCancel="true" btnOkLabel="关闭" :isVisible="isShareVisible" @closeDialog="handleShareClose" @confirmDialog="handleShareClose">
<div class="share-dialog">
<div class="flex">
<div class="flex box poster">
<div>
<p class="share-txt">海报</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary" @click="handleSaveImg(shareForm.posterUrl)">保存图片</el-button>
</div>
<img :src="shareForm.posterUrl" />
</div>
<div class="flex box poster">
<div>
<p class="share-txt">小程序码</p>
<!-- <p>小程序码不带参数</p> -->
<el-button :size="size" type="primary" @click="handleSaveImg(shareForm.qrCodeUrl)">保存图片</el-button>
</div>
<img style="width: 180px; height: 180px" :src="shareForm.qrCodeUrl" />
</div>
</div>
<div class="box page-route">
<div>
<p class="route-txt">短链</p>
<div class="flex">
<p style="width: 426px;">{{ shareForm.linkUrl }}</p>
<el-button :size="size" type="primary" @click="handleSaveTxt(shareForm.linkUrl)">复制链接</el-button>
<!-- <p>链接是直播间原始页面路径,如需加入参数,详见使用方法</p> -->
</div>
</div>
</div>
</div>
</glsx-dialog>
</template>
<script>
export default {
name: 'share',
data() {
return {}
},
props: {
isShareVisible: {
type: Boolean,
default: false
},
shareForm: {
type: Object,
default: () => {}
}
},
mounted() {},
methods: {
handleSaveImg(url) {
var alink = document.createElement('a')
alink.href = url
alink.setAttribute('target', '_blank')
alink.download = '海报'
alink.click()
alink.remove()
},
handleSaveTxt(txt) {
this.$message({
message: '复制成功',
type: 'success',
customClass: 'message-Z-zinde'
})
const input = document.createElement('input')
document.body.appendChild(input)
input.setAttribute('value', txt)
input.select()
document.execCommand('Copy')
document.body.removeChild(input)
},
handleShareClose() {
this.$emit('handleShareClose')
}
}
}
</script>
<style scoped>
.share-dialog .box {
background: #f7f7f7;
border-radius: 6px;
padding: 30px;
}
.share-dialog .poster img {
width: 180px;
height: 297px;
margin-left: 45px;
}
.share-dialog .page-route {
margin-top: 16px;
}
.share-dialog .page-route .route-txt {
font-weight: bold;
padding-bottom: 10px;
}
.share-dialog .share-txt {
font-weight: bold;
margin-bottom: 50px;
}
</style>
<!-- 编辑商品 -->
<template>
<div class="edit-pro marketing p-t-20 edit-box">
<el-tabs v-if="routeInfo.addOrEdit != '1'" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="基本信息" name="basicInfo"></el-tab-pane>
<el-tab-pane label="评价信息" name="afterOrder"></el-tab-pane>
</el-tabs>
<div v-show="routeInfo.addOrEdit == '1' || (['2', '3'].includes(routeInfo.addOrEdit + '') && activeName == 'basicInfo')" class="container edit-container">
<div class="flex">
<div class="home-set-form flex-grow">
<div v-for="(item, index) in externalFormList" :key="index">
<p class="edit-title">{{ item.title }}</p>
<glsx-combi-form class="edit-form-container m-b-60" ref="editFormRef" :labelWidth="labelWidth" :isEdit="isEdit" defaultWidth="320px" :isBlock="true" :formRef="item.editChildRef" :formObj="editForm" :formData="item.editFormData" :formRules="item.editRule" @handleImgDelete="handleFormImgDelete">
<template slot="businessType" slot-scope="scope">
<el-checkbox-group v-model="editForm.businessType">
<el-checkbox :disabled="routeInfo.addOrEdit == 3" v-for="value in scope.scope.businessTypeList" :key="value.businessType" :label="value.businessType">{{ value.businessTypeName }}</el-checkbox>
</el-checkbox-group>
</template>
<template slot="describeBtn">
<el-button :disabled="isDisabled" type="default" @click="handleDescribeImgAdd">+添加图片</el-button>
<span class="edit-tips m-l-20">最多可添加10张图片</span>
</template>
<template slot="goodsImage">
<p class="edit-tips">作为商品列表展示</p>
<p class="edit-tips">建议图片分辨率400*400</p>
</template>
<template slot="goodsDetailImageList">
<p class="edit-tips">作为商品详情页顶部展示</p>
<p class="edit-tips">建议图片分辨率800*800</p>
</template>
<template slot="goodsVideo">
<p class="edit-tips">作为商品详情页顶部展示</p>
<p class="edit-tips">格式建议mp4,大小不超过50M</p>
</template>
<div :style="{ 'margin-left': labelWidth }" slot="descImgs" slot-scope="scope">
<div v-for="(subItem, subIndex) in editForm[scope.scope.name]" :key="subIndex" class="flex">
<!-- 上传图片 -->
<div class="banner-upload-box">
<div class="p-t-12">
<div class="flex">
<div v-show="!subItem.content" class="activity-img img-w-h" style="margin-bottom: 11px;">
<div class="add">+</div>
<span class="number">上传</span>
<input type="file" style="opacity: 0;" ref="file" class="activity-img img-w-h" accept="image/png, image/jpeg, image/gif, image/jpg" @change="e => handleImgChange(e, subIndex)" />
</div>
<div v-show="!subItem.content">
<el-button type="text" class="el-icon-delete" @click="handleEmptyDelete(subIndex)"></el-button>
</div>
</div>
<span v-show="subItem.content" class="muti-imgs">
<img class="img-w-h" :src="subItem.content" />
<span class="img-btns">
<span class="btn-item">
<i v-if="!isDisabled" class="el-icon-delete" @click="handleImgDelete(scope.scope.name, subIndex)"></i>
<i class="el-icon-zoom-in" @click="handleImgLook(subItem.content)"></i>
</span>
</span>
</span>
</div>
<p class="edit-tips">支持上传20MB以内的jpg,png,jpeg图片</p>
</div>
</div>
</div>
<template slot="association">
<el-button type="default" :disabled="specificationDetailList.length" @click="dialogTableVisible = true" v-if="routeInfo.addOrEdit !== 3">+选择</el-button>
<glsx-dialog title="选择优惠券" :isVisible.sync="dialogTableVisible" width="50%" @confirmDialog="associationConfirm" @closeDialog="associationCancel">
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
<!-- <GLButton class="default-blue-btn" style="float: right; margin-bottom: 10px;" :size="size" fn="创建优惠券" @click="handleJumpCoupon">创建优惠券</GLButton> -->
<el-button class="default-blue-btn" style="float: right; margin-bottom: 10px;" :size="size" @click="handleJumpCoupon">创建优惠券</el-button>
<GLTable ref="coupon" :hasNum="false" :getListApi="getListApi" :searchForm="searchForm" :tableParams="associationTableParams" :pageConf="pageConf" @setTableFinishFun="setTableFinishFun">
<div slot="association" slot-scope="scope" class="association">
<el-radio :label="scope.scope.id" v-model="associationRadio" @change.native="getCouponInfo()"></el-radio>
</div>
</GLTable>
<!-- 表格区域 end -->
<!-- <div class="associationBtn">
<el-button type="primary" @click="associationConfirm">确定</el-button>
<el-button type="default" @click="associationCancel">取消</el-button>
</div> -->
</glsx-dialog>
<div class="association-X" v-if="editForm.relatedCouponId">
<div class="associationRow">
<span class="associationLists">名称</span>
<span class="associationLists">优惠卷类型</span>
<span class="associationLists">库存</span>
<span class="associationLists" v-if="routeInfo.addOrEdit !== 3">操作</span>
</div>
<div class="associationRow" style="background:white;">
<el-tooltip effect="dark" :content="editForm.relatedCouponName" placement="bottom">
<span class="associationLists-X">{{ editForm.relatedCouponName }}</span>
</el-tooltip>
<span class="associationLists-X">{{ editForm.relatedDiscountType }}</span>
<span class="associationLists-X">{{ editForm.residueAmount || '-' }}</span>
<span class="associationLists" v-if="routeInfo.addOrEdit !== 3">
<el-button type="text" @click="del()">删除</el-button>
</span>
</div>
</div>
</template>
<template slot="proSpecsBtn">
<el-button :disabled="editForm.relatedCouponId || isDisabled" type="default" @click="handleSpecsEdit(1)">+添加规格项目</el-button>
</template>
<div slot="proSpecs" :style="{ 'margin-left': labelWidth }">
<div class="sepce-box" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">
<div>
<span class="specs-title">规格名:</span>
<span class="specs-item">{{ subItem.specificationName }}</span>
<div style="position: absolute; right: 10px; top: 10px;">
<el-button v-show="!isDisabled" type="text" @click="handleSpecsEdit(2, subItem, subIndex)">编辑</el-button>
<el-button v-show="!isDisabled" type="text" @click="handleSpecsDelete(subIndex)">删除</el-button>
</div>
</div>
<div class="flex">
<span style="width: 56px;">规格值:</span>
<div style="width: calc(100% - 56px);">
<div>
<span class="specs-item" v-for="(n, idx) in subItem.specificationValueList" :key="idx">{{ n.specificationValue }}</span>
</div>
</div>
</div>
</div>
</div>
<div slot="specsDetail" class="flex">
<span class="spesc-label" :style="{ width: labelWidth }">规格明细:</span>
<div :style="{ width: `calc(100% - ${labelWidth} )` }">
<table class="table-spesc">
<tbody>
<tr style="padding: 17px 0; background: #F4F6FC; box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);">
<td :style="{ width: specsWidth }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth }">零售价(元)</td>
<td :style="{ width: specsWidth }">库存(件)</td>
</tr>
</tbody>
</table>
<div style="max-height: 400px; overflow: scroll;">
<table class="table-spesc">
<tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235); height: 54px; line-height: 54px;" v-for="(subItem, subIndex) in nameToValSpecsList" :key="subIndex">
<td :style="{ width: specsWidth }" v-for="(n, idx) in subItem.specsValueList" :key="idx" :title="n">{{ n }}</td>
<td :style="{ width: specsWidth }">
<div v-if="routeInfo.groupOrStore == 1 && editForm.takeType == '1'">
<el-input :disabled="isDisabled" :class="{ 'border-red': (!(subItem.retailPrice + '') || +editForm.supplyPrice > +subItem.retailPrice) && submitted }" placeholder="零售价" v-model="subItem.retailPrice" @input.native="e => handleRetailPriceInput(e, subIndex)" @blur="handleRetailPriceBlur">
<el-popover v-show="(!(subItem.retailPrice + '') || +editForm.supplyPrice > +subItem.retailPrice) && submitted" slot="suffix" placement="top" title width="90" trigger="hover" :content="!(subItem.retailPrice + '') ? '零售价是必填项' : '零售价要大于供货价'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</div>
<el-input :disabled="isDisabled" v-else placeholder="零售价" v-model="subItem.retailPrice" @input.native="e => handleRetailPriceInput(e, subIndex)" @blur="handleRetailPriceBlur"></el-input>
</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" placeholder="库存" v-model="subItem.stock" :class="{ 'border-red': !(subItem.stock + '') && submitted }" @input.native="e => handleStockInput(e, subIndex)">
<el-popover v-show="!(subItem.stock + '') && submitted" slot="suffix" placement="top" title width="90" trigger="hover" content="库存是必填项">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<template slot="retailPrice">
<p class="edit-tips">作为商品商城售卖的价格</p>
</template>
<template slot="originalPrice">
<p class="edit-tips">作为商品划线展示的价格</p>
</template>
<!-- <template slot="supplyPrice">
<p class="edit-tips">作为货源供给门店的价格</p>
</template> -->
<template slot="memberPrice">
<p class="edit-tips">作为会员商城购买的价格</p>
</template>
<template slot="takeType" slot-scope="scope">
<el-radio-group :disabled="isDisabled" v-model="editForm[scope.scope.name]" @change="handleTakeTypeChange">
<div v-for="(n, idx) in baseData.takeTypeList" :key="idx">
<el-radio :label="n.confId" class="take-good-mode-block">
<div>
<span class="mode-radio">{{ n.confName }}</span>
<span class="mode-radio radio-tip-txt" @click.stop.prevent="e => handleCancelBubble(e)">{{ scope.scope.tipObj[n.confId] }}</span>
</div>
<el-form-item v-show="n.confId == '0'" prop="takeFee" label="分润比例:">
<el-input v-model="editForm.takeFee" :disabled="isDisabled || editForm[scope.scope.name] != '0'" placeholder="请输入分润比例"><span slot="append">%</span></el-input>
<p class="edit-tips">此商品由门店帮卖货后获得的分成比例</p>
</el-form-item>
<el-form-item v-show="n.confId == '1'" prop="supplyPrice" label="供货价:">
<el-input v-model="editForm.supplyPrice" :disabled="isDisabled || editForm[scope.scope.name] != '1'" placeholder="请输入供货价"><span slot="append">元</span></el-input>
<p class="edit-tips">作为货源供给门店的价格</p>
</el-form-item>
</el-radio>
</div>
</el-radio-group>
</template>
<div slot="selectMerchant" slot-scope="scope" class="select-merchant">
<div>
<el-radio-group v-model="editForm.takeAllMerchant" :disabled="isDisabled">
<el-radio :label="'1'">全部门店</el-radio>
<el-radio :label="'0'">指定门店</el-radio>
</el-radio-group>
</div>
<el-button :disabled="isDisabled" v-show="editForm.takeAllMerchant == '0'" type="default" @click="handleRelateStoreClose(scope)">{{ editForm.supplyMerchantList.length ? '更换门店' : '+选择门店' }}</el-button>
</div>
<div slot="merchantTable" class="select-merchant" v-show="editForm.takeAllMerchant == '0'" :style="{ 'margin-left': labelWidth, width: `calc(100% - ${labelWidth} - 10px )` }">
<GLTable v-show="editForm.supplyMerchantList.length" ref="merchantTableRef" :tableParams="tableParams" :tableData="editForm.supplyMerchantList">
<span slot="auth-button" slot-scope="scope">
<el-button :disabled="isDisabled" type="text" @click="handleMerchantDelete(scope)">删除</el-button>
</span>
</GLTable>
</div>
</glsx-combi-form>
</div>
</div>
<div class="wechat-container m-r-20" style="margin-top: 59px;">
<div class="wechat-box">
<img class="w-100-per" src="@/assets/phone.png" />
<div class="wechant-back">
<div class="wechat-inner-box">
<div class="wechant-banner-img img-w-h">
<img v-if="!wechatImgList.length" class="inner-img" src="@/assets/product-default.png" />
<el-carousel v-else height="250px">
<el-carousel-item v-for="item in wechatImgList" :key="item">
<video v-if="item.resType == 3" class="inner-img" :src="item.content"></video>
<img class="inner-img" :src="item.content" />
</el-carousel-item>
</el-carousel>
<div>
<div class="inner-block" style="margin-bottom: 4px;">
<span v-show="!specificationDetailList.length">
<span class="price">¥{{ editForm.retailPrice }}</span>
</span>
<span v-show="specificationDetailList.length">
<span class="price">¥{{ minRetailPrice }}</span>
<span v-show="specificationDetailList.length > 1">起</span>
</span>
<span class="old" v-show="editForm.originalPrice">¥{{ editForm.originalPrice }}</span>
<p class="good-name one-line-ellipsis">{{ editForm.goodsName }}</p>
<p>
<span class="txt-tips">剩余:</span>
<span class="txt-tips" style="margin-left: 20px;">销售:0</span>
</p>
</div>
<div class="inner-block" style="margin-bottom: 8px;">
<div class="line" v-if="nameToValSpecsList.length">
<span class="line-label">已选</span>
<span class="line-txt">{{ nameToValSpecsList[0].specificationData }}</span>
</div>
<div class="line" style="display: flex;">
<span class="line-label">配送</span>
<div>
<div style="height: 25px; line-height: 30px;" class="line-txt">填写地址</div>
<div style="height: 25px; line-height: 18px;" class="line-txt">支付后,预计48小时内发货</div>
</div>
</div>
<div class="line">
<span class="line-label">运费</span>
<span v-show="editForm.deliveryType == 1" class="line-txt">免运费</span>
<span v-show="editForm.deliveryType == 2" class="line-txt">{{ editForm.expressFee }}元</span>
</div>
</div>
<div class="inner-block" style="margin-bottom: 0;">
<div style="word-wrap: break-word;padding-bottom: 8px;">{{ editForm.describeTxt }}</div>
<div v-for="(item, index) in editForm.descImgList" :key="index">
<img class="inner-img" v-show="item.content" :src="item.content" />
</div>
</div>
</div>
</div>
</div>
<img class="wechat-footer" src="@/assets/product-footer.png" />
</div>
</div>
</div>
</div>
</div>
<comment-detail v-show="['2', '3'].includes(routeInfo.addOrEdit + '') && activeName == 'afterOrder'" :goodsId="routeInfo.id"></comment-detail>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button v-if="routeInfo.addOrEdit == '1' || (routeInfo.addOrEdit == '2' && activeName == 'basicInfo')" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
<el-dialog :visible.sync="isImgVisible">
<img class="dialog-img" width="100%" :src="dialogImageUrl" alt />
</el-dialog>
<glsx-dialog title="规格" :isVisible.sync="isSpescVisible" width="70%" @confirmDialog="handleSpescConfirm" @closeDialog="handleSpescClose">
<el-form label-width="120px" :model="spescEditForm" :rules="spescRules" ref="spescRef">
<el-form-item label="规格名:" prop="specificationName">
<el-input class="w-320" :size="size" maxlength="30" v-model="spescEditForm.specificationName" placeholder="请输入规格名"></el-input>
</el-form-item>
<el-form-item label="规格值:" prop="specificationValueList">
<el-tag style="margin-right: 10px;" v-for="(tag, i) in spescEditForm.specificationValueList" :key="i" closable :type="tag.type" @close="handleSpescDelete(tag)">{{ tag.specificationValue }}</el-tag>
<el-input class="input-new-tag" v-if="specsInputVisible" v-model="spescInputVal" ref="saveSpescInput" maxlength="30" :size="size" @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm"></el-input>
<el-button v-else class="button-new-tag" size="small" @click="showInput">+ 规格值</el-button>
</el-form-item>
</el-form>
</glsx-dialog>
<relate-store-dialog v-if="relateStoreVisible" ref="relateStore" :relateStoreVisible="relateStoreVisible" :storeApi="storeApi" :storeSearchForm="storeSearchForm" :storeSelected="selectedList" :hasPage="true" @handleRelateStoreConfirm="handleRelateStoreConfirm" @handleRelateStoreClose="handleRelateStoreClose">
<el-row slot>
<el-form :model="storeSearchForm" ref="relate" :inline="true" label-width="90px">
<el-form-item label="商户ID:" prop="merchantId">
<el-input :size="size" v-model.trim="storeSearchForm.merchantId" placeholder="请输入商户ID" clearable></el-input>
</el-form-item>
<el-form-item label="门店名称:" prop="merchantName">
<el-input :size="size" v-model.trim="storeSearchForm.merchantName" placeholder="请输入门店名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button :size="size" type="primary" @click="handleSearchStore">搜索</el-button>
</el-form-item>
</el-form>
</el-row>
</relate-store-dialog>
</div>
</template>
<script>
import { limitPrice } from '@/common/constant'
import commentDetail from './components/commentDetail'
export default {
name: 'editProduct',
data() {
return {
dialogTableVisible: false,
associationRadio: '',
templateSelection: [],
associationList: [],
relatedDiscountType: '',
// 关联优惠券表格
searchForm: {
couponName: '',
directionalFlag: 3,
status: 2,
unUsed: 1,
discountTypes: [2, 3, 4]
},
// 搜索
searchFormData: [
{
label: '名称',
name: 'couponName',
type: 'input',
maxlength: 20
}
],
getListApi: this.$apis.couponManage.getMerchantListApi,
associationTableParams: {
listName: 'list',
tableOption: false,
tableColumns: [
{
prop: 'association',
addHtml: 'association',
width: '100'
},
{
label: '序号',
prop: 'num',
width: '100'
},
{
label: '名称',
prop: 'couponName',
line: 2
},
{
label: '优惠券类型',
prop: 'discountType',
formatter: cellValue => {
return this.associationBaseData.discountTypeList.find(item => item.confId == cellValue.discountType).confName
}
},
{
label: '库存',
prop: 'residueAmount'
// formatter: cellValue => {
// var useChannel = '-'
// if (cellValue.useChannel) {
// useChannel = this.associationBaseData.useChannelList.find(item => item.confId == cellValue.useChannel).confName
// }
// return useChannel
// }
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
associationBaseData: {
// 1:满减券,2:折扣券,3:代金券,4:实物券 5:购车代金券 6:商品折扣券,7:会员服务
discountTypeList: [
{
confId: '2',
confName: '折扣券'
},
{
confId: '3',
confName: '代金券'
},
{
confId: '4',
confName: '兑换券'
}
],
useChannelList: [
{
confId: '1',
confName: '线上商品'
},
{
confId: '2',
confName: '到店核销'
}
]
},
size: 'small',
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
// tab
activeName: 'basicInfo',
submitted: false,
isDisabled: false,
wechatImgList: [],
routeInfo: {
// 1-新建;2-编辑;3-查看
addOrEdit: 1,
// 1-集团;2-门店
groupOrStore: '',
id: ''
},
editStatus: false,
// 选择门店
relateStoreVisible: false,
storeApi: this.$apis.common.getSimpleMerchantList,
storeSearchForm: {
merchantId: '',
merchantName: ''
},
selectedList: [],
// 门店表格
tableParams: {
tableOption: true,
tableColumns: [
{
label: '门店名称',
prop: 'merchantName'
}
]
},
// 商品规格
specsWidth: '50%',
specificationDetailList: [],
nameToValSpecsList: [],
minRetailPrice: '',
/* eslint-disable */
reg: {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/
},
/* eslint-enable */
// 添加规格弹窗
isSpescVisible: false,
spescRules: {
specificationName: [
{ required: true, message: '请输入规格名', trigger: 'blur' },
{
validator: (rule, value, callback) => {
return this.spescData.curSpeceNameList.some(item => item == value) ? callback(new Error('规格名重复')) : callback()
},
trigger: 'blur'
}
],
specificationValueList: [{ required: true, message: '请输入规格值', trigger: 'change' }]
},
spescData: {
status: '',
curSpeceNameList: []
},
spescEditForm: {},
specsInputVisible: false,
spescInputVal: '',
// 表单
editForm: {
businessType: [],
businessTypeList: [],
relatedCouponName: '',
relatedDiscountType: '',
relatedUseChannel: '',
relatedCouponId: '',
goodsName: '',
goodsImage: '',
goodsDetailImageList: [],
goodsVideo: '',
classifyIdList: [],
zoneId: '',
descImgList: [],
// applicationType: [],
// 商品规格
// specificationDetailList: [],
retailPrice: '',
originalPrice: '',
takeType: '0',
takeFee: '',
supplyPrice: '',
memberPrice: '',
goodsStock: '',
deliveryType: 2,
install: 'Y',
expressFee: '',
// 带货是否选择全部商户(0:否,1:是)
takeAllMerchant: '1',
supplyMerchantList: []
},
isEdit: true,
labelWidth: '144px',
externalFormList: [
{
title: '基本信息',
editChildRef: 'editProRef0',
editRule: {
goodsName: [{ required: true, message: '请输入商品名称', trigger: 'change' }],
goodsImage: [{ required: true, message: '请选择商品缩略图', trigger: 'change' }],
goodsDetailImageList: [{ required: true, message: '请选择商品详图', trigger: 'change' }],
zoneId: [{ required: true, message: '请选择关联专区', trigger: 'change' }],
erpMaterialNo: [{ required: false, message: '请输入ERP物料编码', trigger: 'change' }]
},
editFormData: [
{
label: '商品名称',
name: 'goodsName',
type: 'input',
maxlength: 20,
isDisabled: false
},
{
label: '商品缩略图',
name: 'goodsImage',
type: 'upload',
limitSize: 10,
maxPhotoNum: 1,
suffixSlot: 'goodsImage',
isDisabled: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name] = res
this.$refs.editFormRef[0].$refs.editProRef0.validateField(targetItem.name)
})
}
},
{
label: '商品详图',
name: 'goodsDetailImageList',
type: 'upload',
width: '100%',
limitSize: 20,
maxPhotoNum: 10,
suffixSlot: 'goodsDetailImageList',
isDisabled: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm[targetItem.name].push({
content: res,
resType: 1,
bizType: 1
})
this.$refs.editFormRef[0].$refs.editProRef0.validateField(targetItem.name)
this.getWechatImgList()
})
}
},
{
label: '商品视频',
name: 'goodsVideo',
type: 'upload',
uploadType: 'video',
suffixSlot: 'goodsVideo',
limitSize: 50,
maxPhotoNum: 1,
isDisabled: false,
handleUpload: (e, file, targetItem) => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadVideoApi({ file: base64 }).then(res => {
this.editForm[targetItem.name] = res
this.getWechatImgList()
})
}
},
{
label: '业务类型',
name: 'businessType',
addHtml: 'businessType',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
businessTypeList: []
},
{
label: '商品分类',
name: 'classifyIdList',
type: 'select',
multiple: true,
optionList: [],
optionId: 'id',
optionLabel: 'classifyName',
optionsName: 'classifyList',
isDisabled: false
},
{
label: '关联专区',
name: 'zoneId',
type: 'select',
optionList: [],
optionId: 'id',
optionLabel: 'zoneName',
optionsName: 'zoneList',
isDisabled: false
},
{
label: '商品详情',
name: '',
addHtml: 'describeBtn'
},
{
label: '',
name: 'describeTxt',
type: 'input',
inputType: 'textarea',
width: '320px',
placeholder: '请输入商品详情',
rows: 5,
maxlength: '200',
style: {
'margin-left': '144px'
}
},
{
label: '',
name: 'descImgList',
addHtml: 'descImgs'
},
{
label: 'ERP物料编码',
name: 'erpMaterialNo',
type: 'input',
width: '320px',
maxlength: 20,
isHide: true,
isDisabled: false
},
{
label: '服务编码',
name: 'serviceCode',
type: 'input',
width: '320px',
maxlength: 20,
isHide: true,
isDisabled: false
},
{
label: '关联优惠券',
name: '',
addHtml: 'association'
}
]
},
{
title: '价格库存',
editChildRef: 'editProRef1',
editRule: {
retailPrice: [{ required: true, message: '请输入零售价', trigger: 'change' }],
originalPrice: [{ required: true, message: '请输入划线价', trigger: 'change' }],
takeFee: [{ required: true, message: '请输入分润比例', trigger: 'change' }],
supplyPrice: [{ required: false, message: '请输入供货价', trigger: 'change' }],
goodsStock: [{ required: true, message: '请输入库存', trigger: 'change' }]
},
editFormData: [
{
label: '商品规格',
name: 'proSpecsBtn',
addHtml: 'proSpecsBtn'
},
{
label: '',
name: 'specificationDetailList',
addHtml: 'proSpecs'
},
{
// label: '规格明细',
name: 'specsDetail',
addHtml: 'specsDetail'
},
{
label: '零售价',
name: 'retailPrice',
type: 'input',
append: '元',
width: '320px',
suffixSlot: 'retailPrice',
isHide: false,
isDisabled: false
},
{
label: '划线价',
name: 'originalPrice',
type: 'input',
append: '元',
width: '320px',
suffixSlot: 'originalPrice',
isDisabled: false
},
// {
// label: '供货价',
// name: 'supplyPrice',
// type: 'input',
// append: '元',
// width: '320px',
// suffixSlot: 'supplyPrice',
// isDisabled: false
// },
{
label: '会员价',
name: 'memberPrice',
type: 'input',
append: '元',
width: '320px',
suffixSlot: 'memberPrice',
isDisabled: false
},
{
label: '带货模式',
name: 'takeType',
addHtml: 'takeType',
tipObj: {
'0': '集团上架自己的商品分发到门店,每个月安装分润比例分成给门店',
'1': '门店需要配置零售价并上架商品,需要集团设置供货价给门店'
},
isHide: false,
isDisabled: false
},
{
label: '库存',
name: 'goodsStock',
type: 'input',
append: '件',
width: '320px',
suffixSlot: 'goodsStock',
isHide: false,
isDisabled: false
}
]
},
{
title: '物流信息',
editChildRef: 'editProRef2',
editRule: {
deliveryType: [{ required: true, message: '请选择配送发货', trigger: 'change' }],
expressFee: [{ required: true, message: '请输入运费', trigger: 'change' }]
},
editFormData: [
{
label: '配送发货',
name: 'deliveryType',
type: 'radio',
optionId: 'confId',
optionLabel: 'confName',
isDisabled: false,
optionList: [
{
confId: 1,
confName: '到店核销'
},
{
confId: 2,
confName: '快递发货'
}
],
handleRadioChange: val => {
this.handleTypeChange(val)
}
},
{
label: '是否需要安装',
name: 'install',
type: 'radio',
width: '320px',
optionId: 'confId',
optionLabel: 'confName',
optionList: [
{
confId: 'Y',
confName: '是'
},
{
confId: 'N',
confName: '否'
}
],
isHide: true,
isDisabled: false
},
{
label: '运费',
name: 'expressFee',
type: 'input',
append: '元',
width: '320px',
isHide: false,
isDisabled: false
}
]
},
{
title: '分配门店',
editChildRef: 'editProRef3',
editRule: {},
editFormData: [
{
label: '发送门店',
name: 'supplyMerchantList',
addHtml: 'selectMerchant'
},
{
// label: '门店',
name: '',
addHtml: 'merchantTable'
}
]
}
],
descImgItem: {
content: '',
// warning: '请上传20M以内的jpg、jpeg、png图片',
resType: 1,
bizType: 2
},
// 查看大图
isImgVisible: false,
dialogImageUrl: '',
baseData: {
classifyList: [],
zoneList: [],
takeTypeList: [
{
confId: '0',
confName: '集团总控'
},
{
confId: '1',
confName: '门店总控'
}
]
}
}
},
components: {
commentDetail
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
// 规格
specificationDetailList(newValue, oldValue) {
console.log(newValue, '规格--')
},
// 零售价
'editForm.retailPrice'(newValue, oldValue) {
this.editForm.retailPrice = limitPrice(newValue, oldValue, 5, 2)
},
// 划线价
'editForm.originalPrice'(newValue, oldValue) {
this.editForm.originalPrice = limitPrice(newValue, oldValue, 5, 2)
},
// 供货价
'editForm.supplyPrice'(newValue, oldValue) {
this.editForm.supplyPrice = limitPrice(newValue, oldValue, 5, 2)
},
// 分润比例
'editForm.takeFee'(newValue, oldValue) {
this.editForm.takeFee = limitPrice(newValue, oldValue, 3, 0, 0, 100, 'zNumReg')
},
// 会员价
'editForm.memberPrice'(newValue, oldValue) {
this.editForm.memberPrice = limitPrice(newValue, oldValue, 5, 2)
},
// 库存
'editForm.goodsStock'(newValue, oldValue) {
this.editForm.goodsStock = limitPrice(newValue, oldValue, 10, 0, 0, 10000000000, 'zNumReg')
},
// 运费
'editForm.expressFee'(newValue, oldValue) {
this.editForm.expressFee = limitPrice(newValue, oldValue, 5, 2, 0, 100000)
},
// 关联优惠券radio,判断配送发货状态,商品规格
'editForm.relatedCouponId'(newValue, oldValue) {
let inx = this.externalFormList[2].editFormData.findIndex(val => val.name == 'deliveryType')
this.externalFormList[2].editFormData[inx].optionList.find(k => k.confId == 2).isDisabled = !!newValue
// console.log(this.associationList)
if (newValue) {
this.editForm.deliveryType = 1
this.editForm.goodsStock = this.associationList[0].residueAmount + ''
}
this.handleTypeChange(this.editForm.deliveryType)
this.associationRadio = newValue
// 库存
let goodsStockIdx = this.externalFormList[1].editFormData.findIndex(val => val.name == 'goodsStock')
this.externalFormList[1].editFormData[goodsStockIdx].isDisabled = !!newValue
}
},
created() {
this.routeInfo = this.$route.query
this.diffHost()
this.businessGetBusinessTypeById()
},
mounted() {
this.userInfo = this.$globalState.session
this.$refs.merchantTableRef[0].tableHeightValues = '400px'
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
// console.log(this.routeInfo)
this.getBaseDate().then(() => {
this.getOptionsList(0, 'editFormData', false)
})
this.retailStockRule()
this.isDisabled = this.routeInfo.addOrEdit == 3
this.routeInfo.groupOrStore == 2 && this.storeNoExitAttr()
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
this.routeInfo.addOrEdit == 3 && this.setAllDisabled()
},
methods: {
//业务类型请求
businessGetBusinessTypeById() {
this.$apis.proManage.getBusinessTypeByIdApi({}).then(res => {
// console.log('res', res)
var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType')
this.externalFormList[0].editFormData[idx].businessTypeList = res
})
},
// 从域名判断是不是广汇的
diffHost() {
// let href = window.location.host
// this.showGh = href.indexOf('cgacar') != -1
this.showGh = true
if (this.showGh) {
let idx = this.externalFormList[0].editFormData.findIndex(item => item.name == 'erpMaterialNo')
let serviceCodeIdx = this.externalFormList[0].editFormData.findIndex(item => item.name == 'serviceCode')
this.externalFormList[0].editFormData[idx].isHide = !this.showGh
this.externalFormList[0].editFormData[serviceCodeIdx].isHide = !this.showGh
this.externalFormList[0].editRule.erpMaterialNo[0].required = this.showGh
}
},
del() {
this.editForm.relatedCouponId = ''
this.editForm.relatedCouponName = ''
this.editForm.relatedDiscountType = ''
this.editForm.relatedUseChannel = ''
this.editForm.residueAmount = ''
},
associationConfirm() {
this.dialogTableVisible = false
this.editForm.relatedUseChannel = ''
this.editForm.relatedCouponId = this.associationList[0].id
this.editForm.relatedCouponName = this.associationList[0].couponName
this.editForm.residueAmount = this.associationList[0].residueAmount
this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == this.associationList[0].discountType).confName
if (this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel)) {
this.editForm.relatedUseChannel = this.associationBaseData.useChannelList.find(item => item.confId == this.associationList[0].useChannel).confName
}
},
associationCancel() {
this.associationRadio = this.editForm.relatedCouponId
this.dialogTableVisible = false
},
handleJumpCoupon() {
this.$router.push({
path: '/couponManage/index'
})
},
getCouponInfo() {
//获取选中数据
// this.radio
let inx = this.templateSelection.findIndex(value => value.id == this.associationRadio)
this.associationList.pop()
this.associationList.push(this.templateSelection[inx])
},
getBaseDate() {
return new Promise(resolve => {
Promise.all([this.$apis.common.getClassifyListApi({}), this.$apis.common.getZoneListApi({ zoneType: 2, merchantId: this.userInfo.merchantId })]).then(([classify, zone]) => {
this.baseData.classifyList = classify
this.baseData.zoneList = zone
resolve()
})
})
},
handleCancelBubble(e) { },
// 小程序展示
getWechatImgList() {
this.wechatImgList = []
if (this.editForm.goodsVideo) {
this.wechatImgList.push({
content: this.editForm.goodsVideo,
// 资源类型(1:图片;2:文本,3:视频)
resType: 3,
bizType: 1
})
}
if (this.editForm.goodsDetailImageList.length) {
this.editForm.goodsDetailImageList.forEach(item => {
this.wechatImgList.push(item)
})
}
},
handleFormImgDelete() {
this.getWechatImgList()
},
handleTypeChange(val) {
var idx = this.externalFormList[2].editFormData.findIndex(item => item.name == 'expressFee')
this.externalFormList[2].editFormData[idx].isHide = val != 2
var installIdx = this.externalFormList[2].editFormData.findIndex(item => item.name == 'install')
this.externalFormList[2].editFormData[installIdx].isHide = val == 2
},
// 带货模式
handleTakeTypeChange(val) {
this.externalFormList[1].editRule.takeFee[0].required = val == '0'
this.externalFormList[1].editRule.supplyPrice[0].required = val == '1'
},
setAllDisabled() {
this.externalFormList.forEach(item => {
item.editFormData.forEach(subItem => {
subItem.isDisabled = true
})
})
},
hideOrShowAttr(obj, isHide = true) {
var idx = ''
obj.forEach(item => {
idx = this.externalFormList[item.pIdx].editFormData.findIndex(subItem => subItem.name == item.name)
this.externalFormList[item.pIdx].editFormData[idx].isHide = isHide
})
},
storeNoExitAttr() {
var attrObj = [
{
name: 'zoneId',
pIdx: 0
},
{
name: 'takeType',
pIdx: 1
}
]
this.hideOrShowAttr(attrObj)
this.externalFormList.splice(3, 1)
},
retailStockRule() {
var list = ['retailPrice', 'goodsStock']
var otherList = ['specificationDetailList', 'specsDetail']
var idx = ''
list.forEach(item => {
idx = this.externalFormList[1].editFormData.findIndex(subItem => subItem.name == item)
this.externalFormList[1].editFormData[idx].isHide = !!this.specificationDetailList.length
})
otherList.forEach(item => {
idx = this.externalFormList[1].editFormData.findIndex(subItem => subItem.name == item)
this.externalFormList[1].editFormData[idx].isHide = !this.specificationDetailList.length
})
},
handleRetailPriceInput(e, idx) {
var newValue = e.target.value
if (!this.reg.priceReg.test(newValue)) {
newValue = ''
}
var oldValue = newValue
if (e.key != 'Backspace' && newValue.length > 1) {
oldValue = newValue.slice(0, newValue.length - 1)
}
this.nameToValSpecsList[idx].retailPrice = limitPrice(newValue, oldValue, 5, 2)
},
handleRetailPriceBlur() {
this.findSpeceMin()
},
handleStockInput(e, idx) {
var newValue = e.target.value
if (!this.reg.priceReg.test(newValue)) {
newValue = ''
}
var oldValue = newValue
if (e.key != 'Backspace' && newValue.length > 1) {
oldValue = newValue.slice(0, newValue.length - 1)
}
this.nameToValSpecsList[idx].stock = limitPrice(newValue, oldValue, 10, 0, 0, 10000000000, 'zNumReg')
},
// 二次确认
secondSimpleConfirm(title, txt, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
fn && fn()
}
}
})
},
// 选择门店
handleRelateStoreClose() {
this.selectedList = this.$common.utils.deepClone(this.editForm.supplyMerchantList)
this.relateStoreVisible = !this.relateStoreVisible
},
handleRelateStoreConfirm(selectedData) {
this.editForm.supplyMerchantList = selectedData
this.selectedList = selectedData
this.handleRelateStoreClose()
},
handleSearchStore() {
this.$refs.relateStore.handleCurrentChange(1)
},
handleMerchantDelete(obj) {
this.secondSimpleConfirm('删除', '是否删除该门店?', () => {
var idx = this.editForm.supplyMerchantList.findIndex(item => item.merchantNo == obj.scope.merchantNo)
this.editForm.supplyMerchantList.splice(idx, 1)
})
},
// 找最小规格值
findSpeceMin() {
this.minRetailPrice = this.nameToValSpecsList[0].retailPrice
this.nameToValSpecsList.forEach(item => {
if (+item.retailPrice < +this.minRetailPrice) {
this.minRetailPrice = item.retailPrice
}
})
},
// 规格值解构
changeSpecs(isRecovery) {
this.retailStockRule()
this.specsWidth = 100 / (this.specificationDetailList.length + 2) + '%'
this.nameToValSpecsList = []
var markIdx = 0
for (var i = 0; i < this.specificationDetailList.length; i++) {
markIdx = 0
for (var j = 0; j < this.specificationDetailList[i].specificationValueList.length; j++) {
if (i == 0) {
this.nameToValSpecsList.push({
specsValueList: [this.specificationDetailList[i].specificationValueList[j].specificationValue],
retailPrice: '',
stock: ''
})
} else {
var targetValLen = this.specificationDetailList[i].specificationValueList.length
var loopNum = 0
var tempMarkIdx = 0
if (j == 0 && targetValLen > 1) {
var obj = JSON.parse(JSON.stringify(this.nameToValSpecsList))
this.nameToValSpecsList = []
obj.forEach((item, index) => {
for (var k = 0; k < targetValLen; k++) {
this.nameToValSpecsList.push(JSON.parse(JSON.stringify(item)))
}
})
}
loopNum = this.nameToValSpecsList.length / targetValLen
tempMarkIdx = markIdx
for (var k = 0; k < loopNum; k++) {
this.nameToValSpecsList[tempMarkIdx].specsValueList.push(this.specificationDetailList[i].specificationValueList[j].specificationValue)
tempMarkIdx = tempMarkIdx + targetValLen
}
markIdx = markIdx + 1
}
}
}
// console.log(this.nameToValSpecsList)
// console.log(this.specificationDetailList)
if (isRecovery) {
this.nameToValSpecsList.forEach((item, index) => {
var specificationObj = {}
item.specsValueList.forEach((subItem, subIndex) => {
specificationObj[this.specificationDetailList[subIndex].specificationName] = subItem
})
item.specificationData = this.setLocaleCompare(specificationObj)
for (var i = 0; i < this.editForm.specificationDetailList.length; i++) {
var temp = this.editForm.specificationDetailList[i]
if (temp.specificationData == item.specificationData) {
item.retailPrice = (temp.retailPrice / 100).toFixed(2)
item.stock = temp.stock
break
}
}
})
}
// console.log(this.nameToValSpecsList)
},
setLocaleCompare(params) {
let keys = []
let obj = []
Object.keys(params).forEach(item => {
keys.push(item)
})
keys.sort()
keys.forEach(item => {
obj.push([item, params[item]])
})
return obj.join('&').replace(/,/g, '-')
},
// 规格弹窗
handleSpescDelete(tag) {
this.spescEditForm.specificationValueList.splice(this.spescEditForm.specificationValueList.indexOf(tag), 1)
},
showInput() {
this.specsInputVisible = true
this.$nextTick(_ => {
this.$refs.saveSpescInput.$refs.input.focus()
})
},
handleInputConfirm() {
let spescInputVal = this.spescInputVal
if (this.spescEditForm.specificationValueList.length == 20) {
this.$message({
message: '规格值最多不能超过20个',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
if (this.spescEditForm.specificationValueList.findIndex(i => i.specificationValue == spescInputVal) != -1) {
this.$message({
message: spescInputVal + '规格值已经存在',
type: 'error',
customClass: 'message-Z-zinde'
})
return true
}
if (spescInputVal) {
this.spescEditForm.specificationValueList.push({ specificationValue: spescInputVal })
}
this.$refs.spescRef.validateField('specificationValueList')
this.specsInputVisible = false
this.spescInputVal = ''
},
handleSpescConfirm() {
this.$refs.spescRef.validate(valid => {
if (valid) {
if (this.spescData.status == 1) {
this.specificationDetailList.push(this.spescEditForm)
} else {
this.specificationDetailList[this.spescData.targetIdx] = this.spescEditForm
}
this.editForm.retailPrice = ''
this.editForm.goodsStock = ''
this.spescEditForm = {}
this.handleSpescClose()
this.changeSpecs(false)
}
})
},
handleSpescClose() {
this.isSpescVisible = !this.isSpescVisible
},
// 添加规格status(1 - 新增;2 - 编辑)
handleSpecsEdit(status, targetItem, targetIdx) {
if (status == 1 && this.specificationDetailList.length >= 5) {
this.$message({
message: '只能新增5个规格值',
type: 'error'
})
return true
}
var curSpeceNameList = []
this.specificationDetailList.forEach((item, index) => {
if (status == 1 || (status == 2 && index != targetIdx)) {
curSpeceNameList.push(item.specificationName)
}
})
this.spescData = {
// 1 - 新增;2 - 编辑
status: status,
targetIdx: targetIdx,
curSpeceNameList: curSpeceNameList
}
this.spescEditForm = status == 2 ? this.$common.utils.deepClone(targetItem) : { specificationName: '', specificationValueList: [] }
// console.log(this.spescEditForm)
this.handleSpescClose()
},
// 删除规格值
handleSpecsDelete(index) {
this.secondSimpleConfirm('删除', '是否删除该规格?', () => {
this.specificationDetailList.splice(index, 1)
this.changeSpecs(false)
})
},
// 恢复规格值
recoverySpec() {
this.changeSpecs(true)
},
// 恢复商品详情
recoveryDescribe() {
this.editForm.goodsDescList.forEach((item, index) => {
if (item.resType == 2) {
this.editForm.describeTxt = item.content
} else {
this.editForm.descImgList.push({
content: item.content,
resType: 1,
bizType: 2
})
}
})
},
// 恢复发送门店
recoveryMerchantList() {
this.editForm.supplyMerchantList.forEach((item, index) => {
item.merchantNo = item.merchantId
})
},
// 获取商品信息
getInfo() {
this.$apis.proManage.getProInfoApi({ id: this.routeInfo.id }).then(res => {
// console.log('res', res)
this.editForm = {
...res,
goodsVideo: res.goodsVideo || '',
classifyIdList: res.classifyList.map(item => item.id),
originalPrice: (res.originalPrice / 100).toFixed(2),
retailPrice: '',
takeType: res.takeType || '1',
memberPrice: res.memberPrice ? (res.memberPrice / 100).toFixed(2) : '',
goodsStock: res.goodsStock + '',
supplyPrice: res.supplyPrice ? (res.supplyPrice / 100).toFixed(2) : '',
takeFee: res.takeFee || '',
describeTxt: '',
relatedCouponId: '',
takeAllMerchant: res.takeAllMerchant || (res.supplyMerchantList.length ? '0' : '1'),
descImgList: [],
businessType: []
}
this.editForm.businessType = this.editForm.businessTypeList.filter(item => item.isChoose == 1).map(item => item.businessType)
console.log(this.editForm)
if (res.relatedCoupon) {
this.editForm.relatedCouponId = res.relatedCoupon.id
this.editForm.relatedCouponName = res.relatedCoupon.couponName
this.editForm.residueAmount = res.relatedCoupon.stock
this.editForm.relatedDiscountType = this.associationBaseData.discountTypeList.find(item => item.confId == res.relatedCoupon.discountType).confName
if (this.associationBaseData.useChannelList.find(item => item.confId == res.relatedCoupon.useChannel)) {
this.editForm.relatedUseChannel = this.associationBaseData.useChannelList.find(item => item.confId == res.relatedCoupon.useChannel).confName
}
}
// 是否需要安装
this.editForm.install = this.editForm.install || 'Y'
// 运费
if (this.editForm.deliveryType == 2) {
this.editForm.expressFee = (res.expressFee / 100).toFixed(2)
}
// 规格
if (this.editForm.specificationList.length) {
this.specificationDetailList = this.$common.utils.deepClone(this.editForm.specificationList)
this.recoverySpec()
this.findSpeceMin()
} else {
// 零售价
this.editForm.retailPrice = (res.retailPrice / 100).toFixed(2)
}
this.retailStockRule()
this.editForm.goodsDescList.length && this.recoveryDescribe()
this.editForm.supplyMerchantList.length && this.recoveryMerchantList()
this.handleTypeChange(this.editForm.deliveryType)
this.handleTakeTypeChange(this.editForm.takeType)
this.getWechatImgList()
// console.log(this.editForm)
this.$nextTick(() => {
this.editStatus = false
})
})
},
getOptionsList(idx, formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this.externalFormList[idx][formName].find(k => k.name == refreshSigle)
var index = this.externalFormList[idx][formName].findIndex(k => k.name == refreshSigle)
this.$set(this.externalFormList[idx][formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.externalFormList[idx][formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this.externalFormList[idx][formName][index].optionId] = ''
temp[this.externalFormList[idx][formName][index].optionLabel] = '全部'
this.externalFormList[idx][formName][index].optionList.unshift(temp)
}
} else {
this.externalFormList[idx][formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this.externalFormList[idx][formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this.externalFormList[idx][formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this.externalFormList[idx][formName][index].optionId] = ''
temp[this.externalFormList[idx][formName][index].optionLabel] = '全部'
this.externalFormList[idx][formName][index].optionList.unshift(temp)
}
}
})
}
},
// 商品详情-图片
handleDescribeImgAdd() {
if (this.editForm.descImgList.length >= 10) {
this.$message({
message: '最多只允许添加10个',
type: 'error'
})
return true
}
this.editForm.descImgList.push(this.$common.utils.deepClone(this.descImgItem))
},
// 图片-描述-start
handleImgChange(e, idx) {
var reader = new FileReader()
var file = e.srcElement.files[0]
const isLt = file.size / 1024 / 1024 < 20
const isType = ['image/jpeg', 'image/png', 'image/jpg'].includes(file.type)
if (!isType) {
this.$message.error('上传图片不是jpg、jpeg或png的格式!')
return true
}
if (!isLt) {
this.$message.error('上传图片大小不能超过20MB!')
return true
}
reader.readAsDataURL(file)
reader.onload = e => {
const imgFile = e.target.result
const base64 = file.name.split('.')[file.name.split('.').length - 1] + '@' + imgFile.split(',')[1]
this.$apis.common.uploadImgApi({ file: base64, fileType: 'image' }).then(res => {
this.editForm.descImgList[idx].content = res
})
}
},
handleEmptyDelete(idx) {
this.editForm.descImgList.splice(idx, 1)
},
handleImgDelete(attrName, subIndex) {
this.secondSimpleConfirm('删除', '是否删除该图片?', () => {
this.editForm[attrName].splice(subIndex, 1)
})
},
handleImgLook(src) {
this.isImgVisible = true
this.dialogImageUrl = src
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
// 图片-描述-end
handleConfirm() {
console.log(this.editForm)
var isJump = false
this.submitted = true
for (var i = 0; i < this.externalFormList.length; i++) {
if (isJump) {
return true
}
this.$refs.editFormRef[i].$refs['editProRef' + i].validate((valid, errorObj) => {
// 规格值验证
if (i == 1) {
for (var j = 0; j < this.nameToValSpecsList.length; j++) {
var item = this.nameToValSpecsList[j]
if (!item.retailPrice || !(item.stock + '')) {
this.whereToGo('specificationDetailList')
isJump = true
break
}
if (this.routeInfo.groupOrStore == 1 && this.editForm.takeType == '1' && +item.retailPrice < +this.editForm.supplyPrice) {
this.whereToGo('specificationDetailList')
isJump = true
break
}
}
}
if (!isJump && !valid) {
isJump = true
this.whereToGo(Object.keys(errorObj)[0])
}
})
}
var params = this.$common.utils.deepClone(this.editForm)
var deleteAttrList = ['descImgList', 'describeTxt', 'specificationList']
var priceList = ['retailPrice', 'originalPrice', 'supplyPrice', 'expressFee', 'memberPrice']
if (this.routeInfo.addOrEdit == 2) {
params.id = this.routeInfo.id
}
// 业务类型
params.businessTypeList = params.businessType
if (!params.businessTypeList) {
delete params.businessTypeList
} else {
var idx = this.externalFormList[0].editFormData.findIndex(subItem => subItem.name == 'businessType')
var list = this.externalFormList[0].editFormData[idx].businessTypeList
params.businessTypeList = []
this.editForm.businessType.forEach(item => {
console.log(item)
params.businessTypeList.push(list.find(k => k.businessType == item))
})
}
// 描述
params.goodsDescList = []
this.editForm.descImgList.forEach(item => {
item.content && params.goodsDescList.push(item)
})
if (this.editForm.describeTxt) {
params.goodsDescList.unshift({
content: this.editForm.describeTxt,
resType: 2,
bizType: 2
})
}
// 规格
params.specificationDetailList = []
this.nameToValSpecsList.forEach((item, index) => {
var specificationData = ''
item.specsValueList.forEach((subItem, subIndex) => {
if (subIndex != 0) {
specificationData += '&'
}
specificationData = specificationData + this.specificationDetailList[subIndex].specificationName + '-' + subItem
})
params.specificationDetailList.push({
specificationData: specificationData,
retailPrice: (item.retailPrice * 100).toFixed(0),
stock: item.stock
})
})
// 专区-门店没有专区
if (this.routeInfo.groupOrStore != 1) {
delete params.zoneId
}
// 价格格式化(计算到分)
priceList.forEach(item => {
if (params[item]) {
params[item] = (this.editForm[item] * 100).toFixed(0)
}
if (item == 'expressFee' && this.editForm.deliveryType != 2) {
params.expressFee = ''
}
})
params.supplyMerchantList = []
if (this.editForm.takeAllMerchant == '0') {
this.editForm.supplyMerchantList.forEach(item => {
params.supplyMerchantList.push({
merchantId: item.merchantNo,
merchantName: item.merchantName,
merchantAccountLevel: item.merchantAccountLevel
})
})
}
deleteAttrList.forEach(item => {
delete params[item]
})
console.log(params)
this.$apis.proManage.insertOrUpdateProApi(params).then(res => {
// console.log('res',res);
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
},
cancelJump() {
this.$router.push({
path: this.routeInfo.groupOrStore == 1 ? '/productGroupGH/index' : '/productStoreGH/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
},
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
return params
},
setTableFinishFun() {
let num = 0
let pageSize = Number(this.$refs.coupon[0].page.pageSize)
let pageNum = Number(this.$refs.coupon[0].page.pageNum)
let sum = pageSize * (pageNum - 1)
// console.log(pageSize,pageNum);
this.$refs.coupon[0].data.forEach(val => {
if (num <= pageSize) val.num = ++num
if (pageNum > 1) val.num = ++sum
})
// console.log('this.$refs.coupon',this.$refs.coupon[0])
//接收到的数据为空
this.templateSelection = this.$refs.coupon[0].data
},
handleSearch() {
this.$refs.coupon[0].refreshTable()
}
}
}
</script>
<style>
/* .edit-pro .specs-label {
padding: 1px 10px;
font-size: 13px;
border-radius: 2px;
display: inline-block;
border: 1px solid #cccccc;
margin-right: 10px;
} */
.edit-pro .spesc-label {
box-sizing: border-box;
width: 110px;
color: #666;
text-align: right;
padding-right: 12px;
}
.edit-pro .table-spesc {
width: 100%;
text-align: center;
margin-bottom: 0;
}
.edit-pro .table-spesc tbody tr {
border: 1px solid #e7e7e7;
}
.edit-pro .table-spesc tbody td {
display: inline-block;
box-sizing: border-box;
width: 20%;
border: none;
padding: 2px 6px;
vertical-align: center;
text-align: center;
}
.edit-pro .table-spesc .el-input--small .el-input__inner {
text-align: center !important;
}
.edit-pro .w-320 {
width: 320px;
}
.edit-pro .take-good-mode-block {
display: flex;
align-items: center;
}
.edit-pro .mode-radio {
height: 32px;
line-height: 32px;
margin-right: 8px;
}
.edit-pro .take-good-mode-block .el-radio__input {
height: 86px;
}
.edit-pro .take-good-mode-block .radio-tip-txt {
color: #999999;
}
.edit-pro .wechat-container .wechat-footer {
position: absolute;
width: 252px;
height: 35px;
top: 470px;
left: 19px;
}
.edit-pro .wechat-container .wechant-back {
/* border: 1px solid #D8D8D8; */
}
.edit-pro .wechat-container .wechat-inner-box {
position: absolute;
top: 56px;
left: 19px;
width: 253px;
height: 413px;
background-color: #f7f7f7;
overflow-y: scroll;
overflow-x: hidden;
}
.edit-pro .wechat-container .inner-block {
background-color: #ffffff;
padding: 6px 11px;
}
.edit-pro .wechat-container .price {
font-size: 24px;
color: #fc5b32;
margin-right: 4px;
}
.edit-pro .wechat-container .old {
font-size: 12px;
color: #b1b1b3;
text-decoration: line-through;
}
.edit-pro .wechat-container .good-name {
font-size: 12px;
width: 200px;
font-weight: bold;
margin: 8px 0 6px;
}
.edit-pro .wechat-container .txt-tips {
color: #b1b1b3;
font-size: 12px;
}
.edit-pro .wechat-container .line {
height: 50px;
line-height: 50px;
border-bottom: 1px solid #eff0f2;
}
.edit-pro .wechat-container .line-label {
font-size: 12px;
color: #656566;
margin-right: 44px;
}
.edit-pro .wechat-container .line-txt {
font-size: 12px;
color: #3b3b3d;
}
.edit-pro .wechat-container .inner-img {
width: 250px;
height: 250px;
}
.edit-pro .right-arrow::after {
content: '>';
position: absolute;
right: 20px;
}
/* .el-tag + .el-tag {
margin-left: 10px;
} */
.button-new-tag {
height: 32px;
line-height: 30px;
padding-top: 0;
padding-bottom: 0;
}
.input-new-tag {
width: 90px;
vertical-align: bottom;
}
.edit-pro .table-spesc .el-input--small.border-red .el-input__inner {
border: 1px solid #eb4e4e;
}
.edit-pro .sepce-box {
position: relative;
padding: 30px 34px;
color: #3a3a3a;
background: #f7f7f7;
border: 1px solid #dcdfe6;
margin-bottom: 10px;
}
.edit-pro .sepce-box .specs-title {
height: 60px;
line-height: 60px;
}
.edit-pro .sepce-box .specs-item {
background: #e6e9ff;
border-radius: 4px;
padding: 9px 16px;
color: #717171;
margin-right: 12px;
}
.color-red {
color: #eb4e4e;
cursor: pointer;
}
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 6px;
height: 3px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, 0.3);
}
.marketing.edit-pro .el-tabs__item {
background: #f4f6fc !important;
border: 1px solid #f4f6fc !important;
}
.marketing.edit-pro .el-tabs__item.is-active {
background: #ffffff !important;
border: 1px solid #ffffff !important;
}
.edit-pro .association .el-radio__label {
display: none;
}
.edit-pro .associationBtn {
position: absolute;
right: 19px;
bottom: 26px;
}
.association-X {
width: 670px;
height: 108px;
border: 1px solid #eee;
margin-top: 10px;
}
.association-X .associationRow {
display: flex;
height: 54px;
background: #f4f6fc;
align-items: center;
justify-content: center;
}
.association-X .associationRow .associationLists {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
text-align: center;
font-size: 14px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #424242;
}
.association-X .associationRow .associationLists-X {
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
flex: 1;
text-align: center;
font-size: 14px;
color: #666;
}
.marketing .footer-btns {
float: none !important;
}
.el-checkbox__input.is-checked + .el-checkbox__label {
color: #606266;
}
</style>
<!-- 商品管理-集团 -->
<template>
<div class="marketing pro-group p-t-20">
<div class="m-b-20">
<!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建商品</el-button> -->
<GLButton :size="size" type="primary" fn="新建商品" class="el-icon-plus" @click="handleEdit(1)">新建商品</GLButton>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="goodsImage" class="table-image" 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-60 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleUpOrDown(scope.scope)">{{ scope.scope.goodsStatus ? '下架' : '上架' }}</el-button>
<!-- <el-button v-if="!scope.scope.goodsStatus" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button v-if="scope.scope.goodsStatus" type="text" @click="handleEdit(3, scope.scope)">查看</el-button> -->
<GLButton v-if="!scope.scope.goodsStatus" type="text" fn="编辑" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<GLButton v-if="scope.scope.goodsStatus" type="text" fn="查看" @click="handleEdit(3, scope.scope)">查看</GLButton>
<el-button type="text" @click="handleTop(scope.scope)">置顶</el-button>
<el-button type="text" @click="handleShare(scope.scope)">分享</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 下架 -->
<glsx-dialog title="下架" :isVisible.sync="isDownVisible" @confirmDialog="handleDownConfirm" @closeDialog="handleDownClose">
<el-form ref="downRef" label-width="100px" :rules="downRules" :model="downForm">
<el-form-item label="下架备注" prop="offReason">
<el-input :size="size" v-model="downForm.offReason" placeholder="请输入下架备注" maxlength="30"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import shareDialog from './components/shareDialog'
import url from '@/assets/empty.png'
export default {
name: 'productGroup',
data() {
return {
size: 'small',
url: url,
// 下架
isDownVisible: false,
downForm: {
id: '',
offReason: '',
goodsStatus: 0
},
downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
},
// 分享
isShareVisible: false,
shareForm: {},
// 表格
searchForm: {
goodsName: '',
createDate: [],
goodsStatus: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '商品名称',
name: 'goodsName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '商品状态',
name: 'goodsStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
}
],
// 表格
getListApi: this.$apis.proManage.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
line: 2
},
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '浏览量(次)',
name: 'goodsStatistics',
width: '180',
formatter: cellValue => {
return cellValue.goodsStatistics ? cellValue.goodsStatistics.viewAmount || '0' : '0'
}
},
{
label: '销量',
name: 'goodsStatistics',
formatter: cellValue => {
return cellValue.goodsStatistics ? cellValue.goodsStatistics.saleAmount || '0' : '0'
}
},
{
label: '零售价(元)',
name: 'retailPrice',
width: '180',
formatter: cellValue => {
return cellValue.retailPrice
}
},
{
label: '库存',
name: 'goodsStock',
formatter: cellValue => {
return cellValue.goodsStock || '0'
}
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '商品状态',
name: 'goodsStatus',
formatter: cellValue => {
return this.baseData.goodsStatusList.find(item => item.confId == cellValue.goodsStatus).confName
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
goodsStatusList: [
{
confId: '0',
confName: '已下架'
},
{
confId: '1',
confName: '已上架'
}
]
}
}
},
components: {
shareDialog
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// addOrEdit:1-新增;2-编辑;3-查看
// groupOrStore:1-集团;2-门店
handleEdit(addOrEdit, row) {
// addOrEdit == 1 ? this.$router.push('/productGroup/editProduct/' + addOrEdit + '/' + 1) : this.$router.push('/productGroup/editProduct/' + addOrEdit + '/' + 1 + '/' + row.id)
var titleObj = {
1: '新建商品',
2: '编辑商品',
3: '查看商品'
}
var params = {
addOrEdit: addOrEdit,
groupOrStore: 1,
$title: encodeURI(titleObj[addOrEdit])
}
addOrEdit != 1 && (params.id = row.id)
this.$router.push({
path: '/productGroupGH/editProduct',
query: params
})
},
handleUpOrDown(row) {
if (row.goodsStatus) {
this.downForm.id = row.id
this.dwonVisibleChange()
return true
}
this.secondConfirm('上架', '是否确认上架该商品?', 'proManage', 'updateStatusProApi', { id: row.id, goodsStatus: 1 })
},
dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate()
this.isDownVisible = !this.isDownVisible
},
handleDownClose() {
this.dwonVisibleChange()
this.downForm = {
id: '',
offReason: '',
goodsStatus: 0
}
},
handleDownConfirm() {
this.$refs.downRef.validate(valid => {
if (valid) {
this.$apis.proManage.updateStatusProApi(this.downForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleDownClose()
this.handleSearch()
}
})
}
})
},
// 置顶
handleTop(row) {
this.secondConfirm('置顶', '是否确认置顶该商品?', 'proManage', 'topProApi', { id: row.id })
},
handleShare(row) {
this.$apis.proManage.getProShareApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
//接收到的数据为空
if (!this.$refs.proGroupRef.data.length) {
this.$refs.proGroupRef.setTableHeightFun()
} else {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function (a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
}
},
handleSearch() {
this.$refs.proGroupRef.refreshTable()
},
handleReset() {
this.searchForm = {
goodsName: '',
createDate: [],
goodsStatus: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
......@@ -9,14 +9,14 @@
<p class="edit-title">{{ title }}</p>
<div class="flex" style="margin-top: 20px;">
<div class="main-img-box">
<el-carousel height="420px">
<el-carousel height="375px">
<el-carousel-item v-for="item in editForm.goodsDetailImageList" :key="item">
<video v-if="item.resType == 3" class="inner-img" :src="item.content"></video>
<img class="inner-img" :src="item.content" />
</el-carousel-item>
</el-carousel>
</div>
<div style="width: calc(100% - 440px);">
<div style="width: calc(100% - 375px);">
<p class="pro-name txt-ellipsis">{{ editForm.goodsName }}</p>
<p v-show="!specificationDetailList.length" class="txt-ellipsis">
供货价:
......@@ -130,19 +130,22 @@ export default {
label: '零售价',
name: 'retailPrice',
type: 'input',
isDisabled: false
isDisabled: false,
width: '411px'
},
{
label: '供货价',
name: 'supplyPrice',
type: 'input',
isDisabled: true
isDisabled: true,
width: '411px'
},
{
label: '库存',
name: 'goodsStock',
type: 'input',
isDisabled: true
isDisabled: true,
width: '411px'
}
]
}
......@@ -392,14 +395,14 @@ export default {
}
.edit-product-dh .inner-img {
width: 420px;
height: 420px;
width: 100%;
height: 100%;
}
.edit-product-dh .main-img-box {
width: 440px;
width: 375px;
text-align: center;
padding: 0 20px;
margin: 0 34px 0 20px;
}
.edit-product-dh .pro-name {
......
......@@ -18,7 +18,10 @@
<!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="goodsImage" slot-scope="scope">
<img class="img-60" :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-60 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<!-- <el-button v-if="!scope.scope.goodsStatus" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> -->
......@@ -293,7 +296,7 @@ export default {
handleDwonNotice(row) {
this.$alert('你带货的' + row.goodsName + '商品现已下架,下架原因:' + row.offReason, '商品下架通知', {
confirmButtonText: '确定',
callback: action => {}
callback: action => { }
})
},
handleUpOrDown(row) {
......@@ -383,10 +386,10 @@ export default {
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
let stockeList = item.specificationDetailList.sort(function (a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
......
<!-- 商品编辑 - 带货 -->
<template>
<div class="edit-product-dh marketing p-t-20 edit-box">
<el-tabs v-if="routeInfo.addOrEdit != '1'" v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="基本信息" name="basicInfo"></el-tab-pane>
<el-tab-pane label="评价信息" name="afterOrder"></el-tab-pane>
</el-tabs>
<div v-show="routeInfo.addOrEdit == '1' || (['2', '3'].includes(routeInfo.addOrEdit + '') && activeName == 'basicInfo')" class="container edit-container">
<p class="edit-title">{{ title }}</p>
<div class="flex" style="margin-top: 20px;">
<div class="main-img-box">
<el-carousel height="375px">
<el-carousel-item v-for="item in editForm.goodsDetailImageList" :key="item">
<video v-if="item.resType == 3" class="inner-img" :src="item.content"></video>
<img class="inner-img" :src="item.content" />
</el-carousel-item>
</el-carousel>
</div>
<div style="width: calc(100% - 375px);">
<p class="pro-name txt-ellipsis">{{ editForm.goodsName }}</p>
<p v-show="!specificationDetailList.length" class="txt-ellipsis">
供货价:
<span class="supply-price">{{ editForm.retailPrice }}元</span>
</p>
</div>
</div>
<div v-if="specificationDetailList.length" style="margin: 20px;" id="specificationDetailList">
<div class="spesc-label" :style="{ width: labelWidth }">规格明细:</div>
<div style="width: 100%;">
<table class="table-spesc">
<tbody>
<tr style="background: #F4F6FC; box-shadow: 0px 1px 5px 0px rgba(38, 38, 38, 0.1);">
<td :style="{ width: specsWidth, padding: '17px 0' }" v-for="(subItem, subIndex) in specificationDetailList" :key="subIndex">{{ subItem.specificationName }}</td>
<td :style="{ width: specsWidth, padding: '17px 0' }">零售价(元)</td>
<td :style="{ width: specsWidth, padding: '17px 0' }">供货价</td>
<td :style="{ width: specsWidth, padding: '17px 0' }">利润</td>
<td :style="{ width: specsWidth, padding: '17px 0' }">库存</td>
</tr>
</tbody>
</table>
<div style="max-height: 400px; overflow: scroll;">
<table class="table-spesc">
<tbody>
<tr style="border-bottom: 1px solid rgb(235, 235, 235); height: 54px; line-height: 54px;" v-for="(item, index) in nameToValSpecsList" :key="index">
<td :style="{ width: specsWidth }" v-for="(n, idx) in item.specsValueList" :key="idx">{{ n }}</td>
<td :style="{ width: specsWidth }">
<el-input :disabled="isDisabled" :class="{ 'border-red': (!(item.retailPrice + '') || +item.supplyPrice > +item.retailPrice) && submitted }" placeholder="零售价" v-model="item.retailPrice" @input.native="e => handleInput(e, index)">
<el-popover v-show="(!(item.retailPrice + '') || +item.supplyPrice > +item.retailPrice) && submitted" slot="suffix" placement="top" title="" width="90" trigger="hover" :content="!(item.retailPrice + '') ? '零售价是必填项' : '零售价要大于供货价'">
<i class="el-icon-warning color-red" slot="reference"></i>
</el-popover>
</el-input>
</td>
<td :style="{ width: specsWidth }">{{ item.supplyPrice }}元</td>
<td :style="{ width: specsWidth }">{{ (item.retailPrice - item.supplyPrice).toFixed(2) }}元</td>
<td :style="{ width: specsWidth }">{{ item.stock }}件</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<glsx-combi-form v-if="!specificationDetailList.length" class="edit-form-container" ref="editFormRef" labelWidth="140px" defaultWidth="320px" :isBlock="true" :formRef="editChildRef" :formObj="editForm" :formData="editFormData" :formRules="editRule"></glsx-combi-form>
<div style="width: 375px; margin: 0 0 10px 40px;" v-for="(item, index) in editForm.goodsDescList" :key="index">
<div v-show="item.resType == 2">{{ item.content }}</div>
<img style="width: 375px; width: 375px;" v-show="item.resType == 1" :src="item.content" />
</div>
</div>
<comment-detail v-show="['2', '3'].includes(routeInfo.addOrEdit + '') && activeName == 'afterOrder'" :goodsId="routeInfo.id"></comment-detail>
<div class="footer" :style="{ left: footerLeft + 'px', width: footerWidth + 'px' }">
<el-button v-if="routeInfo.addOrEdit == '1' || (routeInfo.addOrEdit == '2' && activeName == 'basicInfo')" type="primary" @click="handleConfirm">确定</el-button>
<el-button type="default" @click="handleCancel">取消</el-button>
</div>
</div>
</template>
<script>
import { limitPrice } from '@/common/constant'
import commentDetail from '../productGroup/components/commentDetail'
export default {
name: 'editProductDh',
data() {
return {
size: 'small',
title: '新增商品',
titleObj: {
1: '新增商品',
2: '编辑商品',
3: '查看商品'
},
footerLeft: '0',
footerWidth: '0',
editChildRef: 'editChildRef',
// tab
activeName: 'basicInfo',
submitted: false,
isDisabled: false,
mainImgUrl: '',
moveNum: 0,
curMoveNum: 0,
/* eslint-disable */
reg: {
priceReg: /^\d[\d\.]*$/,
numReg: /^[1-9]\d*$/
},
editStatus: false,
/* eslint-enable */
routeInfo: {
// 1-新增;2-编辑;3-查看
addOrEdit: 1,
id: ''
},
specificationDetailList: [],
nameToValSpecsList: [],
editForm: {
retailPrice: ''
},
editRule: {
retailPrice: [
{ required: true, message: '请输入零售价', trigger: 'change' },
{
validator: (rule, value, callback) => {
return +this.editForm.supplyPrice > +value ? callback(new Error('零售价不能小于供货价')) : callback()
},
trigger: 'change'
}
]
},
editFormData: [
{
label: '零售价',
name: 'retailPrice',
type: 'input',
isDisabled: false,
width: '411px'
},
{
label: '供货价',
name: 'supplyPrice',
type: 'input',
isDisabled: true,
width: '411px'
},
{
label: '库存',
name: 'goodsStock',
type: 'input',
isDisabled: true,
width: '411px'
}
]
}
},
components: {
commentDetail
},
watch: {
editForm: {
handler(val) {
this.editStatus = true
},
deep: true
},
'editForm.retailPrice'(newValue, oldValue) {
this.editForm.retailPrice = limitPrice(newValue, oldValue, 5, 2)
}
},
created() {
this.routeInfo = this.$route.query
},
mounted() {
this.footerLeft = document.querySelector('.base-container-right').offsetLeft
this.footerWidth = document.documentElement.clientWidth - this.footerLeft
this.title = this.titleObj[this.routeInfo.addOrEdit]
this.isDisabled = this.routeInfo.addOrEdit == 3
this.editFormData[0].isDisabled = this.isDisabled
this.routeInfo.addOrEdit != 1 ? this.getInfo() : ''
},
methods: {
getInfo() {
this.$apis.proManage.getProInfoApi({ id: this.routeInfo.id }).then(res => {
this.editForm = {
...res,
retailPrice: '',
supplyPrice: res.supplyPrice ? (res.supplyPrice / 100).toFixed(2) : ''
}
// 规格
if (this.editForm.specificationList.length) {
this.specificationDetailList = this.$common.utils.deepClone(this.editForm.specificationList)
this.recoverySpec()
// this.findSpeceMin()
} else {
// 零售价
this.editForm.retailPrice = (res.retailPrice / 100).toFixed(2)
}
this.mainImgUrl = this.editForm.goodsDetailImageList[0].content
this.moveNum = this.editForm.goodsDetailImageList.length > 4 ? this.editForm.goodsDetailImageList.length - 4 : 0
this.$nextTick(() => {
this.editStatus = false
})
})
},
// 规格值解构
changeSpecs(isRecovery) {
this.specsWidth = 100 / (this.specificationDetailList.length + 4) + '%'
this.nameToValSpecsList = []
var markIdx = 0
for (var i = 0; i < this.specificationDetailList.length; i++) {
markIdx = 0
for (var j = 0; j < this.specificationDetailList[i].specificationValueList.length; j++) {
if (i == 0) {
this.nameToValSpecsList.push({
specsValueList: [this.specificationDetailList[i].specificationValueList[j].specificationValue],
retailPrice: '',
stock: ''
})
} else {
var targetValLen = this.specificationDetailList[i].specificationValueList.length
var loopNum = 0
var tempMarkIdx = 0
if (j == 0 && targetValLen > 1) {
var obj = JSON.parse(JSON.stringify(this.nameToValSpecsList))
this.nameToValSpecsList = []
obj.forEach((item, index) => {
for (var k = 0; k < targetValLen; k++) {
this.nameToValSpecsList.push(JSON.parse(JSON.stringify(item)))
}
})
}
loopNum = this.nameToValSpecsList.length / targetValLen
tempMarkIdx = markIdx
for (var k = 0; k < loopNum; k++) {
this.nameToValSpecsList[tempMarkIdx].specsValueList.push(this.specificationDetailList[i].specificationValueList[j].specificationValue)
tempMarkIdx = tempMarkIdx + targetValLen
}
markIdx = markIdx + 1
}
}
}
if (isRecovery) {
this.nameToValSpecsList.forEach((item, index) => {
var specificationObj = {}
item.specsValueList.forEach((subItem, subIndex) => {
specificationObj[this.specificationDetailList[subIndex].specificationName] = subItem
})
item.specificationData = this.setLocaleCompare(specificationObj)
for (var i = 0; i < this.editForm.specificationDetailList.length; i++) {
var temp = this.editForm.specificationDetailList[i]
if (temp.specificationData == item.specificationData) {
item.retailPrice = (temp.retailPrice / 100).toFixed(2)
item.specificationKey = temp.specificationKey
item.stock = temp.stock
item.supplyPrice = this.editForm.supplyPrice
break
}
}
})
}
},
setLocaleCompare(params) {
let keys = []
let obj = []
Object.keys(params).forEach(item => {
keys.push(item)
})
keys.sort()
keys.forEach(item => {
obj.push([item, params[item]])
})
return obj.join('&').replace(/,/g, '-')
},
// 恢复规格值
recoverySpec() {
this.changeSpecs(true)
},
// 换图
handleChangeImg(idx) {
this.mainImgUrl = this.editForm.goodsDetailImageList[idx].content
},
handleInput(e, idx) {
var newValue = e.target.value
if (!this.reg.priceReg.test(newValue)) {
newValue = ''
}
var oldValue = newValue
if (e.key != 'Backspace' && newValue.length > 1) {
oldValue = newValue.slice(0, newValue.length - 1)
}
this.nameToValSpecsList[idx].retailPrice = limitPrice(newValue, oldValue, 5, 2)
},
// 跳转
whereToGo(id) {
document.getElementById(id).scrollIntoView()
},
checkSpeceData() {
var flag = true
for (var i = 0; i < this.nameToValSpecsList.length; i++) {
var item = this.nameToValSpecsList[i]
if (!item.retailPrice) {
this.whereToGo('specificationDetailList')
return false
}
if (+item.retailPrice < +item.supplyPrice) {
this.whereToGo('specificationDetailList')
return false
}
}
return flag
},
handleConfirm() {
this.submitted = true
var flag = false
var params = {}
if (this.nameToValSpecsList.length) {
if (!this.checkSpeceData()) {
return
}
params.specificationDetailList = []
this.nameToValSpecsList.forEach((item, index) => {
params.specificationDetailList.push({
specificationData: item.specificationData,
specificationKey: item.specificationKey,
retailPrice: (item.retailPrice * 100).toFixed(0)
})
})
} else {
this.$refs.editFormRef.$refs[this.editChildRef].validate(valid => {
if (!valid) {
flag = true
} else {
params = {
retailPrice: (this.editForm.retailPrice * 100).toFixed(0)
}
}
})
}
if (flag) {
return true
}
params.id = this.routeInfo.id
this.$apis.proManage.updateTakeProApi(params).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : '操作失败',
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.cancelJump()
}
})
},
cancelJump() {
this.$router.push({
path: '/productStoreGH/index'
})
},
handleCancel() {
if (this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.cancelJump()
})
.catch(() => { })
} else {
this.cancelJump()
}
}
}
}
</script>
<style>
.edit-product-dh .title {
padding: 13px 20px;
border-bottom: 1px solid #e5e5e5;
}
.edit-product-dh .view {
width: 375px;
height: 667px;
margin: 30px 45px 0 60px;
background: #f6f6f6;
position: relative;
}
.edit-product-dh .view img {
width: 100%;
vertical-align: top;
}
.edit-product-dh .inner-img {
width: 100%;
height: 100%;
}
.edit-product-dh .main-img-box {
width: 375px;
text-align: center;
margin: 0 34px 0 20px;
}
.edit-product-dh .pro-name {
width: 100%;
font-size: 16px;
color: #3a3a3a;
font-weight: 500;
margin-bottom: 14px;
}
.edit-product-dh .supply-price {
font-size: 26px;
color: #ff6d00;
}
.edit-product-dh .border-red {
border: 1px solid red;
}
.txt-ellipsis {
display: -webkit-box;
overflow: hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
}
/* 规格 */
.edit-product-dh .spesc-label {
box-sizing: border-box;
color: #666;
font-weight: 600;
margin-bottom: 10px;
}
.edit-product-dh .table-spesc {
width: 100%;
text-align: center;
margin-bottom: 0;
}
.edit-product-dh .table-spesc tbody tr {
border: 1px solid #e7e7e7;
}
.edit-product-dh .table-spesc tbody td {
display: inline-block;
box-sizing: border-box;
width: 20%;
border: none;
padding: 2px 6px;
vertical-align: center;
text-align: center;
}
.edit-product-dh .table-spesc .el-input--small .el-input__inner {
text-align: center !important;
}
.edit-product-dh .w-320 {
width: 320px;
}
.color-red {
color: #eb4e4e;
cursor: pointer;
}
/* 规格 */
.marketing.edit-product-dh .el-tabs__item {
background: #f4f6fc !important;
border: 1px solid #f4f6fc !important;
}
.marketing.edit-product-dh .el-tabs__item.is-active {
background: #ffffff !important;
border: 1px solid #ffffff !important;
}
</style>
<!-- 商品管理-门店 -->
<template>
<div class="marketing pro-group p-t-20">
<div class="m-b-20">
<!-- <el-button :size="size" type="primary" class="el-icon-plus" @click="handleEdit(1)">新建商品</el-button> -->
<GLButton :size="size" type="primary" fn="新建商品" class="el-icon-plus" @click="handleEdit(1)">新建商品</GLButton>
</div>
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
<span slot="footer" class="footer-btns">
<el-button :size="size" type="default" @click="handleReset">重置</el-button>
<el-button :size="size" type="primary" @click="handleSearch">查询</el-button>
</span>
</glsx-combi-form>
</div>
<!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="goodsImage" 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-60 pointer" slot="reference" :src="scope.scope.goodsImage" />
</el-popover>
</template>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<!-- <el-button v-if="!scope.scope.goodsStatus" type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> -->
<GLButton v-if="!scope.scope.goodsStatus && scope.scope.goodsSource == 1" type="text" fn="自建编辑" @click="handleEdit(2, scope.scope)">编辑</GLButton>
<GLButton v-if="!scope.scope.goodsStatus && scope.scope.goodsSource == 2 && scope.scope.takeType == '1'" type="text" fn="带货编辑" @click="handleEditDh(2, scope.scope)">编辑</GLButton>
<el-button v-if="!scope.scope.goodsStatus && (scope.scope.goodsSource == 1 || (scope.scope.goodsSource == 2 && scope.scope.originGoodsStatus))" type="text" @click="handleUpOrDown(scope.scope)">上架</el-button>
<el-button v-if="!scope.scope.goodsStatus && scope.scope.goodsSource == 2 && !scope.scope.originGoodsStatus && scope.scope.offReason" type="text" @click="handleDwonNotice(scope.scope)">下架通知</el-button>
<el-button v-if="scope.scope.goodsStatus" type="text" @click="handleUpOrDown(scope.scope)">下架</el-button>
<el-button v-if="!scope.scope.goodsStatus && scope.scope.goodsSource == 2" type="text" @click="handleTakeGood(scope.scope)">取消带货</el-button>
<el-button v-if="!scope.scope.goodsStatus && scope.scope.goodsSource == 1" type="text" @click="handleTop(scope.scope)">置顶</el-button>
<!-- <el-button v-if="scope.scope.goodsStatus" type="text" @click="handleEdit(3, scope.scope)">查看</el-button> -->
<GLButton v-if="scope.scope.goodsStatus && scope.scope.goodsSource == 1" type="text" fn="自建查看" @click="handleEdit(3, scope.scope)">查看</GLButton>
<GLButton v-if="scope.scope.goodsStatus && scope.scope.goodsSource == 2" type="text" fn="带货查看" @click="handleEditDh(3, scope.scope)">查看</GLButton>
<el-button v-if="scope.scope.goodsStatus" type="text" @click="handleShare(scope.scope)">分享</el-button>
</div>
</GLTable>
<!-- 表格区域 end -->
</div>
<!-- 下架 -->
<glsx-dialog title="下架" :isVisible.sync="isDownVisible" @confirmDialog="handleDownConfirm" @closeDialog="handleDownClose">
<el-form ref="downRef" label-width="100px" :rules="downRules" :model="downForm">
<el-form-item label="下架备注" prop="offReason">
<el-input :size="size" v-model="downForm.offReason" placeholder="请输入下架备注" maxlength="30"></el-input>
</el-form-item>
</el-form>
</glsx-dialog>
<!-- 分享 -->
<share-dialog :isShareVisible="isShareVisible" :shareForm="shareForm" @handleShareClose="handleShareClose"></share-dialog>
</div>
</template>
<script>
import * as dayjs from 'dayjs'
import url from '@/assets/empty.png'
import shareDialog from '../productGroup/components/shareDialog'
import { truncate } from 'fs'
export default {
name: 'productGroup',
data() {
return {
size: 'small',
url: url,
// 下架
isDownVisible: false,
downForm: {
id: '',
offReason: '',
goodsStatus: 0
},
downRules: {
offReason: [{ required: true, message: '请输入下架备注', trigger: 'change' }]
},
// 分享
isShareVisible: false,
shareForm: {},
// 表格
searchForm: {
goodsName: '',
createDate: [],
goodsStatus: ''
},
tableSearchForm: {},
// 搜索
searchFormData: [
{
label: '商品名称',
name: 'goodsName',
type: 'input',
maxlength: 20
},
{
label: '创建日期',
name: 'createDate',
type: 'datePicker',
isClear: true,
pickerOptions: 'beforeRangePickerOptions'
},
{
label: '商品状态',
name: 'goodsStatus',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confName',
optionsName: 'goodsStatusList'
}
],
// 表格
getListApi: this.$apis.proManage.getListApi,
tableParams: {
listName: 'list',
tableOption: true,
tableColumns: [
{
label: '商品名称',
prop: 'goodsName',
line: 2
},
{
label: '缩略图',
prop: 'goodsImage',
addHtml: 'goodsImage'
},
{
label: '浏览量(次)',
name: 'goodsStatistics',
width: '180',
formatter: cellValue => {
return cellValue.goodsStatistics ? cellValue.goodsStatistics.viewAmount || '0' : '0'
}
},
{
label: '销量',
name: 'goodsStatistics',
formatter: cellValue => {
return cellValue.goodsStatistics ? cellValue.goodsStatistics.saleAmount || '0' : '0'
}
},
{
label: '零售价(元)',
name: 'retailPrice',
width: '180',
formatter: cellValue => {
return cellValue.retailPrice
}
},
{
label: '库存',
name: 'goodsStock',
formatter: cellValue => {
return cellValue.goodsStock || '0'
}
},
{
label: '创建日期',
prop: 'createdDate',
width: '180',
formatter: cellValue => {
return dayjs(cellValue.createdDate).format('YYYY-MM-DD HH:mm:ss')
}
},
{
label: '商品状态',
name: 'goodsStatus',
formatter: cellValue => {
return this.baseData.goodsStatusList.find(item => item.confId == cellValue.goodsStatus).confName
}
},
{
label: '带货来源',
name: 'goodsSource',
formatter: cellValue => {
return this.baseData.goodsSourceList.find(item => item.confId == cellValue.goodsSource).confName
}
}
]
},
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
baseData: {
goodsStatusList: [
{
confId: '0',
confName: '已下架'
},
{
confId: '1',
confName: '已上架'
}
],
goodsSourceList: [
{
confId: '1',
confName: '门店'
},
{
confId: '2',
confName: '带货'
}
]
}
}
},
components: {
shareDialog
},
mounted() {
this.getOptionsList('searchFormData')
},
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.searchForm))
if (this.searchForm.createDate.length) {
params.startTime = new Date(this.searchForm.createDate[0]).toLocaleDateString().replace(/\//g, '-') + ' 00:00:00'
params.endTime = new Date(this.searchForm.createDate[1]).toLocaleDateString().replace(/\//g, '-') + ' 23:59:59'
}
delete params.createDate
return params
},
beforeSearchFn() {
return new Promise(resolve => {
this.tableSearchForm = this.getParams()
delete this.tableSearchForm.createDate
resolve()
})
},
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
this.$confirm(txt, title, {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
callback: action => {
if (action == 'confirm') {
this.$apis[apiModule][apiName](apiParams).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
fn && fn()
this.handleSearch()
}
})
}
}
})
},
// addOrEdit:1-新增;2-编辑;3-查看
// groupOrStore:1-集团;2-门店
// goodsSource: 1-门店;2-带货
handleEdit(addOrEdit, row) {
// if (addOrEdit != 1 && row.goodsSource == 2) {
// this.$router.push('/productStore/editProductDh/' + addOrEdit + '/' + row.id)
// return true
// }
// addOrEdit == 1 ? this.$router.push('/productGroup/editProduct/' + addOrEdit + '/' + 2) : this.$router.push('/productGroup/editProduct/' + addOrEdit + '/' + 2 + '/' + row.id)
var titleObj = {
1: '新建商品',
2: '编辑商品',
3: '查看商品'
}
var params = {
addOrEdit: addOrEdit,
groupOrStore: 2,
$title: encodeURI(titleObj[addOrEdit])
}
addOrEdit != 1 && (params.id = row.id)
this.$router.push({
path: '/productGroupGH/editProduct',
query: params
})
},
handleEditDh(addOrEdit, row) {
var titleObj = {
2: '编辑商品',
3: '查看商品'
}
var params = {
addOrEdit: addOrEdit,
id: row.id,
$title: encodeURI(titleObj[addOrEdit])
}
this.$router.push({
path: '/productStoreGH/editProductDh',
query: params
})
},
// 下架通知
handleDwonNotice(row) {
this.$alert('你带货的' + row.goodsName + '商品现已下架,下架原因:' + row.offReason, '商品下架通知', {
confirmButtonText: '确定',
callback: action => { }
})
},
handleUpOrDown(row) {
var title = row.goodsStatus == 0 ? '上架' : '下架'
this.secondConfirm(title, '是否确认' + title + '该商品?', 'proManage', 'updateStatusProApi', { id: row.id, goodsStatus: row.goodsStatus == 0 ? 1 : 0 })
},
// 取消带货
handleTakeGood(row) {
this.secondConfirm('取消带货', '是否确认取消带货该商品?', 'proManage', 'deleteTakeProApi', { id: row.id })
},
dwonVisibleChange() {
this.$refs.downRef && this.$refs.downRef.clearValidate()
this.isDownVisible = !this.isDownVisible
},
handleDownClose() {
this.dwonVisibleChange()
this.downForm = {
id: '',
offReason: '',
goodsStatus: 0
}
},
handleDownConfirm() {
this.$refs.downRef.validate(valid => {
if (valid) {
this.$apis.proManage.updateStatusProApi(this.downForm).then(res => {
this.$message({
message: res.code == '0' ? '操作成功' : res.message,
type: res.code == '0' ? 'success' : 'error'
})
if (res.code == '0') {
this.handleDownClose()
this.handleSearch()
}
})
}
})
},
// 置顶
handleTop(row) {
this.secondConfirm('置顶', '是否确认置顶该商品?', 'proManage', 'topProApi', { id: row.id })
},
handleShare(row) {
this.$apis.proManage.getProShareApi({ id: row.id }).then(res => {
this.shareForm = res
this.handleShareClose()
})
},
handleShareClose() {
this.isShareVisible = !this.isShareVisible
},
getOptionsList(formName, hasAll = true, refreshSigle) {
if (refreshSigle) {
var item = this[formName].find(k => k.name == refreshSigle)
var index = this[formName].findIndex(k => k.name == refreshSigle)
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
} else {
this[formName].forEach((item, index) => {
if (item.type === 'select' && this.baseData[item.optionsName].length) {
this.$set(this[formName][index], 'optionList', this.$common.utils.deepClone(this.baseData[item.optionsName]))
if (hasAll && this.baseData[item.optionsName].length && this.baseData[item.optionsName][0][this[formName][index].optionLabel] !== '全部') {
const temp = {}
temp[this[formName][index].optionId] = ''
temp[this[formName][index].optionLabel] = '全部'
this[formName][index].optionList.unshift(temp)
}
}
})
}
},
setTableFinishFun() {
//接收到的数据为空
if (!this.$refs.proGroupRef.data.length) {
this.$refs.proGroupRef.setTableHeightFun()
} else {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function (a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function (a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
}
},
handleSearch() {
this.$refs.proGroupRef.refreshTable()
},
handleReset() {
this.searchForm = {
goodsName: '',
createDate: [],
goodsStatus: ''
}
this.handleSearch()
}
}
}
</script>
<style scoped></style>
<!-- 带货管理 -->
<template>
<div class="marketing take-good">
<div class="marketing take-good p-t-20">
<div class="container">
<div>
<glsx-combi-form ref="showSearch" :formObj="searchForm" :formData="searchFormData">
......@@ -16,12 +16,10 @@
<!-- 表格区域 开始 -->
<GLTable ref="takeGoodRef" class="table-img" :getListApi="getListApi" :noDataImg="url" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="goodsImage" slot-scope="scope">
<!-- <el-tooltip placement="top" trigger="hover" popper-class="table-show-img" effect="light" :visible-arrow="false">
<div slot="content" class="table-show-img">
<img class="img-w-100" :src="scope.scope.goods.goodsImage" />
</div> -->
<img class="img-60" :src="scope.scope.goods.goodsImage" />
<!-- </el-tooltip> -->
<el-popover placement="top" width="160" trigger="hover" popper-class="table-popover-block">
<img class="table-popover-img" :src="scope.scope.goods.goodsImage" />
<img class="img-60 pointer" slot="reference" :src="scope.scope.goods.goodsImage" />
</el-popover>
</div>
<div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="!scope.scope.taked" type="text" @click="handleSingleTakeGood(scope.scope)">带货</el-button>
......@@ -44,6 +42,7 @@ export default {
return {
size: 'small',
url: url,
hideAfter: 100000,
searchForm: {
goodsName: '',
createDate: []
......
......@@ -5,15 +5,15 @@
<div class="container">
<p class="edit-title">{{ title }}</p>
<div class="flex" style="margin-top: 20px;">
<div style="width: 440px; text-align: center;">
<el-carousel height="420px">
<div class="main-img-box">
<el-carousel height="375px">
<el-carousel-item v-for="item in editForm.goodsDetailImageList" :key="item">
<video v-if="item.resType == 3" class="inner-img" :src="item.content"></video>
<img class="inner-img" :src="item.content" />
</el-carousel-item>
</el-carousel>
</div>
<div style="width: calc(100% - 440px);">
<div style="width: calc(100% - 375px);">
<p class="pro-name txt-ellipsis">{{ editForm.goodsName }}</p>
<p v-show="!specificationDetailList.length" class="txt-ellipsis">
供货价:
......@@ -94,13 +94,15 @@ export default {
label: '供货价',
name: 'supplyPrice',
type: 'input',
isDisabled: true
isDisabled: true,
width: '411px'
},
{
label: '库存',
name: 'goodsStock',
type: 'input',
isDisabled: true
isDisabled: true,
width: '411px'
}
]
}
......@@ -227,6 +229,17 @@ export default {
border-bottom: 1px solid #e5e5e5;
}
.edit-product-dh .inner-img {
width: 100%;
height: 100%;
}
.edit-product-dh .main-img-box {
width: 375px;
text-align: center;
margin: 0 34px 0 20px;
}
.view {
width: 375px;
height: 667px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!