提交排班3

This commit is contained in:
边枭-前端开发 2024-09-14 14:12:10 +08:00
commit df1d132246
7 changed files with 4296 additions and 1578 deletions

4792
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 查询回答问卷列表
export function listElderProfile(query) {
return request({
url: '/elder/fwzypgmb/list',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,36 @@
import request from '@/utils/request'
// 查询回答问卷列表
export function listFwzypgmb(query) {
return request({
url: '/elder/fwzypgmb/list',
method: 'get',
params: query
})
}
// 老人档案信息
export function listElderProfile(query) {
return request({
url: '/elder/profile/list',
method: 'get',
params: query
})
}
// 获取问卷列表
export function listQuestionnaireTemplate(query) {
return request({
url: '/elder/questionnaire/question/list',
method: 'get',
params: query
})
}
// 新增老人能力评估
export function addLrnlpg(data) {
return request({
url: '/elder/lrnlpg',
method: 'POST',
data: data
})
}

View File

@ -54,6 +54,7 @@
"navigationBarTitleText": "浏览文本" "navigationBarTitleText": "浏览文本"
} }
} }
], ],
"subPackages": [ "subPackages": [
{ {
@ -374,6 +375,28 @@
} }
] ]
}, },
{
"root": "pages_evaQuestion/pages",
"pages": [
{
"path": "index",
"style": {
"navigationBarTitleText": "评估问卷"
}
}
]
},
{
"root": "pages_radioQustion/pages",
"pages": [
{
"path": "index",
"style": {
"navigationBarTitleText": "老人能力评估调查问卷"
}
}
]
},
{ {
"root": "pages_WenJuanDiaoCha/pages", "root": "pages_WenJuanDiaoCha/pages",
"pages": [ "pages": [

View File

@ -111,6 +111,12 @@
<text class="text">巡更管理</text> <text class="text">巡更管理</text>
</view> </view>
</uni-grid-item> </uni-grid-item>
<uni-grid-item>
<view class="grid-item-box" @click="toPath('/pages_evaQuestion/pages/index')">
<uni-icons type="wallet-filled" size="30"></uni-icons>
<text class="text">评估问卷</text>
</view>
</uni-grid-item>
</uni-grid> </uni-grid>
</view> </view>
</view> </view>

View File

@ -0,0 +1,207 @@
<template>
<view style="width: 100%">
<view class="u-page">
<u-loading-page :loading="loading" bg-color="#e8e8e8"></u-loading-page>
<u-row customStyle="margin: 5px">
<u-col span="9">
<u-search style="z-index: 999" :disabled="true" bgColor="rgb(255 255 255)" placeholder="搜索"
shape="round" @click="handle_SearchBox_click" :showAction="false" :animation="true"></u-search>
</u-col>
<u-col span="3">
<u-button type="primary" @click="handel_plus_click" size="small" shape="circle" class="custom-style"
plain text="创建">
</u-button>
</u-col>
</u-row>
<u-row customStyle="margin-bottom: 10px ">
<u-col span="12">
<u-empty v-if="DataList.length == 0" mode="list"></u-empty>
<u-cell-group customStyle="background-color: white;" v-else>
<u-cell v-for="item in DataList" :key="item.id" size="large" isLink clickable
:title="item.templateName" :name="item.elderQuestionnairePaperId"
@click="handel_cell_click(item)">
</u-cell>
</u-cell-group>
<uni-load-more :status="status" :contentText="loadText" @clickLoadMore="MyonLoad" />
</u-col>
</u-row>
</view>
</view>
</template>
<script setup>
import {
listFwzypgmb,
} from '@/api/elder/pensionAssessment/fwzypgmb/index';
import {
listAssign,
getAssign,
delAssign,
addAssign,
updateAssign,
} from "@/api/elder/questionnaire/assign";
import {
onLoad,
onShow,
onHide,
onReady
} from '@dcloudio/uni-app'
import {
computed,
ref,
reactive,
onMounted,
} from 'vue';
const show = ref(false);
const columns = reactive([
]);
//
let elderName = ref('')
const form1 = ref(null)
// import myLoadMore from "@/pages/mixins/myLoadMore";
// mixins: [myLoadMore],
//
let loading = ref(true)
//
let ids = ref([])
//
let checkedElderQuestionnaireAssignDetail = ref([])
//
let single = ref(true)
//
let multiple = ref(true)
//
let showSearch = ref(true)
//
let total = ref(0)
//
let DataList = ref([])
//
let elderQuestionnaireAssignDetailList = ref([])
//
let title = ref('')
//
let open = ref(false)
//
let queryParams = reactive({
pageNum: null,
pageSize: null,
assignName: null,
assignType: null,
answererId: null,
answererName: null,
assignStatus: null,
autoRating: null,
ruleId: null,
value: null,
level: null,
status: 1,
})
//
let form = reactive({})
//
let rules = reactive({})
onShow(() => {
getList()
})
/** 查询发起问卷列表 */
function getList() {
loading.value = true;
listFwzypgmb(queryParams).then((response) => {
DataList.value = response.rows || [];
total.value = response.total;
loading.value = false;
});
}
//
function handel_cell_click(item) {
const filteredDataList = DataList.value.filter(data => data.elderQuestionnairePaperId === item.name);
const dataListString = JSON.stringify(filteredDataList);
console.log(dataListString, 789);
console.log('11111',item)
// URL
uni.navigateTo({
// url: `/pages_radioQustion/pages/index?name=${encodeURIComponent(item.name)}`
url: `/pages_radioQustion/pages/index?item=${JSON.stringify(item)}`
});
}
</script>
<style scoped>
.demo-uni-row {
margin-bottom: 10px;
/* QQ、字节小程序文档写有 :host但实测不生效 */
/* 百度小程序没有 :host需要设置block */
/* #ifdef MP-TOUTIAO || MP-QQ || MP-BAIDU */
display: block;
/* #endif */
}
/* 支付宝小程序没有 demo-uni-row 层级 */
/* 微信小程序使用了虚拟化节点,没有 demo-uni-row 层级 */
/* #ifdef MP-ALIPAY || MP-WEIXIN */
/deep/ .uni-row {
margin-bottom: 10px;
}
/* #endif */
.demo-uni-col {
height: 36px;
border-radius: 4px;
}
.mypage-title {
font-size: 20px;
font-weight: 600;
align-self: center;
}
.wrap {
padding: 12px;
}
.demo-layout {
height: 25px;
border-radius: 4px;
}
.list-cell {
display: flex;
box-sizing: border-box;
width: 100%;
padding: 10px 24rpx;
overflow: hidden;
color: #323233;
font-size: 14px;
line-height: 24px;
background-color: #fff;
}
.custom-style {
width: 90%;
font-weight: bolder;
font-size: 15px;
height: 75rpx;
}
</style>

View File

@ -0,0 +1,166 @@
<template>
<view class="form-container">
<u-form :model="form" label-width="250px" label-position="top">
<u-divider></u-divider>
<view v-for="(parent, index) in firstArray" :key="parent.questionId">
<text>{{ parent.questionName }}</text>
<template v-if="secondArray[index] === '是否'">
<u-radio-group v-model="selectedValues[index]">
<u-radio :value="parent.value" size="large"></u-radio>
<u-radio :value="0" size="large"></u-radio>
</u-radio-group>
</template>
<template v-else>
<u-radio-group v-model="selectedValues[index]">
<u-radio v-for="child in secondArray[index]" :key="child.questionId" :value="child.value"
size="large">
{{ child.questionName }}
</u-radio>
</u-radio-group>
</template>
</view>
<u-form-item class="submit-btn-container">
<u-button type="primary" @click="submitForm">提交</u-button>
<u-button @click="goBack">取消</u-button>
</u-form-item>
</u-form>
</view>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue';
import {
onLoad,
onShow,
onHide,
onReady
} from '@dcloudio/uni-app'
import {
useRoute
} from 'vue-router'; // 使 vue-router
import {
listQuestionnaireTemplate,
listElderProfile,
addLrnlpg
} from '@/api/elder/pensionAssessment/fwzypgmb/index';
const name = ref('');
const loading = ref(false); // loading
const DataList = ref([]); // DataList
const total = ref(0); // total
const elderList = ref([])
const firstArray = ref([]);
const secondArray = ref([]);
const selectedValues = ref([]);
const questionTitles = ref([])
const dataList = ref([])
let moban=ref({})
const questionnaireTemplateList = ref([])
const isSubmitting = ref(false);
const route = useRoute(); // 使 vue-router
onLoad((option) => {
console.log('-----option',JSON.parse(option.item))
moban.value = JSON.parse(option.item)
console.log('-----option',moban.value.elderQuestionnairePaperId)
getList();
})
function getList() {
loading.value = true;
const receivedName = moban.value.elderQuestionnairePaperId;
//
name.value = receivedName ? decodeURIComponent(receivedName) : '';
console.log("Received name:", name.value);
listElderProfile().then((res) => {
// console.log("", res.rows[0]);
elderList.value = res.rows[0]
// res
}).finally(() => {
loading.value = false;
});
listQuestionnaireTemplate({
paperId: moban.value.elderQuestionnairePaperId,
status: 0
}).then((res) => {
questionTitles.value = res.rows;
questionnaireTemplateList.value = res.rows;
firstArray.value = res.rows.filter(item => item.parentQuestionid === null || item.parentQuestionid ===
'0');
secondArray.value = firstArray.value.map(parent => {
const children = res.rows.filter(item => item.parentQuestionid === parent.questionId);
if (parent.questionType === '2') {
return '是否';
} else {
return children;
}
});
selectedValues.value = new Array(firstArray.value.length).fill(null);
console.log(selectedValues.value, 888)
//
total.value = res.total;
}).finally(() => {
loading.value = false;
});
}
function submitForm() {
if (isSubmitting.value) {
console.log('提交已被锁定,防止多次提交');
return; //
}
isSubmitting.value = true; //
// list
const list = [];
const params = new URLSearchParams(location.search);
// firstArrayquestionIdvalue
firstArray.value.forEach((parent, index) => {
list.push({
questionId: parent.questionId,
value: selectedValues.value[index]
});
});
// list便
console.log('生成的list:', list);
addLrnlpg({
list,
elderName: elderList.value.name,
birthDate: elderList.value.birthday,
elderNumber: elderList.value.sn,
elderProfileId: elderList.value.id,
elderQuestionnairePaperId: route.query.name,
gender: elderList.value.gender,
}).then(res => {
console.log(res)
})
}
function goBack() {
console.log('Cancel button clicked');
};
onMounted(() => {
});
</script>