feat(waterInjection): 等级修改-团队盒数与小区盒数小数精度为两位小数

This commit is contained in:
woody 2025-06-30 16:36:48 +08:00
parent 3161beb2f9
commit e17e54411b
1 changed files with 134 additions and 138 deletions

View File

@ -32,11 +32,9 @@
<el-col :span="4">
<div class="searchbox">
<el-button class="my_search" @click="research">
{{ '搜索' }}</el-button
>
{{ '搜索' }}</el-button>
<el-button class="my_reset" @click="reChongzhi">
{{ '重置' }}</el-button
>
{{ '重置' }}</el-button>
</div>
</el-col>
</el-row>
@ -46,36 +44,33 @@
<div class="maintop">
<div class="mainbtn">
<el-button
v-hasButtons="['waterAdd']"
size="small"
class="addBtn"
v-hasButtons="['waterAdd']"
@click="addRules"
>{{ '添加' }}</el-button
>
>{{ '添加' }}</el-button>
<el-button
size="small"
v-hasButtons="['waterDown']"
@click="importTemplate"
size="small"
style="background-color: #009b58; color: #fff; margin-left: 15px"
class="thebtn2"
@click="importTemplate"
>
{{ '下载模板' }}</el-button
>
{{ '下载模板' }}</el-button>
<el-button
v-hasButtons="['waterImport']"
size="small"
class="thebtn2"
v-hasButtons="['waterImport']"
style="background-color: #ff6723; color: #fff"
@click="handleImport"
>
{{ '导入' }}</el-button
>
{{ '导入' }}</el-button>
</div>
</div>
<div class="maintable">
<el-table
:data="tableData"
v-loading="loading"
:data="tableData"
height="730px"
style="width: 100%"
:header-cell-style="{ background: '#EEEEEE' }"
@ -104,21 +99,21 @@
<el-table-column align="center" :label="'操作'" width="150">
<template slot-scope="scope">
<el-button
v-hasButtons="['waterUp']"
class="colors"
type="text"
size="small"
style="color: #ffad41"
v-hasButtons="['waterUp']"
@click.native.prevent="updateShow(scope.row)"
>
{{ '修改' }}
</el-button>
<el-button
v-hasButtons="['waterDel']"
class="colors"
type="text"
size="small"
style="color: #c73030"
v-hasButtons="['waterDel']"
@click.native.prevent="delRole(scope.row)"
>
{{ '删除' }}
@ -149,21 +144,23 @@
</el-col>
<el-col :span="12">
<el-form-item label="团队总盒数" prop="teamBoxNum">
<el-input
<el-input-number
v-model="table.teamBoxNum"
type="number"
clearable
:placeholder="'请输入'"
:precision="2"
placeholder="请输入"
:controls="false"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="小区盒数" prop="smallBoxNum">
<el-input
<el-input-number
v-model="table.smallBoxNum"
type="number"
clearable
:placeholder="'请输入'"
:precision="2"
placeholder="请输入"
:controls="false"
/>
</el-form-item>
</el-col>
@ -206,8 +203,7 @@
class="button-style"
@click="handleClose"
>
{{ '取消' }}</el-button
>
{{ '取消' }}</el-button>
<el-button
type="text"
size="small"
@ -247,12 +243,12 @@
:auto-upload="false"
drag
>
<i class="el-icon-upload"></i>
<i class="el-icon-upload" />
<div class="el-upload__text">
{{ '将文件拖到此处,或' }}
<em>{{ '点击上传' }}</em>
</div>
<div class="el-upload__tip" style="color: red" slot="tip">
<div slot="tip" class="el-upload__tip" style="color: red">
{{ '提示仅允许导入“xls”或“xlsx”格式文件' }}
</div>
</el-upload>
@ -269,246 +265,246 @@
</template>
<script>
import topBar from "@/components/topBar";
import * as api from "@/api/specialBusiness.js";
import { Message } from "element-ui";
import { getToken } from "@/utils/auth";
import topBar from '@/components/topBar'
import * as api from '@/api/specialBusiness.js'
import { Message } from 'element-ui'
import { getToken } from '@/utils/auth'
export default {
name: "Qxpz",
name: 'Qxpz',
components: {
topBar,
topBar
},
data() {
return {
title: '添加',
modifiedTime: [],
modifiedTime1: [],
forms: "",
forms: '',
rules: {
memberCode: [
{ required: true, message: '请输入', trigger: "blur" },
{ required: true, message: '请输入', trigger: 'blur' }
],
settleDate: [
{ required: true, message: '请选择', trigger: "change" },
],
{ required: true, message: '请选择', trigger: 'change' }
]
},
table: {},
ruleShow: false,
moren: "waterInjection",
moren: 'waterInjection',
topList: [
{
name: "等级修改",
path: "waterInjection",
},
name: '等级修改',
path: 'waterInjection'
}
],
upload: {
//
open: false,
//
title: "",
title: '',
//
isUploading: false,
//
updateSupport: 0,
//
headers: { Authorization: "Bearer " + getToken() },
headers: { Authorization: 'Bearer ' + getToken() },
//
url: process.env.VUE_APP_BASE_API + "/bonus/manage/special/importData",
url: process.env.VUE_APP_BASE_API + '/bonus/manage/special/importData'
},
queryParams: {
pageNum: 1,
pageSize: 50,
pageSize: 50
},
loadingInstance: null,
tableData: [],
loading: false,
total: 0,
};
total: 0
}
},
created() {
this.research();
this.research()
},
methods: {
submitFileForm() {
this.$refs.upload.submit();
this.$refs.upload.submit()
},
//
handleExceed() {
this.upload.isUploading = false;
this.msgInfo('仅可上传一个文件哦');
this.upload.isUploading = false
this.msgInfo('仅可上传一个文件哦')
},
//
handleFileUploadProgress(event, file, fileList) {
console.log(event, "event");
this.upload.isUploading = true;
console.log(event, 'event')
this.upload.isUploading = true
},
//
handleFileSuccess(response, file, fileList) {
console.log(response, "response");
console.log(response, 'response')
this.loadingInstance = this.$loading({
lock: true,
text: "正在处理,请稍候...",
background: "rgba(0, 0, 0, 0.7)",
});
var fileName = response.fileName;
if (fileName != undefined && fileName != "") {
text: '正在处理,请稍候...',
background: 'rgba(0, 0, 0, 0.7)'
})
var fileName = response.fileName
if (fileName != undefined && fileName != '') {
}
if (response.code == 200) {
this.$alert("", '上传成功', {
this.$alert('', '上传成功', {
dangerouslyUseHTMLString: true,
callback: () => {
//
this.loadingInstance.close();
},
});
this.loadingInstance.close()
}
})
} else {
if (response && response.data && Array.isArray(response.data)) {
const msgList = response.data
.map((item) => item.memberCode + " " + item.msg)
.join("<br>");
this.$alert(msgList, this.$t("错误提示"), {
.map((item) => item.memberCode + ' ' + item.msg)
.join('<br>')
this.$alert(msgList, this.$t('错误提示'), {
dangerouslyUseHTMLString: true,
callback: () => {
//
this.loadingInstance.close();
},
});
this.loadingInstance.close()
}
})
} else {
const msgs = response.msg;
this.$alert(msgs, this.$t("错误提示"), {
const msgs = response.msg
this.$alert(msgs, this.$t('错误提示'), {
dangerouslyUseHTMLString: true,
callback: () => {
//
this.loadingInstance.close();
},
});
this.loadingInstance.close()
}
})
}
}
this.upload.open = false;
this.upload.isUploading = false;
this.$refs.upload.clearFiles();
this.upload.open = false
this.upload.isUploading = false
this.$refs.upload.clearFiles()
},
handleImport() {
this.upload.title = "批量导入";
this.upload.open = true;
this.upload.title = '批量导入'
this.upload.open = true
},
importTemplate() {
this.download(
"/bonus/manage/special/download",
'/bonus/manage/special/download',
{},
`${this.$t("新零售注水业绩")}${new Date().getTime()}.xlsx`
);
`${this.$t('新零售注水业绩')}${new Date().getTime()}.xlsx`
)
},
addRules() {
this.types = 1;
this.ruleShow = true;
this.title = '添加';
this.types = 1
this.ruleShow = true
this.title = '添加'
},
updateShow(item) {
this.types = 2;
this.title = '修改';
this.types = 2
this.title = '修改'
api.getOnespecialList(item.pkId).then((res) => {
if (res.code === 200) {
this.ruleShow = true;
this.table = res.data;
this.ruleShow = true
this.table = res.data
}
});
})
},
delRole(item) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: "warning",
type: 'warning'
}).then(() => {
api.specialDel(item.pkId).then((res) => {
if (res.code === 200) {
Message({
message: res.msg,
type: "success",
});
this.research();
type: 'success'
})
this.research()
}
});
});
})
})
},
ruleSubmit() {
this.$refs["forms"].validate((valid) => {
this.$refs['forms'].validate((valid) => {
if (!valid) {
return false;
return false
} else {
if (this.types == 1) {
api.specialSave(this.table).then((res) => {
if (res.code == 200) {
Message({
message: res.msg,
type: "success",
});
this.ruleShow = false;
this.$refs["forms"].clearValidate();
this.$refs["forms"].resetFields();
this.research();
type: 'success'
})
this.ruleShow = false
this.$refs['forms'].clearValidate()
this.$refs['forms'].resetFields()
this.research()
}
});
})
}
if (this.types == 2) {
api.specialUpdate(this.table).then((res) => {
if (res.code == 200) {
Message({
message: res.msg,
type: "success",
});
this.ruleShow = false;
this.$refs["forms"].clearValidate();
this.$refs["forms"].resetFields();
this.research();
type: 'success'
})
this.ruleShow = false
this.$refs['forms'].clearValidate()
this.$refs['forms'].resetFields()
this.research()
}
});
})
}
}
});
})
},
handleClose() {
this.ruleShow = false;
this.table = {};
this.ruleShow = false
this.table = {}
},
changeTime(val) {
this.queryParams.startDate = val ? val[0] : "";
this.queryParams.endtDate = val ? val[1] : "";
this.queryParams.startDate = val ? val[0] : ''
this.queryParams.endtDate = val ? val[1] : ''
},
changeTime1(val) {
this.queryParams.beginEndDate = val ? val[0] : "";
this.queryParams.endEndDate = val ? val[1] : "";
this.queryParams.beginEndDate = val ? val[0] : ''
this.queryParams.endEndDate = val ? val[1] : ''
},
research() {
this.loading = true;
this.loading = true
api.specialList(this.queryParams).then((res) => {
this.loading = false;
this.tableData = res.rows;
this.total = res.total;
});
this.loading = false
this.tableData = res.rows
this.total = res.total
})
},
reChongzhi() {
this.queryParams = {
pageNum: 1,
pageSize: 50,
};
this.modifiedTime = [];
this.modifiedTime1 = [];
this.research();
pageSize: 50
}
this.modifiedTime = []
this.modifiedTime1 = []
this.research()
},
handleSelectionChange(val) {
this.multipleSelection = val;
this.multipleSelection = val
},
tableRowClassName({ row, rowIndex }) {
if (rowIndex % 2 == 1) {
return "warning-row";
return 'warning-row'
} else if (rowIndex % 2 == 0) {
return "success-row";
return 'success-row'
}
return ''
}
}
}
return "";
},
},
};
</script>
<style lang="scss" scoped>
::v-deep .el-upload--picture-card {