Commit 019ee4fd authored by zhangjianguo's avatar zhangjianguo

修改样式

parent 13badf5f
This diff is collapsed.
......@@ -1051,7 +1051,7 @@
}
this.apipost("/api/MallBase/AddOrUpdateMallBase", this.msg, res => {
if (res.data.resultCode == 1) {
this.Info(res.data.message);
this.Success(res.data.message);
} else {
this.Info(res.data.message);
......
......@@ -34,6 +34,11 @@
activeName: 'first'
}
},
created(){
if(this.$route.query.activeName){
this.activeName = this.$route.query.activeName
}
},
components:{
vlogistics,
freight
......
......@@ -61,10 +61,10 @@
width="180">
<template slot-scope="scope">
<el-tooltip class="item" effect="dark" content="编辑" placement="top" >
<img src="../../../assets/img/setup/edit.png" alt="" class="imgstyle">
<img src="../../../assets/img/setup/edit.png" alt="" class="imgstyle" @click="Edit(scope.row)">
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<img src="../../../assets/img/setup/del.png" alt="" class="imgstyle">
<el-tooltip class="item" effect="dark" content="删除" placement="top" >
<img src="../../../assets/img/setup/del.png" alt="" class="imgstyle" @click="delete_b(scope.row)">
</el-tooltip>
</template>
</el-table-column>
......@@ -113,6 +113,34 @@
},
addRule(){
this.$emit("AddRule",);
},
Edit(row){
this.$router.push({
name: 'addFreightRule',
query: {
ID:row.ID,
blank: "y"
}
});
},
delete_b(row){//删除按钮
let that=this;
that.Confirm("是否删除?", function () {
that.apipost(
"/api/MallBase/DelRules",
{Id:row.ID},
res => {
if (res.data.resultCode == 1) {
that.Success(res.data.message);
that.GetLogisticsRulesPage();
} else {
that.Error(res.data.message);
}
},
null
);
});
}
},
mounted(){
......
......@@ -77,7 +77,7 @@
this.apipost("/api/MallBase/AddOrUpdateLogistics", this.msg, res => {
if (res.data.resultCode == 1) {
this.Info(res.data.message);
this.Success(res.data.message);
} else {
this.Info(res.data.message);
......
<template>
<div class="regionChoice">
<div class="regionChoice" v-loading="loading">
<div class="item">
<div class="item_b" v-for="(item,index) in regionList" :key="index">
<el-checkbox :indeterminate="item.indeterminate" v-model="item.ischeckAll" @change="handleCheckAllChange(index,item.ID,$event)" > </el-checkbox>
......@@ -26,6 +26,10 @@
<script>
export default {
name: "regionChoice",
props: {
List: Array,
required: true
},
data(){
return{
regionList:[],
......@@ -39,16 +43,29 @@
cityList:[],
areaList:[],
loading:false,
getlist:[],
}
},
methods:{
getprovince(){
let getlist = this.getlist
this.apipost("/api/Destination/GetChildList",this.msg , res => {
if (res.data.resultCode == 1) {
let data = res.data.data;
for(let i=0;i<data.length;i++){
data[i].ischeckAll=false;
data[i].indeterminate=false;
for(let j=0;j<getlist.length;j++){
if(getlist[j].GrandpaID==data[i].ID || getlist[j].ParentID==data[i].ID){ //如果有着2个参数再 他的子级没选择完全
data[i].indeterminate=true;
}
if(getlist[j].RegionId==data[i].ID){
data[i].ischeckAll=true;
data[i].indeterminate=false;
this.getCitylist(true)
}
}
}
this.regionList = data;
this.cityID = data[this.provinceindex].ID
......@@ -59,17 +76,46 @@
})
},
getCitylist(type=false){
let getlist =this.getlist
console.log()
this.apipost("/api/Destination/GetChildList",{'Id':this.cityID} , res => {
if (res.data.resultCode == 1) {
let data = res.data.data;
this.areaID = data[this.cityindex].ID
for(let i=0;i<data.length;i++){
if(type==true){
data[i].ischeckAll=true;
data[i].indeterminate=false;
}else {
data[i].ischeckAll=false;
data[i].indeterminate=false;
}
if(getlist.length>0){
for(let j=0;j<getlist.length;j++){
if(type==true){
data[i].ischeckAll=true;
data[i].indeterminate=false;
}else {
if(getlist[j].RegionId==this.cityID){ //父 勾选
data[i].ischeckAll=true;
data[i].indeterminate=false;
}else if(getlist[j].ParentID==data[i].ID){
data[i].ischeckAll=false;
data[i].indeterminate=true;
}else if(getlist[j].RegionId==data[i].ID){//如果自己身相等
data[i].ischeckAll=true;
data[i].indeterminate=false;
}else {
data[i].ischeckAll=false;
data[i].indeterminate=false;
}
}
}
}else {
if(type==true){
data[i].ischeckAll=true;
data[i].indeterminate=false;
}else {
data[i].ischeckAll=false;
data[i].indeterminate=false;
}
}
}
let regionList = this.regionList
......@@ -79,7 +125,6 @@
}
}
this.cityList = regionList[this.provinceindex].cityList
this.areaID = data[this.cityindex].ID
this.getareaIDlist(type)
} else {
this.Info(res.data.message);
......@@ -87,15 +132,40 @@
})
},
getareaIDlist(type=false){
let getlist =this.getlist
this.apipost("/api/Destination/GetChildList",{'Id':this.areaID} , res => {
this.loading= false
if (res.data.resultCode == 1) {
let data = res.data.data;
for(let i=0;i<data.length;i++){
if(type==true){
data[i].ischeckAll=true;
if(getlist.length>0){
for(let j=0;j<getlist.length;j++){
if(type==true){
data[i].ischeckAll=true;
}else {
if(getlist[j].RegionId==this.cityID){
data[i].ischeckAll=true;
}else if(getlist[j].RegionId==data[i].ID){
data[i].ischeckAll=true;
}else {
data[i].ischeckAll=false;
}
}
}
}else {
data[i].ischeckAll=false;
} }
if(type==true){
data[i].ischeckAll=true;
}else {
data[i].ischeckAll=false;
}
}
}
let regionList = this.regionList;
for(let i=0;i<regionList.length;i++){
if(regionList[i].ID== this.cityID){
......@@ -133,7 +203,7 @@
this.cityList = cityList
let areaList = this.cityList[this.cityindex].areaList
for(let i=0;i<areaList.length;i++){
areaList[i].ischeckAll=true
areaList[i].ischeckAll=false
}
this.areaList = areaList
......@@ -152,8 +222,6 @@
}
}
this.toParent()
},
showcity(index, id){
......@@ -172,29 +240,40 @@
let regionList = this.regionList;
this.cityindex = index;
this.areaID = id;
if(regionList[this.provinceindex].cityList[index].hasOwnProperty('areaList')==false){//没有子级的时候加载
this.getareaIDlist()
}else {
this.areaList = regionList[this.provinceindex].cityList[index].areaList;
}
//取消自己的勾的时候父级的勾改变
let areaList = regionList[this.provinceindex].cityList[index].areaList;
if(e==false){
if(regionList[this.provinceindex].cityList[index].hasOwnProperty('areaList')==false){
this.getareaIDlist()
}else {
this.areaList = regionList[this.provinceindex].cityList[index].areaList;
}
regionList[this.provinceindex].indeterminate=true;
regionList[this.provinceindex].ischeckAll=false;
if(areaList!=undefined){
for(let i=0;i<areaList.length;i++){
areaList[i].ischeckAll=false
areaList[i].ischeckAll=false;
}
regionList[this.provinceindex].cityList[index].indeterminate=false
}
}else {
if(regionList[this.provinceindex].cityList[index].hasOwnProperty('areaList')==false){
this.getareaIDlist(true)
}else {
this.areaList = regionList[this.provinceindex].cityList[index].areaList;
}
regionList[this.provinceindex].indeterminate=true;
regionList[this.provinceindex].ischeckAll=false;
let all=true;
let cityList = this.regionList[this.provinceindex].cityList;
this.regionList[this.provinceindex].indeterminate=true;
if(cityList!=undefined){
for(let i=0;i<cityList.length;i++){
if(cityList[i].ischeckAll==false){
all=false
}
......@@ -240,6 +319,7 @@
regionList[this.provinceindex].cityList[this.cityindex].indeterminate=true
}else {
regionList[this.provinceindex].indeterminate=true
regionList[this.provinceindex].cityList[this.cityindex].indeterminate=true
let areaList= regionList[this.provinceindex].cityList[this.cityindex].areaList;
......@@ -270,9 +350,19 @@
},
toParent(){//传值给父组件
this.$emit('event1', this.regionList)
},
Receive(val){
console.log('进入')
this.regionList = [];
this.loading=true;
this.cityindex=0,
this.areaindex=0,
this.getlist= val;
setTimeout(()=>{
this.getprovince()
},100)
}
},
mounted(){
......
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