Commit 6000b230 authored by 黄媛媛's avatar 黄媛媛

update

parent 7bc36378
......@@ -109,27 +109,7 @@
</div>
<el-row>
<el-col :span="12">
<el-form-item label="商品总库存" prop="InventoryNum">
<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 label="默认规则名">
<el-input v-model="addMsg.DefaultSpecificationName" size="small" placeholder="请输入内容" class="input-with-select"></el-input>
</el-form-item>
<el-form-item label="商品规格">
<el-tooltip class="item" effect="dark" content="如有颜色、尺码等多种规格,请添加商品规格" placement="top-start"
style="position: absolute;left: -22px;top:12px">
<i class="elzk el-tooltip el-icon-info"></i>
</el-tooltip>
<div style="width:130%">
<div class="app-attr-group">
<div flex="dir:left cross:center" class="bg">
<el-button size="small">添加规格模板</el-button>
<el-button size="small">添加规格项目</el-button>
<span style="padding-left: 14px;color: rgb(201, 201, 201)">注:规格名最多添加5个</span>
</div>
</div>
</div>
</el-form-item>
<el-form-item label="排序">
<el-tooltip class="item" effect="dark" content="排序值越小排序越靠前" placement="top-start"
style="position: absolute;left: -22px;top:12px">
......@@ -181,6 +161,118 @@
<el-button slot="append"></el-button>
</el-input>
</el-form-item>
<el-form-item label="商品总库存" prop="InventoryNum">
<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 label="默认规则名">
<el-input v-model="addMsg.DefaultSpecificationName" size="small" placeholder="请输入内容" class="input-with-select"></el-input>
</el-form-item>
<el-form-item label="商品规格">
<el-tooltip class="item" effect="dark" content="如有颜色、尺码等多种规格,请添加商品规格" placement="top-start"
style="position: absolute;left: -22px;top:12px">
<i class="elzk el-tooltip el-icon-info"></i>
</el-tooltip>
<div style="width:130%">
<div class="app-attr-group">
<div v-for="(item,index) in SpecificationList" :key="index" style="margin-bottom:16px;">
<div flex="dir:left cross:center" class="bg">
<span>规格名:</span>
<el-input 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>
<div style="margin-left: auto; line-height: 1;">
<div @click="DeleteggModule(item,index)" class="el-image del-img">
<img src="../../assets/img/userman/del1.png" class="el-image__inner">
</div>
</div>
</div>
<div flex="dir:left" style="padding: 0px 10px;margin-top: 16px;">
<div class="box-grow-0">规格值:</div>
<div v-for="(item2,index2) in item.SpecificationValueList" :key="index2" flex="dir:left" style="flex-wrap: wrap;">
<div class="attr-list">
<el-input size="mini" v-model="item2.Name" width="152px"></el-input>
<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 class="attr-jt"></div>
<div class="app-attachment">
<div style="line-height: normal; display: inline-block;">
<span>+添加图片</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div v-if="SpecificationList.length<6" flex="dir:left cross:center" class="bg">
<el-button @click="addggModeule" size="small">添加规格模板</el-button>
<el-button size="small">添加规格项目</el-button>
<span style="padding-left: 14px;color: rgb(201, 201, 201)">注:规格名最多添加5个</span>
</div>
</div>
</div>
<div style="width: 130%; margin-top: 24px;">
<div class="app-attr">
<div class="box">
<!-- <el-checkbox v-model="val2">全选</el-checkbox> -->
<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-select v-model="val2" slot="prepend" placeholder="请选择">
<el-option label="餐厅名" value="1"></el-option>
<el-option label="订单号" value="2"></el-option>
<el-option label="用户电话" value="3"></el-option>
</el-select>
<el-button slot="append" >确定</el-button>
</el-input>
</el-form-item>
</div>
<el-table
ref="table"
:data="tableData"
border
style="width: 100%"
@selection-change="TbaleSelectionChange">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
v-for="(item,index) in SpecificationList"
:key="index"
:label="item.Name">
</el-table-column>
<el-table-column
:render-header="renderHeader"
label="价格">
<template slot-scope="scope">
<el-input size="small"></el-input>
</template>
</el-table-column>
<el-table-column
:render-header="renderHeader"
label="库存">
<template slot-scope="scope">
<el-input size="small"></el-input>
</template>
</el-table-column>
<el-table-column
label="重量">
<template slot-scope="scope">
<el-input size="small"></el-input>
</template>
</el-table-column>
<el-table-column
prop="address"
label="货号">
<template slot-scope="scope">
<el-input size="small"></el-input>
</template>
</el-table-column>
</el-table>
</div>
</div>
</el-form-item>
<el-form-item label="商品货号">
<el-input v-model="addMsg.GoodsNumbers" size="small" placeholder="请输入内容" class="input-with-select">
</el-input>
......@@ -307,8 +399,8 @@
<el-input v-model="addMsg.IntegralPresent" style="width:670px;margin-left:15px" type="number" min="1" size="small" placeholder="请输入内容" class="input-with-select">
<el-button slot="append">
<el-radio v-model="addMsg.IntegralPresentType" :label="1">固定值</el-radio>
<el-radio v-model="addMsg.IntegralPresentType" :label="2">百分比</el-radio>
<el-radio v-model="addMsg.IntegralPresentType" :label="2">固定值</el-radio>
<el-radio v-model="addMsg.IntegralPresentType" :label="1">百分比</el-radio>
</el-button>
</el-input>
</el-form-item>
......@@ -321,8 +413,8 @@
<template slot="prepend">最多抵扣</template>
<el-button slot="append">
<el-radio v-model="addMsg.PointsDeductionType" :label="1">固定值</el-radio>
<el-radio v-model="addMsg.PointsDeductionType" :label="2">百分比</el-radio>
<el-radio v-model="addMsg.PointsDeductionType" :label="2">固定值</el-radio>
<el-radio v-model="addMsg.PointsDeductionType" :label="1">百分比</el-radio>
</el-button>
</el-input>
</el-form-item>
......@@ -357,8 +449,8 @@
<el-radio v-model="addMsg.SeparateDistributionType" :label="2">详细设置</el-radio>
</el-form-item>
<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-radio v-model="addMsg.SeparateDistributionMoneyType" :label="2">固定金额</el-radio>
<el-radio v-model="addMsg.SeparateDistributionMoneyType" :label="1">百分比</el-radio>
</el-form-item>
</el-tab-pane>
<el-tab-pane label="会员价设置" name="third">
......@@ -509,12 +601,37 @@
</span>
</el-dialog>
<!--新增规则弹窗-->
<el-dialog custom-class="regionDig" title="新增规则" :visible.sync="dialogFormVisible" >
<region_Choice @event1="change($event)" :List="AreaList" ref="child"></region_Choice>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="Addto">确 定</el-button>
<el-dialog custom-class="regionDig" title="新增规则" :visible.sync="dialogFormVisible" >
<region_Choice @event1="change($event)" :List="AreaList" ref="child"></region_Choice>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="Addto">确 定</el-button>
</div>
</el-dialog>
<!-- 选择规格模板 -->
<el-dialog custom-class="speciDig" title="选择规格模板" :visible.sync="speciDig" width="680px">
<div flex="dir:left">
<div class="tpl-box">
<div class="tpl-head">规格名选择</div>
<div class="tpl-scrollbar el-scrollbar">
<el-checkbox @change="speciDigActive=index,changeCheckAll(item,index)" v-for="(item,index) in speciList" v-model="item.checkAll" :key="index">{{item.Name}}</el-checkbox>
</div>
</div>
<div class="tpl-box" style="margin-left:10px">
<div class="tpl-head">规格值选择</div>
<div class="tpl-scrollbar el-scrollbar">
<el-checkbox-group v-model="item.SpecificationValueList" @change="changeSpeciList(item,index)" v-for="(item,index) in speciList" :key="index" >
<span v-if="speciDigActive==index">
<el-checkbox style="padding-left:10px" v-for="(item2,index1) in item.NewSpecList" :label="item2" :key="index1">{{item2.Name}}</el-checkbox>
</span>
</el-checkbox-group>
</div>
</div>
</el-dialog>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="chooseSpecificationValueList">确定选择</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
......@@ -528,11 +645,22 @@ export default {
},
data() {
return {
tableData:[{
Id:1
}],
SpecificationList:[],
SpecificationPriceList:[],
speciDigActive:-1,
newSpecificationValueList:[],
SpecificationValueList:[],
speciDig:false,
speciList:[],
val2:'',
defaultMsg: '',
config: {
initialFrameWidth: null,
initialFrameHeight: 350,
},
dialogFormVisible:false,
choosebdDig:false,
......@@ -579,9 +707,9 @@ export default {
IsAreaBuy:2,
AreaList:[],
IntegralPresent:0,
IntegralPresentType:1,
IntegralPresentType:2,
PointsDeduction:0,
PointsDeductionType:1,
PointsDeductionType:2,
IsMultipleDeduction:2,
GoodsDetails:'',
SeparateDistribution:2,
......@@ -632,25 +760,126 @@ export default {
AreaList:[],
};
},
created() {
created(){},
mounted() {
if(this.$route.query.UserId){
this.UserId=this.$route.query.UserId;
// this.getData()
}else{
this.$refs.ue.InitData();
}
this.getTree();
this.getService();
this.getRule();
this.getSpeciList();
},
methods: {
getUEContent() {
let content = this.$refs.ue.getUEContent();
console.log(content)
TbaleSelectionChange(){},
renderHeader (h,{column}) { // h即为cerateElement的简写,具体可看vue官方文档
return h(
'div',
[
h('span', column.label),
h('i', {
class:'iconfont icon-xinghao1',
style:'color:#F56C6C;left: -41px;position: relative;'
})
]
);
},
CheckBox(val){
console.log(val);
},
// 删除规格模板
DeleteggModule(item,index){
this.SpecificationList.splice(index,1);
this.$forceUpdate();
},
// 删除规格值
Deleteggz(item,index,index2){
this.SpecificationList[index].SpecificationValueList.splice(index2,1);
this.$forceUpdate();
},
// 全选
changeCheckAll(item,index){
if(item.checkAll){
this.speciList[index].SpecificationValueList=item.NewSpecList;
}else{
this.speciList[index].SpecificationValueList=[];
}
this.$forceUpdate();
},
changeSpeciList(val,index){
this.$forceUpdate();
},
chooseSpecificationValueList(){
if(!this.SpecificationList){
this.SpecificationList=[];
}
let arr=[];
this.speciList.forEach(item=>{
if(item.checkAll){
arr.push(item);
}
})
this.SpecificationList=JSON.parse(JSON.stringify(this.SpecificationList.concat(arr)))
this.SpecificationList.forEach((item,index)=>{
item.EnabledImage=2;
item.Sort=index;
item.SpecificationValueList.forEach((list,index2)=>{
list.Image="";
list.Sort=index2;
})
})
console.log("this.SpecificationList",this.SpecificationList)
let SpecificationPriceList=[];
let data=this.SpecificationList;
let namerr=[];
for(let i=0;i<data.length;i++){
namerr.push(`name${i}`)
console.log("namerr",namerr)
for(let j=0;j<data[i].SpecificationValueList.length;j++){
let list= data[i].SpecificationValueList;
for(let k=0;k<namerr.length;k++){
let obj={
GoodsNumbers:'',
GoodsWeight:0,
InventoryNum:0,
SellingPrice:0,
SpecificationSort:'',
}
obj[namerr[k]]=list[j].Name;
SpecificationPriceList.push(obj);
}
}
}
console.log("SpecificationPriceList",SpecificationPriceList)
this.speciDig=false;
},
addggModeule(){
this.speciDig=true;
this.speciList.forEach(item=>{
item.NewSpecList=[];
item.checkAll=false;
item.SpecificationValueList=[];
item.SpecList.forEach(val=>{
let obj={
Id:item.Id,
Name:val
}
item.NewSpecList.push(obj)
})
})
},
Save(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
let content = this.$refs.ue.getUEContent();
this.addMsg.GoodsDetails=content;
this.apipost("/api/product/SetProductGoodsInfo",this.addMsg, res => {
if(res.data.resultCode==1){
this.Success(res.data.message)
......@@ -665,6 +894,35 @@ export default {
}
});
},
getSpeciList(){
let msg={
pageIndex:1,
pageSize:999,
Name:'',
Id:0,
Content:'',
}
this.apipost("/api/product/GetProductSpecificationPageList", msg, res => {
if(res.data.resultCode==1){
let pageData=res.data.data.pageData;
this.speciList=pageData;
this.speciList.forEach(item=>{
item.NewSpecList=[];
item.checkAll=false;
item.SpecList.forEach(val=>{
let obj={
Id:item.Id,
Name:val
}
item.NewSpecList.push(obj)
})
})
console.log("speciList",this.speciList)
}
})
},
editQy(){
this.dialogFormVisible=true;
setTimeout(()=>{
......@@ -811,13 +1069,96 @@ export default {
},
},
mounted() {
}
};
</script>
<style>
.goodsListEdit .el-table th>.cell{
padding-left: 20px!important;
}
.goodsListEdit .app-attr .box {
line-height: 64px;
border-top: 1px solid #E8EAEE;
border-left: 1px solid #E8EAEE;
border-right: 1px solid #E8EAEE;
padding: 0 16px;
}
.speciDig .tpl-scrollbar .el-checkbox {
display: flex;
-webkit-align-items: center;
align-items: center;
padding:10px 0;
}
.speciDig .tpl-scrollbar {
height: calc(440px - 44px - 10px);
}
.speciDig .tpl-box .tpl-head {
padding: 0 20px;
font-size: 15px;
color: #909399;
margin-bottom: 10px;
line-height: 44px;
background: #f5f7fa;
}
.speciDig .tpl-box {
width: 300px;
height: 440px;
}
.goodsListEdit .app-attr-group .attr-jt {
background: #ffffff;
width: 6px;
height: 6px;
border-top: 1px solid rgb(235, 238, 245);
border-right: 1px solid #EBEEF5;
transform: rotate(-45deg);
-o-transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
-moz-transform: rotate(-45deg);
-ms-transform: rotate(-45deg);
position: absolute;
top: -5px;
}
.goodsListEdit .app-attr-group .img-box {
position: relative;
height: 100px;
width: 100px;
margin-top: 8px;
border: 1px solid #EBEEF5;
}
.goodsListEdit .app-attr-group .close {
position: absolute;
top: -4px;
right: -4px;
font-size: 16px;
cursor: pointer;
}
.goodsListEdit .app-attr-group .attr-list {
display: inline-block;
margin-right: 10px;
margin-bottom: 10px;
position: relative;
cursor: move;
}
.goodsListEdit .box-grow-0 {
min-width: 0;
-webkit-box-flex: 0;
-webkit-flex-grow: 0;
-ms-flex-positive: 0;
flex-grow: 0;
-webkit-flex-shrink: 0;
-ms-flex-negative: 0;
flex-shrink: 0;
}
.goodsListEdit .app-attr-group .del-img {
height: 20px;
width: 20px;
cursor: pointer;
}
.goodsListEdit .app-attr-group .bg {
height: 44px;
padding: 0 10px;
background: #f8f8f8;
}
.regionDig .regionChoice .item_b{
margin-bottom:10px;
}
......
......@@ -131,8 +131,10 @@
<span @click="addEquityList" style="color: rgb(53, 53, 53);font-size: 14px;">新增权益</span>
</div>
</el-form-item>
<el-form-item label="会员规则" prop="MemberSpecification">
<el-form-item class="hygz" label="会员规则" prop="MemberSpecification">
<div style="width:455px">
<UE :defaultMsg=defaultMsg :config=config ref="ue" ></UE>
</div>
</el-form-item>
</el-form>
......@@ -147,16 +149,20 @@
</div>
</template>
<script>
import UE from '@/components/global/UE.vue'
import ChooseImg from "@/components/global/ChooseImg.vue";
export default {
components: {
ChooseImg
ChooseImg,UE
},
data() {
return {
icon1:'',
icon2:'',
icon3:'',
loading:false,
defaultMsg: '',
config: {
initialFrameWidth: null,
initialFrameHeight: 350,
},
currentPage4:3,
changeState:false,
val:'',
......@@ -210,9 +216,15 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
};
},
created() {
},
mounted(){
console.log("this.$refs.ue",this.$refs.ue)
if(this.$route.query.GradeId){
this.GradeId=this.$route.query.GradeId;
this.getData()
}else{
this.$refs.ue.InitData();
}
},
methods: {
......@@ -251,9 +263,10 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
this.addMsg.EquityList.splice(index, 1);
},
Save(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
let content = this.$refs.ue.getUEContent();
this.addMsg.MemberSpecification=content;
let cmd="/api/user/SetMemberGradeInfo";
this.apipost(cmd,this.addMsg,
res => {
......@@ -286,21 +299,22 @@ import ChooseImg from "@/components/global/ChooseImg.vue";
this.loading=false;
if(res.data.resultCode==1){
this.addMsg=res.data.data;
this.addMsg.MallBaseId=this.getLocalStorage().MallBaseId
this.addMsg.MallBaseId=this.getLocalStorage().MallBaseId;
this.defaultMsg=res.data.data.MemberSpecification;
this.$refs.ue.InitData();
}
})
},
},
mounted() {
}
};
</script>
<style>
.setMember .hygz .el-form-item__content{
line-height:inherit!important;
}
.setMember .setTable .el-table__body .cell{
display: flex;
align-items: center;
......
......@@ -29,22 +29,22 @@
},
},
mounted() {
const _this = this;
this.editor = UE.getEditor('editor', this.config); // 初始化UE
this.editor.addListener("ready", function () {
_this.editor.setContent(_this.defaultMsg); // 确保UE加载完成后,放入内容。
});
this.loadUe();
},
methods: {
InitData(){
const _this = this;
this.editor = UE.getEditor('editor', this.config); // 初始化UE
this.editor.addListener("ready", function () {
_this.editor.setContent(_this.defaultMsg); // 确保UE加载完成后,放入内容。
});
this.loadUe();
},
SelectId(e) {
console.log("eee",e);
if (e) {
let html = '';
this.ue = UE.getEditor('editor');
html= '< img src="' + this.domainManager().ImageUrl+e.url + '" style="max-width: 100%;">';
console.log("this.ue ",this.ue)
html= '<img src="' + this.domainManager().ImageUrl+e.url + '" style="max-width: 100%;">';
this.ue.execCommand('inserthtml', html);
}
this.changeState=false;
......@@ -55,19 +55,19 @@
loadUe() {
const vm = this;
this.ue = UE.getEditor('editor');
this.ue.addListener('ready', editor => {
if (this.tempContent) {
this.ue.setContent(this.tempContent);
}
});
this.ue.addListener('keyup', editor => {
this.isInputChange = true;
this.$emit('input', this.ue.getContent());
});
this.ue.addListener('contentChange', editor => {
this.isInputChange = true;
this.$emit('input', this.ue.getContent());
});
// this.ue.addListener('ready', editor => {
// if (this.tempContent) {
// this.ue.setContent(this.tempContent);
// }
// });
// this.ue.addListener('keyup', editor => {
// this.isInputChange = true;
// this.$emit('input', this.ue.getContent());
// });
// this.ue.addListener('contentChange', editor => {
// this.isInputChange = true;
// this.$emit('input', this.ue.getContent());
// });
let self = this;
UE.registerUI('appinsertimage', (editor, uiName) => {
return new UE.ui.Button({
......@@ -83,9 +83,6 @@
});
}
},
beforeInit(){
console.log("sagg")
},
destroyed() {
this.editor.destroy();
},
......
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