Commit d2ea69cd authored by Mac's avatar Mac

样式的修改

parent b2af4ba6
...@@ -465,7 +465,7 @@ export default { ...@@ -465,7 +465,7 @@ export default {
Tier:0, Tier:0,
ParentId:0, ParentId:0,
Enabled:1, Enabled:1,
IsShow:1, IsShow:0,
}, },
msg2:{ msg2:{
pageIndex:0, pageIndex:0,
...@@ -475,7 +475,7 @@ export default { ...@@ -475,7 +475,7 @@ export default {
Tier:0, Tier:0,
ParentId:0, ParentId:0,
Enabled:1, Enabled:1,
IsShow:1, IsShow:0,
}, },
tableData1:[], tableData1:[],
tableData2:[], tableData2:[],
......
...@@ -1531,7 +1531,7 @@ ...@@ -1531,7 +1531,7 @@
}, },
goCollection(item,list){//跳到erp收款单 goCollection(item,list){//跳到erp收款单
let currentUser = this.getLocalStorage() let currentUser = this.getLocalStorage()
let companyID =currentUser.ERPBranchId let companyID =currentUser.ERPBranchId !=0 ?currentUser.ERPBranchId :1224;
let orderObj = { let orderObj = {
OrderSource:16, OrderSource:16,
OtherType:21, OtherType:21,
...@@ -1544,7 +1544,7 @@ ...@@ -1544,7 +1544,7 @@
}, },
goPayment(item,list){//跳到erp付款单 goPayment(item,list){//跳到erp付款单
let currentUser = this.getLocalStorage() let currentUser = this.getLocalStorage()
let companyID =currentUser.ERPBranchId let companyID =currentUser.ERPBranchId !=0 ?currentUser.ERPBranchId :1224;
let orderObj = { let orderObj = {
OrderSource:16, OrderSource:16,
OtherType:22, OtherType:22,
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<div class="splist" v-if="msg.UseType==2"> <div class="splist" v-if="msg.UseType==2">
<div v-for="(item,index) in commoditylist" :label="item.ProductId" :key="index" style="margin-right: 20px; position: relative; cursor: pointer;" > <div v-for="(item,index) in commoditylist" :label="item.ProductId" :key="index" style="margin-right: 20px; position: relative; cursor: pointer;" >
<div class="app-image" :style="{backgroundImage:'url(' + domainManager().ImageUrl+item.CoverImage + ')',backgroundSize:'cover'}" ></div> <div class="app-image" :style="{backgroundImage:'url(' + item.CoverImage + ')',backgroundSize:'cover'}" ></div>
<i class="el-icon-error" style="position: absolute;right: -5px;top:-5px;color: #F56C6C;font-size: 20px" @click="deletecommod(index,1)"></i> <i class="el-icon-error" style="position: absolute;right: -5px;top:-5px;color: #F56C6C;font-size: 20px" @click="deletecommod(index,1)"></i>
</div> </div>
</div> </div>
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
label="商品图" label="商品图"
width="80"> width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<img style="width:50px;height:50px;margin-right:1px" :src="domainManager().ImageUrl+scope.row.CoverImage" alt=""> <img style="width:50px;height:50px;margin-right:1px" :src="scope.row.CoverImage" alt="">
</template> </template>
</el-table-column> </el-table-column>
...@@ -230,7 +230,6 @@ ...@@ -230,7 +230,6 @@
<div class="el-input el-input--small" style="width: 40%;" > <div class="el-input el-input--small" style="width: 40%;" >
<input type="text" autocomplete="off" placeholder="商品名称" class="el-input__inner" v-model="msg2.Name" <input type="text" autocomplete="off" placeholder="商品名称" class="el-input__inner" v-model="msg2.Name"
@clear="msg2.pageIndex=1,getProductGoodsPageList()" @clear="msg2.pageIndex=1,getProductGoodsPageList()"
@keyup.enter.native="msg2.pageIndex=1,getProductGoodsPageList()"
> >
</div> </div>
<button type="button" class="el-button el-button--default el-button--small" style="margin-left: 15px" @click="msg2.pageIndex=1,getProductGoodsPageList()">查找商品</button> <button type="button" class="el-button el-button--default el-button--small" style="margin-left: 15px" @click="msg2.pageIndex=1,getProductGoodsPageList()">查找商品</button>
...@@ -257,7 +256,7 @@ ...@@ -257,7 +256,7 @@
label="商品图" label="商品图"
width="80"> width="80">
<template slot-scope="scope"> <template slot-scope="scope">
<img style="width:50px;height:50px;margin-right:1px" :src="domainManager().ImageUrl+scope.row.CoverImage" alt=""> <img style="width:50px;height:50px;margin-right:1px" :src="scope.row.CoverImage" alt="">
</template> </template>
</el-table-column> </el-table-column>
...@@ -456,11 +455,26 @@ ...@@ -456,11 +455,26 @@
let ProductList = res.data.data.ProductList; let ProductList = res.data.data.ProductList;
let newData = [] let newData = []
for(let i= 0;i<ProductList.length;i++){ for(let i= 0;i<ProductList.length;i++){
for(let j=0;j<this.tableData.length;j++){ this.apipost("/api/product/GetProductGoodsPageList",
if(ProductList[i].ProductId == this.tableData[j].Id){ {
newData.push(this.tableData[j]) pageIndex:1,
pageSize:15,
Name:'',
GoodsStatus:0,
IsSelectSellOut:0,
CategoryIds:'',
Id:ProductList[i].ProductId,
StartTime:'',
EndTime:'',
} }
} , res => {
if(res.data.resultCode==1){
let pageData= res.data.data.pageData;
newData.push(pageData[0])
}
})
} }
this.commoditylist = newData this.commoditylist = newData
} }
...@@ -499,7 +513,12 @@ ...@@ -499,7 +513,12 @@
if(res.data.resultCode==1){ if(res.data.resultCode==1){
let pageData= res.data.data.pageData; let pageData= res.data.data.pageData;
for(let i= 0;i<pageData.length;i++){ for(let i= 0;i<pageData.length;i++){
pageData[i].disabled=false pageData[i].disabled=false;
this.commoditylist.forEach(x=>{
if(pageData[i].Id == x.Id){
pageData[i].disabled=true;
}
})
} }
this.tableData = pageData this.tableData = pageData
this.count = res.data.data.count this.count = res.data.data.count
...@@ -551,7 +570,10 @@ ...@@ -551,7 +570,10 @@
batchAdd(){ //批量添加 batchAdd(){ //批量添加
let newdata=[] let newdata=[]
for(let i=0;i<this.multipleSelection.length;i++){ for(let i=0;i<this.multipleSelection.length;i++){
console.log(this.commoditylist)
console.log(this.multipleSelection)
if(this.commoditylist.length>0){ if(this.commoditylist.length>0){
console.log('有的情况')
for(let j=0;j<this.commoditylist.length;j++){ for(let j=0;j<this.commoditylist.length;j++){
if(this.multipleSelection[i].Id!=this.commoditylist[j].Id){ if(this.multipleSelection[i].Id!=this.commoditylist[j].Id){
newdata.push(this.multipleSelection[i]) newdata.push(this.multipleSelection[i])
...@@ -564,6 +586,7 @@ ...@@ -564,6 +586,7 @@
} }
} }
}else { }else {
console.log('没有的情况')
newdata.push(this.multipleSelection[i]) newdata.push(this.multipleSelection[i])
for(let z =0;z<this.tableData.length;z++){ for(let z =0;z<this.tableData.length;z++){
if(this.tableData[z].Id==this.multipleSelection[i].Id){ if(this.tableData[z].Id==this.multipleSelection[i].Id){
...@@ -579,7 +602,20 @@ ...@@ -579,7 +602,20 @@
if(newdata.length>0){ if(newdata.length>0){
this.Success('添加成功'); this.Success('添加成功');
} }
this.commoditylist = this.commoditylist.concat(newdata) this.commoditylist = this.unique(this.commoditylist.concat(newdata))
},
// 数组去重
unique(arr) {
for (var i = 0, len = arr.length; i < len; i++) {
for (var j = i + 1, len = arr.length; j < len; j++) {
if (arr[i].Id === arr[j].Id ) {
arr.splice(j, 1);
j--; // 每删除一个数j的值就减1
len--; // j值减小时len也要相应减1(减少循环次数,节省性能)
}
}
}
return arr;
}, },
addcommoditybtn(){ addcommoditybtn(){
this.addcommodity=true; this.addcommodity=true;
...@@ -603,7 +639,6 @@ ...@@ -603,7 +639,6 @@
} }
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection=val this.multipleSelection=val
}, },
getUseType(val){ getUseType(val){
......
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