12
This commit is contained in:
@@ -1,6 +1,24 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
var service_name = 'oil-mall'
|
var service_name = 'oil-mall'
|
||||||
export default {
|
export default {
|
||||||
|
brandGetByPage() {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductBrands/getByPage`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getAllAttributesType() {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductAttributesType/getAllAttributesType`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
getClassificationTree() {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductClassification/getClassificationTree`,
|
||||||
|
method: 'get',
|
||||||
|
})
|
||||||
|
},
|
||||||
classifySave(page) {
|
classifySave(page) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/mallProductClassification/save`,
|
url: `/${service_name}/mallProductClassification/save`,
|
||||||
@@ -70,6 +88,13 @@ delete(page) {
|
|||||||
data: page
|
data: page
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
typeUpdate(page) {
|
||||||
|
return request({
|
||||||
|
url: `/${service_name}/mallProductAttributes/update`,
|
||||||
|
method: 'post',
|
||||||
|
data: page
|
||||||
|
})
|
||||||
|
},
|
||||||
update(page) {
|
update(page) {
|
||||||
return request({
|
return request({
|
||||||
url: `/${service_name}/mallProductAttributesType/update`,
|
url: `/${service_name}/mallProductAttributesType/update`,
|
||||||
|
|||||||
@@ -36,6 +36,12 @@ export const constantRoutes = [{
|
|||||||
name: 'productAdd',
|
name: 'productAdd',
|
||||||
meta: { title: '添加商品', icon: 'iconkongzhitai', affix: true }
|
meta: { title: '添加商品', icon: 'iconkongzhitai', affix: true }
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/brand',
|
||||||
|
component: () => import('@/views/product/brand/index'),
|
||||||
|
name: 'brand',
|
||||||
|
meta: { title: '商品品牌', icon: 'iconkongzhitai', affix: true }
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: '/productClassify',
|
path: '/productClassify',
|
||||||
component: () => import('@/views/product/productClassify/index'),
|
component: () => import('@/views/product/productClassify/index'),
|
||||||
|
|||||||
134
src/views/product/brand/index.vue
Normal file
134
src/views/product/brand/index.vue
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-card :bordered="false" shadow="never" class="ivu-mt" :body-style="{ padding: 0 }">
|
||||||
|
<div class="padding-add">
|
||||||
|
<el-form ref="artFrom" :model="page" label-width="80px" label-position="right" class="tabform"
|
||||||
|
@submit.native.prevent inline>
|
||||||
|
<el-form-item label="输入搜索">
|
||||||
|
<el-input clearable v-model="page.rule_name" placeholder="品牌名称/关键词"
|
||||||
|
class="form_content_width"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" @click="userSearchs">查询</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card :bordered="false" shadow="never" class="ivu-mt-16">
|
||||||
|
<el-button type="primary" @click="addType">添加品牌</el-button>
|
||||||
|
<el-table @current-change="tableCurrentChange" ref="table" :data="tableData" v-loading="loading"
|
||||||
|
highlight-current-row :row-key="getRowKey" @selection-change="handleSelectRow" empty-text="暂无数据"
|
||||||
|
class="mt14">
|
||||||
|
<el-table-column type="selection" width="60" :reserve-selection="true"> </el-table-column>
|
||||||
|
<el-table-column label="编号">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.brandNum }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="品牌名称">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ scope.row.name }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="品牌首字母">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showAttrList(scope.row)" type="text">
|
||||||
|
{{ scope.row.attrCount }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="排序">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showAttrList(scope.row)" type="text">
|
||||||
|
{{ scope.row.attrCount }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="是否显示">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button @click="showAttrList(scope.row)" type="text">
|
||||||
|
{{ scope.row.attrCount }}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" fixed="right">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<a @click="edit(scope.row)">编辑</a>
|
||||||
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<a @click="del(scope.row)">删除</a>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<div class="acea-row row-right page">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page="page.currentPage"
|
||||||
|
:page-sizes="[10, 15, 20, 30]"
|
||||||
|
:page-size="page.pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="page.totalCount" />
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
import productApi from '@/api/product/productAttr.js';
|
||||||
|
import { loadingFn } from "@/utils/validate"
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
selection: [],
|
||||||
|
selectAttrList: null,
|
||||||
|
isShowAttrList: false,
|
||||||
|
loading: false,
|
||||||
|
page: {
|
||||||
|
"currentPage": 1,
|
||||||
|
"pageSize": 10,
|
||||||
|
"params": {},
|
||||||
|
totalCount: 0
|
||||||
|
},
|
||||||
|
tableData: [],
|
||||||
|
total: 0,
|
||||||
|
selectedIds: new Set(), //选中合并项的id
|
||||||
|
ids: [],
|
||||||
|
multipleSelection: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
created() { },
|
||||||
|
methods: {
|
||||||
|
tableCurrentChange(e) { },
|
||||||
|
handleCurrentChange(val) { },
|
||||||
|
handleSizeChange(val) { },
|
||||||
|
clearSelection() { },
|
||||||
|
onCancel() { },
|
||||||
|
addType() { },
|
||||||
|
showAttrList(e) { },
|
||||||
|
getRowKey(row) { },
|
||||||
|
//全选和取消全选时触发
|
||||||
|
handleSelectAll(selection) { },
|
||||||
|
// 选中某一行
|
||||||
|
handleSelectRow(selection) { },
|
||||||
|
setChecked() { },
|
||||||
|
// 删除
|
||||||
|
del(row) { },
|
||||||
|
addAttr(model) {
|
||||||
|
},
|
||||||
|
// 编辑
|
||||||
|
edit(row) {
|
||||||
|
},
|
||||||
|
// 列表
|
||||||
|
getList() {
|
||||||
|
loadingFn.call(this, "loading", productApi.brandGetByPage(this.page).then(res => {
|
||||||
|
if (res.code = 20000) ({ list: this.tableData = [], totalCount: this.page.totalCount = 0 } = res.data);
|
||||||
|
}));
|
||||||
|
},
|
||||||
|
// 表格搜索
|
||||||
|
userSearchs() { },
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
|
|
||||||
@@ -717,7 +717,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24" v-if="formValidate.freight == 3">
|
<!-- <el-col :span="24" v-if="formValidate.freight == 3">
|
||||||
<el-form-item label="" prop="temp_id">
|
<el-form-item label="" prop="temp_id">
|
||||||
<div class="acea-row">
|
<div class="acea-row">
|
||||||
<el-select
|
<el-select
|
||||||
@@ -736,7 +736,7 @@
|
|||||||
<span class="addfont" @click="addTemp">新增运费模板</span>
|
<span class="addfont" @click="addTemp">新增运费模板</span>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 营销设置-->
|
<!-- 营销设置-->
|
||||||
<el-row :gutter="24" v-show="headTab.length === 6 ? currentTab === '5' : currentTab === '4'">
|
<el-row :gutter="24" v-show="headTab.length === 6 ? currentTab === '5' : currentTab === '4'">
|
||||||
|
|||||||
@@ -9,7 +9,8 @@
|
|||||||
<!--<el-step title="规格设置" />-->
|
<!--<el-step title="规格设置" />-->
|
||||||
</el-steps>
|
</el-steps>
|
||||||
</div>
|
</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-row v-show="currentTab === 0" :gutter="24">
|
||||||
<!-- 商品信息-->
|
<!-- 商品信息-->
|
||||||
<el-col v-bind="grid2">
|
<el-col v-bind="grid2">
|
||||||
@@ -19,7 +20,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-bind="grid2">
|
<el-col v-bind="grid2">
|
||||||
<el-form-item label="商品分类:" prop="cateIds">
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-bind="grid2">
|
<el-col v-bind="grid2">
|
||||||
@@ -27,14 +29,15 @@
|
|||||||
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" :disabled="isDisabled" />
|
<el-input v-model="formValidate.keyword" placeholder="请输入商品关键字" :disabled="isDisabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-bind="grid2">
|
<!-- <el-col v-bind="grid2">
|
||||||
<el-form-item label="单位:" prop="unitName">
|
<el-form-item label="单位:" prop="unitName">
|
||||||
<el-input v-model="formValidate.unitName" placeholder="请输入单位" :disabled="isDisabled" />
|
<el-input v-model="formValidate.unitName" placeholder="请输入单位" :disabled="isDisabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col v-bind="grid2">
|
<el-col v-bind="grid2">
|
||||||
<el-form-item label="商品简介:" prop="storeInfo">
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-bind="grid2">
|
<el-col v-bind="grid2">
|
||||||
@@ -50,20 +53,14 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="商品轮播图:" prop="sliderImages">
|
<el-form-item label="商品轮播图:" prop="sliderImages">
|
||||||
<div class="acea-row">
|
<div class="acea-row">
|
||||||
<div
|
<div v-for="(item, index) in formValidate.sliderImages" :key="index" class="pictrue" draggable="true"
|
||||||
v-for="(item,index) in formValidate.sliderImages"
|
@dragstart="handleDragStart($event, item)" @dragover.prevent="handleDragOver($event, item)"
|
||||||
:key="index"
|
@dragenter="handleDragEnter($event, item)" @dragend="handleDragEnd($event, item)">
|
||||||
class="pictrue"
|
|
||||||
draggable="true"
|
|
||||||
@dragstart="handleDragStart($event, item)"
|
|
||||||
@dragover.prevent="handleDragOver($event, item)"
|
|
||||||
@dragenter="handleDragEnter($event, item)"
|
|
||||||
@dragend="handleDragEnd($event, item)"
|
|
||||||
>
|
|
||||||
<img :src="item">
|
<img :src="item">
|
||||||
<i v-if="!isDisabled" class="el-icon-error btndel" @click="handleRemove(index)" />
|
<i v-if="!isDisabled" class="el-icon-error btndel" @click="handleRemove(index)" />
|
||||||
</div>
|
</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">
|
<div class="upLoad">
|
||||||
<i class="el-icon-camera cameraIconfont" />
|
<i class="el-icon-camera cameraIconfont" />
|
||||||
</div>
|
</div>
|
||||||
@@ -71,30 +68,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</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-form-item label="运费模板:" prop="tempId">
|
||||||
<el-select v-model="formValidate.tempId" placeholder="请选择" class="mr20" :disabled="isDisabled" style="width:100%;">
|
<el-select v-model="formValidate.tempId" placeholder="请选择" class="mr20" :disabled="isDisabled"
|
||||||
<el-option
|
style="width:100%;">
|
||||||
v-for="item in shippingList"
|
<el-option v-for="item in shippingList" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
:key="item.id"
|
|
||||||
:label="item.name"
|
|
||||||
:value="item.id"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :xs="6" :sm="6" :md="6" :lg="12" :xl="12">
|
<!-- <el-col :xs="6" :sm="6" :md="6" :lg="12" :xl="12">
|
||||||
<el-button v-show="!isDisabled" class="mr15" @click="addTem">运费模板</el-button>
|
<el-button v-show="!isDisabled" class="mr15" @click="addTem">运费模板</el-button>
|
||||||
</el-col>
|
</el-col> -->
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="商品规格:" props="specType">
|
<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="false" class="radio">单规格</el-radio>
|
||||||
<el-radio :label="true">多规格</el-radio>
|
<el-radio :label="true">多规格</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="佣金设置:" props="isSub">
|
<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="true" class="radio">单独设置</el-radio>
|
||||||
<el-radio :label="false">默认设置</el-radio>
|
<el-radio :label="false">默认设置</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
@@ -105,7 +100,7 @@
|
|||||||
<el-form-item label="选择规格:" prop="">
|
<el-form-item label="选择规格:" prop="">
|
||||||
<div class="acea-row">
|
<div class="acea-row">
|
||||||
<el-select v-model="formValidate.selectRule">
|
<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-select>
|
||||||
<el-button type="primary" class="mr20" @click="confirm">确认</el-button>
|
<el-button type="primary" class="mr20" @click="confirm">确认</el-button>
|
||||||
<el-button class="mr15" @click="addRule">添加规格</el-button>
|
<el-button class="mr15" @click="addRule">添加规格</el-button>
|
||||||
@@ -113,28 +108,16 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div v-for="(item, index) in formValidate.attr" :key="index">
|
<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">
|
<div class="rulesBox">
|
||||||
<el-tag
|
<el-tag v-for="(j, indexn) in item.attributeContentList" :key="indexn" closable size="medium"
|
||||||
v-for="(j, indexn) in item.attrValue"
|
:disable-transitions="false" class="mb5 mr10" @close="handleClose(item.attrValue, indexn)">
|
||||||
:key="indexn"
|
|
||||||
closable
|
|
||||||
size="medium"
|
|
||||||
:disable-transitions="false"
|
|
||||||
class="mb5 mr10"
|
|
||||||
@close="handleClose(item.attrValue,indexn)"
|
|
||||||
>
|
|
||||||
{{ j }}
|
{{ j }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<el-input
|
<el-input v-if="item.inputVisible" ref="saveTagInput" v-model="item.attrValue.attrsVal"
|
||||||
v-if="item.inputVisible"
|
class="input-new-tag" size="small" @keyup.enter.native="createAttr(item.attrValue.attrsVal, index)"
|
||||||
ref="saveTagInput"
|
@blur="createAttr(item.attrValue.attrsVal, index)" />
|
||||||
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>
|
<el-button v-else class="button-new-tag" size="small" @click="showInput(item)">+ 添加</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -175,20 +158,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-if="formValidate.isSub">
|
<template v-if="formValidate.isSub">
|
||||||
<el-table-column align="center" label="一级返佣(元)" min-width="120">
|
<el-table-column align="center" label="一级返佣(元)" min-width="120">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="二级返佣(元)" min-width="120">
|
<el-table-column align="center" label="二级返佣(元)" min-width="120">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
@@ -214,20 +201,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<template v-if="formValidate.isSub">
|
<template v-if="formValidate.isSub">
|
||||||
<el-table-column align="center" label="一级返佣(元)" min-width="120">
|
<el-table-column align="center" label="一级返佣(元)" min-width="120">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="二级返佣(元)" min-width="120">
|
<el-table-column align="center" label="二级返佣(元)" min-width="120">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</template>
|
</template>
|
||||||
@@ -238,10 +229,12 @@
|
|||||||
<el-button type="default" @click="showAllSku()" :disabled="isDisabled">展示</el-button>
|
<el-button type="default" @click="showAllSku()" :disabled="isDisabled">展示</el-button>
|
||||||
</el-form-item>
|
</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">
|
<el-table :data="ManyAttrValue" border class="tabNumWidth" size="mini">
|
||||||
<template v-if="manyTabDate">
|
<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">
|
<template slot-scope="scope">
|
||||||
<span class="priceBox" v-text="scope.row[iii]" />
|
<span class="priceBox" v-text="scope.row[iii]" />
|
||||||
</template>
|
</template>
|
||||||
@@ -257,21 +250,24 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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">
|
<template slot-scope="scope">
|
||||||
<!-- <span>scope.row:{{scope.row}}</span>-->
|
<!-- <span>scope.row:{{scope.row}}</span>-->
|
||||||
<el-input :disabled="isDisabled" maxlength="9" min="0.01"
|
<el-input :disabled="isDisabled" maxlength="9" min="0.01" v-model="scope.row[iii]" class="priceBox"
|
||||||
v-model="scope.row[iii]" class="priceBox" @blur="keyupEvent(iii, scope.row[iii], scope.$index, 3)" />
|
@blur="keyupEvent(iii, scope.row[iii], scope.$index, 3)" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="一级返佣(元)" min-width="120" v-if="formValidate.isSub">
|
<el-table-column align="center" label="一级返佣(元)" min-width="120" v-if="formValidate.isSub">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column align="center" label="二级返佣(元)" min-width="120" v-if="formValidate.isSub">
|
<el-table-column align="center" label="二级返佣(元)" min-width="120" v-if="formValidate.isSub">
|
||||||
<template slot-scope="scope">
|
<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>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column v-if="!isDisabled" key="3" align="center" label="操作" min-width="80">
|
<el-table-column v-if="!isDisabled" key="3" align="center" label="操作" min-width="80">
|
||||||
@@ -308,7 +304,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-bind="grid">
|
<el-col v-bind="grid">
|
||||||
<el-form-item label="积分:">
|
<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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-bind="grid">
|
<el-col v-bind="grid">
|
||||||
@@ -320,24 +317,18 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="商品推荐:">
|
<el-form-item label="商品推荐:">
|
||||||
<el-checkbox-group v-model="checkboxGroup" size="small" @change="onChangeGroup" :disabled="isDisabled">
|
<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-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="活动优先级:">
|
<el-form-item label="活动优先级:">
|
||||||
<div class="color-list acea-row row-middle">
|
<div class="color-list acea-row row-middle">
|
||||||
<div
|
<div :disabled="isDisabled" class="color-item" :class="activity[item]"
|
||||||
:disabled="isDisabled"
|
v-for="item in formValidate.activity" :key="item" draggable="true"
|
||||||
class="color-item" :class="activity[item]"
|
@dragstart="handleDragStart($event, item)" @dragover.prevent="handleDragOver($event, item)"
|
||||||
v-for="item in formValidate.activity"
|
@dragenter="handleDragEnterFont($event, item)" @dragend="handleDragEnd($event, item)">{{ item }}</div>
|
||||||
: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 class="tip">可拖动按钮调整活动的优先展示顺序</div>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -345,14 +336,8 @@
|
|||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="优惠券:" class="proCoupon">
|
<el-form-item label="优惠券:" class="proCoupon">
|
||||||
<div class="acea-row">
|
<div class="acea-row">
|
||||||
<el-tag
|
<el-tag v-for="(tag, index) in formValidate.coupons" :key="index" class="mr10 mb10"
|
||||||
v-for="(tag, index) in formValidate.coupons"
|
:closable="!isDisabled" :disable-transitions="false" @close="handleCloseCoupon(tag)">
|
||||||
:key="index"
|
|
||||||
class="mr10 mb10"
|
|
||||||
:closable="!isDisabled"
|
|
||||||
:disable-transitions="false"
|
|
||||||
@close="handleCloseCoupon(tag)"
|
|
||||||
>
|
|
||||||
{{ tag.name }}
|
{{ tag.name }}
|
||||||
</el-tag>
|
</el-tag>
|
||||||
<!-- <span v-if="formValidate.couponIds == null">无</span> -->
|
<!-- <span v-if="formValidate.couponIds == null">无</span> -->
|
||||||
@@ -363,8 +348,10 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-show="currentTab > 0" class="submission priamry_border" @click="handleSubmitUp">上一步</el-button>
|
<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" type="primary" class="submission"
|
||||||
<el-button v-show="(currentTab===2 || $route.params.id) && !isDisabled" type="primary" class="submission" @click="handleSubmit('formValidate')">提交</el-button>
|
@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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -373,11 +360,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import productApi from '@/api/product/productAttr.js';
|
||||||
import Tinymce from '@/components/Tinymce/index'
|
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 CreatTemplates from '@/views/systemSetting/logistics/shippingTemplates/creatTemplates'
|
||||||
import Templates from "../../appSetting/wxAccount/wxTemplate/index";
|
import Templates from "../../appSetting/wxAccount/wxTemplate/index";
|
||||||
import { Debounce } from '@/utils/validate'
|
import { Debounce } from '@/utils/validate'
|
||||||
@@ -453,11 +437,9 @@
|
|||||||
isDisabled: this.$route.params.isDisabled === '1' ? true : false,
|
isDisabled: this.$route.params.isDisabled === '1' ? true : false,
|
||||||
activity: { '默认': 'red', '秒杀': 'blue', '砍价': 'green', '拼团': 'yellow' },
|
activity: { '默认': 'red', '秒杀': 'blue', '砍价': 'green', '拼团': 'yellow' },
|
||||||
props2: {
|
props2: {
|
||||||
children: 'child',
|
children: 'children',
|
||||||
label: 'name',
|
label: 'categoryName',
|
||||||
value: 'id',
|
value: 'id'
|
||||||
multiple: true,
|
|
||||||
emitPath: false
|
|
||||||
},
|
},
|
||||||
checkboxGroup: [],
|
checkboxGroup: [],
|
||||||
recommend: [],
|
recommend: [],
|
||||||
@@ -569,20 +551,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.tempRoute = Object.assign({}, this.$route)
|
this.getCategorySelect();
|
||||||
if (this.$route.params.id && this.formValidate.specType) {
|
this.productGetRule()
|
||||||
this.$watch('formValidate.attr', this.watCh)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.formValidate.sliderImages = []
|
|
||||||
if ( this.$route.params.id ) {
|
|
||||||
this.setTagsViewTitle()
|
|
||||||
this.getInfo()
|
|
||||||
}
|
|
||||||
this.getCategorySelect()
|
|
||||||
this.getShippingList()
|
|
||||||
this.getGoodsType()
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 校验输入框不能输入0,保留2位小数,库存为正整数
|
// 校验输入框不能输入0,保留2位小数,库存为正整数
|
||||||
@@ -766,21 +738,29 @@
|
|||||||
if (!this.formValidate.selectRule) {
|
if (!this.formValidate.selectRule) {
|
||||||
return this.$message.warning('请选择属性')
|
return this.$message.warning('请选择属性')
|
||||||
}
|
}
|
||||||
const data = []
|
const data = [];
|
||||||
this.ruleList.forEach(item => {
|
this.formValidate.attr = this.ruleList.find(item=>item.id==this.formValidate.selectRule).attributesList;
|
||||||
if (item.id === this.formValidate.selectRule) {
|
|
||||||
item.ruleValue.forEach(i => {
|
console.log(this.formValidate.attr,'attributeContentList')
|
||||||
data.push({
|
// this.ruleList.forEach(item => { attributesList
|
||||||
attrName: i.value,
|
// if (item.id === this.formValidate.selectRule) {
|
||||||
attrValue: i.detail
|
// item.ruleValue.forEach(i => {
|
||||||
})
|
// data.push({
|
||||||
})
|
// attrName: i.value,
|
||||||
}
|
// attrValue: i.detail
|
||||||
this.formValidate.attr = data;
|
// })
|
||||||
});
|
// })
|
||||||
|
// }
|
||||||
|
// this.formValidate.attr = data;
|
||||||
|
// });
|
||||||
},
|
},
|
||||||
// 商品分类;
|
// 商品分类;
|
||||||
getCategorySelect() {
|
getCategorySelect() {
|
||||||
|
productApi.getClassificationTree().then(res=>{
|
||||||
|
if(res.code==20000){
|
||||||
|
this.merCateList = res.data;
|
||||||
|
}
|
||||||
|
})
|
||||||
// categoryApi({ status: -1, type: 1 }).then(res => {
|
// categoryApi({ status: -1, type: 1 }).then(res => {
|
||||||
// this.merCateList = this.filerMerCateList(res)
|
// this.merCateList = this.filerMerCateList(res)
|
||||||
// let newArr = [];
|
// let newArr = [];
|
||||||
@@ -802,13 +782,29 @@
|
|||||||
},
|
},
|
||||||
// 获取商品属性模板;
|
// 获取商品属性模板;
|
||||||
productGetRule() {
|
productGetRule() {
|
||||||
templateListApi(this.tableFrom).then(res => {
|
productApi.getAllAttributesType().then(res=>{
|
||||||
const list = res.list
|
if(res.code==20000){
|
||||||
for (var i = 0; i < list.length; i++) {
|
this.ruleList = res.data.map(item=>{
|
||||||
list[i].ruleValue = JSON.parse(list[i].ruleValue)
|
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() {
|
getShippingList() {
|
||||||
@@ -1248,15 +1244,18 @@
|
|||||||
margin-left: 36px !important;
|
margin-left: 36px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.disLabelmoren {
|
.disLabelmoren {
|
||||||
::v-deep.el-form-item__label {
|
::v-deep.el-form-item__label {
|
||||||
margin-left: 120px !important;
|
margin-left: 120px !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.priamry_border {
|
.priamry_border {
|
||||||
border: 1px solid #1890FF;
|
border: 1px solid #1890FF;
|
||||||
color: #1890FF;
|
color: #1890FF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-item {
|
.color-item {
|
||||||
height: 30px;
|
height: 30px;
|
||||||
line-height: 30px;
|
line-height: 30px;
|
||||||
@@ -1264,76 +1263,95 @@
|
|||||||
color: #fff;
|
color: #fff;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-list .color-item.blue {
|
.color-list .color-item.blue {
|
||||||
background-color: #1E9FFF;
|
background-color: #1E9FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-list .color-item.yellow {
|
.color-list .color-item.yellow {
|
||||||
background-color: rgb(254, 185, 0);
|
background-color: rgb(254, 185, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-list .color-item.green {
|
.color-list .color-item.green {
|
||||||
background-color: #009688;
|
background-color: #009688;
|
||||||
}
|
}
|
||||||
|
|
||||||
.color-list .color-item.red {
|
.color-list .color-item.red {
|
||||||
background-color: #ed4014;
|
background-color: #ed4014;
|
||||||
}
|
}
|
||||||
|
|
||||||
.proCoupon {
|
.proCoupon {
|
||||||
::v-deep.el-form-item__content {
|
::v-deep.el-form-item__content {
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabPic {
|
.tabPic {
|
||||||
width: 40px !important;
|
width: 40px !important;
|
||||||
height: 40px !important;
|
height: 40px !important;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.noLeft {
|
.noLeft {
|
||||||
::v-deep.el-form-item__content {
|
::v-deep.el-form-item__content {
|
||||||
margin-left: 0 !important;
|
margin-left: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.tabNumWidth {
|
.tabNumWidth {
|
||||||
::v-deep.el-input-number--medium {
|
::v-deep.el-input-number--medium {
|
||||||
width: 121px !important;
|
width: 121px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep.el-input-number__increase {
|
::v-deep.el-input-number__increase {
|
||||||
width: 20px !important;
|
width: 20px !important;
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep.el-input-number__decrease {
|
::v-deep.el-input-number__decrease {
|
||||||
width: 20px !important;
|
width: 20px !important;
|
||||||
font-size: 12px !important;
|
font-size: 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep.el-input-number--medium .el-input__inner {
|
::v-deep.el-input-number--medium .el-input__inner {
|
||||||
padding-left: 25px !important;
|
padding-left: 25px !important;
|
||||||
padding-right: 25px !important;
|
padding-right: 25px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep thead {
|
::v-deep thead {
|
||||||
line-height: normal !important;
|
line-height: normal !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
::v-deep .el-table .cell {
|
::v-deep .el-table .cell {
|
||||||
line-height: normal !important;
|
line-height: normal !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.selWidth {
|
.selWidth {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selWidthd {
|
.selWidthd {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-new-tag {
|
.button-new-tag {
|
||||||
height: 28px;
|
height: 28px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-bottom: 0;
|
padding-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-new-tag {
|
.input-new-tag {
|
||||||
width: 90px;
|
width: 90px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pictrue {
|
.pictrue {
|
||||||
width: 60px;
|
width: 60px;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
@@ -1341,15 +1359,18 @@
|
|||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
video {
|
video {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.btndel {
|
.btndel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@@ -1358,6 +1379,7 @@
|
|||||||
left: 46px;
|
left: 46px;
|
||||||
top: -4px;
|
top: -4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.labeltop {
|
.labeltop {
|
||||||
::v-deep.el-form-item__label {
|
::v-deep.el-form-item__label {
|
||||||
float: none !important;
|
float: none !important;
|
||||||
@@ -1365,6 +1387,7 @@
|
|||||||
width: auto !important;
|
width: auto !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.iview-video-style {
|
.iview-video-style {
|
||||||
width: 300px;
|
width: 300px;
|
||||||
height: 180px;
|
height: 180px;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="modal" @closed="onCancel" title="商品规格" width="1000px" v-loading="spinShow">
|
<el-dialog :visible.sync="modal" @close="onCancel" title="商品规格" width="1000px" v-loading="spinShow">
|
||||||
<el-form ref="formDynamic" :model="formDynamic" :rules="rules" class="attrFrom" label-width="110px"
|
<el-form ref="formDynamic" :model="formDynamic" :rules="rules" class="attrFrom" label-width="110px"
|
||||||
label-position="right" @submit.native.prevent>
|
label-position="right" @submit.native.prevent>
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
@@ -104,13 +104,14 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() { },
|
||||||
console.log(this.formDynamic)
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
onCancel() {
|
onCancel() {
|
||||||
this.$parent.clearSelection();
|
this.$parent.clearSelection();
|
||||||
this.$parent.selection = [];
|
this.formDynamic = {
|
||||||
|
name: '',
|
||||||
|
spec: [],
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onClose() {
|
onClose() {
|
||||||
this.ids = 0;
|
this.ids = 0;
|
||||||
@@ -144,17 +145,21 @@ export default {
|
|||||||
}
|
}
|
||||||
this.modal_loading = true;
|
this.modal_loading = true;
|
||||||
Promise.all([...this.formDynamic.spec.map(item => {
|
Promise.all([...this.formDynamic.spec.map(item => {
|
||||||
return productApi[this.model]({
|
return productApi[this.model](Object.assign({
|
||||||
"attributeName": item.value,
|
"attributeName": item.value,
|
||||||
"attributeContent": item.detail.join(","),
|
"attributeContent": item.detail.join(","),
|
||||||
"typeId": this.formDynamic.id,
|
|
||||||
"sort": 1,
|
"sort": 1,
|
||||||
})
|
}, this.model == "save" ? {
|
||||||
|
"typeId": this.formDynamic.id,
|
||||||
|
} : {
|
||||||
|
"id": this.formDynamic.id || ""
|
||||||
|
}))
|
||||||
})]).then(res => {
|
})]).then(res => {
|
||||||
this.$message.success("添加成功")
|
this.$message.success("添加成功")
|
||||||
this.modal = false;
|
this.modal = false;
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.modal_loading = false;
|
this.modal_loading = false;
|
||||||
|
this.model == "save" ? this.$parent.handleCurrentChange() : this.$parent.$refs.attrList.getByPage()
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -225,6 +230,7 @@ export default {
|
|||||||
::v-deep .el-tag {
|
::v-deep .el-tag {
|
||||||
margin-right: 20px !important;
|
margin-right: 20px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rulesBox {
|
.rulesBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import productApi from '@/api/product/productAttr.js';
|
import productApi from '@/api/product/productAttr.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "attrList",
|
name: "attrList",
|
||||||
props: {
|
props: {
|
||||||
@@ -111,7 +110,7 @@ export default {
|
|||||||
}],
|
}],
|
||||||
})
|
})
|
||||||
this.$parent.$parent.selection = [data];
|
this.$parent.$parent.selection = [data];
|
||||||
this.$parent.$parent.addAttr('update');
|
this.$parent.$parent.addAttr('typeUpdate');
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {
|
if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {
|
||||||
|
|||||||
@@ -52,8 +52,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<add-attr :selection="selection" ref="addattr" @getList="userSearchs"></add-attr>
|
<add-attr :selection="selection" ref="addattr" @getList="userSearchs"></add-attr>
|
||||||
<el-dialog @closed="onCancel" title="属性列表" :visible.sync="isShowAttrList" width="30%">
|
<el-dialog title="属性列表" :visible.sync="isShowAttrList" width="30%">
|
||||||
<attrList :selectAttrId="selectAttrId" v-if="isShowAttrList"></attrList>
|
<attrList ref="attrList" :selectAttrId="selectAttrId" v-if="isShowAttrList"></attrList>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -85,12 +85,16 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {},
|
computed: {},
|
||||||
|
watch:{
|
||||||
|
// isShowAttrList(n,o){
|
||||||
|
// this.clearSelection()
|
||||||
|
// }
|
||||||
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
tableCurrentChange(e) {
|
tableCurrentChange(e) {
|
||||||
|
|
||||||
// this.$message.warning()
|
// this.$message.warning()
|
||||||
console.log(e,'===')
|
console.log(e,'===')
|
||||||
},
|
},
|
||||||
@@ -103,11 +107,11 @@ export default {
|
|||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
clearSelection(){
|
clearSelection(){
|
||||||
|
this.selection = [];
|
||||||
|
// this.handleSelectRow([]);
|
||||||
this.$refs.table.clearSelection();
|
this.$refs.table.clearSelection();
|
||||||
},
|
},
|
||||||
onCancel(){
|
onCancel(){ },
|
||||||
|
|
||||||
},
|
|
||||||
addType() {
|
addType() {
|
||||||
this.$prompt('请输入类型', '提示', {
|
this.$prompt('请输入类型', '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
@@ -154,7 +158,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 选中某一行
|
// 选中某一行
|
||||||
handleSelectRow(selection) {
|
handleSelectRow(selection) {
|
||||||
console.log("selection",selection)
|
|
||||||
this.selection = selection;
|
this.selection = selection;
|
||||||
},
|
},
|
||||||
setChecked() {
|
setChecked() {
|
||||||
@@ -208,7 +211,6 @@ export default {
|
|||||||
getDataList() {
|
getDataList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
productApi.typeFindByPage(this.artFrom).then(res => {
|
productApi.typeFindByPage(this.artFrom).then(res => {
|
||||||
console.log(res.data);
|
|
||||||
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.artFrom.totalCount = 0 } = res.data);
|
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.artFrom.totalCount = 0 } = res.data);
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user