培训需求调查

This commit is contained in:
yunkexin 2026-01-30 16:16:48 +08:00
parent ac85a733f4
commit eb94a0cc8f
2 changed files with 88 additions and 20 deletions

View File

@ -241,7 +241,7 @@
json.Sort = "ID" json.Sort = "ID"
extendRule(json, 'TYPE', 1, '1') extendRule(json, 'TYPE', 1, '2')
dataSelect = await getRequestOrderPage(json, "/SE/TestEnumPoint/OrderPaged").then(res => { dataSelect = await getRequestOrderPage(json, "/SE/TestEnumPoint/OrderPaged").then(res => {
this.selectorInfo.totalCount = res.TotalCount this.selectorInfo.totalCount = res.TotalCount

View File

@ -4,11 +4,7 @@
<view class="background"></view> <view class="background"></view>
<view> <view>
<u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm"> <u--form labelPosition="left" labelWidth="auto" labelAlign="center" :model="model" class="demo-ruleForm">
<u-form-item required label="筛选" @click="handleShowSheet({title: '筛选', name: 'Nav_JoinDepartment'})" borderBottom>
<u--input disabledColor="#fff" v-model="type" disabled placeholder="请选择筛选条件" suffixIcon="arrow-down" suffixIconStyle="font-size:12px" fontSize="14px" border="none"
customStyle="margin:0px;display:flex;padding:3px 0px" inputAlign="right">
</u--input>
</u-form-item>
<u-form-item label="调查名称:" prop="NAME" borderBottom> <u-form-item label="调查名称:" prop="NAME" borderBottom>
<u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input> <u--input v-model="model.NAME" border="none" slot="right" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item> </u-form-item>
@ -30,30 +26,52 @@
<view class="tag-view" v-if="model.Nav_JoinDepartment"> <view class="tag-view" v-if="model.Nav_JoinDepartment">
<uni-tag class="tag" v-for="(i, k) in model.Nav_JoinDepartment.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.Nav_Department.NAME" type="primary" /> <uni-tag class="tag" v-for="(i, k) in model.Nav_JoinDepartment.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.Nav_Department.NAME" type="primary" />
</view> --> </view> -->
<u-form-item label="调查内容"> <u-form-item label="调查目的">
<!-- <u-icon name="arrow-down" size="12" slot="right"></u-icon> --> <!-- <u-icon name="arrow-down" size="12" slot="right"></u-icon> -->
</u-form-item> </u-form-item>
<view class="tag-view" v-if="model.Nav_Points"> <view class="tag-view" v-if="model.Nav_Points">
<uni-tag class="tag" v-for="(i, k) in model.Nav_Points.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.Nav_Point.NAME" type="primary" /> <uni-tag class="tag" v-for="(i, k) in model.Nav_Points.filter(i => !i.IS_DELETED)" :key="k" :inverted="true" :text="i.Nav_Point.NAME" type="primary" />
</view> </view>
<u-form-item label="调查份数:" prop="END_TIME" borderBottom>
<u--input v-model="total" border="none" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="反馈份数:" prop="END_TIME" borderBottom>
<u--input v-model="reportCount" border="none" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<u-form-item label="反馈比例:" prop="END_TIME" borderBottom>
<u--input v-model="rate" border="none" inputAlign="right" disabled disabledColor="#ffffff" fontSize="14px"></u--input>
</u-form-item>
<view class="table-container" v-if="ROWS && ROWS.length > 0"> <view class="table-container" v-if="ROWS && ROWS.length > 0">
<table> <table>
<tr> <tr>
<th colspan="100%" style="text-align: center; background-color: #f5f7fa; font-weight: bold; padding: 12px;"> <th>序号</th>
答案正确率(百分比) <th>培训需求</th>
</th> <th>需求部门</th>
<th>需求人数</th>
</tr> </tr>
<!-- 动态渲染表格行 --> <!-- 动态渲染表格行 -->
<tr v-for="(row, rowIndex) in ROWS" :key="rowIndex"> <tr v-for="(row, rowIndex) in ROWS" :key="rowIndex">
<td>{{rowIndex + 1}}</td>
<!-- 如果是第一行使用 u-th 作为表头 --> <td>{{row.NAME}}</td>
<template v-if="rowIndex === 0"> <td>{{row.department.join('、')}}</td>
<th v-for="(cell, cellIndex) in row" :key="cellIndex">{{ cell }}</th> <td>{{row.report}}</td>
</template> </tr>
<!-- 其他行使用 u-td --> </table>
<template v-else> </view>
<td v-for="(cell, cellIndex) in row" :key="cellIndex">{{ cell }}<span v-if="cellIndex!==0">%</span></td> <view class="table-container" v-if="ROWS1 && ROWS1.length > 0">
</template> <table>
<tr>
<th>序号</th>
<th>培训其他需求</th>
<th>需求人员</th>
<th>需求人数</th>
</tr>
<!-- 动态渲染表格行 -->
<tr v-for="(row, rowIndex) in ROWS1" :key="rowIndex">
<td>{{rowIndex + 1}}</td>
<td>{{row.NAME}}</td>
<td>{{row.department.join('、')}}</td>
<td>{{row.report}}</td>
</tr> </tr>
</table> </table>
</view> </view>
@ -69,7 +87,8 @@
import { import {
initFilter, initFilter,
extendRule, extendRule,
extendInclude extendInclude,
extendSelectField
} from '../../../../utils/common' } from '../../../../utils/common'
import { import {
getRequest, getRequest,
@ -96,6 +115,10 @@
Lists: [], Lists: [],
type: '部门', type: '部门',
ROWS: [], ROWS: [],
ROWS1: [],
total:0,
reportCount:0,
rate:0,
comPickerInfo: { comPickerInfo: {
showSheet: false, showSheet: false,
columns: [], columns: [],
@ -136,9 +159,54 @@
getRequest(json, "/SE/TrainSurvey/Get").then(res => { getRequest(json, "/SE/TrainSurvey/Get").then(res => {
this.model = res this.model = res
this.reportCount = this.model && this.model.Nav_Demands ? this.model.Nav_Demands.filter(i => i.OK).length : 0;
this.total = this.model && this.model.Nav_Demands ? this.model.Nav_Demands.length : 0;
this.rate = this.total === 0 ? 0 : Math.round(this.reportCount * 100 / this.total)+'%';
this.updataData()
this.isLoadOK = true; this.isLoadOK = true;
}) })
}, },
updataData() {
let r = {};
this.model.Nav_Demands.forEach(it => {
it.Nav_Items.forEach(d => {
let idx = r[d.DEMAND_ID];
if (idx === undefined) {
idx = this.ROWS.length
r[d.DEMAND_ID] = idx;
this.ROWS.push({
ID: d.DEMAND_ID,
NAME: d.Nav_DEMAND?.NAME,
department: [],
total: 0,
report: 0,
})
}
let name = it.Nav_User?.Nav_Department.NAME;
if (name == '宁化行洛坑钨矿有限公司') {
name = '公司领导';
}
if (this.ROWS[idx].department.indexOf(name) == -1) {
this.ROWS[idx].department.push(name);
}
this.ROWS[idx].total++;
if (it.OK) {
this.ROWS[idx].report++;
}
})
});
this.model.Nav_Demands.forEach(it => {
if (it.OTHER != undefined && it.OTHER != "") {
this.ROWS1.push({
NAME: it.OTHER,
department: [it.Nav_User?.NAME],
total: 1,
report: 1,
})
}
});
},
// //
async handleShowSheet(p) { async handleShowSheet(p) {
const orgId = uni.getStorageSync('orgId') const orgId = uni.getStorageSync('orgId')