|
@@ -9,27 +9,29 @@
|
|
<text class="content-two">{{item.agentName}}</text>
|
|
<text class="content-two">{{item.agentName}}</text>
|
|
<text class="content-three" @click="button(index)">核销返利</text>
|
|
<text class="content-three" @click="button(index)">核销返利</text>
|
|
</view>
|
|
</view>
|
|
-
|
|
|
|
|
|
+
|
|
<view class="content-four">
|
|
<view class="content-four">
|
|
<text>品牌</text>
|
|
<text>品牌</text>
|
|
<text>奖励</text>
|
|
<text>奖励</text>
|
|
<text @click="checkedAll(index,item)" :key='index'>全选</text>
|
|
<text @click="checkedAll(index,item)" :key='index'>全选</text>
|
|
</view>
|
|
</view>
|
|
<checkbox-group @change="checkboxChange($event,index,item.storegentBrandList)">
|
|
<checkbox-group @change="checkboxChange($event,index,item.storegentBrandList)">
|
|
- <view class="content-five" v-for="(item,brandIndex) in item.storegentBrandList" :key="brandIndex">
|
|
|
|
- <view class="content-five-img">
|
|
|
|
- <u-image width="100%" height="65%" scaleType="matrix" :src="item.logoUrl"></u-image>
|
|
|
|
- </view>
|
|
|
|
- <view class="content-five-view">
|
|
|
|
- {{item.usableMoney}}元
|
|
|
|
- </view>
|
|
|
|
- <view>
|
|
|
|
|
|
+ <view class="content-five" v-for="(item,brandIndex) in item.storegentBrandList" :key="brandIndex">
|
|
|
|
+ <view class="content-five-img">
|
|
|
|
+ <u-image width="100%" height="65%" scaleType="matrix" :src="item.logoUrl"></u-image>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="content-five-view">
|
|
|
|
+ {{item.usableMoney}}元
|
|
|
|
+ </view>
|
|
|
|
+ <view>
|
|
<label>
|
|
<label>
|
|
- <checkbox v-model="JSON.stringify(item)" :value="JSON.stringify(item)" :checked="checkboxList[index]" :disabled="item.usableMoney==0" v-if="item.usableMoney!=0" color="#FFCC33" style="transform:scale(0.7)"/>
|
|
|
|
|
|
+ <checkbox v-model="JSON.stringify(item)" :value="JSON.stringify(item)" :checked="checkboxList[index]" :disabled="item.usableMoney==0"
|
|
|
|
+ v-if="item.usableMoney!=0" color="#FFCC33" style="transform:scale(0.7)" />
|
|
|
|
+ <checkbox @click="checkbox" disabled v-if="item.usableMoney==0" color="#FFCC33" style="transform:scale(0.7)" />
|
|
</label>
|
|
</label>
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
|
|
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
</checkbox-group>
|
|
</checkbox-group>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -38,6 +40,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+ import {mapMutations} from 'vuex'
|
|
import {
|
|
import {
|
|
request
|
|
request
|
|
} from '../../../common/request/request'
|
|
} from '../../../common/request/request'
|
|
@@ -48,7 +51,7 @@
|
|
datalist: [],
|
|
datalist: [],
|
|
agentId: '',
|
|
agentId: '',
|
|
Arry: [],
|
|
Arry: [],
|
|
- brandCodeCheckList:[],
|
|
|
|
|
|
+ brandCodeCheckList: [],
|
|
amount: '',
|
|
amount: '',
|
|
choice: 0,
|
|
choice: 0,
|
|
kunnr: '',
|
|
kunnr: '',
|
|
@@ -59,39 +62,51 @@
|
|
checked: true,
|
|
checked: true,
|
|
list: [{}],
|
|
list: [{}],
|
|
checkboxList: [],
|
|
checkboxList: [],
|
|
- idList:[],
|
|
|
|
- listaa:['a','b','c'],
|
|
|
|
- checkedAllList:[],
|
|
|
|
|
|
+ idList: [],
|
|
|
|
+ listaa: ['a', 'b', 'c'],
|
|
|
|
+ checkedAllList: [],
|
|
// isCheckedAll:false
|
|
// isCheckedAll:false
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
this.getData()
|
|
this.getData()
|
|
},
|
|
},
|
|
- computed:{
|
|
|
|
- ckeck(){
|
|
|
|
|
|
+ computed: {
|
|
|
|
+ ckeck() {
|
|
return this.checkboxList
|
|
return this.checkboxList
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ ...mapMutations(["inStore"]),
|
|
// 获取结算中心数据
|
|
// 获取结算中心数据
|
|
getData() {
|
|
getData() {
|
|
request({
|
|
request({
|
|
url: '/myapp/storeSettlementCenter',
|
|
url: '/myapp/storeSettlementCenter',
|
|
method: 'post',
|
|
method: 'post',
|
|
data: {
|
|
data: {
|
|
- 'storeId':this.$store.state.storeInfo.storeId,
|
|
|
|
- 'userId':this.$store.state.storeInfo.userId
|
|
|
|
|
|
+ 'storeId': this.$store.state.storeInfo.storeId,
|
|
|
|
+ 'userId': this.$store.state.storeInfo.userId
|
|
}
|
|
}
|
|
}).then(res => {
|
|
}).then(res => {
|
|
- console.log(res.data)
|
|
|
|
- this.datalist = res.data.data
|
|
|
|
- this.Arry.length = this.datalist.length
|
|
|
|
- // 每个新建数组长度为空,全选为false
|
|
|
|
- for(var i=0;i<this.datalist.length;i++){
|
|
|
|
- this.Arry[i] = []
|
|
|
|
- this.checkboxList[i] = false
|
|
|
|
- }
|
|
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
+ console.log(res.data)
|
|
|
|
+ this.datalist = res.data.data
|
|
|
|
+ this.Arry.length = this.datalist.length
|
|
|
|
+ // 每个新建数组长度为空,全选为false
|
|
|
|
+ for (var i = 0; i < this.datalist.length; i++) {
|
|
|
|
+ this.Arry[i] = []
|
|
|
|
+ this.checkboxList[i] = false
|
|
|
|
+ }
|
|
|
|
+ this.inStore()
|
|
|
|
+ }else {
|
|
|
|
+ console.log(res)
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: res.data.msg,
|
|
|
|
+ icon: "none",
|
|
|
|
+ duration: _this.$store.state.showToastDuration
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
}).catch(err => {
|
|
}).catch(err => {
|
|
console.log(err + "")
|
|
console.log(err + "")
|
|
})
|
|
})
|
|
@@ -105,88 +120,94 @@
|
|
},
|
|
},
|
|
|
|
|
|
checkboxChange1() {
|
|
checkboxChange1() {
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ // 置灰选择框
|
|
|
|
+ checkbox() {
|
|
|
|
+ this.$u.toast('奖励金额不能为0!');
|
|
},
|
|
},
|
|
// 选中某个复选框时,由checkbox时触发
|
|
// 选中某个复选框时,由checkbox时触发
|
|
// ,bollean,index
|
|
// ,bollean,index
|
|
- checkboxChange(e,index,dataArr){
|
|
|
|
|
|
+ checkboxChange(e, index, dataArr) {
|
|
console.log(index)
|
|
console.log(index)
|
|
console.log(e)
|
|
console.log(e)
|
|
let newArr = []
|
|
let newArr = []
|
|
console.log(this.Arry)
|
|
console.log(this.Arry)
|
|
- e.detail.value.forEach((item) =>{
|
|
|
|
|
|
+ e.detail.value.forEach((item) => {
|
|
var obj = {
|
|
var obj = {
|
|
- "storeId":this.$store.state.storeInfo.storeId,
|
|
|
|
|
|
+ "storeId": this.$store.state.storeInfo.storeId,
|
|
"amount": JSON.parse(item).usableMoney,
|
|
"amount": JSON.parse(item).usableMoney,
|
|
"brandCode": JSON.parse(item).brandCode,
|
|
"brandCode": JSON.parse(item).brandCode,
|
|
"kunnr": JSON.parse(item).kunnr,
|
|
"kunnr": JSON.parse(item).kunnr,
|
|
- 'userId':this.$store.state.storeInfo.userId
|
|
|
|
|
|
+ 'userId': this.$store.state.storeInfo.userId
|
|
}
|
|
}
|
|
console.log(obj)
|
|
console.log(obj)
|
|
newArr.push(obj)
|
|
newArr.push(obj)
|
|
})
|
|
})
|
|
this.Arry[index] = newArr
|
|
this.Arry[index] = newArr
|
|
console.log(newArr)
|
|
console.log(newArr)
|
|
- if(this.Arry[index].length == dataArr.filter((item)=>{
|
|
|
|
- return item.usableMoney != 0
|
|
|
|
- }).length ){
|
|
|
|
|
|
+ // 判断他是否全选
|
|
|
|
+ if (this.Arry[index].length == dataArr.filter((item) => {
|
|
|
|
+ return item.usableMoney != 0
|
|
|
|
+ }).length) {
|
|
this.$set(this.checkboxList, index, true);
|
|
this.$set(this.checkboxList, index, true);
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.$set(this.checkboxList, index, false);
|
|
this.$set(this.checkboxList, index, false);
|
|
- }
|
|
|
|
|
|
+ }
|
|
},
|
|
},
|
|
- // 核销返利
|
|
|
|
- button(index) {
|
|
|
|
- console.log(index)
|
|
|
|
- console.log(this.Arry[index])
|
|
|
|
- request({
|
|
|
|
- url: '/myapp/storeCancel',
|
|
|
|
- method: 'post',
|
|
|
|
- data: this.Arry[index]
|
|
|
|
- }).then(res => {
|
|
|
|
- console.log(res)
|
|
|
|
- if(res.data.msg=="success") {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '核销返利成功',
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- this.getData()
|
|
|
|
-
|
|
|
|
- }else {
|
|
|
|
- uni.showToast({
|
|
|
|
- title: '核销返利失败',
|
|
|
|
- icon: false,
|
|
|
|
- duration: 2000
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }).catch(err => {
|
|
|
|
- console.log(err)
|
|
|
|
- })
|
|
|
|
- .finally(() => {
|
|
|
|
- setTimeout(() => {
|
|
|
|
- uni.hideLoading();
|
|
|
|
- this.loading = false;
|
|
|
|
- }, 1000)
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
|
|
+ // 核销返利
|
|
|
|
+ button(index) {
|
|
|
|
+ console.log(index)
|
|
|
|
+ console.log(this.Arry[index])
|
|
|
|
+ request({
|
|
|
|
+ url: '/myapp/storeCancel',
|
|
|
|
+ method: 'post',
|
|
|
|
+ data: this.Arry[index]
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.data.msg == "success") {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '核销返利成功',
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ this.getData()
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ title: '核销返利失败',
|
|
|
|
+ icon: false,
|
|
|
|
+ duration: 2000
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }).catch(err => {
|
|
|
|
+ console.log(err)
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ this.loading = false;
|
|
|
|
+ }, 1000)
|
|
|
|
+
|
|
|
|
+ })
|
|
},
|
|
},
|
|
// 选中任一checkbox时,由checkbox-group触发
|
|
// 选中任一checkbox时,由checkbox-group触发
|
|
- checkboxGroupChange(e) {
|
|
|
|
- },
|
|
|
|
|
|
+ checkboxGroupChange(e) {},
|
|
// 全选
|
|
// 全选
|
|
- checkedAll(index,e) {
|
|
|
|
- console.log(index,e)
|
|
|
|
- let newArr=[]
|
|
|
|
- if(this.Arry[index].length == e.storegentBrandList.filter((item)=>{
|
|
|
|
- return item.usableMoney != 0
|
|
|
|
- }).length ){
|
|
|
|
|
|
+ checkedAll(index, e) {
|
|
|
|
+ console.log(index, e)
|
|
|
|
+ let newArr = []
|
|
|
|
+ // 根据奖励金额是否为0判断全选取消全选
|
|
|
|
+ if (this.Arry[index].length == e.storegentBrandList.filter((item) => {
|
|
|
|
+ return item.usableMoney != 0
|
|
|
|
+ }).length) {
|
|
this.$set(this.checkboxList, index, false);
|
|
this.$set(this.checkboxList, index, false);
|
|
this.Arry[index] = []
|
|
this.Arry[index] = []
|
|
- }else{
|
|
|
|
|
|
+ } else {
|
|
this.$set(this.checkboxList, index, true);
|
|
this.$set(this.checkboxList, index, true);
|
|
- for(var i=0;i<e.storegentBrandList.length;i++){
|
|
|
|
- if( e.storegentBrandList[i].usableMoney !=0){
|
|
|
|
|
|
+ for (var i = 0; i < e.storegentBrandList.length; i++) {
|
|
|
|
+ if (e.storegentBrandList[i].usableMoney != 0) {
|
|
var obj = {
|
|
var obj = {
|
|
"storeId": this.$store.state.storeInfo.storeId,
|
|
"storeId": this.$store.state.storeInfo.storeId,
|
|
"amount": e.storegentBrandList[i].usableMoney,
|
|
"amount": e.storegentBrandList[i].usableMoney,
|
|
@@ -195,14 +216,14 @@
|
|
}
|
|
}
|
|
newArr.push(obj)
|
|
newArr.push(obj)
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
this.Arry[index] = newArr
|
|
this.Arry[index] = newArr
|
|
}
|
|
}
|
|
-
|
|
|
|
- console.log(this.Arry,this.checkboxList)
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ console.log(this.Arry, this.checkboxList)
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
}
|
|
}
|
|
@@ -264,7 +285,7 @@
|
|
display: inline-block;
|
|
display: inline-block;
|
|
background-color: #3A9FF2;
|
|
background-color: #3A9FF2;
|
|
margin-top: -20rpx;
|
|
margin-top: -20rpx;
|
|
- margin-right: 20rpx;
|
|
|
|
|
|
+ margin-right: 15rpx;
|
|
border-radius: 10rpx;
|
|
border-radius: 10rpx;
|
|
font-size: 24rpx;
|
|
font-size: 24rpx;
|
|
color: #fff;
|
|
color: #fff;
|
|
@@ -278,7 +299,7 @@
|
|
font-weight: bolder;
|
|
font-weight: bolder;
|
|
font-size: 26rpx;
|
|
font-size: 26rpx;
|
|
margin-top: 40rpx;
|
|
margin-top: 40rpx;
|
|
- margin-left: 80rpx;
|
|
|
|
|
|
+ margin-left: 70rpx;
|
|
margin-right: 50rpx;
|
|
margin-right: 50rpx;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -300,6 +321,6 @@
|
|
}
|
|
}
|
|
|
|
|
|
.content-five-view {
|
|
.content-five-view {
|
|
- margin-left: -150rpx;
|
|
|
|
|
|
+ margin-left: -100rpx;
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|