赋分 #73

Merged
lukeyan merged 1 commits from lukeyan into master 1 year ago

@ -16,3 +16,26 @@ export function getSafeCompanyDetail(params) {
params
})
}
// 增加企业赋分上报数据
export function addSafeCompanyDetail(data) {
return request({
url: '/safety/system/tbSafeCompanyScoreDetail',
method: 'post',
data
})
}
// 编辑企业赋分上报数据
export function changeSafeCompanyDetail(data) {
return request({
url: '/safety/system/tbSafeCompanyScoreDetail',
method: 'put',
data
})
}
// 删除企业赋分上报数据
export function deleteSafeCompanyDetail(params) {
return request({
url: '/safety/system/tbSafeCompanyScoreDetail?' + params,
method: 'delete',
})
}

@ -74,7 +74,7 @@ request.interceptors.response.use(
content: response.data.msg,
duration: 3
})
return response.data3
return response.data
}
}

@ -7,11 +7,8 @@
{{ this.input_text }}
</div>
<div class="input_body">
<el-input
v-model="person_input"
placeholder="请输入数量(人)"
></el-input>
<el-button>提交</el-button>
<el-input v-model="person_input" placeholder="请输入数量"></el-input>
<el-button @click="add_detail"></el-button>
</div>
<div class="table_body">
<el-table
@ -24,6 +21,7 @@
v-for="item in table_list"
:key="item.prop"
:label="item.label"
:prop="item.prop"
>
</el-table-column>
<el-table-column prop="operation" label="操作">
@ -31,7 +29,7 @@
<el-button size="small" class="operation" @click="open(scope.row)"
>编辑
</el-button>
<el-button size="small" class="operation" @click="open(scope.row)"
<el-button size="small" class="operation" @click="open_delete(scope.row)"
>删除
</el-button>
</template>
@ -43,6 +41,7 @@
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:page-sizes="[4]"
:pager-count="5"
:page-size="pageSize"
:current-page="pageNum"
layout="total, sizes, prev, pager, next, jumper"
@ -51,14 +50,25 @@
</el-pagination>
</div>
</div>
<DetailsTableDialog ref="detailsTableDialog" @refresh="refresh"></DetailsTableDialog>
<DetailsTableDelete ref="detailsTableDelete" @refresh="refresh"></DetailsTableDelete>
</div>
</template>
<script>
import bus from "@/assets/js/eventBus.js";
import { getIndexTable } from "@/api/systemManagement/safeIndex";
import { getSafeCompanyDetail } from "@/api/systemManagement/companyScore";
import {
getSafeCompanyDetail,
addSafeCompanyDetail,
} from "@/api/systemManagement/companyScore";
import DetailsTableDialog from './detailsTableDialog'
import DetailsTableDelete from './detailsTableDelete'
export default {
name: "DetailsTable",
components:{
DetailsTableDialog,
DetailsTableDelete
},
props: {
company_id: {
type: String,
@ -77,33 +87,60 @@ export default {
person_input: "",
table_list: [
{
prop: "time",
prop: "updateTime",
label: "填报时间",
width: "200",
},
{
prop: "person_num",
label: "填报数量(人)",
prop: "numValue",
label: "填报数量",
width: "200",
},
{
prop: "warning",
prop: "alarmLevel",
label: "预警情况",
width: "200",
},
{
prop: "person",
prop: "userName",
label: "填报人",
},
],
detail_table_data:[],
detail_table_data: [],
pageSize: 10,
pageNum: 1,
total: 0,
};
},
created() {
this.get_data();
async created() {
await getIndexTable().then((res) => {
console.log("res", res.data);
this.note_arr = res.data;
for (let i = 0; i < this.note_arr.length; i++) {
//
this.two_level_arr = this.two_level_arr.concat(
this.note_arr[i].tbSafeRuleTwoVoList
);
}
for (let i = 0; i < this.two_level_arr.length; i++) {
//
this.three_level_arr = this.three_level_arr.concat(
this.two_level_arr[i].tbSafeRuleThreeVoList
);
}
console.log("this.three_level_arr", this.three_level_arr);
});
//
this.three_level_id = "5";
const new_arr = this.three_level_arr.filter(
(item) => item.id == this.three_level_id
);
console.log("new_arr", new_arr);
this.note = JSON.parse(new_arr[0].note);
this.input_text = new_arr[0].levelIndexThree;
this.massage_title = this.note.titleNote;
//
this.get_detail_data();
},
mounted() {
bus.$on("send_three", (data) => {
@ -115,7 +152,7 @@ export default {
this.note = JSON.parse(new_arr[0].note);
this.input_text = new_arr[0].levelIndexThree;
this.massage_title = this.note.titleNote;
this.get_detail_data()
this.get_detail_data();
});
},
methods: {
@ -143,13 +180,47 @@ export default {
let param = {
companyId: this.company_id,
safeRuleId: this.three_level_id,
pageSize : this.pageSize,
pageNum : this.pageNum,
pageSize: this.pageSize,
pageNum: this.pageNum,
};
getSafeCompanyDetail(param).then(res=>{
this.detail_table_data = res.rows
this.total = res.total
getSafeCompanyDetail(param).then((res) => {
this.detail_table_data = res.rows;
this.total = res.total;
});
},
//
add_detail() {
let param = {
companyId: this.company_id,
safeRuleId: this.three_level_id,
pageSize: this.pageSize,
pageNum: this.pageNum,
numValue: this.person_input,
levelIndexThree: this.input_text
};
addSafeCompanyDetail(param)
.then((res) => {
console.log(res);
this.$message.success("新增成功");
this.get_detail_data(); //
})
.catch((err) => {
console.log(err);
this.$message.warning("今日记录已经存在记录,可使用编辑功能修改");
this.get_detail_data(); //
});
},
open(val) {
console.log('valll',val);
this.$refs.detailsTableDialog.open(val)
},
open_delete(val) {
console.log('valll2',val);
this.$refs.detailsTableDelete.open(val)
},
//
refresh() {
this.get_detail_data()
},
//
table_header({ row, rowIndex }) {
@ -284,6 +355,8 @@ export default {
.table_pagination {
width: 51vw;
height: 5vh;
display: flex;
flex-direction: row-reverse;
/deep/.el-input--suffix .el-input__inner {
color: #fff;
border: 0.1px solid #34a6a6;
@ -299,7 +372,6 @@ export default {
height: 2.6vh;
}
/deep/.el-pagination {
margin-left: 50%;
margin-top: 1vh;
.el-pagination__total {
color: #fff;
@ -307,20 +379,24 @@ export default {
.el-input__inner {
border-radius: 0px;
background: #3c4b4a;
border: 0.1px solid #277f79;
color: #fff;
}
.btn-prev {
border-radius: 0px;
background: #3c4b4a;
border: 0.1px solid #277f79;
color: #fff;
}
ul {
li {
border: 0.1px solid #277f79;
background: #3c4b4a;
color: #fff;
}
}
.btn-next {
border: 0.1px solid #277f79;
border-radius: 0px;
background: #3c4b4a;
color: #fff;

@ -0,0 +1,102 @@
<template>
<el-dialog
class="dialog"
title="编辑"
:visible.sync="visible"
:close-on-click-modal="false"
width="500px"
@close="close"
>
<div class="main_text">确认删除该数据</div>
<div class="form_btn" slot="footer">
<el-button @click="save_delete"> </el-button>
<el-button @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { deleteSafeCompanyDetail } from "@/api/systemManagement/companyScore";
export default {
name: "DetailsTableDelete",
data() {
return {
visible: false,
id:''
};
},
methods:{
open(val) {
this.visible = true
this.id = val.id
},
save_delete() {
let params = `idList=${this.id}`;
deleteSafeCompanyDetail(params).then((res) => {
console.log(res);
this.$message.success("删除成功");
this.$emit("refresh");
this.visible = false;
}).catch(err=>{
console.log(err);
this.$message.warning('删除失败')
this.$emit("refresh");
this.visible = false;
});
},
close() {
this.visible = false;
},
}
};
</script>
<style lang="less" scoped>
/deep/.el-dialog {
.el-dialog__title {
color: #fff;
text-shadow: 0 0 9px rgba(21, 255, 198, 0.64);
}
background-image: url("~@/assets/companyFile/dialogBack.png");
background-size: 100% 100%;
background-repeat: no-repeat;
height: 400px;
/* 关闭弹窗叉号 */
.el-dialog__headerbtn {
.el-dialog__close {
color: #fff;
font-size: 18px;
}
}
.el-dialog__body {
padding: 0px;
padding-left: 15px;
padding-right: 15px;
p {
font-size: 16px;
color: #fff;
}
.main_text {
width: 470px;
height: 280px;
color: #fff;
text-align: center;
line-height: 280px;
font-size: 35px;
font-weight: 500;
text-shadow: 0 0 9px rgba(21, 255, 198, 0.64);
}
}
.el-button {
width: 120px;
border: 1px solid #4a6072;
color: #fff;
border-radius: 0px !important;
background: #323f43;
}
.el-button:focus,
.el-button:hover {
color: #34e1b3;
background: url("~@/assets/companyFile/891771.png") no-repeat !important;
background-size: 100% 100% !important;
}
}
</style>

@ -0,0 +1,145 @@
<template>
<!-- 编辑三级指标详情 -->
<el-dialog
class="dialog"
title="编辑"
:visible.sync="visible"
:close-on-click-modal="false"
width="500px"
@close="close"
>
<div class="main_text">
<div class="input_title">{{ this.input_title }}</div>
<div class="input">
<el-input v-model="input_num" placeholder="请输入数量"></el-input>
</div>
</div>
<div class="form_btn" slot="footer">
<el-button @click="save"> </el-button>
<el-button @click="close"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { changeSafeCompanyDetail } from "@/api/systemManagement/companyScore";
export default {
name: "DetailsTableDialog",
data() {
return {
visible: false,
input_title: "",
input_num: "",
param: {},
};
},
methods: {
open(val) {
this.visible = true;
console.log("val", val);
this.input_title = val.levelIndexThree;
this.input_num = val.numValue;
this.param = {
companyId: val.companyId,
safeRuleId: val.safeRuleId,
numValue: val.numValue,
levelIndexThree: val.levelIndexThree
}
},
close() {
this.visible = false;
},
save() {
this.param.numValue = this.input_num
console.log('this.param',this.param);
changeSafeCompanyDetail(this.param).then(res=>{
console.log(res);
this.$message.success('编辑成功')
this.visible = false;
this.$emit("refresh");
}).catch(err=>{
console.log(err);
this.$message.warning('编辑失败')
this.visible = false;
this.$emit("refresh");
});
},
},
};
</script>
<style lang="less" scoped>
/deep/.el-dialog {
.el-dialog__title {
color: #fff;
text-shadow: 0 0 9px rgba(21, 255, 198, 0.64);
}
background-image: url("~@/assets/companyFile/dialogBack.png");
background-size: 100% 100%;
background-repeat: no-repeat;
height: 300px;
/* 关闭弹窗叉号 */
.el-dialog__headerbtn {
.el-dialog__close {
color: #fff;
font-size: 18px;
}
}
.el-dialog__body {
padding: 0px;
padding-left: 15px;
padding-right: 15px;
p {
font-size: 16px;
color: #fff;
}
.main_text {
width: 470px;
height: 180px;
color: #fff;
// border: 1px solid #fff;
// text-align: center;
// line-height: 280px;
// font-size: 35px;
// font-weight: 500;
// text-shadow: 0 0 9px rgba(21, 255, 198, 0.64);
.input_title {
margin-left: 20px;
color: #fff;
width: 440px;
height: 60px;
line-height: 60px;
font-size: 18px;
}
.input {
margin-left: 20px;
width: 440px;
height: 60px;
}
}
}
.el-button {
width: 120px;
border: 1px solid #4a6072;
color: #fff;
border-radius: 0px !important;
background: #323f43;
}
.el-button:focus,
.el-button:hover {
color: #34e1b3;
background: url("~@/assets/companyFile/891771.png") no-repeat !important;
background-size: 100% 100% !important;
}
}
.el-input {
width: 18vw;
height: 4.5vh;
}
/deep/.el-input__inner {
width: 15vw;
height: 4.5vh;
border-radius: 0px;
color: #fff;
border: 0.1px solid #374956;
background: #212d2f;
}
</style>

@ -563,12 +563,14 @@ export default {
background: #233438 !important;
}
/deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar {
display: none;
width: 6px;
background-color: #5e666a;
border-radius: 4px;
}
/deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar-thumb {
display: none;
width: 5px;
background-color: #3c4b4a;
border-radius: 4px;

Loading…
Cancel
Save