2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目汇总表(按总分从高到低排序)
This commit is contained in:
@@ -15,6 +15,15 @@
|
||||
<Content Remove="wwwroot\Captcha\Image\6.jpg" />
|
||||
<Content Remove="wwwroot\Captcha\Image\7.jpg" />
|
||||
<Content Remove="wwwroot\Captcha\Image\8.jpg" />
|
||||
<Content Update="wwwroot\html\yjbvote20251222\Expert.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\html\yjbvote20251222\index.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Update="wwwroot\html\yjbvote20251222\VoteResult.html">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -63,6 +63,6 @@
|
||||
"GetHouseInfoCitysByCommunity": "http://sjk.test.ky.com/housesafety/statistics/GetHouseInfoCitysByCommunity?communityID={0}"
|
||||
},
|
||||
"UserScore": {
|
||||
"ExpertNumber": 8
|
||||
"ExpertNumber": 17
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -106,7 +106,8 @@
|
||||
//location = '/gb/yjb/manage/VoteResult'
|
||||
//location = '/gb/yjb/manage/nbczResult'
|
||||
//location = '/202307/html/outsidewall/result.html'
|
||||
location = '../yjbvote2025/voteresult.html';
|
||||
// location = '../yjbvote2025/voteresult.html';
|
||||
location = '../yjbvote20251222/voteresult.html';
|
||||
}
|
||||
}
|
||||
_this.loading = false;
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../lib/element-ui/theme-chalk/index.css">
|
||||
<script src="../../lib/vue2/vue.min.js"></script>
|
||||
<script src="../../lib/element-ui/theme-chalk/index.js"></script>
|
||||
<script src="../../lib/axios/axios.min.js"></script>
|
||||
<script src="../../lib/qs/qs.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app" v-loading="loading">
|
||||
<h3 style="text-align:center;">2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目 专家投票情况</h3>
|
||||
<el-table :data="tableData" style="width: 20%;margin:0 auto;">
|
||||
<el-table-column prop="login_code" label="专家"> </el-table-column>
|
||||
<el-table-column prop="is_vote" label="是否投票" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="info" v-if="scope.row.is_vote==true">已投</el-tag>
|
||||
<el-tag type="danger" v-else>未投</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<h3 style="text-align:center;">
|
||||
<el-button @click="load_vote">刷新数据</el-button>
|
||||
<el-button @click="show_expert_vote">查看项目投票情况</el-button>
|
||||
<el-button @click="show_dialog">新增专家</el-button>
|
||||
</h3>
|
||||
<el-dialog title="新增专家" :visible.sync="dialogVisible" width="20%">
|
||||
<div class="blocks">
|
||||
<el-input v-model="addexpertnum" placeholder="输入新增专家个数" style="width:100px"></el-input>
|
||||
<el-button @click="add_expert">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--<el-dialog v-model="dialogVisible" title="弹框" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" append-to-body width="60%">
|
||||
<el-form :model="pageData.loginForm" ref="loginFormRef" label-position="top">
|
||||
<el-form-item label="手机号码" label-width="80px" prop="phone" :rules="[{ required: true, trigger: 'blur', min: 11, max: 11, message: '请输入正确的手机号码' }]">
|
||||
<el-input v-model="pageData.loginForm.phone" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验证码" label-width="80px" prop="code" :rules="[{ required: true, trigger: 'blur', min: 4, max: 4, message: '请输入验证码' }]">
|
||||
<el-input type="text" maxlength="4" placeholder="验证码" v-model="pageData.loginForm.code">
|
||||
<template slot="append" #append>
|
||||
<el-button :disabled="pageData.loginForm.disabled" @click="(v,v2)=>funHandles.getCode(v,pageData,loginFormRef)">{{ pageData.loginForm.valiBtn }}</el-button>
|
||||
</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">-->
|
||||
<!--<el-button @click="dialogFormVisible = false">Cancel</el-button>-->
|
||||
<!--<el-button type="primary" @click="(v,v2)=>funHandles.verifyKey(pageData,loginFormRef)">登录</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>-->
|
||||
</div>
|
||||
</body>
|
||||
<style scoped>
|
||||
.buhuanhang {
|
||||
white-space: nowrap;
|
||||
width: 21%;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
tableData: [],
|
||||
loading: false,
|
||||
token: '',
|
||||
dialogVisible: false,
|
||||
addexpertnum: 0
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.check_login()
|
||||
this.loading = true;
|
||||
this.load_vote();
|
||||
|
||||
},
|
||||
methods: {
|
||||
show_expert_vote() {
|
||||
location = 'voteresult.html'
|
||||
},
|
||||
check_login() {
|
||||
this.token = window.sessionStorage.getItem('__TOKEN');
|
||||
if (!this.token)
|
||||
location = '../manage/login.html'
|
||||
},
|
||||
|
||||
load_vote() {
|
||||
this.loading = true;
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/projects/expert-vote',
|
||||
data: {},
|
||||
responseType: "json",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(function (response) {
|
||||
_this.tableData = response.data.data
|
||||
console.log(_this.tableData)
|
||||
_this.loading = false;
|
||||
}).catch(function (error) {
|
||||
if (error.response.status == 403)
|
||||
location = '../manage/login.html'
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
loading_false() { this.loading = false },
|
||||
|
||||
dateFormat(fmt, date) {
|
||||
let ret;
|
||||
const opt = {
|
||||
"Y+": date.getFullYear().toString(), // 年
|
||||
"m+": (date.getMonth() + 1).toString(), // 月
|
||||
"d+": date.getDate().toString(), // 日
|
||||
"H+": date.getHours().toString(), // 时
|
||||
"M+": date.getMinutes().toString(), // 分
|
||||
"S+": date.getSeconds().toString() // 秒
|
||||
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
||||
};
|
||||
for (let k in opt) {
|
||||
ret = new RegExp("(" + k + ")").exec(fmt);
|
||||
if (ret) {
|
||||
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
|
||||
};
|
||||
};
|
||||
return fmt;
|
||||
}
|
||||
,
|
||||
show_dialog() {
|
||||
this.dialogVisible = true
|
||||
}
|
||||
,
|
||||
add_expert() {
|
||||
this.loading = true;
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/projects/expert',
|
||||
data: { expertnum: this.addexpertnum },
|
||||
responseType: "json",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(function (response) {
|
||||
_this.loading = false;
|
||||
location.reload();
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,195 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="../../lib/element-ui/theme-chalk/index.css">
|
||||
<script src="../../lib/vue2/vue.min.js"></script>
|
||||
<script src="../../lib/element-ui/theme-chalk/index.js"></script>
|
||||
<script src="../../lib/axios/axios.min.js"></script>
|
||||
<script src="../../lib/qs/qs.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app" v-loading="loading">
|
||||
<h3 style="text-align:center;">2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目 选票结果</h3>
|
||||
<el-collapse style="width: 80%;margin:0 auto;">
|
||||
<el-collapse-item v-for="(prolist,idx) in tableData" :title="prolist.name" :name="idx" v-show="prolist.data.length>0" :key="idx">
|
||||
<el-table :data="prolist.data" style="width:95%;margin:0 auto;">
|
||||
<el-table-column prop="serial_number" label="序号" width="120"> </el-table-column>
|
||||
<el-table-column prop="name" label="工程名称"> </el-table-column>
|
||||
<el-table-column prop="no_count" label="不同意票数" width="120"> </el-table-column>
|
||||
<el-table-column prop="yes_count" label="同意票数" width="120"> </el-table-column>
|
||||
<el-table-column prop="is_agree" label="是否通过" width="120">
|
||||
<template slot-scope="scope">
|
||||
<el-tag type="info" v-if="scope.row.is_agree==true">通过</el-tag>
|
||||
<el-tag type="danger" v-else>不通过</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-collapse-item>
|
||||
<h3 style="text-align:center;">
|
||||
<el-button @click="load_projects">刷新数据</el-button>
|
||||
<el-button type="primary" @click="export_excel">导出Excel</el-button>
|
||||
<el-button @click="show_expert_vote">查看专家投票情况</el-button>
|
||||
</h3>
|
||||
</div>
|
||||
</body>
|
||||
<style scoped>
|
||||
.buhuanhang {
|
||||
white-space: nowrap;
|
||||
width: 21%;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
tableData: [],
|
||||
tableData0: [],
|
||||
tableData1: [],
|
||||
tableData2: [],
|
||||
tableData3: [],
|
||||
tableData4: [],
|
||||
tableData5: [],
|
||||
loading: false,
|
||||
token: ''
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.check_login()
|
||||
this.loading = true;
|
||||
this.load_projects();
|
||||
|
||||
},
|
||||
methods: {
|
||||
show_expert_vote() {
|
||||
//location = '/gb/yjb/manage/expert'
|
||||
location = 'Expert.html'
|
||||
},
|
||||
export_excel() {
|
||||
this.download('/gb/yjb/api/projects/download', this.dateFormat("YYYYmmddHHMMSS", new Date()) + "-2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目投票结果.xlsx", this.loading_false);
|
||||
},
|
||||
check_login() {
|
||||
this.token = window.sessionStorage.getItem('__TOKEN');
|
||||
if (!this.token)
|
||||
location = '../manage/login.html'
|
||||
},
|
||||
|
||||
load_projects() {
|
||||
this.loading = true;
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/projects/list2',
|
||||
data: {},
|
||||
responseType: "json",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(function (response) {
|
||||
_this.tableData = [];
|
||||
console.log(response)
|
||||
var _data = response.data.data.data
|
||||
var typeList = response.data.data.typeList
|
||||
for (var i = 0; i < typeList.length; i++) {
|
||||
var _p = _data.filter(a => { return a.type == i; });
|
||||
_this.tableData.push({ name: typeList[i], data: _p })
|
||||
}
|
||||
console.log(_this.tableData)
|
||||
//_this.tableData0 = response.data.data.data0
|
||||
//_this.tableData1 = response.data.data.data1
|
||||
//_this.tableData2 = response.data.data.data2
|
||||
//_this.tableData3 = response.data.data.data3
|
||||
//_this.tableData4 = response.data.data.data4
|
||||
//_this.tableData5 = response.data.data.data5
|
||||
//console.log(_this.tableData0)
|
||||
_this.loading = false;
|
||||
}).catch(function (error) {
|
||||
if (error.response.status == 403)
|
||||
location = '../manage/login.html'
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
loading_false() { this.loading = false },
|
||||
|
||||
download(url, filename, callback) {
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: { 'Content-Type': 'application/json;charset=UTF-8' },
|
||||
method: 'post',
|
||||
url: url,
|
||||
data: {},
|
||||
responseType: "blob",
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + _this.token
|
||||
}
|
||||
}).then(function (response) {
|
||||
console.log(response);
|
||||
//解析文件充blod中解析
|
||||
const url = window.URL.createObjectURL(
|
||||
new Blob([response.data], { type: "application/vnd.ms-excel" })
|
||||
);
|
||||
const link = document.createElement("a");
|
||||
link.style.display = "none";
|
||||
link.href = url;
|
||||
link.setAttribute("download", filename);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
callback();
|
||||
}).catch(function (error) {
|
||||
callback();
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
})
|
||||
},
|
||||
getMonthWeek(now) {
|
||||
var a = now.getYear();
|
||||
var b = now.getMonth() + 1;
|
||||
var c = now.getDate();
|
||||
/*
|
||||
a = d = 当前日期
|
||||
b = 6 - w = 当前周的还有几天过完(不算今天)
|
||||
a + b 的和在除以7 就是当天是当前月份的第几周
|
||||
*/
|
||||
var date = new Date(a, parseInt(b) - 1, c), w = date.getDay(), d = date.getDate();
|
||||
return Math.ceil(
|
||||
(d + 6 - w) / 7
|
||||
);
|
||||
},
|
||||
dateFormat(fmt, date) {
|
||||
let ret;
|
||||
const opt = {
|
||||
"Y+": date.getFullYear().toString(), // 年
|
||||
"m+": (date.getMonth() + 1).toString(), // 月
|
||||
"d+": date.getDate().toString(), // 日
|
||||
"H+": date.getHours().toString(), // 时
|
||||
"M+": date.getMinutes().toString(), // 分
|
||||
"S+": date.getSeconds().toString() // 秒
|
||||
// 有其他格式化字符需求可以继续添加,必须转化成字符串
|
||||
};
|
||||
for (let k in opt) {
|
||||
ret = new RegExp("(" + k + ")").exec(fmt);
|
||||
if (ret) {
|
||||
fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, "0")))
|
||||
};
|
||||
};
|
||||
return fmt;
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,302 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0,
|
||||
maximum-scale=1.0, user-scalable=no"/>
|
||||
<link rel="stylesheet" href="../../lib/element-ui/theme-chalk/index.css">
|
||||
<script src="../../lib/vue2/vue.min.js"></script>
|
||||
<script src="../../lib/element-ui/theme-chalk/index.js"></script>
|
||||
<script src="../../lib/axios/axios.min.js"></script>
|
||||
<script src="../../lib/qs/qs.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="app" v-loading="loading">
|
||||
<h3 style="text-align:center;"><p>2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目汇总表</p>(按总分从高到低排序)</h3>
|
||||
<el-collapse>
|
||||
<el-collapse-item v-for="(prolist,idx) in projects" :title="prolist.name" :name="idx" v-show="prolist.data.length>0" :key="idx">
|
||||
<el-descriptions class="margin-top" title="" :column="1" border v-for="project in prolist.data" :key="project.id">
|
||||
<el-descriptions-item label-class-name="buhuanhang" label="项目名称"><b>{{project.serial_number}}:{{project.name}}</b></el-descriptions-item>
|
||||
<el-descriptions-item label-class-name="buhuanhang" label="备注"><i>{{project.remark}}</i></el-descriptions-item>
|
||||
<el-descriptions-item label="请投票">
|
||||
<template>
|
||||
<el-radio-group v-model="project.vote">
|
||||
<el-radio label="true">同意</el-radio>
|
||||
<el-radio label="false">淘汰</el-radio>
|
||||
</el-radio-group>
|
||||
</template>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
<h3 style="text-align:center;">
|
||||
<el-input v-model="logincode" placeholder="请输入提交码"></el-input>
|
||||
</h3>
|
||||
<h3 style="text-align:center;">
|
||||
<el-button @click="alltrue">重置</el-button>
|
||||
<el-button type="primary" @click="submit">提交</el-button>
|
||||
</h3>
|
||||
</div>
|
||||
</body>
|
||||
<style scoped>
|
||||
.buhuanhang {
|
||||
white-space: nowrap;
|
||||
width: 21%;
|
||||
}
|
||||
|
||||
.el-message-box {
|
||||
width: 300px !important;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: function () {
|
||||
return {
|
||||
projects: [],
|
||||
projects0: [],
|
||||
projects1: [],
|
||||
projects2: [],
|
||||
projects3: [],
|
||||
projects4: [],
|
||||
projects5: [],
|
||||
confirm_title: '',
|
||||
loading: false,
|
||||
logincode: ''
|
||||
}
|
||||
},
|
||||
created: function () {
|
||||
this.loading = true;
|
||||
this.load_projects();
|
||||
|
||||
},
|
||||
methods: {
|
||||
alltrue() {
|
||||
this.projects.map(a => {
|
||||
a.data.map(b => {
|
||||
b.vote = "true";
|
||||
return b;
|
||||
})
|
||||
});
|
||||
//this.projects0 = this.projects0.map(a => { a.vote = "true"; return a; });
|
||||
//this.projects1 = this.projects1.map(a => { a.vote = "true"; return a; });
|
||||
//this.projects2 = this.projects2.map(a => { a.vote = "true"; return a; });
|
||||
//this.projects3 = this.projects3.map(a => { a.vote = "true"; return a; });
|
||||
//this.projects4 = this.projects4.map(a => { a.vote = "true"; return a; });
|
||||
//this.projects5 = this.projects5.map(a => { a.vote = "true"; return a; });
|
||||
},
|
||||
async checkcode() {
|
||||
let _this = this;
|
||||
//检验码
|
||||
if (this.logincode.length < 6) {
|
||||
//this.$alert(`<div>提交码输入错误</div>`, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
//}).then(a => { }).catch(err => { console.log(err) });
|
||||
alert("提交码输入错误");
|
||||
return false;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
axios({
|
||||
headers: {'Content-Type': 'application/json;charset=UTF-8'},
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/projects/check-submit-code',
|
||||
data: {'code': this.logincode},
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
if (response.data.data != true) {
|
||||
//_this.$alert(`<div>提交码输入错误</div>`, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
//}).then(a => { }).catch(err => { console.log(err) });
|
||||
alert("提交码输入错误");
|
||||
reject();
|
||||
} else {
|
||||
resolve(true)
|
||||
}
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
})
|
||||
},
|
||||
async submit() {
|
||||
let _this = this;
|
||||
await this.checkcode().then(a => {
|
||||
if (a == false)
|
||||
return;
|
||||
var msg1 = "";
|
||||
var msg2 = "";
|
||||
var all_no_select_num = 0;
|
||||
var select_false_list = [];
|
||||
var all_select_false_num = 0;
|
||||
var all_select_true_num = 0;
|
||||
var allselects = [];
|
||||
for (var i = 0; i < _this.projects.length; i++) {
|
||||
var _p = _this.projects[i];
|
||||
if (_p.data.length > 0) {
|
||||
// var no_select = _p.data.filter(a => { return !a.vote }).length;
|
||||
// all_no_select_num += no_select;
|
||||
// if (no_select > 0) {
|
||||
// msg1 += `<p>目前[` + _p.name + `]未选择的有` + no_select + `个</p>`;
|
||||
// }
|
||||
var select_false = _p.data.filter(a => {
|
||||
return a.vote == "false"
|
||||
}).length;
|
||||
select_false_list.push(select_false)
|
||||
// if (select_false < 1) {
|
||||
msg2 += `目前[` + _p.name + `]淘汰的有 ` + select_false + ` 个\n`;
|
||||
// }
|
||||
all_select_false_num += select_false;
|
||||
all_select_true_num += _p.data.filter(a => {
|
||||
return a.vote == "true"
|
||||
}).length;
|
||||
allselects = allselects.concat(_p.data)
|
||||
}
|
||||
}
|
||||
if (all_no_select_num > 0) {
|
||||
//this.$alert(`<div>请全部选择完毕后再次提交!</div>` + msg1, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
//}).then(a => { }).catch(err => { console.log(err) });
|
||||
alert("请全部选择完毕后再次提交");
|
||||
return;
|
||||
}
|
||||
debugger
|
||||
//if (select_false_list.filter(a => a < 1).length > 0) {
|
||||
// this.$alert(`<div>每个专业必须有一个淘汰!</div>` + msg2, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
// }).then(a => { }).catch(err => { console.log(err) });
|
||||
// return;
|
||||
//}
|
||||
//房建不少于5个
|
||||
if (select_false_list[0] < 10) {
|
||||
// this.$alert(`<div>房屋建筑工程不少于10个淘汰!</div>` + msg2, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
// }).then(a => {
|
||||
// }).catch(err => {
|
||||
// console.log(err)
|
||||
// });
|
||||
alert("房屋建筑工程不少于 10 个淘汰!\n\n" + msg2);
|
||||
return;
|
||||
}
|
||||
//市政不少于4个
|
||||
if (select_false_list[1] < 5) {
|
||||
// this.$alert(`<div>市政基础设施工程不少于5个淘汰!</div>` + msg2, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
// }).then(a => {
|
||||
// }).catch(err => {
|
||||
// console.log(err)
|
||||
// });
|
||||
alert("市政基础设施工程不少于 5 个淘汰!\n\n" + msg2);
|
||||
return;
|
||||
}
|
||||
//交通不少于1个
|
||||
if (select_false_list[2] < 2) {
|
||||
// this.$alert(`<div>轨道交通工程不少于2个淘汰!</div>` + msg2, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
// }).then(a => {
|
||||
// }).catch(err => {
|
||||
// console.log(err)
|
||||
// });
|
||||
alert("轨道交通工程不少于 2 个淘汰!\n\n" + msg2);
|
||||
return;
|
||||
}
|
||||
////水利不少于1个
|
||||
//if (select_false_list[4] < 1) {
|
||||
// this.$alert(`<div>水利工程不少于1个淘汰!</div>` + msg2, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
// }).then(a => { }).catch(err => { console.log(err) });
|
||||
// return;
|
||||
//}
|
||||
if (all_select_false_num < 17) {
|
||||
//this.$alert(`<div>淘汰总数必须大于20个!</div>` + msg2, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
//}).then(a => { }).catch(err => { console.log(err) });
|
||||
alert("淘汰总数必须大于17个");
|
||||
return;
|
||||
}
|
||||
this.$confirm('您此次选择了同意' + all_select_true_num + '个,淘汰' + all_select_false_num + '个,是否继续提交?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
_this.loading = true;
|
||||
axios({
|
||||
headers: {'Content-Type': 'application/json;charset=UTF-8'},
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/projects/submit-vote',
|
||||
data: {'code': this.logincode, 'projects': allselects},
|
||||
responseType: "json",
|
||||
}).then(async response => {
|
||||
if (response.data.data != true) {
|
||||
//_this.$alert(`<div>` + response.data.message + `</div>`, '错误', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
//}).then(a => { }).catch(err => { console.log(err) });
|
||||
alert(response.data.message);
|
||||
} else {
|
||||
//_this.$alert(`<div>提交成功</div>`, '成功', {
|
||||
// confirmButtonText: '确定', dangerouslyUseHTMLString: true, center: true, closeOnClickModal: true
|
||||
//}).then(a => { }).catch(err => { console.log(err) });
|
||||
alert("提交成功");
|
||||
}
|
||||
_this.loading = false;
|
||||
}).catch(async error => {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
})
|
||||
},
|
||||
load_projects() {
|
||||
let _this = this;
|
||||
axios({
|
||||
headers: {'Content-Type': 'application/json;charset=UTF-8'},
|
||||
method: 'post',
|
||||
url: '/gb/yjb/api/projects/list',
|
||||
data: {},
|
||||
responseType: "json",
|
||||
}).then(function (response) {
|
||||
//console.log(response)
|
||||
var _data = response.data.data.data
|
||||
var typeList = response.data.data.typeList
|
||||
_data.map(a => {
|
||||
a.vote = !a.vote ? '' : a.vote.toString();
|
||||
return a;
|
||||
});
|
||||
for (var i = 0; i < typeList.length; i++) {
|
||||
var _p = _data.filter(a => {
|
||||
return a.type == i;
|
||||
});
|
||||
_this.projects.push({name: typeList[i], data: _p})
|
||||
}
|
||||
_this.alltrue();
|
||||
_this.loading = false;
|
||||
}).catch(function (error) {
|
||||
console.log(error)
|
||||
_this.$message({
|
||||
type: 'error',
|
||||
message: error.message
|
||||
})
|
||||
_this.loading = false;
|
||||
})
|
||||
},
|
||||
loading_false() {
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@@ -32,7 +32,10 @@ namespace Vote.Services.ApiController
|
||||
private readonly IRepository<Entities.VoteRecords_2021> rep_VoteRecords2021;
|
||||
private readonly IRepository<Entities.Projects_2022> rep_Projects2022;
|
||||
private readonly IRepository<Entities.VoteRecords_2022> rep_VoteRecords2022;
|
||||
public ProjectsService(IRepository<Entities.Projects> _rep_Projects, IRepository<Entities.Experts> _rep_Experts, IRepository<Entities.VoteRecords> _rep_VoteRecords, IRepository<Entities.Projects_2021> _rep_Projects2021, IRepository<Entities.VoteRecords_2021> _rep_VoteRecords2021, IRepository<Entities.Projects_2022> _rep_Projects2022, IRepository<Entities.VoteRecords_2022> _rep_VoteRecords2022)
|
||||
|
||||
public ProjectsService(IRepository<Entities.Projects> _rep_Projects, IRepository<Entities.Experts> _rep_Experts, IRepository<Entities.VoteRecords> _rep_VoteRecords,
|
||||
IRepository<Entities.Projects_2021> _rep_Projects2021, IRepository<Entities.VoteRecords_2021> _rep_VoteRecords2021,
|
||||
IRepository<Entities.Projects_2022> _rep_Projects2022, IRepository<Entities.VoteRecords_2022> _rep_VoteRecords2022)
|
||||
{
|
||||
rep_Projects = _rep_Projects;
|
||||
rep_Experts = _rep_Experts;
|
||||
@@ -51,7 +54,7 @@ namespace Vote.Services.ApiController
|
||||
[Microsoft.AspNetCore.Authorization.AllowAnonymous]
|
||||
public async Task<dynamic> List(ProjectsInput args)
|
||||
{
|
||||
var typeList = new List<string> { "房建工程", "市政工程", "轨道交通工程" };//, "电力工程", "交通工程", "水利工程" };
|
||||
var typeList = new List<string> { "房屋建筑工程", "市政基础设施工程", "轨道交通工程", "电力工程" }; //, "交通工程", "水利工程" };
|
||||
var data = await rep_Projects.DetachedEntities.Where(p => !p.IsDeleted)
|
||||
.Where(args.type != null, a => (int)a.type == args.type)
|
||||
.ProjectToType<ProjectsOutput>()
|
||||
@@ -110,24 +113,27 @@ namespace Vote.Services.ApiController
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
private async Task<List<ProjectsList2Output>> GetVoteData()
|
||||
{
|
||||
var query = from a in rep_Projects.DetachedEntities
|
||||
join b in rep_VoteRecords.DetachedEntities
|
||||
on a.Id equals b.project_id into grouping
|
||||
from p in grouping.DefaultIfEmpty()
|
||||
group new { a, p } by new { a.Id, a.name, a.serial_number, a.type } into pp
|
||||
select new ProjectsList2Output
|
||||
{
|
||||
serial_number = pp.Key.serial_number,
|
||||
id = pp.Key.Id,
|
||||
name = pp.Key.name,
|
||||
yes_count = pp.Where(a => a.p.is_agree).Count(),
|
||||
no_count = pp.Where(a => !a.p.is_agree).Count(),
|
||||
type = pp.Key.type
|
||||
};
|
||||
join b in rep_VoteRecords.DetachedEntities
|
||||
on a.Id equals b.project_id into grouping
|
||||
from p in grouping.DefaultIfEmpty()
|
||||
group new { a, p } by new { a.Id, a.name, a.serial_number, a.type }
|
||||
into pp
|
||||
select new ProjectsList2Output
|
||||
{
|
||||
serial_number = pp.Key.serial_number,
|
||||
id = pp.Key.Id,
|
||||
name = pp.Key.name,
|
||||
yes_count = pp.Where(a => a.p.is_agree).Count(),
|
||||
no_count = pp.Where(a => !a.p.is_agree).Count(),
|
||||
type = pp.Key.type
|
||||
};
|
||||
return await query.OrderBy(a => a.serial_number).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 列表
|
||||
/// </summary>
|
||||
@@ -135,7 +141,6 @@ namespace Vote.Services.ApiController
|
||||
[HttpPost]
|
||||
public async Task<dynamic> List2()
|
||||
{
|
||||
|
||||
//var data = rep_Projects.DetachedEntities.Where(p => !p.IsDeleted)
|
||||
// //.Where(args.type != null, a => (int)a.type == args.type)
|
||||
// .Join(rep_VoteRecords.DetachedEntities, a => a.Id, a => a.project_id, (a, b) =>
|
||||
@@ -167,9 +172,10 @@ namespace Vote.Services.ApiController
|
||||
// data4,
|
||||
// data5
|
||||
//};
|
||||
var typeList = new List<string> { "房建工程", "市政工程", "轨道交通工程" };//, "电力工程", "交通工程", "水利工程" };
|
||||
var typeList = new List<string> { "房建工程", "市政工程", "轨道交通工程", "电力工程" }; //, "电力工程", "交通工程", "水利工程" };
|
||||
return new { data, typeList };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -178,10 +184,11 @@ namespace Vote.Services.ApiController
|
||||
{
|
||||
var data = await GetVoteData();
|
||||
//var filepath = Tools.ExcelHelper.WriteTemplate(data, 4, "C");
|
||||
string template_name = "2024年度宁波市结构优质认定项目投票结果.xlsx";
|
||||
var filepath = Tools.ExcelHelper.WriteTemplate(template_name, data, 5, "C");
|
||||
string template_name = "2025年度浙江省建筑施工安全生产标准化优良工地(宁波地区)水平认定项目投票结果.xlsx";
|
||||
var filepath = Tools.ExcelHelper.WriteTemplate(template_name, data, 4, "D");
|
||||
return new FileStreamResult(new FileStream(filepath, FileMode.Open), "application/octet-stream") { FileDownloadName = filepath };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
@@ -204,8 +211,6 @@ namespace Vote.Services.ApiController
|
||||
// is_vote = tt == null
|
||||
// };
|
||||
//return await query.ToListAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -229,7 +234,8 @@ namespace Vote.Services.ApiController
|
||||
CreatedTime = DateTime.Now
|
||||
});
|
||||
}
|
||||
|
||||
await rep_Experts.InsertAsync(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -15,42 +15,49 @@ namespace Vote.Services.Dto
|
||||
/// 项目类型
|
||||
/// </summary>
|
||||
public int? type { get; set; }
|
||||
|
||||
public int? is_no_inspection { get; set; }
|
||||
}
|
||||
|
||||
public class ProjectsOutput
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目序号
|
||||
/// </summary>
|
||||
public int serial_number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程名称
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目类型
|
||||
/// </summary>
|
||||
public EnumProjectType type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目类型
|
||||
/// </summary>
|
||||
public string type_title
|
||||
{
|
||||
get
|
||||
{
|
||||
return type.GetEnumDescription();
|
||||
}
|
||||
get { return type.GetEnumDescription(); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public bool vote { get; set; } = false;
|
||||
|
||||
public string remark { get; set; }
|
||||
public int is_no_inspection { get; set; }
|
||||
}
|
||||
|
||||
public class CheckSubmitCodeInput
|
||||
{
|
||||
/// <summary>
|
||||
@@ -59,6 +66,7 @@ namespace Vote.Services.Dto
|
||||
[Required]
|
||||
public string code { get; set; }
|
||||
}
|
||||
|
||||
public class SubmitInput
|
||||
{
|
||||
/// <summary>
|
||||
@@ -66,8 +74,8 @@ namespace Vote.Services.Dto
|
||||
/// </summary>
|
||||
[Required]
|
||||
public string code { get; set; }
|
||||
[Required]
|
||||
public List<ProjectsOutput> projects { get; set; }
|
||||
|
||||
[Required] public List<ProjectsOutput> projects { get; set; }
|
||||
}
|
||||
|
||||
public class ProjectsList2Output
|
||||
@@ -76,10 +84,12 @@ namespace Vote.Services.Dto
|
||||
///
|
||||
/// </summary>
|
||||
public string id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目序号
|
||||
/// </summary>
|
||||
public int serial_number { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 工程名称
|
||||
/// </summary>
|
||||
@@ -95,29 +105,29 @@ namespace Vote.Services.Dto
|
||||
{
|
||||
get
|
||||
{
|
||||
return yes_count > 15;
|
||||
return yes_count >= 11;
|
||||
// return (yes_count / (yes_count + no_count)) >= (2.0 / 3.0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目类型
|
||||
/// </summary>
|
||||
public EnumProjectType type { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 项目类型
|
||||
/// </summary>
|
||||
public string type_title
|
||||
{
|
||||
get
|
||||
{
|
||||
return type.GetEnumDescription();
|
||||
}
|
||||
get { return type.GetEnumDescription(); }
|
||||
}
|
||||
|
||||
public class AddExpertInput
|
||||
{
|
||||
[Required]
|
||||
public int expertnum { get; set; }
|
||||
[Required] public int expertnum { get; set; }
|
||||
}
|
||||
|
||||
public int is_no_inspection { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ namespace Vote.Services.Entities
|
||||
/// </summary>
|
||||
[Comment("工程名称")]
|
||||
public string name { get; set; }
|
||||
public string remark { get; set; }
|
||||
/// <summary>
|
||||
/// 项目类型
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user