赋分 #73

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

@ -16,3 +16,26 @@ export function getSafeCompanyDetail(params) {
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, content: response.data.msg,
duration: 3 duration: 3
}) })
return response.data3 return response.data
} }
} }

@ -7,11 +7,8 @@
{{ this.input_text }} {{ this.input_text }}
</div> </div>
<div class="input_body"> <div class="input_body">
<el-input <el-input v-model="person_input" placeholder="请输入数量"></el-input>
v-model="person_input" <el-button @click="add_detail"></el-button>
placeholder="请输入数量(人)"
></el-input>
<el-button>提交</el-button>
</div> </div>
<div class="table_body"> <div class="table_body">
<el-table <el-table
@ -24,6 +21,7 @@
v-for="item in table_list" v-for="item in table_list"
:key="item.prop" :key="item.prop"
:label="item.label" :label="item.label"
:prop="item.prop"
> >
</el-table-column> </el-table-column>
<el-table-column prop="operation" label="操作"> <el-table-column prop="operation" label="操作">
@ -31,7 +29,7 @@
<el-button size="small" class="operation" @click="open(scope.row)" <el-button size="small" class="operation" @click="open(scope.row)"
>编辑 >编辑
</el-button> </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> </el-button>
</template> </template>
@ -43,6 +41,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
:page-sizes="[4]" :page-sizes="[4]"
:pager-count="5"
:page-size="pageSize" :page-size="pageSize"
:current-page="pageNum" :current-page="pageNum"
layout="total, sizes, prev, pager, next, jumper" layout="total, sizes, prev, pager, next, jumper"
@ -51,14 +50,25 @@
</el-pagination> </el-pagination>
</div> </div>
</div> </div>
<DetailsTableDialog ref="detailsTableDialog" @refresh="refresh"></DetailsTableDialog>
<DetailsTableDelete ref="detailsTableDelete" @refresh="refresh"></DetailsTableDelete>
</div> </div>
</template> </template>
<script> <script>
import bus from "@/assets/js/eventBus.js"; import bus from "@/assets/js/eventBus.js";
import { getIndexTable } from "@/api/systemManagement/safeIndex"; 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 { export default {
name: "DetailsTable", name: "DetailsTable",
components:{
DetailsTableDialog,
DetailsTableDelete
},
props: { props: {
company_id: { company_id: {
type: String, type: String,
@ -77,22 +87,22 @@ export default {
person_input: "", person_input: "",
table_list: [ table_list: [
{ {
prop: "time", prop: "updateTime",
label: "填报时间", label: "填报时间",
width: "200", width: "200",
}, },
{ {
prop: "person_num", prop: "numValue",
label: "填报数量(人)", label: "填报数量",
width: "200", width: "200",
}, },
{ {
prop: "warning", prop: "alarmLevel",
label: "预警情况", label: "预警情况",
width: "200", width: "200",
}, },
{ {
prop: "person", prop: "userName",
label: "填报人", label: "填报人",
}, },
], ],
@ -102,8 +112,35 @@ export default {
total: 0, total: 0,
}; };
}, },
created() { async created() {
this.get_data(); 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() { mounted() {
bus.$on("send_three", (data) => { bus.$on("send_three", (data) => {
@ -115,7 +152,7 @@ export default {
this.note = JSON.parse(new_arr[0].note); this.note = JSON.parse(new_arr[0].note);
this.input_text = new_arr[0].levelIndexThree; this.input_text = new_arr[0].levelIndexThree;
this.massage_title = this.note.titleNote; this.massage_title = this.note.titleNote;
this.get_detail_data() this.get_detail_data();
}); });
}, },
methods: { methods: {
@ -146,10 +183,44 @@ export default {
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum, pageNum: this.pageNum,
}; };
getSafeCompanyDetail(param).then(res=>{ getSafeCompanyDetail(param).then((res) => {
this.detail_table_data = res.rows this.detail_table_data = res.rows;
this.total = res.total 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 }) { table_header({ row, rowIndex }) {
@ -284,6 +355,8 @@ export default {
.table_pagination { .table_pagination {
width: 51vw; width: 51vw;
height: 5vh; height: 5vh;
display: flex;
flex-direction: row-reverse;
/deep/.el-input--suffix .el-input__inner { /deep/.el-input--suffix .el-input__inner {
color: #fff; color: #fff;
border: 0.1px solid #34a6a6; border: 0.1px solid #34a6a6;
@ -299,7 +372,6 @@ export default {
height: 2.6vh; height: 2.6vh;
} }
/deep/.el-pagination { /deep/.el-pagination {
margin-left: 50%;
margin-top: 1vh; margin-top: 1vh;
.el-pagination__total { .el-pagination__total {
color: #fff; color: #fff;
@ -307,20 +379,24 @@ export default {
.el-input__inner { .el-input__inner {
border-radius: 0px; border-radius: 0px;
background: #3c4b4a; background: #3c4b4a;
border: 0.1px solid #277f79;
color: #fff; color: #fff;
} }
.btn-prev { .btn-prev {
border-radius: 0px; border-radius: 0px;
background: #3c4b4a; background: #3c4b4a;
border: 0.1px solid #277f79;
color: #fff; color: #fff;
} }
ul { ul {
li { li {
border: 0.1px solid #277f79;
background: #3c4b4a; background: #3c4b4a;
color: #fff; color: #fff;
} }
} }
.btn-next { .btn-next {
border: 0.1px solid #277f79;
border-radius: 0px; border-radius: 0px;
background: #3c4b4a; background: #3c4b4a;
color: #fff; 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; background: #233438 !important;
} }
/deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar { /deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar {
display: none;
width: 6px; width: 6px;
background-color: #5e666a; background-color: #5e666a;
border-radius: 4px; border-radius: 4px;
} }
/deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar-thumb { /deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar-thumb {
display: none;
width: 5px; width: 5px;
background-color: #3c4b4a; background-color: #3c4b4a;
border-radius: 4px; border-radius: 4px;

Loading…
Cancel
Save