<template>
|
<el-col :span="24" class="form inner-bg-style">
|
<el-form size="mini" ref="form" label-width="140px" :model="form" class="product"
|
:disabled="$route.query.pageTag === 'detail'" :rules="formRules">
|
<!-- <div v-show="showCategory">
|
<p class="category">选择品类发布商品</p>
|
<el-form-item label="选择品类:">
|
<el-cascader ref="cascaderAddr" :options="categoryList" :props="categoryProp"
|
@change="handleChange" style="width: 50%" clearable>
|
<div slot-scope="scope" @click="clickCategory('cascaderAddr',$event)">
|
{{scope.data.catName}}</div>
|
</el-cascader>
|
</el-form-item>
|
</div> -->
|
<div v-show="!showCategory && !showSkuMetas">
|
<p>商品信息</p>
|
<div class="formBlock">
|
<el-row>
|
<el-col :span="12">
|
<div v-if="pageTag === 'add' || (pageTag === 'edit' && form.prodSpu.spuType === '3')">
|
<el-form-item label="选择品类:" prop="categoryArr">
|
<el-cascader ref="cascaderAddr" v-model="form.categoryArr" :options="categoryList"
|
:props="categoryProp" @change="handleChange" clearable>
|
<div slot-scope="scope" @click="clickCategory('cascaderAddr',$event)">
|
{{scope.data.catName}}</div>
|
</el-cascader>
|
</el-form-item>
|
</div>
|
<div v-else>
|
<span>{{this.form.prodSpu.cascaderLabel}}</span>
|
<!-- <el-button type="text" @click="againChoice" v-if="!spuId">重选品类</el-button> -->
|
</div>
|
</el-col>
|
</el-row>
|
</div>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="商品主编码:" prop="prodSpu.spuNum">
|
<!-- <el-input placeholder="请输入与主数据商品编号一致的商品编号" v-model="form.prodSpu.spuNum" clearable>
|
</el-input> -->
|
<el-autocomplete v-model.trim="form.prodSpu.spuNum" :disabled="!!$route.query.spuId"
|
:fetch-suggestions="querySearchAsync"
|
placeholder="请输入与主数据商品编号一致的商品编号" @select="handleSelect"
|
@change="changeSpuNum" :trigger-on-focus="false" style="width: 100%"
|
oninput="value=value.replace(/[^\w]/g,'')">
|
<template slot-scope="{ item }">
|
<div :class="item.isExist ? 'is-disabled' : ''">
|
<div class="spuNum">{{ item.spuNum }}</div>
|
<span class="content">{{ item.spuName }} <span
|
class="exist">{{item.isExist ? '【已存在】' : ''}}</span></span>
|
</div>
|
</template>
|
</el-autocomplete>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12" v-if="form.shopSpu.packageCode">
|
<el-form-item label="平台套餐编码:">
|
{{form.shopSpu.packageCode}}
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="商品名称:" prop="prodSpu.spuName">
|
<el-input placeholder="请输入商品名称" v-model="form.prodSpu.spuName" clearable></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="商品类型:" prop="prodSpu.spuCls">
|
<el-select placeholder="请选择商品类型" v-model="form.prodSpu.spuCls" clearable>
|
<el-option label="酒类" value="1" key="1"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="商品品牌:" prop="prodSpu.brandId">
|
<el-select ref="brandLabel" placeholder="请选择商品品牌" v-model="form.prodSpu.brandId"
|
clearable @change="getBrandLabel">
|
<el-option v-for="item in brandArray" :key="item.brandId" :value="item.brandId"
|
:label="item.brandName"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="展示分类:">
|
<el-cascader ref="displayCascader" :options="displayCategoryArray"
|
:props="displayCategoryProp" v-model="catIdSaleArray" clearable>
|
<!-- <div slot-scope="scope" @click="clickCategory('displayCascader',$event)">{{scope.data.catName}}</div> -->
|
</el-cascader>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="计量单位:" prop="prodSpu.spuUnit">
|
<el-input placeholder="请输入计量单位" :disabled="form.skuMetasArray.length ? true : false"
|
v-model="form.prodSpu.spuUnit" clearable></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="广告词:" prop="prodSpu.spuAdWords">
|
<el-input placeholder="请输入广告词" v-model="form.prodSpu.spuAdWords" clearable></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="商品标签:" prop="prodSpu.spuTags">
|
<el-input placeholder="请输入商品标签" v-model="form.prodSpu.spuTags" clearable></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="分享描述:" prop="prodSpu.spuShare">
|
<el-input placeholder="请输入分享描述" v-model="form.prodSpu.spuShare" clearable></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<!-- <el-col :span="12">
|
<el-form-item label="商品负库存:" prop="prodSpu.negativeStockType">
|
<el-radio-group v-model="form.prodSpu.negativeStockType">
|
<el-radio label="1">允许</el-radio>
|
<el-radio label="0">不允许</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</el-col> -->
|
<el-col :span="12">
|
<el-form-item label="展示到推荐:" prop="prodSpu.isRecommend">
|
<el-radio-group v-model="form.prodSpu.isRecommend">
|
<el-radio label="1">推荐</el-radio>
|
<el-radio label="0">不推荐</el-radio>
|
</el-radio-group>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<!-- <el-form-item label="优先展示:" prop="firstDisplay">
|
<el-radio-group v-model="form.firstDisplay" @change="changeFirstDisplay">
|
<el-radio label="1">是</el-radio>
|
<el-radio label="0">否</el-radio>
|
</el-radio-group>
|
</el-form-item> -->
|
<!-- <el-row>
|
<el-col :span="12">
|
<el-form-item label="展示顺序:" v-if="form.firstDisplay==='1'" prop="prodSpu.hotProduct">
|
<el-select v-model="form.prodSpu.hotProduct">
|
<el-option label="1" value="3"></el-option>
|
<el-option label="2" value="2"></el-option>
|
<el-option label="3" value="1"></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row> -->
|
<div v-if="showSpecifications && form.prodSpu.spuType !== '3'">
|
<div class="formBlock">
|
<span>价格库存</span>
|
</div>
|
<div v-if="isTip" class="itemTip">温馨提示:销售价格不应低于红线价格</div>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="销售价格:" prop="shopSpu.prodPrice.salePrice">
|
<el-input-number v-model="form.shopSpu.prodPrice.salePrice"
|
@keydown.native="limiInputType" clearable
|
@change="changeProdSalePrice">
|
</el-input-number>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="挂牌价格:" prop="shopSpu.prodPrice.listPrice">
|
<el-input-number v-model="form.shopSpu.prodPrice.listPrice"
|
@keydown.native="limiInputType" clearable></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item prop="shopSpu.prodPrice.redLinePrice">
|
<template slot="label">
|
<span>红线价格(瓶)
|
<el-popover placement="top" trigger="click">
|
1.指该商品规格最低销售价格,不得低于红线价<br />
|
2.该价统一由工管部规划
|
<i class="el-icon-question" style="cursor:pointer;" slot="reference"></i>
|
</el-popover>
|
<span>:</span>
|
</span>
|
</template>
|
<el-input-number v-if="form.shopSpu.prodPrice.redLinePrice" disabled
|
v-model="form.shopSpu.prodPrice.redLinePrice"
|
@keydown.native="limiInputType" clearable>
|
</el-input-number>
|
<span v-else>-</span>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="商品库存:" prop="shopSpu.spuStorage">
|
<el-input-number disabled v-model="form.shopSpu.spuStorage" :min='0'
|
@keydown.native="limiInputType" clearable></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="预警库存:" prop="shopSpu.spuFreezeStorage">
|
<el-input-number disabled v-model="form.shopSpu.spuFreezeStorage" :min='0'
|
@keydown.native="limiInputType" clearable></el-input-number>
|
</el-form-item>
|
</el-col>
|
<el-col :span="12">
|
<el-form-item label="扣减方式:" prop="shopSpu.storageMinusType">
|
下单后扣减
|
<!-- <el-select placeholder="请选择扣减方式" v-model="form.shopSpu.storageMinusType" clearable>
|
<el-option v-for="item in reduceArray" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
</el-select> -->
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="12">
|
<el-form-item label="商品扣减数:" prop="shopSpu.skuReduceStorage"
|
:rules="formRules.skuReduceStorage">
|
<el-input-number disabled v-model="form.shopSpu.skuReduceStorage" :min='0'
|
@keydown.native="limiInputType" clearable></el-input-number>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</div>
|
<sku-metas-info v-else ref="skuMetas" :reduceArray="reduceArray" :form="form"
|
:showSkuMetas="showSkuMetas" :formRules='formRules'></sku-metas-info>
|
<!-- <div class="formBlock">
|
<span>商品属性</span>
|
</div>
|
<div>
|
<span v-for="(item,index) in form.categoryPropArray" class="categoryPropStyle" :key="index">
|
<el-form-item :label="item.productProp.propName+':'" :prop="'categoryPropArray.'+index+'.temporaryId'" v-if="item.productProp.propShow !== '0'" :rules="{required: item.productProp.propRequired ? true : false, message: `请输入${item.productProp.propName}`}">
|
<el-select :placeholder="'请选择'+item.productProp.propName" v-model="item.temporaryId" clearable >
|
<el-option v-for="itemProp in item.propMetaValues" :key="itemProp.propValueId" :value="itemProp.propValueId" :label="itemProp.propValue"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item :label="item.productProp.propName+':'" :prop="'categoryPropArray.'+index+'.customPropValue'" v-if="item.productProp.propShow === '0'" :rules="[{required: item.productProp.propRequired ? true : false, message: `请输入${item.productProp.propName}`},{max:128,message:`${item.productProp.propName}最多只能输入 128 个字`}]">
|
<el-input :placeholder="'请输入'+item.productProp.propName" v-model="item.customPropValue" clearable></el-input>
|
</el-form-item>
|
</span>
|
</div> -->
|
<div class="formBlock">
|
<span>商品详情</span>
|
</div>
|
<el-form-item label="商品轮播图片:" prop="prodImgs">
|
<custom-upload-img :limitNumber="5"
|
:accept='".jpg,.jpeg,.png,.JPG,.JPEG,.PBG,.gif,.GIF,.mp4"'
|
@handle-file-data="handleFileData" :draggable="true"
|
@handle-success="handleSuccess" @handle-remove="handleRemove"
|
:isHideDelete="$route.query.pageTag !== 'detail'"
|
:imageSize="'754 * 754'" :fileList="form.prodImgs"></custom-upload-img>
|
</el-form-item>
|
<el-form-item v-if="$route.query.pageTag === 'detail'" label="商品描述:">
|
<div class="content" v-html="form.spuDetails[0].spuContent"></div>
|
</el-form-item>
|
<el-form-item v-else label="商品描述:" prop="spuDetails[0].spuContent">
|
<!-- <tinymce @get-context="getContext" :contentTxt ="form.spuDetails[0].spuContent" ></tinymce> -->
|
<Editor ref="editor" :content.sync="form.spuDetails[0].spuContent"></Editor>
|
</el-form-item>
|
</div>
|
<!-- <sku-metas-info ref="skuMetas" :reduceArray="reduceArray" :form="form" :showSkuMetas="showSkuMetas" :formRules='formRules'></sku-metas-info> -->
|
</el-form>
|
<el-row class="buttonPosition">
|
<!-- <el-button type="primary" v-show="showSkuMetas " size="mini" @click="upStep">上一步</el-button> -->
|
<!-- <el-button type="primary" v-show="showCategory && categoryId" size="mini" @click="nextStep">
|
下一步</el-button> -->
|
<!-- <el-button type="primary" v-show="!showCategory&&form.skuMetasArray.length&&!showSkuMetas" size="mini" @click="nextStepTwo">下一步</el-button> -->
|
<el-button type="primary" v-show="!showCategory && $route.query.pageTag !== 'detail'"
|
size="mini" :loading="loading" @click="submit">保存</el-button>
|
<el-button size="mini" @click="cancel">取消</el-button>
|
</el-row>
|
</el-col>
|
</template>
|
<script>
|
import productListApi from '@/api/productmanagement/productList'
|
import productCategoryApi from '@/api/productmanagement/productCategory'
|
import productExhibitionApi from '@/api/productmanagement/productExhibition'
|
import skuMetasInfo from '@/views/product/components/skuMetasInfo.vue'
|
// import tinymce from '@/components/tinymce/index.vue'
|
import Editor from '@/components/editor/editor.vue'
|
import { getStrLength } from '@/utils/getStrLength'
|
import { limiInputType } from '@/utils/limiInputType'
|
import { limitNumType, validatePrice, inputNumberValid } from '@/utils/validator'
|
|
export default {
|
components: {
|
skuMetasInfo,
|
Editor
|
// tinymce
|
},
|
data() {
|
var validateType = (rule, value, callback) => {
|
if (((!this.showCategory && !this.form.skuMetasArray.length) || this.showSkuMetas) && !value) {
|
callback(new Error('请选择扣减方式'))
|
} else {
|
callback()
|
}
|
}
|
// var validateSpuStorage = (rule, value, callback) => {
|
// if (((!this.showCategory && !this.form.skuMetasArray.length) || this.showSkuMetas) && value === null && value === '') {
|
// callback(new Error('请输入商品库存'))
|
// } else {
|
// callback()
|
// }
|
// }
|
// var validateSpuFreezeStorage = (rule, value, callback) => {
|
// // if (((!this.showCategory && !this.form.skuMetasArray.length) || this.showSkuMetas) && value === null && value === '') {
|
// // callback(new Error('请输入预警库存'))
|
// // }
|
// const reg = /^[0-9]*$/ // 只能输入正整数
|
// if (value && !reg.test(value)) {
|
// callback(new Error('请输入大于等于0的整数'))
|
// } else if (((!this.showCategory && !this.form.skuMetasArray.length) || this.showSkuMetas) && value >= this.form.shopSpu.spuStorage) {
|
// callback(new Error('预警库存应小于商品库存'))
|
// } else {
|
// callback()
|
// }
|
// }
|
// const inputStorgeNumberValid = (rule, value, callback) => {
|
// const reg = /^[0-9]*$/ // 只能输入正整数
|
// if (((!this.showCategory && !this.form.skuMetasArray.length) || this.showSkuMetas) && (!value || !reg.test(value))) {
|
// callback(new Error('请输入大于0的整数'))
|
// } else {
|
// callback()
|
// }
|
// }
|
return {
|
dialogImageUrl: '',
|
dialogVisible: false,
|
showSkuMetas: false,
|
showSpecifications: false, // 是否展示商品规格
|
isTip: false, // 超过红线价格提示
|
form: {
|
tableLabel: null,
|
firstDisplay: '0',
|
categoryArr: [], // 选中的品类
|
prodSpu: {
|
brandId: null,
|
spuNum: null,
|
spuPriceCls: 1,
|
cascaderLabel: null,
|
brandName: null,
|
spuLibraryType: '1',
|
negativeStockType: '0',
|
isRecommend: '0',
|
spuUnit: null,
|
hotProduct: null,
|
catId: null
|
},
|
shopSpu: {
|
prodPrice: {
|
listPrice: null,
|
salePrice: null,
|
redLinePrice: null
|
},
|
// prodStorages: [{
|
// skuFreezeStorage: null,
|
// skuStorage: null
|
// }],
|
spuFreezeStorage: null,
|
spuStorage: null,
|
skuReduceStorage: 1,
|
storageMinusType: '0',
|
oldSkuId: null,
|
packageCode: null
|
},
|
spuDetails: [{
|
spuContent: '',
|
spuShowType: '2'
|
}],
|
prodImgs: [],
|
categoryPropArray: [], // 属性数组
|
skuMetasArray: [] // 单品数组
|
},
|
formRules: {
|
categoryArr: [{ required: true, message: '请选择品类', trigger: 'change' }],
|
'prodSpu.spuNum': [
|
{ required: true, message: '请输入与主数据商品编号一致的商品编号', trigger: 'change' },
|
{ max: 32, message: '商品主编码最多只能输入 32 个字' },
|
{ validator: limitNumType }
|
],
|
'prodSpu.spuName': [{ required: true, message: '请输入商品名称', trigger: 'change' }, {
|
validator: (rule, value, callback) => {
|
callback(getStrLength(rule, value, callback, 255, '商品名称'))
|
}
|
}],
|
'prodSpu.spuCls': [{ required: true, message: '请选择商品类型', trigger: 'change' }],
|
'prodSpu.spuLibraryType': [{ required: true, message: '请选择商品是否添加商品库', trigger: 'change' }],
|
'prodSpu.isRecommend': [{ required: true, message: '请选择商品是否展示到推荐', trigger: 'change' }],
|
firstDisplay: [{ required: true, message: '请选择商品是否优先展示', trigger: 'change' }],
|
'prodSpu.negativeStockType': [{ required: true, message: '请选择是否负库存', trigger: 'change' }],
|
'prodSpu.hotProduct': [{ required: true, message: '请选择商品展示顺序', trigger: 'change' }],
|
'prodSpu.brandId': [{ required: true, message: '请选择商品品牌', trigger: 'change' }],
|
// 'prodSpu.catIdSale': [{ required: true, message: '请选择展示分类' }],
|
'prodSpu.spuUnit': [{ required: true, message: '请输入计量单位', trigger: 'change' }, {
|
validator: (rule, value, callback) => {
|
callback(getStrLength(rule, value, callback, 8, '计量单位'))
|
}
|
}],
|
'shopSpu.prodPrice.salePrice': [
|
{ required: true, message: '请输入销售价格', trigger: 'change' },
|
{ validator: validatePrice }
|
],
|
'shopSpu.prodPrice.listPrice': [
|
{ required: true, message: '请输入挂牌价格', trigger: 'change' },
|
{ validator: validatePrice }
|
],
|
'spuDetails[0].spuContent': [{ required: true, message: '请输入商品描述', trigger: 'change' }, {
|
validator: (rule, value, callback) => {
|
callback(getStrLength(rule, value, callback, 4194304, '商品描述'))
|
}
|
}],
|
'shopSpu.storageMinusType': [{ required: true, validator: validateType }],
|
prodImgs: [{ type: 'array', required: true, message: '请上传商品轮播图片' }],
|
'prodSpu.spuAdWords': [{
|
validator: (rule, value, callback) => {
|
callback(getStrLength(rule, value, callback, 512, '广告词'))
|
}
|
}],
|
'prodSpu.spuTags': [{
|
validator: (rule, value, callback) => {
|
callback(getStrLength(rule, value, callback, 15, '商品标签'))
|
}
|
}],
|
'prodSpu.spuShare': [{
|
validator: (rule, value, callback) => {
|
callback(getStrLength(rule, value, callback, 1024, '分享描述'))
|
}
|
}],
|
salePrice: [
|
{ required: true, message: '请输入销售价格', trigger: 'change' },
|
{ validator: validatePrice }
|
],
|
listPrice: [{ required: true, message: '请输入挂牌价格', trigger: 'change' }, { validator: validatePrice }],
|
// skuStorage: [
|
// { required: true, message: '请输入商品库存', trigger: 'change' },
|
// { validator: inputNumberValid }
|
// ],
|
// skuFreezeStorage: [
|
// { required: true, message: '请输入预警库存', trigger: 'change' },
|
// { validator: inputNumberValid }
|
// ],
|
// 'shopSpu.spuStorage': [
|
// { required: true, validator: validateSpuStorage },
|
// { validator: inputStorgeNumberValid }
|
// ],
|
// 'shopSpu.spuFreezeStorage': [
|
// { validator: validateSpuFreezeStorage }
|
// // { validator: inputStorgeNumberValid }
|
// ],
|
skuReduceStorage: [
|
{ required: true, message: '请输入扣减库存', trigger: 'change' },
|
{ validator: inputNumberValid }
|
],
|
skuPropValueId: [{ required: true, message: '请选择规格', trigger: 'change' }]
|
},
|
showCategory: false,
|
reduceArray: [
|
{
|
name: '下单后',
|
id: '0'
|
},
|
{
|
name: '支付后',
|
id: '1'
|
},
|
{
|
name: '到货后',
|
id: '2'
|
},
|
{
|
name: '不扣减库存',
|
id: '3'
|
}
|
],
|
categoryList: [], // 品类数组
|
categoryProp: {
|
value: 'catId',
|
label: 'catName',
|
children: 'childrens',
|
checkStrictly: true
|
},
|
displayCategoryProp: {
|
value: 'catId',
|
label: 'catName',
|
children: 'childrens',
|
multiple: true
|
},
|
brandArray: [], // 商品品牌数组
|
displayCategoryArray: [], // 展示分类数组
|
catIdSaleArray: [], // 展示分类数组
|
spuId: null, // 商品Id
|
pageTag: 'add', // 页面标识
|
loading: false,
|
spuNumArr: [], // 搜索主数据编码
|
oldSpuNum: null // 存一个每次点击前的spuNum
|
}
|
},
|
created() {
|
this.spuId = this.$route.query.spuId
|
this.pageTag = this.$route.query.pageTag
|
if (this.spuId) {
|
// this.showCategory = false
|
this.getFormDetails()
|
this.form.prodSpu.cascaderLabel = null
|
} else {
|
this.initForm()
|
}
|
this.getCategory() // 获取分类树
|
},
|
watch: {
|
'form.spuDetails': {
|
handler: function (newValue) {
|
if (newValue[0].spuContent) {
|
this.$refs.form.clearValidate('spuDetails[0].spuContent')
|
}
|
},
|
deep: true
|
}
|
},
|
methods: {
|
// 当主数据编码失去焦点的时候,遍历查询到的主数据,获取商品名称
|
changeSpuNum(value) {
|
if (value !== this.oldSpuNum && this.oldSpuNum !== 'custom') {
|
if (this.showSkuMetas) {
|
this.$refs.skuMetas.skuMetaForm.tableData = []
|
// 是自己输入的商品主编码
|
this.oldSpuNum = 'custom'
|
}
|
// 非单品
|
if (this.form.skuMetasArray.length === 0) {
|
this.getNotSingleRedLinePrice(value)
|
}
|
}
|
const row = this.spuNumArr.find(item => item.spuNum === this.form.prodSpu.spuNum)
|
if (row && !row.isExist) {
|
this.$set(this.form.prodSpu, 'spuName', row.spuName)
|
this.$set(this.form.shopSpu, 'spuStorage', row.stock || 0)
|
this.$set(this.form.shopSpu, 'spuFreezeStorage', row.warningStock || 0)
|
} else if (!row) {
|
this.$set(this.form.shopSpu, 'spuStorage', 0)
|
this.$set(this.form.shopSpu, 'spuFreezeStorage', 0)
|
}
|
},
|
// 非单品的情况获取红线价格
|
getNotSingleRedLinePrice(spuNum) {
|
productListApi.getRedLinePrice({ spuNum: spuNum }).then(res => {
|
// data为空,则主商品未关联红线价格
|
this.form.shopSpu.prodPrice.redLinePrice = res.data ? res.data.redLinePrice : null
|
this.isTip = !!(this.form.shopSpu.prodPrice.redLinePrice !== null && this.form.shopSpu.prodPrice.salePrice < this.form.shopSpu.prodPrice.redLinePrice)
|
})
|
},
|
// 模糊搜索主数据编码
|
querySearchAsync(queryString, cb) {
|
if (queryString) {
|
clearTimeout(this.timeout)
|
this.timeout = setTimeout(async () => {
|
const res = queryString ? await productListApi.queryStockSpuInfoByAssociate({ spuNum: queryString }) : null
|
let results = []
|
if (res.data) {
|
results = res.data
|
}
|
this.spuNumArr = results
|
cb(results)
|
}, 3000 * Math.random())
|
}
|
},
|
handleSelect(item) {
|
if (!item.isExist) {
|
if (this.form.prodSpu.spuNum !== item.spuNum && this.showSkuMetas) {
|
this.$refs.skuMetas.skuMetaForm.tableData = []
|
}
|
this.form.prodSpu.spuNum = item.spuNum
|
this.form.prodSpu.spuName = item.spuName
|
this.form.shopSpu.spuStorage = item.stock
|
this.form.shopSpu.spuFreezeStorage = item.warningStock
|
this.oldSpuNum = this.form.prodSpu.spuNum
|
// 非单品
|
if (this.form.skuMetasArray.length === 0) {
|
this.getNotSingleRedLinePrice(this.form.prodSpu.spuNum)
|
}
|
}
|
},
|
// 点击分类时获取值(点击即改变)
|
clickCategory(name, event) {
|
event.target.parentElement.parentElement.firstChild.click()
|
// // 点击文字 关闭选择框
|
// if (this.$refs[name].toggleDropDownVisible) {
|
// this.$refs[name].toggleDropDownVisible(false)
|
// } else {
|
// this.$refs[name][0].toggleDropDownVisible(false)
|
// }
|
},
|
// 数组更新时重新获取数据
|
handleFileData(arr) {
|
this.form.prodImgs = arr
|
},
|
/**
|
* 当优先展示值改变时触发
|
*/
|
changeFirstDisplay(val) {
|
this.$set(this.form.prodSpu, 'hotProduct', null)
|
},
|
/**
|
* 获取上传成功的图片
|
*/
|
handleSuccess(data) {
|
this.form.prodImgs.push({
|
url: data.url,
|
uid: data.id
|
})
|
this.$refs.form.validateField('prodImgs')
|
},
|
/**
|
* 移除图片
|
*/
|
handleRemove(file, data) {
|
this.form.prodImgs = this.form.prodImgs.filter(v => {
|
return v.uid !== file.uid
|
})
|
},
|
/**
|
* 限制不能输入数字
|
*/
|
limiInputType(e) {
|
limiInputType(e)
|
},
|
/**
|
* 销售价格改变
|
*/
|
changeProdSalePrice() {
|
if (this.form.shopSpu.prodPrice.redLinePrice !== null && this.form.shopSpu.prodPrice.salePrice < this.form.shopSpu.prodPrice.redLinePrice) {
|
this.isTip = true
|
} else {
|
this.isTip = false
|
}
|
},
|
/**
|
* 获取表单详情
|
*/
|
getFormDetails() {
|
productListApi.detailsInfo({ spuId: this.spuId }).then(res => {
|
if (res.data) {
|
// const spuFreezeStorage = res.data.spuInfo[0].spuFreezeStorage
|
// res.data.spuInfo[0].spuFreezeStorage = spuFreezeStorage === null || spuFreezeStorage === '' ? undefined : spuFreezeStorage
|
this.form.prodSpu = res.data.spuInfo
|
if (!res.data.spuInfo.hotProduct || res.data.spuInfo.hotProduct === '0') {
|
res.data.spuInfo.hotProduct = null
|
this.$set(this.form, 'firstDisplay', '0')
|
this.$set(this.form.prodSpu, 'hotProduct', null)
|
} else {
|
this.$set(this.form, 'firstDisplay', '1')
|
}
|
this.form.prodSpu.brandName = res.data.spuInfo.brandName
|
this.form.prodSpu.cascaderLabel = this.getCascader(res.data.categories, 2).join('/')
|
this.catIdSaleArray = []
|
res.data.saleCategories.forEach(item => {
|
const arr = this.getCascader(item, 1)
|
this.catIdSaleArray.push(arr)
|
})
|
const arr = JSON.parse(JSON.stringify(this.form.categoryArr))
|
const cId = arr ? arr[0] : null
|
this.getBrandByCategory(cId)
|
this.getDisplayCategory() // 获取展示品类
|
// this.form.shopSpu.prodStorages = res.data.defaultSkuInfo ? res.data.defaultSkuInfo.prodStorages : [{}]
|
const defaultSkuInfo = res.data.defaultSkuInfo
|
this.form.shopSpu.spuStorage = defaultSkuInfo ? defaultSkuInfo.spuStorage : null
|
this.form.shopSpu.spuFreezeStorage = defaultSkuInfo && defaultSkuInfo.spuFreezeStorage !== null && defaultSkuInfo.spuFreezeStorage !== '' ? defaultSkuInfo.spuFreezeStorage : undefined
|
this.form.shopSpu.skuReduceStorage = 1
|
this.form.shopSpu.oldSkuId = defaultSkuInfo && defaultSkuInfo.skuId
|
this.form.shopSpu.packageCode = defaultSkuInfo && defaultSkuInfo.packageCode
|
|
this.form.categoryPropArray = res.data.spuProps.normalMetas || []
|
const spuPropList = JSON.parse(res.data.spuInfo.spuPropList)
|
this.form.categoryPropArray.forEach(item => {
|
this.$set(item, 'temporaryId', null)
|
this.$set(item, 'customPropValue', null)
|
spuPropList.spuProps.forEach(itemProp => {
|
if (item.productProp.propId === itemProp.propId) {
|
item.temporaryId = itemProp.propValues[0].valuekey
|
if ((item.productProp.propShow === '1' && item.temporaryId === 'null') || item.productProp.propShow === '0') {
|
item.temporaryId = null
|
}
|
item.customPropValue = itemProp.propValues[0].value
|
}
|
})
|
})
|
this.form.prodImgs = res.data.images.map(item => { return { url: item.imgUrl, uid: item.imgId } })
|
if (res.data?.spuProps?.skuMetas) {
|
res.data.spuProps.skuMetas.forEach(item => {
|
item.checkList = []
|
item.propsLable = []
|
})
|
}
|
this.form.skuMetasArray = res.data?.spuProps?.skuMetas ? res.data.spuProps.skuMetas : []
|
// this.form.prodSpu.spuUnit = this.form.skuMetasArray.length ? '瓶' : res.data.spuInfo.spuUnit
|
this.form.tableLabel = ''
|
this.form.skuMetasArray.forEach(item => {
|
// this.form.tableLabel += item.productProp.propName + '/'
|
item.propId = item.productProp.propId
|
item.checkList = []
|
})
|
this.form.tableLabel = this.form.tableLabel.substring(0, this.form.tableLabel.length - 1)
|
|
this.form.shopSpu.storageMinusType = res.data.defaultSkuInfo ? res.data.defaultSkuInfo.storageMinusType : null
|
this.form.spuDetails[0].spuContent = res.data.details[0]?.spuContent
|
this.showSpecifications = !this.form.skuMetasArray.length
|
if (this.showSpecifications) {
|
this.form.shopSpu.prodPrice.salePrice = res.data.defaultSkuInfo ? res.data.defaultSkuInfo.fixedPrice.salePrice : null
|
this.form.shopSpu.prodPrice.listPrice = res.data.defaultSkuInfo ? res.data.defaultSkuInfo.fixedPrice.listPrice : null
|
this.form.shopSpu.prodPrice.redLinePrice = res.data.defaultSkuInfo ? res.data.defaultSkuInfo.fixedPrice.redLinePrice : null
|
this.isTip = !!(this.form.shopSpu.prodPrice.redLinePrice !== null && this.form.shopSpu.prodPrice.salePrice < this.form.shopSpu.prodPrice.redLinePrice)
|
}
|
if (this.form.prodSpu.spuType === '3' && res.data?.suiteQuerySpu) {
|
this.inventedGroupDetails(res.data.suiteQuerySpu)
|
this.showSpecifications = false
|
}
|
// 存在单品时
|
if (this.form.skuMetasArray?.length) {
|
this.getSkuMaintenance(res.data)
|
}
|
}
|
})
|
},
|
// 虚拟组套详情
|
inventedGroupDetails(data) {
|
this.form.shopSpu.storageMinusType = data.storageMinusType
|
this.form.shopSpu.spuStorage = data.spuStorage || 0
|
this.form.shopSpu.spuFreezeStorage = data.spuFreezeStorage || 0
|
this.form.shopSpu.prodPrice.salePrice = data.fixedPrice.salePrice || null
|
this.form.shopSpu.prodPrice.listPrice = data.fixedPrice.listPrice || null
|
data.suiteProds.forEach(item => {
|
this.setSkuMetasTable(item)
|
})
|
},
|
/**
|
* 获取单品信息
|
*/
|
getSkuMaintenance(productBaseInfo) {
|
productListApi.getSkuMaintenance({ spuId: this.spuId }).then(res => {
|
if (res.data) {
|
res.data.shopSpus.forEach(item => {
|
this.form.shopSpu.storageMinusType = item.storageMinusType
|
this.form.shopSpu.spuStorage = item.spuStorage || 0
|
this.form.shopSpu.spuFreezeStorage = item.spuFreezeStorage || 0
|
item.prodSkus.forEach((itemProp, index) => {
|
// 获取选中的单品属性
|
const size = itemProp.skuPropValuesId.length
|
this.form.skuMetasArray.forEach((skuItem, skuIndex) => {
|
skuItem.propMetaValues.forEach((val) => {
|
for (let i = 0; i < size; i++) {
|
if (val.propValueId === itemProp.skuPropValuesId[i]) {
|
this.form.skuMetasArray[skuIndex].checkList.push(itemProp.skuPropValuesId[i])
|
this.form.skuMetasArray[skuIndex].propsLable.push(itemProp.skuPropValuesName[i])
|
}
|
}
|
})
|
})
|
// 给第二阶段table赋值
|
|
this.$refs.skuMetas.$nextTick(() => {
|
this.$refs.skuMetas.showTable = true
|
if (productBaseInfo.defaultSku && this.form.skuMetasArray.length) {
|
this.$refs.skuMetas.skuMetaForm.tableData = []
|
} else {
|
if (this.form.prodSpu.spuType !== '3') {
|
this.setSkuMetasTable(itemProp)
|
}
|
}
|
})
|
})
|
})
|
/**
|
* 去除重复数据
|
*/
|
this.form.skuMetasArray.forEach(item => {
|
item.checkList = [...new Set(item.checkList)]
|
item.propsLable = [...new Set(item.propsLable)]
|
})
|
}
|
})
|
},
|
// 单品套组商品复制
|
setSkuMetasTable(itemProp) {
|
const _fixedPrice = itemProp.fixedPrice
|
this.$refs.skuMetas.skuMetaForm.tableData.push({
|
columnsText: itemProp.skuPropValuesName.join('/'),
|
salePrice: itemProp.fixedPrice.salePrice,
|
listPrice: itemProp.fixedPrice.listPrice,
|
propValueId: itemProp.skuPropValuesId && itemProp.skuPropValuesId[0],
|
fileList: itemProp.listProdImg ? itemProp.listProdImg.map(item => { return { url: item.imgUrl, id: item.imgId, imgNum: item.imgNum } }) : [],
|
skuReduceStorage: itemProp.skuReduceStorage,
|
packageCode: itemProp.packageCode,
|
skuId: itemProp.skuId,
|
spuNum: itemProp.spuNum,
|
spuName: itemProp.spuName,
|
spuTypeName: itemProp.spuTypeName,
|
redLinePrice: itemProp.fixedPrice.redLinePrice,
|
skuStorage: itemProp.listProdStorage ? itemProp.listProdStorage[0].skuStorage : 0,
|
options: [{
|
propValueId: itemProp.skuPropValuesId && itemProp.skuPropValuesId[0],
|
propValue: itemProp.skuPropValuesName && itemProp.skuPropValuesName[0]
|
}],
|
isTip: !!(_fixedPrice.redLinePrice !== null && _fixedPrice.salePrice < _fixedPrice.redLinePrice)
|
// skuFreezeStorage: itemProp.listProdStorage ? itemProp.listProdStorage[0].skuFreezeStorage : 0
|
})
|
},
|
/**
|
* 获取返回的级联数据
|
*/
|
getCascader(data, val) {
|
const arr = []
|
for (const key in data) {
|
if (!data[key]) {
|
continue
|
}
|
if (val === 1) {
|
arr.push(data[key].catId)
|
} else {
|
arr.push(data[key].catName)
|
this.form.categoryArr = [data[key].catId]
|
}
|
}
|
return arr
|
},
|
getContext(value) {
|
this.form.spuDetails[0].spuContent = value
|
},
|
/**
|
* 获取分类树
|
*/
|
getCategory() {
|
productCategoryApi.getList({ bizId: 'B02' }).then(res => {
|
if (res.data) {
|
this.categoryList = res.data
|
}
|
})
|
},
|
/**
|
* 上一步
|
*/
|
upStep() {
|
this.showSkuMetas = false
|
},
|
/**
|
* 下一步
|
*/
|
nextStep() {
|
const arr = JSON.parse(JSON.stringify(this.form.categoryArr))
|
const cId = arr ? arr[0] : null
|
this.getByCategoryProp(cId)
|
this.getBrandByCategory(cId)
|
this.getDisplayCategory()
|
this.$refs.cascaderAddr.$nextTick(() => {
|
this.form.prodSpu.cascaderLabel = this.$refs.cascaderAddr.presentText
|
this.form.prodSpu.catId = cId
|
})
|
},
|
/**
|
*前往下一阶段
|
*/
|
nextStepTwo() {
|
this.form.spuDetails[0].spuContent = this.$refs.editor.getData()
|
this.$refs.form.validate((valid) => {
|
if (valid) {
|
this.showSkuMetas = true
|
} else {
|
this.$message({
|
message: '请完善商品信息',
|
type: 'warning'
|
})
|
}
|
})
|
},
|
/**
|
* 初始化表单
|
*/
|
initForm() {
|
this.form = {
|
firstDisplay: '0',
|
categoryArr: [], // 选中的品类
|
prodSpu: {
|
spuPriceCls: 1,
|
spuLibraryType: '1',
|
negativeStockType: '0',
|
isRecommend: '0',
|
spuUnit: null,
|
hotProduct: null
|
},
|
shopSpu: {
|
prodPrice: {
|
listPrice: null,
|
salePrice: null
|
},
|
// prodStorages: [{
|
// skuFreezeStorage: null,
|
// skuStorage: null
|
// }],
|
spuFreezeStorage: null,
|
spuStorage: null,
|
skuReduceStorage: 1,
|
storageMinusType: '0'
|
},
|
spuDetails: [{
|
spuContent: null,
|
spuShowType: '2'
|
}],
|
prodImgs: [],
|
categoryPropArray: [], // 属性数组
|
skuMetasArray: [] // 单品数组
|
}
|
this.catIdSaleArray = []
|
|
this.$nextTick(() => {
|
this.$refs.skuMetas.initTable()
|
this.$refs.form.clearValidate()
|
})
|
},
|
/**
|
* 重新选择品类
|
*/
|
againChoice() {
|
this.showCategory = true
|
},
|
/**
|
* 选择展示分类
|
*/
|
handleDisplayCategory(val) {
|
// if (val.length > 0) {
|
// this.form.prodSpu.catIdSale = val[val.length - 1]
|
// } else {
|
// this.form.prodSpu.catIdSale = null
|
// }
|
},
|
/**
|
* 选择品类
|
*/
|
handleChange(val) {
|
if (this.pageTag === 'add' || (this.pageTag === 'edit' && this.form.prodSpu.spuType === '3')) {
|
this.initFormData()
|
if (val.length) {
|
this.nextStep()
|
}
|
}
|
},
|
/**
|
* 品类选中项改变---部分数据初始化
|
*/
|
initFormData() {
|
this.form.categoryPropArray = []
|
this.showCategory = false
|
this.showSpecifications = false
|
this.form.skuMetasArray = []
|
// 商品品牌
|
this.form.prodSpu.brandId = null
|
this.brandArray = []
|
// 展示分类
|
this.catIdSaleArray = []
|
// this.displayCategoryArray = []
|
// 计量单位
|
this.form.prodSpu.spuUnit = null
|
this.$refs.cascaderAddr.$nextTick(() => {
|
this.form.prodSpu.cascaderLabel = null
|
this.form.prodSpu.catId = null
|
})
|
this.$nextTick(() => {
|
this.$refs.form.clearValidate(['prodSpu.brandId', 'prodSpu.spuUnit'])
|
})
|
},
|
/**
|
* 选择品牌时
|
*/
|
getBrandLabel(val) {
|
const data = this.brandArray.find(item => {
|
if (item.brandId === val) {
|
return item
|
}
|
})
|
if (data) {
|
this.$set(this.form.prodSpu, 'brandName', data.brandName)
|
}
|
},
|
/**
|
* 通过商品
|
*/
|
getBrandByCategory(categoryId) {
|
productCategoryApi.getCategoryBrandList({ categoryId }).then(res => {
|
if (res.data) {
|
this.brandArray = res.data
|
}
|
})
|
},
|
/**
|
* 获取展示品类
|
*/
|
getDisplayCategory() {
|
productExhibitionApi.getList({ bizId: 'B02' }).then(res => {
|
if (res.data) {
|
this.displayCategoryArray = res.data
|
}
|
})
|
},
|
/**
|
* 通过分类获取产品属性
|
*/
|
getByCategoryProp(catId) {
|
productCategoryApi.getByCategoryProp({ catId }).then(res => {
|
// if (!res.data.normalMetas) {
|
// this.$message({
|
// type: 'info',
|
// message: ' 此品类暂无商品属性,请重新选择!'
|
// })
|
// return
|
// }
|
this.form.categoryPropArray = res.data.normalMetas
|
if (res.data.skuMetas) {
|
res.data.skuMetas.forEach(item => {
|
item.checkList = []
|
})
|
}
|
// skuMetas为null非单品,不为null为单品
|
this.form.skuMetasArray = res.data.skuMetas ? res.data.skuMetas : []
|
this.showCategory = false
|
this.showSpecifications = !res.data.skuMetas
|
this.form.prodSpu.spuUnit = res.data.skuMetas ? '瓶' : null
|
// 品类发生改变,非单品并且主编码存在的情况下这里需要调用获取红线价格的接口
|
if (this.form.skuMetasArray.length === 0 && this.form.prodSpu.spuNum) {
|
this.getNotSingleRedLinePrice(this.form.prodSpu.spuNum)
|
}
|
})
|
},
|
/**
|
* 处理表单数据
|
*/
|
handFormData() {
|
let formData = {}
|
const { spuDetails, shopSpu } = this.form
|
const arr = JSON.parse(JSON.stringify(this.form.categoryArr))
|
formData = { spuDetails, shopSpu }
|
formData.prodSpu = JSON.parse(JSON.stringify(this.form.prodSpu))
|
formData.prodSpu.catId = arr ? arr[0] : null
|
formData.prodSpu.catIdSaleList = this.catIdSaleArray.map(item => item[item.length - 1])
|
if (this.form.firstDisplay === '0') formData.prodSpu.hotProduct = '0'
|
formData.prodImgs = this.form.prodImgs.map((item, index) => { return { imgId: item.uid, imgNum: index + 1, imgUrl: item.url } })
|
formData.spuProps = []
|
this.form.categoryPropArray.map(item => {
|
if (((!item.productProp.propShow || item.productProp.propShow === '1') && item.temporaryId) || (item.productProp.propShow === '0' && item.customPropValue)) {
|
formData.spuProps.push({
|
metaValues: [{ propValueId: item.temporaryId ? item.temporaryId : 'null', customPropValue: item.customPropValue }],
|
propCustom: '0',
|
propId: item.productProp.propId,
|
propName: item.productProp.propName
|
})
|
}
|
})
|
return formData
|
},
|
/**
|
* 当是商品时
|
*/
|
productSave() {
|
let resDate = null
|
if (this.spuId) {
|
resDate = productListApi.updateInfo(this.handFormData())
|
} else {
|
resDate = productListApi.addInfo(this.handFormData())
|
}
|
return resDate
|
},
|
/**
|
*提交
|
*/
|
submit() {
|
this.form.shopSpu.storageMinusType = '0'
|
this.form.spuDetails[0].spuContent = this.$refs.editor.getData()
|
this.$refs.form.validate((valid) => {
|
if (valid) {
|
this.loading = true
|
if (this.form.prodSpu.spuType === '3') {
|
this.inventedGroupEdit()
|
} else {
|
if (this.form.skuMetasArray.length) {
|
this.hasSkuMetas()// 当是单品时
|
} else {
|
// 当是商品时
|
this.productSave().then(res => {
|
if (res.data) {
|
this.$message({
|
message: '操作成功',
|
type: 'success'
|
})
|
this.loading = false
|
this.$router.push({ name: 'productList' })
|
this.$parent.queryList()
|
} else {
|
this.loading = false
|
}
|
}).catch(() => {
|
this.loading = false
|
})
|
}
|
}
|
} else {
|
this.loading = false
|
this.$message({
|
message: '请完善商品信息',
|
type: 'warning'
|
})
|
}
|
})
|
},
|
/**
|
* 第一阶段发布
|
*/
|
firstPublish() {
|
return new Promise(resolve => {
|
let resUrl = null
|
if (this.spuId) {
|
resUrl = productListApi.skuSaveInfoFirst(this.handFormData())
|
} else {
|
resUrl = productListApi.skuAddInfoFirst(this.handFormData())
|
}
|
resUrl.then(res => {
|
if (res.data) {
|
resolve(res.data)
|
} else {
|
this.loading = false
|
}
|
}).catch(() => {
|
this.loading = false
|
})
|
})
|
},
|
/**
|
* 第二阶段发布
|
*/
|
twoPublish(spuId) {
|
if (!this.$refs.skuMetas.skuMetaForm.tableData.length) {
|
this.$message({
|
message: '请选择以上商品属性(至少选择一种属性)',
|
type: 'info'
|
})
|
this.loading = false
|
return
|
}
|
let resDate = null
|
resDate = this.$refs.skuMetas.handFormData()
|
resDate.spuId = spuId
|
const prodSpu = this.form.prodSpu
|
resDate.spuName = prodSpu.spuName
|
resDate.spuNum = prodSpu.spuNum
|
productListApi.skuAddInfoTwo(resDate).then(res => {
|
if (res.data) {
|
this.$message({
|
message: '操作成功',
|
type: 'success'
|
})
|
this.loading = false
|
this.$router.push({ name: 'productList' })
|
this.$parent.queryList()
|
} else {
|
this.loading = false
|
}
|
}).catch(() => {
|
this.loading = false
|
})
|
},
|
// 编辑虚拟组套商品
|
async inventedGroupEdit() {
|
this.loading = true
|
const res = await productListApi.inventedGroupEdit(this.handFormData())
|
if (res.data) {
|
this.$message({
|
message: '操作成功',
|
type: 'success'
|
})
|
this.loading = false
|
this.$router.push({ name: 'productList' })
|
// this.$parent.queryList()
|
}
|
},
|
/**
|
* 当是单品属性时
|
*/
|
hasSkuMetas() {
|
this.$refs.skuMetas.$refs.skuMetaForm.validate().then(async (res) => {
|
this.loading = true
|
const p = await this.firstPublish()
|
await this.twoPublish(p)
|
}).catch(res => {
|
this.loading = false
|
this.$message({
|
message: '请完善单品信息',
|
type: 'warning'
|
})
|
})
|
},
|
/**
|
* 取消
|
*/
|
cancel() {
|
this.$router.push({ name: 'productList' })
|
}
|
}
|
}
|
</script>
|
<style lang="scss">
|
.inputTip {
|
border: 1px solid #d70012;
|
border-radius: 4px;
|
}
|
.itemTip {
|
margin-bottom: 15px;
|
margin-left: 52px;
|
}
|
.el-scrollbar .el-autocomplete-suggestion__list {
|
.content {
|
font-size: 12px;
|
.exist {
|
color: red;
|
}
|
}
|
li:has(.is-disabled) {
|
pointer-events: none;
|
}
|
.is-disabled {
|
cursor: not-allowed;
|
color: #c0c4cc;
|
}
|
}
|
|
.form {
|
padding: 20px;
|
}
|
.product {
|
.el-select {
|
width: 100%;
|
}
|
.buttonPosition {
|
text-align: center;
|
}
|
// p{
|
// border-bottom:1px solid #000000;
|
// font-weight: bold;
|
// font-size: 20px;
|
// padding-bottom: 10px;
|
// }
|
.category {
|
margin-bottom: 20px;
|
}
|
.el-cascader {
|
width: 100%;
|
}
|
.formBlock {
|
border-bottom: 1px solid #cccccc;
|
margin-top: 20px;
|
padding-bottom: 10px;
|
margin-bottom: 20px;
|
}
|
.categoryPropStyle {
|
width: 50%;
|
display: inline-block;
|
}
|
.content {
|
width: 100%;
|
max-height: 600px;
|
border: 1px solid #cccccc;
|
padding: 25px;
|
overflow-y: auto;
|
overflow-x: hidden;
|
.image,
|
.video {
|
text-align: center;
|
}
|
img,
|
video {
|
width: auto;
|
height: auto;
|
max-width: 100%;
|
}
|
div,
|
p {
|
width: 100% !important;
|
}
|
}
|
}
|
</style>
|