|
|
@@ -9,6 +9,7 @@
|
|
|
<el-button @click="clean('userMy')">all userMy</el-button>
|
|
|
<el-button @click="clean('collection')">all collection</el-button>
|
|
|
<el-button @click="clean('recommend')">all recommend</el-button>
|
|
|
+ <el-button @click="recal">计算asset</el-button>
|
|
|
<el-divider></el-divider>
|
|
|
<div>
|
|
|
<el-button @click="clearUserProperty">清除UserProperty</el-button>
|
|
|
@@ -53,42 +54,42 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
operatingStockOrSale(operationType) {
|
|
|
- let collectionId = this.collectionId.replace(/\s*/g,'');
|
|
|
- let num = this.num.replace(/\s*/g,'');
|
|
|
- var reg = /^[0-9]*$/
|
|
|
+ let collectionId = this.collectionId.replace(/\s*/g, '');
|
|
|
+ let num = this.num.replace(/\s*/g, '');
|
|
|
+ var reg = /^[0-9]*$/;
|
|
|
if (collectionId == null || collectionId === undefined || collectionId === '') {
|
|
|
- this.$message.error('请输入collectionId')
|
|
|
- return
|
|
|
+ this.$message.error('请输入collectionId');
|
|
|
+ return;
|
|
|
}
|
|
|
if (num == null || num === undefined || num === '') {
|
|
|
- this.$message.error('请输入num')
|
|
|
- return
|
|
|
+ this.$message.error('请输入num');
|
|
|
+ return;
|
|
|
}
|
|
|
- if(!reg.test(this.collectionId)){
|
|
|
- this.$message.error('请正确输入collectionId,只允许输入数字')
|
|
|
- return
|
|
|
+ if (!reg.test(this.collectionId)) {
|
|
|
+ this.$message.error('请正确输入collectionId,只允许输入数字');
|
|
|
+ return;
|
|
|
}
|
|
|
- if(!reg.test(this.num)){
|
|
|
- this.$message.error('请正确输入num,只允许输入数字且必须大于0')
|
|
|
- return
|
|
|
+ if (!reg.test(this.num)) {
|
|
|
+ this.$message.error('请正确输入num,只允许输入数字且必须大于0');
|
|
|
+ return;
|
|
|
}
|
|
|
if (this.num <= 0) {
|
|
|
- this.$message.error('num必须大于0')
|
|
|
- return
|
|
|
+ this.$message.error('num必须大于0');
|
|
|
+ return;
|
|
|
}
|
|
|
- this.loading = true
|
|
|
+ this.loading = true;
|
|
|
this.$http
|
|
|
.post('/cache/operating/' + this.collectionId + '/' + this.num + '/' + operationType)
|
|
|
.then(res => {
|
|
|
this.loading = false;
|
|
|
this.$message.success('成功');
|
|
|
- this.num = null
|
|
|
- this.collectionId = null
|
|
|
+ this.num = null;
|
|
|
+ this.collectionId = null;
|
|
|
})
|
|
|
.catch(e => {
|
|
|
this.loading = false;
|
|
|
this.$message.error(e.error || '失败');
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
clearUserProperty() {
|
|
|
this.loading = true;
|
|
|
@@ -160,6 +161,18 @@ export default {
|
|
|
});
|
|
|
};
|
|
|
i.click();
|
|
|
+ },
|
|
|
+ recal() {
|
|
|
+ if (this.param) {
|
|
|
+ this.$http
|
|
|
+ .get('/asset/recal', { userId: this.param })
|
|
|
+ .then(res => {
|
|
|
+ this.$message.success('ok');
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.$message.error(e.error);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
components: { SingleUpload }
|