Commit 81c1c15a authored by 黄媛媛's avatar 黄媛媛

update

parent 0e964435
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="goodsList"> <div class="goodsList">
<div class="head-title"> <div class="head-title">
商品列表 商品列表
<el-button style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">商品导出</el-button> <el-button @click="Export" style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">商品导出</el-button>
<el-button @click="CommonJump('goodsListEdit')" style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">添加商品</el-button> <el-button @click="CommonJump('goodsListEdit')" style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">添加商品</el-button>
<el-button style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">更新所有商品销量</el-button> <el-button style="float:right;margin-top: -5px;margin-left:20px;" size="small" type="primary">更新所有商品销量</el-button>
...@@ -170,8 +170,8 @@ ...@@ -170,8 +170,8 @@
width="200" width="200"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<img @click="Delete(scope.row)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/edit.png" alt=""> <img @click="CommonJump('goodsListEdit',{GoodsId:scope.row.Id})" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/edit.png" alt="">
<img @click="Edit(scope.row,6)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/del.png" alt=""> <img @click="Delete(scope.row)" style="width:32px;height:32px;margin:0 10px" src="../../assets/img/userman/del.png" alt="">
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -435,7 +435,16 @@ export default { ...@@ -435,7 +435,16 @@ export default {
this.getRule(); this.getRule();
}, },
methods:{ methods:{
Export(){
let msg = this.msg;
msg = JSON.parse(JSON.stringify(msg));
msg.pageSize=999;
this.JavaGetLocalFile(
"/api/product/GetProductGoodsListToExcel",
msg,
"商品列表.xls"
);
},
plsetOk(){ plsetOk(){
if(this.plszMsg.Type==7){ if(this.plszMsg.Type==7){
// if(this.plszMsg.FreightId==0){ // if(this.plszMsg.FreightId==0){
...@@ -608,7 +617,7 @@ export default { ...@@ -608,7 +617,7 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.apipost('/api/product/DelProductServiceInfo',{ServiceId:item.Id}, this.apipost('/api/product/DelProcudtGoodsInfo',{GoodsId:item.Id},
res => { res => {
if (res.data.resultCode === 1) { if (res.data.resultCode === 1) {
this.getList(); this.getList();
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="商品分类"> <el-form-item label="商品分类">
<template v-if="addMsg.CategoryList && addMsg.CategoryList.length>0"> <template v-if="addMsg.CategoryList && addMsg.CategoryList.length>0">
<el-tag type="warning" style="margin-right:10px;" @close="exitCheck(item,index)" v-for="(item,index) in addMsg.CategoryList" :key="index" closable>{{item.Name}}</el-tag> <el-tag type="warning" style="margin-right:10px;" @close="exitCheck(item,index)" v-for="(item,index) in addMsg.CategoryList" :key="index" closable>{{item.CategoryName}}</el-tag>
</template> </template>
<el-button type="primary" @click="flDig=true,keepCategoryList=addMsg.CategoryList" style="margin:0 10px;" size="small">选择分类</el-button> <el-button type="primary" @click="flDig=true,keepCategoryList=addMsg.CategoryList" style="margin:0 10px;" size="small">选择分类</el-button>
<span @click="CommonJump('addGoodsClass')" class="blue point">添加分类</span> <span @click="CommonJump('addGoodsClass')" class="blue point">添加分类</span>
...@@ -165,7 +165,7 @@ ...@@ -165,7 +165,7 @@
<el-input v-model="addMsg.InventoryNum" type="number" min="1" size="small" placeholder="请输入内容" class="input-with-select"></el-input> <el-input v-model="addMsg.InventoryNum" type="number" min="1" size="small" placeholder="请输入内容" class="input-with-select"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="默认规则名"> <el-form-item label="默认规则名">
<el-input v-model="addMsg.DefaultSpecificationName" size="small" placeholder="请输入内容" class="input-with-select"></el-input> <el-input :disabled="SpecificationList.length>0" v-model="addMsg.DefaultSpecificationName" size="small" placeholder="请输入内容" class="input-with-select"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商品规格"> <el-form-item label="商品规格">
<el-tooltip class="item" effect="dark" content="如有颜色、尺码等多种规格,请添加商品规格" placement="top-start" <el-tooltip class="item" effect="dark" content="如有颜色、尺码等多种规格,请添加商品规格" placement="top-start"
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
<div v-for="(item,index) in SpecificationList" :key="index" style="margin-bottom:16px;"> <div v-for="(item,index) in SpecificationList" :key="index" style="margin-bottom:16px;">
<div flex="dir:left cross:center" class="bg"> <div flex="dir:left cross:center" class="bg">
<span>规格名:</span> <span>规格名:</span>
<el-input v-model="item.Name" size="mini" style="width: 94px;margin: 0px 16px;"></el-input> <el-input @input="ggzChange" v-model="item.Name" size="mini" style="width: 94px;margin: 0px 16px;"></el-input>
<el-checkbox @change="CheckBox" v-show="index==0" v-model="item.EnabledImage" :true-label="1" :false-label="2">规格图片</el-checkbox> <el-checkbox @change="CheckBox" v-show="index==0" v-model="item.EnabledImage" :true-label="1" :false-label="2">规格图片</el-checkbox>
<div style="margin-left: auto; line-height: 1;"> <div style="margin-left: auto; line-height: 1;">
<div @click="DeleteggModule(item,index)" class="el-image del-img"> <div @click="DeleteggModule(item,index)" class="el-image del-img">
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
<div class="box-grow-0">规格值:</div> <div class="box-grow-0">规格值:</div>
<div v-for="(item2,index2) in item.SpecificationValueList" :key="index2" flex="dir:left" style="flex-wrap: wrap;"> <div v-for="(item2,index2) in item.SpecificationValueList" :key="index2" flex="dir:left" style="flex-wrap: wrap;">
<div class="attr-list"> <div class="attr-list">
<el-input size="mini" v-model="item2.Name" width="152px"></el-input> <el-input @input="ggzChange" size="mini" v-model="item2.Name" width="152px"></el-input>
<i @click="Deleteggz(item,index,index2)" class="el-icon-error close"></i> <i @click="Deleteggz(item,index,index2)" class="el-icon-error close"></i>
<div v-if="index==0 && item.EnabledImage==1" flex="cross:center main:center" class="img-box"> <div v-if="index==0 && item.EnabledImage==1" flex="cross:center main:center" class="img-box">
<div class="attr-jt"></div> <div class="attr-jt"></div>
...@@ -201,33 +201,37 @@ ...@@ -201,33 +201,37 @@
</div> </div>
</div> </div>
</div> </div>
<div flex="dir:left" style="flex-wrap: wrap;">
<span @click="addGgz(item,index)" class="blue f12">添加规格值</span>
</div>
</div> </div>
</div> </div>
<div v-if="SpecificationList.length<6" flex="dir:left cross:center" class="bg"> <div v-if="SpecificationList.length<6" flex="dir:left cross:center" class="bg">
<el-button @click="addggModeule" size="small">添加规格模板</el-button> <el-button @click="addggModeule" size="small">添加规格模板</el-button>
<el-button size="small">添加规格项目</el-button> <el-button @click="addggxm" size="small">添加规格项目</el-button>
<span style="padding-left: 14px;color: rgb(201, 201, 201)">注:规格名最多添加5个</span> <span style="padding-left: 14px;color: rgb(201, 201, 201)">注:规格名最多添加5个</span>
</div> </div>
</div> </div>
</div> </div>
<div style="width: 130%; margin-top: 24px;"> <div v-show="SpecificationPriceList.length>0" style="width: 130%; margin-top: 24px;">
<div class="app-attr"> <div class="app-attr">
<div class="box"> <div class="box">
<!-- <el-checkbox v-model="val2">全选</el-checkbox> --> <!-- <el-checkbox v-model="val2">全选</el-checkbox> -->
<el-form-item label-width="90px" style="display:inline-block" label="批量设置"> <el-form-item label-width="90px" style="display:inline-block" label="批量设置">
<el-input style="width:560px" size="small" v-model="addMsg.GoodsNumbers" placeholder="请输入内容" class="input-with-select"> <el-input style="width:560px" size="small" v-model="valpl" placeholder="请输入内容" class="input-with-select">
<el-select v-model="val2" slot="prepend" placeholder="请选择"> <el-select style="width:120px" v-model="ggpl" slot="prepend" placeholder="请选择">
<el-option label="餐厅名" value="1"></el-option> <el-option label="价格" :value="1"></el-option>
<el-option label="订单号" value="2"></el-option> <el-option label="库存" :value="2"></el-option>
<el-option label="用户电话" value="3"></el-option> <el-option label="重量(g)" :value="3"></el-option>
<el-option label="货号" :value="4"></el-option>
</el-select> </el-select>
<el-button slot="append" >确定</el-button> <el-button @click="ggPlSet" slot="append" >确定</el-button>
</el-input> </el-input>
</el-form-item> </el-form-item>
</div> </div>
<el-table <el-table
ref="table" ref="table"
:data="tableData" :data="SpecificationPriceList"
border border
style="width: 100%" style="width: 100%"
@selection-change="TbaleSelectionChange"> @selection-change="TbaleSelectionChange">
...@@ -235,38 +239,43 @@ ...@@ -235,38 +239,43 @@
type="selection" type="selection"
width="55"> width="55">
</el-table-column> </el-table-column>
<template v-for="(item,index) in SpecificationList">
<el-table-column <el-table-column :key="index"
v-for="(item,index) in SpecificationList"
:key="index"
:label="item.Name"> :label="item.Name">
</el-table-column> <template slot-scope="scope">
<span v-if="index==index2" v-for="(item2,index2) in scope.row.AttrList" :key="index2">
{{scope.row.AttrList[index2].SVName}}
</span>
</template>
</el-table-column>
</template>
<el-table-column <el-table-column
:render-header="renderHeader" :render-header="renderHeader"
label="价格"> label="价格">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="small"></el-input> <el-input v-model="scope.row.SellingPrice" size="small"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
:render-header="renderHeader" :render-header="renderHeader"
label="库存"> label="库存">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="small"></el-input> <el-input v-model="scope.row.InventoryNum" size="small"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="重量"> label="重量(克)">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="small"></el-input> <el-input v-model="scope.row.GoodsWeight" size="small"></el-input>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="address" prop="address"
label="货号"> label="货号">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input size="small"></el-input> <el-input v-model="scope.row.GoodsNumbers" size="small"></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -444,14 +453,158 @@ ...@@ -444,14 +453,158 @@
:inactive-value="0"> :inactive-value="0">
</el-switch> </el-switch>
</el-form-item> </el-form-item>
<el-form-item label="分销类型"> <template v-if="addMsg.SeparateDistribution==1">
<el-radio v-model="addMsg.SeparateDistributionType" :label="1">普通设置</el-radio> <el-form-item label="分销类型">
<el-radio v-model="addMsg.SeparateDistributionType" :label="2">详细设置</el-radio> <el-radio v-model="addMsg.SeparateDistributionType" :label="1">普通设置</el-radio>
</el-form-item> <el-radio @change="butionType" v-model="addMsg.SeparateDistributionType" :label="2">详细设置</el-radio>
<el-form-item label="分销佣金类型"> </el-form-item>
<el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="2">固定金额</el-radio> <el-form-item label="分销佣金类型">
<el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="1">百分比</el-radio> <el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="2">固定金额</el-radio>
</el-form-item> <el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="1">百分比</el-radio>
</el-form-item>
<el-form-item class="111">
<div v-if="addMsg.SeparateDistributionType==1" class="app-attr">
<div class="box">
<el-form-item label-width="90px" style="display:inline-block" label="批量设置">
<el-select style="width:130px" v-model="pusetVal" size="small">
<el-option v-for="(item,index) in butorInt" :label="`${index+1}级分销`" :value="index+1" :key="index"></el-option>
</el-select>
<el-input style="width:150px;position:relative;top:5px" size="small" v-model="ptinput" placeholder="请输入内容">
<el-button slot="append" >%</el-button>
</el-input>
<el-button @click="PuSet" style="position:relative;" size="small" type="primary">设置</el-button>
</el-form-item>
</div>
<el-table
ref="table"
:data="GradeCommissionList"
border
style="width: 100%"
@selection-change="TbaleSelectionChange2">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
width="100"
label="等级名称">
<template slot-scope="scope">
<template v-for="(item2,index) in DropdownList">
<span :key="index" v-if="scope.row.DistributorGrade==item2.Id">{{item2.Name}}</span>
</template>
</template>
</el-table-column>
<template v-for="(item,index) in butorIntList">
<el-table-column :key="index"
:label="item.Name">
<template slot-scope="scope">
<span>
<el-input v-model="scope.row.OneCommission" v-if="index==0" size="small">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType==2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType==1">%</span>
</el-button>
</el-input>
<el-input v-model="scope.row.TwoCommission" v-if="index==1" size="small">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType==2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType==1">%</span>
</el-button>
</el-input>
<el-input v-model="scope.row.ThreeCommission" v-if="index==2" size="small">
<el-button slot="append">
<span v-if="addMsg.SeparateDistributionMoneyType==2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType==1">%</span>
</el-button>
</el-input>
</span>
</template>
</el-table-column>
</template>
</el-table>
</div>
</el-form-item>
<el-form-item class="222">
<div v-if="addMsg.SeparateDistributionType==2" class="app-attr">
<div class="box">
<el-form-item label-width="90px" style="display:inline-block" label="批量设置">
<el-select style="width:130px" v-model="gradeVal" size="small">
<el-option v-for="(item,index) in DropdownList" :label="item.Name" :value="item.Grade" :key="index"></el-option>
</el-select>
<el-select style="width:130px" v-model="fxVal" size="small">
<el-option v-for="(item,index) in butorInt" :label="`${index+1}级分销`" :value="index+1" :key="index"></el-option>
</el-select>
<el-input style="width:150px;position:relative;top:5px" size="small" v-model="xxVal" placeholder="请输入内容">
<el-button slot="append" >
<span v-if="addMsg.SeparateDistributionMoneyType==2"></span>
<span v-if="addMsg.SeparateDistributionMoneyType==1">%</span>
</el-button>
</el-input>
<el-button @click="xxSet" style="position:relative;" size="small" type="primary">设置</el-button>
</el-form-item>
</div>
<el-table
ref="table"
:data="disList2"
border
style="width: 100%"
@selection-change="TbaleSelectionChange3">
<template v-for="(item,index) in SpecificationList">
<el-table-column :key="index"
:label="item.Name"
width="100">
<template slot-scope="scope">
<span v-if="index==index2" v-for="(item2,index2) in scope.row.AttrList" :key="index2">
{{scope.row.AttrList[index2].SVName}}
</span>
</template>
</el-table-column>
</template>
<template v-for="(item,index3) in DropdownList">
<el-table-column :key="index3"
:label="item.Name">
<el-table-column
width="100"
v-if="butorInt>0"
label="一级分销">
<template slot-scope="scope">
<el-input v-model="scope.row.GradeCommissionList[index3].OneCommission" size="small">
</el-input>
</template>
</el-table-column>
<el-table-column
width="100"
v-if="butorInt>1"
label="二级分销">
<template slot-scope="scope">
<el-input v-model="scope.row.GradeCommissionList[index3].TwoCommission" size="small">
</el-input>
</template>
</el-table-column>
<el-table-column
width="100"
v-if="butorInt>2"
label="三级分销">
<template slot-scope="scope">
<el-input v-model="scope.row.GradeCommissionList[index3].ThreeCommission" size="small">
</el-input>
</template>
</el-table-column>
</el-table-column>
</template>
<el-table-column
type="selection"
:fixed="true"
width="55">
</el-table-column>
</el-table>
</div>
</el-form-item>
</template>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="会员价设置" name="third"> <el-tab-pane label="会员价设置" name="third">
<el-form-item label="是否享受会员功能"> <el-form-item label="是否享受会员功能">
...@@ -645,9 +798,7 @@ export default { ...@@ -645,9 +798,7 @@ export default {
}, },
data() { data() {
return { return {
tableData:[{ tableData:[],
Id:1
}],
SpecificationList:[], SpecificationList:[],
SpecificationPriceList:[], SpecificationPriceList:[],
speciDigActive:-1, speciDigActive:-1,
...@@ -758,25 +909,138 @@ export default { ...@@ -758,25 +909,138 @@ export default {
val1:{}, val1:{},
keepFormsId:-1, keepFormsId:-1,
AreaList:[], AreaList:[],
skuList:[],
GoodsId:'',
butorInt:0,
butorIntList:[],
DropdownList:[],
DistributionCommissionTreeList:[],
disList1:[
{
SpecificationSort:'',
GradeCommissionList:[],
}
],
disList2:[],
GradeCommissionList:[],
ggpl:'',
ggplList:[],
valpl:'',
pusetVal:'',
pusetList:[],
ptinput:'',
fxVal:'',
gradeVal:'',
xxVal:'',
xxList:[],
}; };
}, },
created(){}, created(){},
mounted() { mounted() {
if(this.$route.query.UserId){ if(this.$route.query.GoodsId){
this.UserId=this.$route.query.UserId; this.GoodsId=this.$route.query.GoodsId;
// this.getData() this.getData()
}else{ }else{
this.$refs.ue.InitData(); this.$refs.ue.InitData();
} }
this.getTree(); this.getTree();
this.getService(); this.getService();
this.getRule(); this.getRule();
this.getSpeciList(); this.getSpeciList();
this.getDistributor();
}, },
methods: { methods: {
TbaleSelectionChange(){},
TbaleSelectionChange3(val){
this.xxList=val;
},
xxSet(){
if(this.gradeVal===''){
this.Error("请选择等级!");
return;
}
if(this.fxVal===''){
this.Error("请选择层级!");
return;
}
// this.disList2.forEach(item=>{
// item=JSON.parse(JSON.stringify(item))
// item.GradeCommissionList(grade=>{
// this.pusetList.forEach(list=>{
// if(item.Id==list.Id){
// if(grade.DistributorGrade==this.gradeVal){
// if(this.fxVal==1){
// grade.OneCommission=this.xxVal;
// }
// if(this.fxVal==2){
// grade.TwoCommission=this.xxVal;
// }
// if(this.fxVal==3){
// grade.ThreeCommission=this.xxVal;
// }
// }
// }
// })
// })
// })
},
PuSet(){
this.GradeCommissionList.forEach(item=>{
this.pusetList.forEach(list=>{
if(item.DistributorGrade==list.DistributorGrade){
if(this.pusetVal==1){
item.OneCommission=this.ptinput;
}
if(this.pusetVal==2){
item.TwoCommission=this.ptinput;
}
if(this.pusetVal==3){
item.ThreeCommission=this.ptinput;
}
}
})
})
},
TbaleSelectionChange2(val){
this.pusetList=val;
},
ggPlSet(){
if(this.ggplList.length==0){
this.Error("至少选择一项!");
return;
}
this.SpecificationPriceList.forEach(item=>{
this.ggplList.forEach(list=>{
if(item.Id==list.Id){
if(this.ggpl==1){
item.SellingPrice=this.valpl;
}
if(this.ggpl==2){
item.InventoryNum=this.valpl;
}
if(this.ggpl==3){
item.GoodsWeight=this.valpl;
}
if(this.ggpl==4){
item.GoodsNumbers=this.valpl;
}
}
})
})
},
TbaleSelectionChange(val){
this.ggplList=val;
},
renderHeader (h,{column}) { // h即为cerateElement的简写,具体可看vue官方文档 renderHeader (h,{column}) { // h即为cerateElement的简写,具体可看vue官方文档
return h( return h(
'div', 'div',
...@@ -792,15 +1056,26 @@ export default { ...@@ -792,15 +1056,26 @@ export default {
CheckBox(val){ CheckBox(val){
console.log(val); console.log(val);
}, },
butionType(val){
this.skuList=[];
this.getSkuData([], 0,this.SpecificationList);
},
// 删除规格模板 // 删除规格模板
DeleteggModule(item,index){ DeleteggModule(item,index){
this.SpecificationList.splice(index,1); this.SpecificationList.splice(index,1);
this.$forceUpdate(); this.$forceUpdate();
this.skuList=[];
this.getSkuData([], 0,this.SpecificationList);
}, },
// 删除规格值 // 删除规格值
Deleteggz(item,index,index2){ Deleteggz(item,index,index2){
this.SpecificationList[index].SpecificationValueList.splice(index2,1); this.SpecificationList[index].SpecificationValueList.splice(index2,1);
this.$forceUpdate(); this.$forceUpdate();
if(this.SpecificationList[index].SpecificationValueList.length==0){
this.SpecificationList.splice(index,1)
}
this.skuList=[];
this.getSkuData([], 0,this.SpecificationList);
}, },
// 全选 // 全选
changeCheckAll(item,index){ changeCheckAll(item,index){
...@@ -815,6 +1090,33 @@ export default { ...@@ -815,6 +1090,33 @@ export default {
this.$forceUpdate(); this.$forceUpdate();
}, },
// 添加规格模板
addggxm(){
let that=this;
let obj={
Name:'',
SpecificationValueList:[],
Sort:that.SpecificationList.length
}
this.SpecificationList.push(obj);
},
// 添加规格值
addGgz(item,index){
let obj={
Id:0,
Image:'',
Name:'',
Sort:item.SpecificationValueList.length
};
this.SpecificationList[index].SpecificationValueList.push(obj);
},
// 修改规格值
ggzChange(){
this.$forceUpdate();
this.skuList=[];
this.getSkuData([], 0,this.SpecificationList);
},
chooseSpecificationValueList(){ chooseSpecificationValueList(){
if(!this.SpecificationList){ if(!this.SpecificationList){
this.SpecificationList=[]; this.SpecificationList=[];
...@@ -834,31 +1136,92 @@ export default { ...@@ -834,31 +1136,92 @@ export default {
list.Sort=index2; list.Sort=index2;
}) })
}) })
console.log("this.SpecificationList",this.SpecificationList) this.skuList=[];
let SpecificationPriceList=[]; this.getSkuData([], 0,this.SpecificationList);
let data=this.SpecificationList; // console.log("this.skuList",this.skuList)
let namerr=[]; this.speciDig=false;
for(let i=0;i<data.length;i++){ },
namerr.push(`name${i}`) getSkuData(skuArr = [], i, list) {
console.log("namerr",namerr)        for (let j = 0; j < list[i].SpecificationValueList.length; j++) {
for(let j=0;j<data[i].SpecificationValueList.length;j++){ skuArr[i]={};
let list= data[i].SpecificationValueList;          if (i < list.length - 1) {
for(let k=0;k<namerr.length;k++){            skuArr[i].SName= list[i].Name;
let obj={            skuArr[i].SVName= list[i].SpecificationValueList[j].Name;
GoodsNumbers:'',            skuArr[i].SVId= list[i].SpecificationValueList[j].Sort;
GoodsWeight:0,            this.getSkuData(skuArr, i + 1, list); // 递归循环
InventoryNum:0,          } else {
SellingPrice:0, skuArr[i].SName= list[i].Name;
SpecificationSort:'',            skuArr[i].SVName= list[i].SpecificationValueList[j].Name;
}            skuArr[i].SVId= list[i].SpecificationValueList[j].Sort;
obj[namerr[k]]=list[j].Name;
SpecificationPriceList.push(obj);
//            this.skuList.push([...skuArr, list[i].SpecificationValueList[j].Name]); // 扩展运算符,连接两个数组
           this.skuList.push([...skuArr]); // 扩展运算符,连接两个数组
         }
       }
this.calcList(this.skuList,this.SpecificationList);
    },
calcList(list,calist){
this.SpecificationPriceList=[];
let arrList=[];
list.forEach(item=>{
item.AttrList=[];
item.SpecificationSort="";
item.forEach((item2,index2)=>{
let obj={
SName:item2.SName,
SVName:item2.SVName,
SVId:item2.SVId,
};
let str=":";
if(index2==item.length-1){
str="";
} }
} item.SpecificationSort+=item2.SVId+str;
} item.GoodsNumbers='';
console.log("SpecificationPriceList",SpecificationPriceList) item.GoodsWeight=0;
this.speciDig=false; item.InventoryNum=0;
item.SellingPrice=0;
item.AttrList.push(obj)
})
})
list.forEach((item,i)=>{
let obj={
AttrList:item.AttrList,
SpecificationSort:item.SpecificationSort,
GoodsNumbers:item.GoodsNumbers,
GoodsWeight:item.GoodsWeight,
InventoryNum:item.InventoryNum,
SellingPrice:item.SellingPrice,
};
let obj1={
Id:i,
AttrList:item.AttrList,
SpecificationSort:item.SpecificationSort,
GradeCommissionList:[],
};
this.SpecificationPriceList.push(obj)
arrList.push(obj1)
})
this.calcdis(JSON.parse(JSON.stringify(arrList)));
},
calcdis(dislist){
dislist.forEach(item=>{
for(let i=0;i<this.DropdownList.length;i++){
let obj={
DistributorGrade:this.DropdownList[i].Id,
OneCommission:0,
TwoCommission:0,
ThreeCommission:0,
Name:item.Name
}
item.GradeCommissionList.push(obj);
}
})
this.disList2=JSON.parse(JSON.stringify(dislist));
console.log(" this.disList2", this.disList2)
}, },
addggModeule(){ addggModeule(){
this.speciDig=true; this.speciDig=true;
...@@ -880,6 +1243,16 @@ export default { ...@@ -880,6 +1243,16 @@ export default {
if (valid) { if (valid) {
let content = this.$refs.ue.getUEContent(); let content = this.$refs.ue.getUEContent();
this.addMsg.GoodsDetails=content; this.addMsg.GoodsDetails=content;
if(this.SpecificationList.length>0){
this.addMsg.IsCustomSpecification=1;
}
if(this.addMsg.SeparateDistributionType==1){
this.addMsg.DistributionCommissionList=this.disList1;
} else{
this.addMsg.DistributionCommissionList=this.disList2;
}
this.addMsg.SpecificationPriceList=this.SpecificationPriceList;
this.addMsg.SpecificationList=this.SpecificationList;
this.apipost("/api/product/SetProductGoodsInfo",this.addMsg, res => { this.apipost("/api/product/SetProductGoodsInfo",this.addMsg, res => {
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.Success(res.data.message) this.Success(res.data.message)
...@@ -1028,13 +1401,33 @@ export default { ...@@ -1028,13 +1401,33 @@ export default {
if(res.data.resultCode==1){ if(res.data.resultCode==1){
let pageData=res.data.data; let pageData=res.data.data;
this.fenleiData=pageData; this.fenleiData=pageData;
this.fenleiData.forEach(item=>{
item.CategoryName=item.Name;
})
} }
}) })
}, },
getData(){ getData(){
this.apipost("/api/user/GetMemberUserInfo",{UserId:this.UserId}, res => { this.apipost("/api/product/GetProductGoodsInfo",{GoodsId:this.GoodsId}, res => {
this.userInfo=res.data.data; this.addMsg=res.data.data;
console.log("addMsg",this.addMsg);
this.SpecificationPriceList=this.addMsg.SpecificationPriceList;
this.SpecificationList=this.addMsg.SpecificationList;
if(this.addMsg.SeparateDistributionType==1){
this.disList1=this.addMsg.DistributionCommissionTreeList;
this.GradeCommissionList=this.addMsg.DistributionCommissionTreeList[0].GradeCommissionList
console.log("this.GradeCommissionList",this.GradeCommissionList)
}
if(this.addMsg.SeparateDistributionType==2){
this.disList2=this.addMsg.DistributionCommissionTreeList;
}
this.disList1=[];
let objNew={
SpecificationSort:'',
GradeCommissionList:this.GradeCommissionList
};
this.disList1.push(objNew);
}) })
}, },
getRule(){ getRule(){
...@@ -1067,12 +1460,95 @@ export default { ...@@ -1067,12 +1460,95 @@ export default {
}) })
}, },
getDistributor(){
this.loading=true;
this.apipost("/api/user/GetDistributorBasicsInfo", {}, res => {
this.loading=false;
if(res.data.resultCode==1){
this.butorInt=res.data.data.DistributorTier;
this.butorIntList=[];
for(let i=0;i<res.data.data.DistributorTier;i++){
let msg={
Name:i+1+"级分销",
}
this.butorIntList.push(msg)
}
this.GetDropdownList();
}
})
},
GetDropdownList(){
let msg={
Id:0,
Grade:0,
Name:'',
Enabled:0,
}
this.apipost("/api/user/GetDistributorGradeDropdownList",msg, res => {
this.DropdownList=JSON.parse(JSON.stringify(res.data.data));
let msg={
Grade:0,
GradeCommissionList:[],
Name:'默认等级',
SpecificationSort:'',
Id:0
}
this.DropdownList.unshift(msg)
this.disList1.GradeCommissionList=[];
this.disList1.SpecificationSort="";
this.DropdownList.forEach(item=>{
item.GradeCommissionList=[];
item.SpecificationSort='';
for(let i=0;i<this.butorInt;i++){
let obj={
DistributorGrade:item.Id,
OneCommission:0,
TwoCommission:0,
ThreeCommission:0,
}
item.GradeCommissionList.push(obj);
}
})
this.DropdownList=JSON.parse(JSON.stringify(this.DropdownList));
console.log("this.this.DropdownList",this.DropdownList);
if(!this.$route.query.GoodsId){
this.GradeCommissionList=[];
this.DropdownList.forEach(item=>{
let obj2={
DistributorGrade:item.Id,
OneCommission:0,
TwoCommission:0,
ThreeCommission:0,
Name:item.Name
}
this.GradeCommissionList.push(obj2);
})
this.GradeCommissionList=JSON.parse(JSON.stringify(this.GradeCommissionList))
this.disList1=[];
let objNew={
SpecificationSort:'',
GradeCommissionList:this.GradeCommissionList
};
this.disList1.push(objNew);
console.log("this.disList1",this.disList1);
}
})
},
}, },
}; };
</script> </script>
<style> <style>
.goodsListEdit .pendSelect{
width:100px;
}
.goodsListEdit .el-table th>.cell{ .goodsListEdit .el-table th>.cell{
padding-left: 20px!important; padding-left: 20px!important;
} }
......
<template> <template>
<div class="orderList afterSalesOrder"> <div class="orderList afterSalesOrder">
<div class="head-title"> <div class="head-title">
订单列表 售后列表
<el-button @click="dialogVisible=true" style="float:right;margin-top: -5px;" size="small" type="primary">批量导出</el-button> <el-button @click="dialogVisible=true" style="float:right;margin-top: -5px;" size="small" type="primary">批量导出</el-button>
</div> </div>
<div class="content"> <div class="content">
<div> <div>
<span>下单时间:</span> <span>添加时间:</span>
<el-date-picker <el-date-picker
v-model="dateList" v-model="dateList"
@change="getList" @change="getList"
...@@ -27,16 +27,6 @@ ...@@ -27,16 +27,6 @@
:value="item.Id"> :value="item.Id">
</el-option> </el-option>
</el-select> </el-select>
<span style="margin-left:15px">配送方式:</span>
<el-select class="w120" @change="getList" style="margin-right: 10px;" v-model="msg.DeliveryMethod" size="small" placeholder="请选择">
<el-option label="全部订单" :value="0"></el-option>
<el-option
v-for="item in deliveryList"
:key="item.Id"
:label="item.Name"
:value="item.Id">
</el-option>
</el-select>
<el-input @clear="getList" clearable style="margin-left:15px;width:300px" class="input-with-select" placeholder="请输入内容" v-model="msgVal" size="small"> <el-input @clear="getList" clearable style="margin-left:15px;width:300px" class="input-with-select" placeholder="请输入内容" v-model="msgVal" size="small">
<el-select class="pendSelect" @change="ChangeId" v-model="msgId" slot="prepend" placeholder="请选择"> <el-select class="pendSelect" @change="ChangeId" v-model="msgId" slot="prepend" placeholder="请选择">
<el-option <el-option
...@@ -54,10 +44,12 @@ ...@@ -54,10 +44,12 @@
<el-tab-pane v-for="item in orderTypeList" :key="item.Id" :dataId="item.Id" :label="item.Name"></el-tab-pane> <el-tab-pane v-for="item in orderTypeList" :key="item.Id" :dataId="item.Id" :label="item.Name"></el-tab-pane>
</el-tabs> </el-tabs>
<div class="app-order-title"> <div class="app-order-title">
<div style="width: 55%;">商品信息</div> <div style="width: 50%;">商品信息</div>
<div style="width: 20%;">实付金额</div> <div style="width: 8%;">售后类型</div>
<div style="width: 20%;">分销状态</div> <div style="width: 8%;">订单状态</div>
<div style="width: 20%;">分销情况</div> <div style="width: 8%;">金额</div>
<div style="width: 8%;">申请理由</div>
<div style="width: 18%;">操作</div>
</div> </div>
<div v-loading="loading" class="app-order-list"> <div v-loading="loading" class="app-order-list">
<el-card v-for="(item,index) in tableData" :key="index" class="app-order-item" shadow="never"> <el-card v-for="(item,index) in tableData" :key="index" class="app-order-item" shadow="never">
...@@ -65,13 +57,13 @@ ...@@ -65,13 +57,13 @@
<div flex="cross:center" class="app-order-head"> <div flex="cross:center" class="app-order-head">
<div class="app-order-time">{{item.CreateDate}}</div> <div class="app-order-time">{{item.CreateDate}}</div>
<div class="app-order-user"> <div class="app-order-user">
<span class="app-order-time">订单号:</span>{{item.OrderNo}} <span class="app-order-time">订单号:</span>{{item.ReOrderNo}}
</div> </div>
<div flex="cross:center" class="app-order-user"> <div flex="cross:center" class="app-order-user">
<img v-if="item.OrderSource==1" src="../../assets/img/userman/wx.png" alt=""> <img v-if="item.OrderModel.OrderSource==1" src="../../assets/img/userman/wx.png" alt="">
<span>{{item.UserName}}</span> <span>{{item.UserName}}({{item.UserId}})</span>
</div> </div>
<div flex="dir:left wrap:wrap" class="app-order-offline"> <!-- <div flex="dir:left wrap:wrap" class="app-order-offline">
<div class="express-send-box"> <div class="express-send-box">
<span class="el-tag el-tag--small el-tag--light">{{item.DeliveryMethodName}}</span> <span class="el-tag el-tag--small el-tag--light">{{item.DeliveryMethodName}}</span>
</div> </div>
...@@ -87,85 +79,63 @@ ...@@ -87,85 +79,63 @@
<el-tag v-if="item.OrderStatus==7" style="margin-left:5px" size="small" type="danger">已取消</el-tag> <el-tag v-if="item.OrderStatus==7" style="margin-left:5px" size="small" type="danger">已取消</el-tag>
</div> </div> -->
</div> </div>
</div> </div>
<div class="app-order-body"> <div class="app-order-body">
<div class="goods-item" style="width: 55%;"> <div class="goods-item" style="width: 50%;">
<div v-for="(list,index2) in item.DetailList" :key="index2" class="goods"> <div class="goods">
<img :src="domainManager().ImageUrl+list.CoverImagePath" class="goods-image"> <img :src="domainManager().ImageUrl+item.OrderDetailModel.CoverImagePath" class="goods-image">
<div flex="dir:left"> <div flex="dir:left">
<div class="goods-info"> <div class="goods-info">
<div class="goods-name"> <div class="goods-name">
<div class="app-ellipsis"> <div class="app-ellipsis">
<div class="vue-line-clamp" style="word-break: break-all; -webkit-line-clamp: 2;"> <div class="vue-line-clamp" style="word-break: break-all; -webkit-line-clamp: 2;">
<span class="el-tag el-tag--warning el-tag--mini el-tag--light is-hit" style="margin-right: 5px;"> {{item.OrderDetailModel.GoodsName}}
{{list.OrderTypeName}}
</span>
{{list.GoodsName}}
</div> </div>
</div> </div>
</div> </div>
<div style="margin-bottom: 24px;"> <div style="margin-bottom: 24px;">
<span style="margin-right: 10px;"> <span style="margin-right: 10px;">
规格: 规格:
<el-tag style="top: 5px;position: relative;margin-right: 5px; max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" size="mini"> <el-tag :key="index2" v-for="(list,index2) in item.OrderDetailModel.SpecificationList" style="top: 5px;position: relative;margin-right: 5px; max-width: 300px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;" size="mini">
{{list.Specification}} {{list}}
</el-tag> </el-tag>
</span> </span>
</div> </div>
<div class="app-order-goods-price"> <!-- <div class="app-order-goods-price">
<span>货号:{{list.ProductCode}}</span> <span>货号:{{list.ProductCode}}</span>
</div> </div> -->
</div> </div>
<div flex="dir:left box:mean" style="width: 250px;"> <div flex="dir:left box:mean" style="width: 250px;">
<div flex="cross:center main:center"> <div flex="cross:center main:center">
<span>小计:¥{{list.Final_Price}} <span>小计:¥{{item.Income}}
</span> </span>
</div> </div>
<div flex="cross:center main:center">数量:x {{list.Number}}</div> <div flex="cross:center main:center">数量:x {{item.ReNumber}}</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div flex="cross:center" class="app-order-info" style="width: 15%;"> <div flex="cross:center" class="app-order-info" style="width: 8%;">
<div flex="dir:top"> <div>
<div> <span v-if="item.Type==1">退货退款</span>
<span style="font-size: 16px;">{{item.Income}}</span> <span v-if="item.Type==2">换货</span>
<el-popover
placement="top-start"
title="标题"
width="200"
trigger="hover"
:content="'商品小计 '+ item.Income">
<img slot="reference" src="../../assets/img/userman/price.png" alt="">
</el-popover>
</div>
<div class="express-price"><span>
<span style="color: rgb(144, 147, 153);">(含运费¥{{item.FreightMoney}})
</span>
</span></div>
<div><el-tag effect="dark" type="warning" size="mini">{{item.PaymentWayName}}</el-tag></div>
</div> </div>
</div> </div>
<div flex="main:center cross:center" class="app-box-info" style="width: 10%;border-right: 1px solid #EBEEF5;"> <div flex="main:center cross:center" class="app-box-info" style="width: 8%;border-right: 1px solid #EBEEF5;">
<div>待结算</div> <div>{{item.ReOrderStatusName}}</div>
</div> </div>
<div flex="main:center cross:center" class="app-order-info" style="border-right: 0px; width: 15%;"> <div flex="main:center cross:center" class="app-order-info" style="border-right:1px solid #EBEEF5; width: 8%;">
<div> <div>实付金额:¥{{item.Income-item.RefundActual}}</div>
<div v-for="(list,index2) in item.OrderCommissionList" :key="index2" shadow="never" style="margin: 10px;"> </div>
<div> <div flex="cross:center" class="app-order-info" style="width: 8%;">
<span v-if="list.Grade==0">自购返利</span> <el-tooltip class="item" effect="dark" :content="item.Remark" placement="top">
<span v-if="list.Grade==1">一级佣金</span> <div>{{item.Remark}}</div>
<span v-if="list.Grade==2">二级佣金</span> </el-tooltip>
<span v-if="list.Grade==3">三级佣金</span>
<span class="price">{{list.Commission}}</span> </div>
</div> <div flex="main:center cross:center" class="app-order-info" style="width: 18%;">
<div>昵称:{{list.Name}}</div>
<div>姓名:{{list.UserName}}</div>
<div>手机:{{list.Mobile}}</div>
</div>
</div>
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
...@@ -288,18 +258,26 @@ export default { ...@@ -288,18 +258,26 @@ export default {
OrderId:0, OrderId:0,
StartTime:'', StartTime:'',
EndTime:'', EndTime:'',
OrderStatus:0,
OrderNo:'', OrderNo:'',
UserName:'', UserName:'',
UserId:0, UserId:0,
GoodsName:'', GoodsName:'',
SelectStatus:0,
ReOrderNo:'',
Consignee:'',
Mobile:'',
}, },
platList:[], platList:[],
option:[ option:[
{Id:1,name:'订单号'}, {Id:1,name:'订单号'},
{Id:2,name:'用户名'}, {Id:2,name:'原订单号'},
{Id:3,name:'用户ID'}, {Id:3,name:'用户名'},
{Id:4,name:'商品名称'} {Id:4,name:'用户ID'},
{Id:5,name:'商品名称'},
{Id:6,name:'收件人'},
{Id:7,name:'收件人电话'}
], ],
msgId:1, msgId:1,
ExpressList:[], ExpressList:[],
...@@ -370,28 +348,67 @@ export default { ...@@ -370,28 +348,67 @@ export default {
ChangeId(val){ ChangeId(val){
let msgVal=this.msgVal; let msgVal=this.msgVal;
if(val==1){ if(val==1){
this.msg.OrderNo=msgVal; this.msg.ReOrderNo=msgVal;
this.msg.OrderNo='';
this.msg.UserName=''; this.msg.UserName='';
this.msg.UserId=''; this.msg.UserId='';
this.msg.GoodsName=''; this.msg.GoodsName='';
this.msg.Consignee='';
this.msg.Mobile='';
} }
if(val==2){ if(val==2){
this.msg.ReOrderNo='';
this.msg.OrderNo=msgVal;
this.msg.UserName='';
this.msg.UserId='';
this.msg.GoodsName='';
this.msg.Consignee='';
this.msg.Mobile='';
}
if(val==3){
this.msg.ReOrderNo='';
this.msg.OrderNo=''; this.msg.OrderNo='';
this.msg.UserName=msgVal; this.msg.UserName=msgVal;
this.msg.UserId=''; this.msg.UserId='';
this.msg.GoodsName=''; this.msg.GoodsName='';
this.msg.Consignee='';
this.msg.Mobile='';
} }
if(val==3){ if(val==4){
this.msg.ReOrderNo='';
this.msg.OrderNo=''; this.msg.OrderNo='';
this.msg.UserName=''; this.msg.UserName='';
this.msg.UserId=msgVal; this.msg.UserId=msgVal;
this.msg.GoodsName=''; this.msg.GoodsName='';
this.msg.Consignee='';
this.msg.Mobile='';
} }
if(val==4){ if(val==5){
this.msg.ReOrderNo='';
this.msg.OrderNo=''; this.msg.OrderNo='';
this.msg.UserName=''; this.msg.UserName='';
this.msg.UserId=''; this.msg.UserId='';
this.msg.GoodsName=msgVal; this.msg.GoodsName=msgVal;
this.msg.Consignee='';
this.msg.Mobile='';
}
if(val==6){
this.msg.ReOrderNo='';
this.msg.OrderNo='';
this.msg.UserName='';
this.msg.UserId='';
this.msg.GoodsName='';
this.msg.Consignee=msgVal;
this.msg.Mobile='';
}
if(val==7){
this.msg.ReOrderNo='';
this.msg.OrderNo='';
this.msg.UserName='';
this.msg.UserId='';
this.msg.GoodsName='';
this.msg.Consignee='';
this.msg.Mobile=msgVal;
} }
this.getList(); this.getList();
}, },
...@@ -427,16 +444,19 @@ export default { ...@@ -427,16 +444,19 @@ export default {
}, },
handleClick(val){ handleClick(val){
let dataId=val.$attrs.dataId; let dataId=val.$attrs.dataId;
this.msg.OrderStatus=dataId; this.msg.SelectStatus=dataId;
this.getList(); this.getList();
}, },
getList(){ getList(){
if(!this.msgVal || this.msgVal==''){ if(!this.msgVal || this.msgVal==''){
this.msg.ReOrderNo='';
this.msg.OrderNo=''; this.msg.OrderNo='';
this.msg.UserName=''; this.msg.UserName='';
this.msg.UserId=0; this.msg.UserId='';
this.msg.GoodsName=''; this.msg.GoodsName='';
this.msg.Consignee='';
this.msg.Mobile='';
} }
if(this.dateList && this.dateList.length>0){ if(this.dateList && this.dateList.length>0){
this.msg.StartTime=this.dateList[0]; this.msg.StartTime=this.dateList[0];
...@@ -446,7 +466,7 @@ export default { ...@@ -446,7 +466,7 @@ export default {
this.msg.EndTime=''; this.msg.EndTime='';
} }
this.loading=true; this.loading=true;
this.apipost("/api/order/GetDistributionOrdersPageList", this.msg, res => { this.apipost("/api/order/GetGoodsOrderAfterPageList", this.msg, res => {
this.loading=false; this.loading=false;
if(res.data.resultCode==1){ if(res.data.resultCode==1){
this.total=res.data.data.count; this.total=res.data.data.count;
...@@ -472,7 +492,7 @@ export default { ...@@ -472,7 +492,7 @@ export default {
}) })
}, },
getOrderType(){ getOrderType(){
this.apipost("/api/order/GetOrderTypeEnumList",{}, res => { this.apipost("/api/order/GetAfterSaleSelectStatusEnumList",{}, res => {
this.orderTypeList=res.data.data; this.orderTypeList=res.data.data;
}) })
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment