|
|
|
@ -9,7 +9,8 @@ |
|
|
|
|
<!--<el-step title="规格设置" />--> |
|
|
|
|
</el-steps> |
|
|
|
|
</div> |
|
|
|
|
<el-form ref="formValidate" v-loading="fullscreenLoading" class="formValidate mt20" :rules="ruleValidate" :model="formValidate" label-width="120px" @submit.native.prevent> |
|
|
|
|
<el-form ref="formValidate" v-loading="fullscreenLoading" class="formValidate mt20" :rules="ruleValidate" |
|
|
|
|
:model="formValidate" label-width="120px" @submit.native.prevent> |
|
|
|
|
<el-row v-show="currentTab === 0" :gutter="24"> |
|
|
|
|
<!-- 商品信息--> |
|
|
|
|
<el-col v-bind="grid2"> |
|
|
|
@ -19,7 +20,8 @@ |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-bind="grid2"> |
|
|
|
|
<el-form-item label="商品分类:" prop="cateIds"> |
|
|
|
|
<el-cascader v-model="formValidate.cateIds" :options="merCateList" :props="props2" clearable class="selWidth" :show-all-levels="false" :disabled="isDisabled"/> |
|
|
|
|
<el-cascader v-model="formValidate.cateIds" :options="merCateList" :props="props2" clearable |
|
|
|
|
class="selWidth" :show-all-levels="false" :disabled="isDisabled" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-bind="grid2"> |
|
|
|
@ -27,14 +29,15 @@ |
|
|
|
|
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" :disabled="isDisabled" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-bind="grid2"> |
|
|
|
|
<!-- <el-col v-bind="grid2"> |
|
|
|
|
<el-form-item label="单位:" prop="unitName"> |
|
|
|
|
<el-input v-model="formValidate.unitName" placeholder="请输入单位" :disabled="isDisabled" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
</el-col> --> |
|
|
|
|
<el-col v-bind="grid2"> |
|
|
|
|
<el-form-item label="商品简介:" prop="storeInfo"> |
|
|
|
|
<el-input v-model="formValidate.storeInfo" type="textarea" maxlength="250" :rows="3" placeholder="请输入商品简介" :disabled="isDisabled"/> |
|
|
|
|
<el-input v-model="formValidate.storeInfo" type="textarea" maxlength="250" :rows="3" placeholder="请输入商品简介" |
|
|
|
|
:disabled="isDisabled" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-bind="grid2"> |
|
|
|
@ -50,20 +53,14 @@ |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="商品轮播图:" prop="sliderImages"> |
|
|
|
|
<div class="acea-row"> |
|
|
|
|
<div |
|
|
|
|
v-for="(item,index) in formValidate.sliderImages" |
|
|
|
|
:key="index" |
|
|
|
|
class="pictrue" |
|
|
|
|
draggable="true" |
|
|
|
|
@dragstart="handleDragStart($event, item)" |
|
|
|
|
@dragover.prevent="handleDragOver($event, item)" |
|
|
|
|
@dragenter="handleDragEnter($event, item)" |
|
|
|
|
@dragend="handleDragEnd($event, item)" |
|
|
|
|
> |
|
|
|
|
<div v-for="(item, index) in formValidate.sliderImages" :key="index" class="pictrue" draggable="true" |
|
|
|
|
@dragstart="handleDragStart($event, item)" @dragover.prevent="handleDragOver($event, item)" |
|
|
|
|
@dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)"> |
|
|
|
|
<img :src="item"> |
|
|
|
|
<i v-if="!isDisabled" class="el-icon-error btndel" @click="handleRemove(index)" /> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="formValidate.sliderImages.length<10 && !isDisabled" class="upLoadPicBox" @click="modalPicTap('2')"> |
|
|
|
|
<div v-if="formValidate.sliderImages.length < 10 && !isDisabled" class="upLoadPicBox" |
|
|
|
|
@click="modalPicTap('2')"> |
|
|
|
|
<div class="upLoad"> |
|
|
|
|
<i class="el-icon-camera cameraIconfont" /> |
|
|
|
|
</div> |
|
|
|
@ -71,30 +68,28 @@ |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :xs="18" :sm="18" :md="18" :lg="12" :xl="12"> |
|
|
|
|
<!-- <el-col :xs="18" :sm="18" :md="18" :lg="12" :xl="12"> |
|
|
|
|
<el-form-item label="运费模板:" prop="tempId"> |
|
|
|
|
<el-select v-model="formValidate.tempId" placeholder="请选择" class="mr20" :disabled="isDisabled" style="width:100%;"> |
|
|
|
|
<el-option |
|
|
|
|
v-for="item in shippingList" |
|
|
|
|
:key="item.id" |
|
|
|
|
:label="item.name" |
|
|
|
|
:value="item.id" |
|
|
|
|
/> |
|
|
|
|
<el-select v-model="formValidate.tempId" placeholder="请选择" class="mr20" :disabled="isDisabled" |
|
|
|
|
style="width:100%;"> |
|
|
|
|
<el-option v-for="item in shippingList" :key="item.id" :label="item.name" :value="item.id" /> |
|
|
|
|
</el-select> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :xs="6" :sm="6" :md="6" :lg="12" :xl="12"> |
|
|
|
|
</el-col> --> |
|
|
|
|
<!-- <el-col :xs="6" :sm="6" :md="6" :lg="12" :xl="12"> |
|
|
|
|
<el-button v-show="!isDisabled" class="mr15" @click="addTem">运费模板</el-button> |
|
|
|
|
</el-col> |
|
|
|
|
</el-col> --> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="商品规格:" props="specType"> |
|
|
|
|
<el-radio-group v-model="formValidate.specType" @change="onChangeSpec(formValidate.specType)" :disabled="isDisabled"> |
|
|
|
|
<el-radio-group v-model="formValidate.specType" @change="onChangeSpec(formValidate.specType)" |
|
|
|
|
:disabled="isDisabled"> |
|
|
|
|
<el-radio :label="false" class="radio">单规格</el-radio> |
|
|
|
|
<el-radio :label="true">多规格</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="佣金设置:" props="isSub"> |
|
|
|
|
<el-radio-group v-model="formValidate.isSub" @change="onChangetype(formValidate.isSub)" :disabled="isDisabled"> |
|
|
|
|
<el-radio-group v-model="formValidate.isSub" @change="onChangetype(formValidate.isSub)" |
|
|
|
|
:disabled="isDisabled"> |
|
|
|
|
<el-radio :label="true" class="radio">单独设置</el-radio> |
|
|
|
|
<el-radio :label="false">默认设置</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
@ -105,7 +100,7 @@ |
|
|
|
|
<el-form-item label="选择规格:" prop=""> |
|
|
|
|
<div class="acea-row"> |
|
|
|
|
<el-select v-model="formValidate.selectRule"> |
|
|
|
|
<el-option v-for="item in ruleList" :key="item.id" :label="item.ruleName" :value="item.id" /> |
|
|
|
|
<el-option v-for="item in ruleList" :key="item.id" :label="item.name" :value="item.id" /> |
|
|
|
|
</el-select> |
|
|
|
|
<el-button type="primary" class="mr20" @click="confirm">确认</el-button> |
|
|
|
|
<el-button class="mr15" @click="addRule">添加规格</el-button> |
|
|
|
@ -113,28 +108,16 @@ |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item> |
|
|
|
|
<div v-for="(item, index) in formValidate.attr" :key="index"> |
|
|
|
|
<div class="acea-row row-middle"><span class="mr5">{{ item.attrName }}</span><i class="el-icon-circle-close" @click="handleRemoveAttr(index)" /></div> |
|
|
|
|
<div class="acea-row row-middle"><span class="mr5">{{ item.attributeName }}</span><i |
|
|
|
|
class="el-icon-circle-close" @click="handleRemoveAttr(index)" /></div> |
|
|
|
|
<div class="rulesBox"> |
|
|
|
|
<el-tag |
|
|
|
|
v-for="(j, indexn) in item.attrValue" |
|
|
|
|
:key="indexn" |
|
|
|
|
closable |
|
|
|
|
size="medium" |
|
|
|
|
:disable-transitions="false" |
|
|
|
|
class="mb5 mr10" |
|
|
|
|
@close="handleClose(item.attrValue,indexn)" |
|
|
|
|
> |
|
|
|
|
<el-tag v-for="(j, indexn) in item.attributeContentList" :key="indexn" closable size="medium" |
|
|
|
|
:disable-transitions="false" class="mb5 mr10" @close="handleClose(item.attrValue, indexn)"> |
|
|
|
|
{{ j }} |
|
|
|
|
</el-tag> |
|
|
|
|
<el-input |
|
|
|
|
v-if="item.inputVisible" |
|
|
|
|
ref="saveTagInput" |
|
|
|
|
v-model="item.attrValue.attrsVal" |
|
|
|
|
class="input-new-tag" |
|
|
|
|
size="small" |
|
|
|
|
@keyup.enter.native="createAttr(item.attrValue.attrsVal,index)" |
|
|
|
|
@blur="createAttr(item.attrValue.attrsVal,index)" |
|
|
|
|
/> |
|
|
|
|
<el-input v-if="item.inputVisible" ref="saveTagInput" v-model="item.attrValue.attrsVal" |
|
|
|
|
class="input-new-tag" size="small" @keyup.enter.native="createAttr(item.attrValue.attrsVal, index)" |
|
|
|
|
@blur="createAttr(item.attrValue.attrsVal, index)" /> |
|
|
|
|
<el-button v-else class="button-new-tag" size="small" @click="showInput(item)">+ 添加</el-button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -175,20 +158,24 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120"> |
|
|
|
|
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" |
|
|
|
|
min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input v-model="scope.row[iii]" maxlength="9" min="0.01" class="priceBox" @blur="keyupEvent(iii, scope.row[iii], scope.$index, 1)"/> |
|
|
|
|
<el-input v-model="scope.row[iii]" maxlength="9" min="0.01" class="priceBox" |
|
|
|
|
@blur="keyupEvent(iii, scope.row[iii], scope.$index, 1)" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<template v-if="formValidate.isSub"> |
|
|
|
|
<el-table-column align="center" label="一级返佣(元)" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input v-model="scope.row.brokerage" type="number" :min="0" :max="scope.row.price" class="priceBox" /> |
|
|
|
|
<el-input v-model="scope.row.brokerage" type="number" :min="0" :max="scope.row.price" |
|
|
|
|
class="priceBox" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="二级返佣(元)" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" :max="scope.row.price" class="priceBox" /> |
|
|
|
|
<el-input v-model="scope.row.brokerageTwo" type="number" :min="0" :max="scope.row.price" |
|
|
|
|
class="priceBox" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</template> |
|
|
|
@ -214,20 +201,24 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120"> |
|
|
|
|
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" |
|
|
|
|
min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row[iii]" maxlength="9" min="0.01" class="priceBox" @blur="keyupEvent(iii, scope.row[iii], scope.$index, 2)" /> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row[iii]" maxlength="9" min="0.01" class="priceBox" |
|
|
|
|
@blur="keyupEvent(iii, scope.row[iii], scope.$index, 2)" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<template v-if="formValidate.isSub"> |
|
|
|
|
<el-table-column align="center" label="一级返佣(元)" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerage" type="number" :min="0" class="priceBox" /> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerage" type="number" :min="0" |
|
|
|
|
class="priceBox" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="二级返佣(元)" min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerageTwo" type="number" :min="0" class="priceBox" /> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerageTwo" type="number" :min="0" |
|
|
|
|
class="priceBox" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</template> |
|
|
|
@ -238,10 +229,12 @@ |
|
|
|
|
<el-button type="default" @click="showAllSku()" :disabled="isDisabled">展示</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
<!-- 多规格表格--> |
|
|
|
|
<el-form-item v-if="formValidate.attr.length>0 && formValidate.specType" label="商品属性:" class="labeltop" :class="isDisabled?'disLabel':'disLabelmoren'"> |
|
|
|
|
<el-form-item v-if="formValidate.attr.length > 0 && formValidate.specType" label="商品属性:" class="labeltop" |
|
|
|
|
:class="isDisabled ? 'disLabel' : 'disLabelmoren'"> |
|
|
|
|
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini"> |
|
|
|
|
<template v-if="manyTabDate"> |
|
|
|
|
<el-table-column v-for="(item,iii) in manyTabDate" :key="iii" align="center" :label="manyTabTit[iii].title" min-width="80"> |
|
|
|
|
<el-table-column v-for="(item, iii) in manyTabDate" :key="iii" align="center" |
|
|
|
|
:label="manyTabTit[iii].title" min-width="80"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span class="priceBox" v-text="scope.row[iii]" /> |
|
|
|
|
</template> |
|
|
|
@ -257,21 +250,24 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-for="(item,iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" min-width="120"> |
|
|
|
|
<el-table-column v-for="(item, iii) in attrValue" :key="iii" :label="formThead[iii].title" align="center" |
|
|
|
|
min-width="120"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<!-- <span>scope.row:{{scope.row}}</span>--> |
|
|
|
|
<el-input :disabled="isDisabled" maxlength="9" min="0.01" |
|
|
|
|
v-model="scope.row[iii]" class="priceBox" @blur="keyupEvent(iii, scope.row[iii], scope.$index, 3)" /> |
|
|
|
|
<el-input :disabled="isDisabled" maxlength="9" min="0.01" v-model="scope.row[iii]" class="priceBox" |
|
|
|
|
@blur="keyupEvent(iii, scope.row[iii], scope.$index, 3)" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="一级返佣(元)" min-width="120" v-if="formValidate.isSub"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerage" type="number" :min="0" :max="scope.row.price" class="priceBox" /> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerage" type="number" :min="0" |
|
|
|
|
:max="scope.row.price" class="priceBox" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column align="center" label="二级返佣(元)" min-width="120" v-if="formValidate.isSub"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerageTwo" type="number" :min="0" :max="scope.row.price" class="priceBox" /> |
|
|
|
|
<el-input :disabled="isDisabled" v-model="scope.row.brokerageTwo" type="number" :min="0" |
|
|
|
|
:max="scope.row.price" class="priceBox" /> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column v-if="!isDisabled" key="3" align="center" label="操作" min-width="80"> |
|
|
|
@ -308,7 +304,8 @@ |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-bind="grid"> |
|
|
|
|
<el-form-item label="积分:"> |
|
|
|
|
<el-input-number v-model="formValidate.giveIntegral" :min="0" placeholder="请输入排序" :disabled="isDisabled" /> |
|
|
|
|
<el-input-number v-model="formValidate.giveIntegral" :min="0" placeholder="请输入排序" |
|
|
|
|
:disabled="isDisabled" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col v-bind="grid"> |
|
|
|
@ -320,24 +317,18 @@ |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="商品推荐:"> |
|
|
|
|
<el-checkbox-group v-model="checkboxGroup" size="small" @change="onChangeGroup" :disabled="isDisabled"> |
|
|
|
|
<el-checkbox v-for="(item, index) in recommend" :key="index" :label="item.value">{{ item.name }}</el-checkbox> |
|
|
|
|
<el-checkbox v-for="(item, index) in recommend" :key="index" :label="item.value">{{ item.name |
|
|
|
|
}}</el-checkbox> |
|
|
|
|
</el-checkbox-group> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="活动优先级:"> |
|
|
|
|
<div class="color-list acea-row row-middle"> |
|
|
|
|
<div |
|
|
|
|
:disabled="isDisabled" |
|
|
|
|
class="color-item" :class="activity[item]" |
|
|
|
|
v-for="item in formValidate.activity" |
|
|
|
|
:key="item" |
|
|
|
|
draggable="true" |
|
|
|
|
@dragstart="handleDragStart($event, item)" |
|
|
|
|
@dragover.prevent="handleDragOver($event, item)" |
|
|
|
|
@dragenter="handleDragEnterFont($event, item)" |
|
|
|
|
@dragend="handleDragEnd($event, item)" |
|
|
|
|
>{{item}}</div> |
|
|
|
|
<div :disabled="isDisabled" class="color-item" :class="activity[item]" |
|
|
|
|
v-for="item in formValidate.activity" :key="item" draggable="true" |
|
|
|
|
@dragstart="handleDragStart($event, item)" @dragover.prevent="handleDragOver($event, item)" |
|
|
|
|
@dragenter="handleDragEnterFont($event, item)" @dragend="handleDragEnd($event, item)">{{ item }}</div> |
|
|
|
|
<div class="tip">可拖动按钮调整活动的优先展示顺序</div> |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
@ -345,14 +336,8 @@ |
|
|
|
|
<el-col :span="24"> |
|
|
|
|
<el-form-item label="优惠券:" class="proCoupon"> |
|
|
|
|
<div class="acea-row"> |
|
|
|
|
<el-tag |
|
|
|
|
v-for="(tag, index) in formValidate.coupons" |
|
|
|
|
:key="index" |
|
|
|
|
class="mr10 mb10" |
|
|
|
|
:closable="!isDisabled" |
|
|
|
|
:disable-transitions="false" |
|
|
|
|
@close="handleCloseCoupon(tag)" |
|
|
|
|
> |
|
|
|
|
<el-tag v-for="(tag, index) in formValidate.coupons" :key="index" class="mr10 mb10" |
|
|
|
|
:closable="!isDisabled" :disable-transitions="false" @close="handleCloseCoupon(tag)"> |
|
|
|
|
{{ tag.name }} |
|
|
|
|
</el-tag> |
|
|
|
|
<!-- <span v-if="formValidate.couponIds == null">无</span> --> |
|
|
|
@ -363,8 +348,10 @@ |
|
|
|
|
</el-row> |
|
|
|
|
<el-form-item> |
|
|
|
|
<el-button v-show="currentTab > 0" class="submission priamry_border" @click="handleSubmitUp">上一步</el-button> |
|
|
|
|
<el-button v-show="currentTab<2" type="primary" class="submission" @click="handleSubmitNest('formValidate')">下一步</el-button> |
|
|
|
|
<el-button v-show="(currentTab===2 || $route.params.id) && !isDisabled" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button> |
|
|
|
|
<el-button v-show="currentTab < 2" type="primary" class="submission" |
|
|
|
|
@click="handleSubmitNest('formValidate')">下一步</el-button> |
|
|
|
|
<el-button v-show="(currentTab === 2 || $route.params.id) && !isDisabled" type="primary" class="submission" |
|
|
|
|
@click="handleSubmit('formValidate')">提交</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
</el-card> |
|
|
|
@ -373,11 +360,8 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import productApi from '@/api/product/productAttr.js'; |
|
|
|
|
import Tinymce from '@/components/Tinymce/index' |
|
|
|
|
// import { templateListApi, productCreateApi, categoryApi, productDetailApi, productUpdateApi } from '@/api/store' |
|
|
|
|
// import { marketingSendApi} from '@/api/marketing'; |
|
|
|
|
// import { shippingTemplatesList } from '@/api/logistics' |
|
|
|
|
// import { goodDesignList } from "@/api/systemGroup"; |
|
|
|
|
import CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates' |
|
|
|
|
import Templates from "../../appSetting/wxAccount/wxTemplate/index"; |
|
|
|
|
import { Debounce } from '@/utils/validate' |
|
|
|
@ -453,11 +437,9 @@ |
|
|
|
|
isDisabled: this.$route.params.isDisabled === '1' ? true : false, |
|
|
|
|
activity: { '默认': 'red', '秒杀': 'blue', '砍价': 'green', '拼团': 'yellow' }, |
|
|
|
|
props2: { |
|
|
|
|
children: 'child', |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id', |
|
|
|
|
multiple: true, |
|
|
|
|
emitPath: false |
|
|
|
|
children: 'children', |
|
|
|
|
label: 'categoryName', |
|
|
|
|
value: 'id' |
|
|
|
|
}, |
|
|
|
|
checkboxGroup: [], |
|
|
|
|
recommend: [], |
|
|
|
@ -569,20 +551,10 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
created() { |
|
|
|
|
this.tempRoute = Object.assign({}, this.$route) |
|
|
|
|
if (this.$route.params.id && this.formValidate.specType) { |
|
|
|
|
this.$watch('formValidate.attr', this.watCh) |
|
|
|
|
} |
|
|
|
|
this.getCategorySelect(); |
|
|
|
|
this.productGetRule() |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.formValidate.sliderImages = [] |
|
|
|
|
if ( this.$route.params.id ) { |
|
|
|
|
this.setTagsViewTitle() |
|
|
|
|
this.getInfo() |
|
|
|
|
} |
|
|
|
|
this.getCategorySelect() |
|
|
|
|
this.getShippingList() |
|
|
|
|
this.getGoodsType() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 校验输入框不能输入0,保留2位小数,库存为正整数 |
|
|
|
@ -766,21 +738,29 @@ |
|
|
|
|
if (!this.formValidate.selectRule) { |
|
|
|
|
return this.$message.warning('请选择属性') |
|
|
|
|
} |
|
|
|
|
const data = [] |
|
|
|
|
this.ruleList.forEach(item => { |
|
|
|
|
if (item.id === this.formValidate.selectRule) { |
|
|
|
|
item.ruleValue.forEach(i => { |
|
|
|
|
data.push({ |
|
|
|
|
attrName: i.value, |
|
|
|
|
attrValue: i.detail |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.formValidate.attr = data; |
|
|
|
|
}); |
|
|
|
|
const data = []; |
|
|
|
|
this.formValidate.attr = this.ruleList.find(item=>item.id==this.formValidate.selectRule).attributesList; |
|
|
|
|
|
|
|
|
|
console.log(this.formValidate.attr,'attributeContentList') |
|
|
|
|
// this.ruleList.forEach(item => { attributesList |
|
|
|
|
// if (item.id === this.formValidate.selectRule) { |
|
|
|
|
// item.ruleValue.forEach(i => { |
|
|
|
|
// data.push({ |
|
|
|
|
// attrName: i.value, |
|
|
|
|
// attrValue: i.detail |
|
|
|
|
// }) |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// this.formValidate.attr = data; |
|
|
|
|
// }); |
|
|
|
|
}, |
|
|
|
|
// 商品分类; |
|
|
|
|
getCategorySelect() { |
|
|
|
|
productApi.getClassificationTree().then(res=>{ |
|
|
|
|
if(res.code==20000){ |
|
|
|
|
this.merCateList = res.data; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// categoryApi({ status: -1, type: 1 }).then(res => { |
|
|
|
|
// this.merCateList = this.filerMerCateList(res) |
|
|
|
|
// let newArr = []; |
|
|
|
@ -802,13 +782,29 @@ |
|
|
|
|
}, |
|
|
|
|
// 获取商品属性模板; |
|
|
|
|
productGetRule() { |
|
|
|
|
templateListApi(this.tableFrom).then(res => { |
|
|
|
|
const list = res.list |
|
|
|
|
for (var i = 0; i < list.length; i++) { |
|
|
|
|
list[i].ruleValue = JSON.parse(list[i].ruleValue) |
|
|
|
|
productApi.getAllAttributesType().then(res=>{ |
|
|
|
|
if(res.code==20000){ |
|
|
|
|
this.ruleList = res.data.map(item=>{ |
|
|
|
|
return { |
|
|
|
|
...item, |
|
|
|
|
attributesList:item.attributesList.map(citem=>{ |
|
|
|
|
return { |
|
|
|
|
...citem, |
|
|
|
|
attributeContentList:citem.attributeContent.split(",") |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.ruleList = list |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|
console.log( this.ruleList,' this.ruleList') |
|
|
|
|
}) |
|
|
|
|
// templateListApi(this.tableFrom).then(res => { |
|
|
|
|
// const list = res.list |
|
|
|
|
// for (var i = 0; i < list.length; i++) { |
|
|
|
|
// list[i].ruleValue = JSON.parse(list[i].ruleValue) |
|
|
|
|
// } |
|
|
|
|
// this.ruleList = list |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
// 运费模板; |
|
|
|
|
getShippingList() { |
|
|
|
@ -1248,15 +1244,18 @@ |
|
|
|
|
margin-left: 36px !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.disLabelmoren { |
|
|
|
|
::v-deep.el-form-item__label { |
|
|
|
|
margin-left: 120px !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.priamry_border { |
|
|
|
|
border: 1px solid #1890FF; |
|
|
|
|
color: #1890FF; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.color-item { |
|
|
|
|
height: 30px; |
|
|
|
|
line-height: 30px; |
|
|
|
@ -1264,76 +1263,95 @@ |
|
|
|
|
color: #fff; |
|
|
|
|
margin-right: 10px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.color-list .color-item.blue { |
|
|
|
|
background-color: #1E9FFF; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.color-list .color-item.yellow { |
|
|
|
|
background-color: rgb(254, 185, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.color-list .color-item.green { |
|
|
|
|
background-color: #009688; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.color-list .color-item.red { |
|
|
|
|
background-color: #ed4014; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.proCoupon { |
|
|
|
|
::v-deep.el-form-item__content { |
|
|
|
|
margin-top: 5px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tabPic { |
|
|
|
|
width: 40px !important; |
|
|
|
|
height: 40px !important; |
|
|
|
|
|
|
|
|
|
img { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.noLeft { |
|
|
|
|
::v-deep.el-form-item__content { |
|
|
|
|
margin-left: 0 !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.tabNumWidth { |
|
|
|
|
::v-deep.el-input-number--medium { |
|
|
|
|
width: 121px !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep.el-input-number__increase { |
|
|
|
|
width: 20px !important; |
|
|
|
|
font-size: 12px !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep.el-input-number__decrease { |
|
|
|
|
width: 20px !important; |
|
|
|
|
font-size: 12px !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep.el-input-number--medium .el-input__inner { |
|
|
|
|
padding-left: 25px !important; |
|
|
|
|
padding-right: 25px !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep thead { |
|
|
|
|
line-height: normal !important; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::v-deep .el-table .cell { |
|
|
|
|
line-height: normal !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.selWidth { |
|
|
|
|
width: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.selWidthd { |
|
|
|
|
width: 300px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.button-new-tag { |
|
|
|
|
height: 28px; |
|
|
|
|
line-height: 26px; |
|
|
|
|
padding-top: 0; |
|
|
|
|
padding-bottom: 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.input-new-tag { |
|
|
|
|
width: 90px; |
|
|
|
|
margin-left: 10px; |
|
|
|
|
vertical-align: bottom; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.pictrue { |
|
|
|
|
width: 60px; |
|
|
|
|
height: 60px; |
|
|
|
@ -1341,15 +1359,18 @@ |
|
|
|
|
margin-right: 10px; |
|
|
|
|
position: relative; |
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
img { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
video { |
|
|
|
|
width: 100%; |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.btndel { |
|
|
|
|
position: absolute; |
|
|
|
|
z-index: 1; |
|
|
|
@ -1358,6 +1379,7 @@ |
|
|
|
|
left: 46px; |
|
|
|
|
top: -4px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.labeltop { |
|
|
|
|
::v-deep.el-form-item__label { |
|
|
|
|
float: none !important; |
|
|
|
@ -1365,6 +1387,7 @@ |
|
|
|
|
width: auto !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.iview-video-style { |
|
|
|
|
width: 300px; |
|
|
|
|
height: 180px; |
|
|
|
|