pull/2/head
dt_2916866708 1 year ago
parent 8049bb804c
commit 93cc41f557
  1. 25
      src/api/product/productAttr.js
  2. 6
      src/router/index.js
  3. 134
      src/views/product/brand/index.vue
  4. 4
      src/views/product/productAdd/index.vue
  5. 273
      src/views/product/productAdd/newIndex.vue
  6. 22
      src/views/product/productAttr/addAttr.vue
  7. 3
      src/views/product/productAttr/components/attrList.vue
  8. 18
      src/views/product/productAttr/index.vue

@ -1,6 +1,24 @@
import request from '@/utils/request'
var service_name = 'oil-mall'
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) {
return request({
url: `/${service_name}/mallProductClassification/save`,
@ -70,6 +88,13 @@ delete(page) {
data: page
})
},
typeUpdate(page) {
return request({
url: `/${service_name}/mallProductAttributes/update`,
method: 'post',
data: page
})
},
update(page) {
return request({
url: `/${service_name}/mallProductAttributesType/update`,

@ -36,6 +36,12 @@ export const constantRoutes = [{
name: 'productAdd',
meta: { title: '添加商品', icon: 'iconkongzhitai', affix: true }
},
{
path: '/brand',
component: () => import('@/views/product/brand/index'),
name: 'brand',
meta: { title: '商品品牌', icon: 'iconkongzhitai', affix: true }
},
{
path: '/productClassify',
component: () => import('@/views/product/productClassify/index'),

@ -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>
</el-form-item>
</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">
<div class="acea-row">
<el-select
@ -736,7 +736,7 @@
<span class="addfont" @click="addTemp">新增运费模板</span>
</div>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
<!-- 营销设置-->
<el-row :gutter="24" v-show="headTab.length === 6 ? currentTab === '5' : currentTab === '4'">

@ -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: {
// 02
@ -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;

@ -1,5 +1,5 @@
<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"
label-position="right" @submit.native.prevent>
<el-row :gutter="24">
@ -104,13 +104,14 @@ export default {
}
}
},
created() {
console.log(this.formDynamic)
},
created() { },
methods: {
onCancel() {
this.$parent.clearSelection();
this.$parent.selection = [];
this.formDynamic = {
name: '',
spec: [],
}
},
onClose() {
this.ids = 0;
@ -144,17 +145,21 @@ export default {
}
this.modal_loading = true;
Promise.all([...this.formDynamic.spec.map(item => {
return productApi[this.model]({
return productApi[this.model](Object.assign({
"attributeName": item.value,
"attributeContent": item.detail.join(","),
"typeId": this.formDynamic.id,
"sort": 1,
})
}, this.model == "save" ? {
"typeId": this.formDynamic.id,
} : {
"id": this.formDynamic.id || ""
}))
})]).then(res => {
this.$message.success("添加成功")
this.modal = false;
}).finally(() => {
this.modal_loading = false;
this.model == "save" ? this.$parent.handleCurrentChange() : this.$parent.$refs.attrList.getByPage()
})
} else {
@ -225,6 +230,7 @@ export default {
::v-deep .el-tag {
margin-right: 20px !important;
}
.rulesBox {
display: flex;
align-items: center;

@ -35,7 +35,6 @@
</template>
<script>
import productApi from '@/api/product/productAttr.js';
export default {
name: "attrList",
props: {
@ -111,7 +110,7 @@ export default {
}],
})
this.$parent.$parent.selection = [data];
this.$parent.$parent.addAttr('update');
this.$parent.$parent.addAttr('typeUpdate');
},
init() {
if (this.selectAttrId && this.selectAttrId.indexOf("/") !== -1) {

@ -52,8 +52,8 @@
</div>
</el-card>
<add-attr :selection="selection" ref="addattr" @getList="userSearchs"></add-attr>
<el-dialog @closed="onCancel" title="属性列表" :visible.sync="isShowAttrList" width="30%">
<attrList :selectAttrId="selectAttrId" v-if="isShowAttrList"></attrList>
<el-dialog title="属性列表" :visible.sync="isShowAttrList" width="30%">
<attrList ref="attrList" :selectAttrId="selectAttrId" v-if="isShowAttrList"></attrList>
</el-dialog>
</div>
</template>
@ -85,12 +85,16 @@ export default {
};
},
computed: {},
watch:{
// isShowAttrList(n,o){
// this.clearSelection()
// }
},
created() {
this.getDataList();
},
methods: {
tableCurrentChange(e) {
// this.$message.warning()
console.log(e,'===')
},
@ -103,11 +107,11 @@ export default {
this.getDataList()
},
clearSelection(){
this.selection = [];
// this.handleSelectRow([]);
this.$refs.table.clearSelection();
},
onCancel(){
},
onCancel(){ },
addType() {
this.$prompt('请输入类型', '提示', {
confirmButtonText: '确定',
@ -154,7 +158,6 @@ export default {
},
//
handleSelectRow(selection) {
console.log("selection",selection)
this.selection = selection;
},
setChecked() {
@ -208,7 +211,6 @@ export default {
getDataList() {
this.loading = true;
productApi.typeFindByPage(this.artFrom).then(res => {
console.log(res.data);
if (res.code = 20000) ({ list: this.tableList = [], totalCount: this.artFrom.totalCount = 0 } = res.data);
}).finally(() => {
this.loading = false;

Loading…
Cancel
Save