监督考核页面优化(页面显示、数据等等)
This commit is contained in:
parent
f0aedc78f8
commit
535d509445
|
@ -1,10 +1,11 @@
|
||||||
// page {
|
page {
|
||||||
// background-color: #e9eef4;
|
position: relative;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// .container {
|
.container {
|
||||||
// background-color: #e9eef4;
|
width: 100%;
|
||||||
// }
|
|
||||||
|
}
|
||||||
|
|
||||||
.picker {
|
.picker {
|
||||||
padding: 30rpx 30rpx;
|
padding: 30rpx 30rpx;
|
||||||
|
|
|
@ -37,40 +37,31 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<nut-form>
|
|
||||||
<nut-form-item label-width="50" label="备注">
|
|
||||||
<nut-input v-model="_form.remark" placeholder="请输入备注" type="text" />
|
|
||||||
</nut-form-item>
|
|
||||||
</nut-form>
|
|
||||||
<!-- 签字 -->
|
|
||||||
<view>
|
<view>
|
||||||
<nut-form labelWidth="320rpx" labelAlign="left">
|
<nut-form labelWidth="320rpx" labelAlign="left">
|
||||||
|
<nut-form-item label="备注">
|
||||||
|
<nut-input v-model="_form.remark" placeholder="请输入备注" type="text" />
|
||||||
|
</nut-form-item>
|
||||||
|
|
||||||
<nut-form-item label="考核人员签字:">
|
<nut-form-item label="考核人员签字:">
|
||||||
<navigator :url="`/subPages/select/signature/signature?index=${1}`" hover-class="navigator-hover">
|
<navigator :url="`/subPages/select/signature/signature?index=${1}`" hover-class="navigator-hover">
|
||||||
<nut-button style="height: 50rpx" shape="square" type="info">考核人员签字</nut-button>
|
<image v-if="_form.assessmentUserSignature" :src="_form.assessmentUserSignature" mode="heightFix" style="height: 80rpx"></image>
|
||||||
|
<nut-button v-else style="height: 50rpx" shape="square" type="info">考核人员签字</nut-button>
|
||||||
</navigator>
|
</navigator>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<nut-form-item v-if="mydailycolors">
|
|
||||||
<view style="padding: 0">
|
|
||||||
<image :src="mydailycolors"></image>
|
|
||||||
</view>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="被考评学校签名:">
|
<nut-form-item label="被考评学校签名:">
|
||||||
<navigator :url="`/subPages/select/signature/signature?index=${2}`" hover-class="navigator-hover">
|
<navigator :url="`/subPages/select/signature/signature?index=${2}`" hover-class="navigator-hover">
|
||||||
<nut-button style="height: 50rpx" shape="square" type="info">被考评学校负责人</nut-button>
|
<image v-if="_form.byAssessmentEnterprisesUnitUserSignature" :src="_form.byAssessmentEnterprisesUnitUserSignature" mode="heightFix" style="height: 80rpx"></image>
|
||||||
|
<nut-button v-else style="height: 50rpx" shape="square" type="info">被考评学校负责人</nut-button>
|
||||||
</navigator>
|
</navigator>
|
||||||
</nut-form-item>
|
</nut-form-item>
|
||||||
<nut-form-item v-if="mydailycolorschools">
|
|
||||||
<view style="padding: 0">
|
|
||||||
<image :src="mydailycolorschools"></image>
|
|
||||||
</view>
|
|
||||||
</nut-form-item>
|
|
||||||
<nut-form-item label="确认:">
|
|
||||||
<nut-button style="height: 50rpx" shape="square" type="info" @click="onSubmit">确认提交</nut-button>
|
|
||||||
</nut-form-item>
|
|
||||||
<view style="height: 20px"></view>
|
|
||||||
</nut-form>
|
</nut-form>
|
||||||
</view>
|
</view>
|
||||||
|
<view style="height: 150rpx"></view>
|
||||||
|
<view style="display: flex; width: 100%; justify-content: center; position: fixed; bottom: 50rpx">
|
||||||
|
<nut-button shape="round" type="info" @click="onSubmit" style="height: 80rpx; width: 702rpx; margin: 10rpx auto">确认提交</nut-button>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
@ -100,19 +91,16 @@ watch(
|
||||||
([newDaily, newBase64_1, newBase64_2]) => {
|
([newDaily, newBase64_1, newBase64_2]) => {
|
||||||
_form.assessmentUserSignature = newBase64_1
|
_form.assessmentUserSignature = newBase64_1
|
||||||
_form.byAssessmentEnterprisesUnitUserSignature = newBase64_2
|
_form.byAssessmentEnterprisesUnitUserSignature = newBase64_2
|
||||||
console.log('watch_______________', _form)
|
|
||||||
|
|
||||||
if (newDaily.length > 0) {
|
if (newDaily.length > 0) {
|
||||||
starRating.value = newDaily
|
starRating.value = newDaily
|
||||||
}
|
}
|
||||||
submitData.value = newDaily
|
submitData.value = newDaily
|
||||||
|
console.log('watch_______________', _form, submitData.value)
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
const mydailycolors = ref('')
|
|
||||||
const mydailycolorschools = ref('')
|
|
||||||
|
|
||||||
useLoad(async () => {
|
useLoad(async () => {
|
||||||
await getUnitEnterprisesUnitList()
|
await getUnitEnterprisesUnitList()
|
||||||
})
|
})
|
||||||
|
@ -149,17 +137,42 @@ interface CkProjectListByType {
|
||||||
/**
|
/**
|
||||||
* @assessmentCriteriaRulesByCkProjectId 获取考核规则
|
* @assessmentCriteriaRulesByCkProjectId 获取考核规则
|
||||||
*/
|
*/
|
||||||
|
interface StandardList {
|
||||||
|
ckItemId: string
|
||||||
|
deductionPoints: number
|
||||||
|
name: string
|
||||||
|
snowFlakeId: string
|
||||||
|
}
|
||||||
|
interface ItemList {
|
||||||
|
ckGroupId: string
|
||||||
|
name: string
|
||||||
|
remark: string
|
||||||
|
snowFlakeId: string
|
||||||
|
standardList: StandardList[]
|
||||||
|
type: { value: string; label: string }
|
||||||
|
selectedID: string
|
||||||
|
selected_points: number
|
||||||
|
selectedGroup: string[]
|
||||||
|
}
|
||||||
|
interface StarRating {
|
||||||
|
itemList: ItemList[]
|
||||||
|
name: string
|
||||||
|
remark: string
|
||||||
|
snowFlakeId: string
|
||||||
|
totalScore: number
|
||||||
|
currentScore: number
|
||||||
|
}
|
||||||
const assessmentCriteriaRulesByCkProjectId = async function (ckProjectId) {
|
const assessmentCriteriaRulesByCkProjectId = async function (ckProjectId) {
|
||||||
Taro.showLoading({
|
Taro.showLoading({
|
||||||
title: '加载中...',
|
title: '加载中...',
|
||||||
mask: true,
|
mask: true,
|
||||||
})
|
})
|
||||||
const res = await api.get<any[]>(`/assessmentCriteria/assessmentCriteriaRulesByCkProjectId`, { ckProjectId })
|
const res = await api.get<StarRating[]>(`/assessmentCriteria/assessmentCriteriaRulesByCkProjectId`, { ckProjectId })
|
||||||
// ————————————————————————————————————————处理数据,默认添加已选择项
|
// ————————————————————————————————————————处理数据,默认添加已选择项
|
||||||
res.data?.forEach((item) => {
|
res.data?.forEach((item) => {
|
||||||
item.currentScore = 0
|
item.currentScore = 0
|
||||||
|
|
||||||
item.itemList.forEach((element) => {
|
item.itemList.forEach((element: ItemList) => {
|
||||||
// element.selectedID = element.standardList[0].snowFlakeId
|
// element.selectedID = element.standardList[0].snowFlakeId
|
||||||
element.standardList.unshift({
|
element.standardList.unshift({
|
||||||
ckItemId: 'null',
|
ckItemId: 'null',
|
||||||
|
@ -257,9 +270,9 @@ const onSubmit = async function () {
|
||||||
mask: true,
|
mask: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
submitData.value.forEach((element) => {
|
submitData.value.forEach((element: StarRating) => {
|
||||||
element?.itemList.forEach((item) => {
|
element?.itemList.forEach((item: ItemList) => {
|
||||||
item.standardList.forEach((ele) => {
|
item.standardList.forEach((ele: StandardList) => {
|
||||||
if (ele.snowFlakeId === item.selectedID && !item.hasOwnProperty('selectedGroup') && item.selectedID != 'null') {
|
if (ele.snowFlakeId === item.selectedID && !item.hasOwnProperty('selectedGroup') && item.selectedID != 'null') {
|
||||||
assessmentRecordDetails.value.push({
|
assessmentRecordDetails.value.push({
|
||||||
ckGroupId: element.snowFlakeId, //选项的雪花Id
|
ckGroupId: element.snowFlakeId, //选项的雪花Id
|
||||||
|
@ -270,15 +283,16 @@ const onSubmit = async function () {
|
||||||
})
|
})
|
||||||
if (item.hasOwnProperty('selectedGroup')) {
|
if (item.hasOwnProperty('selectedGroup')) {
|
||||||
item.selectedGroup.forEach((selectedItem) => {
|
item.selectedGroup.forEach((selectedItem) => {
|
||||||
console.log(selectedItem)
|
item.standardList.forEach((standard_Element) => {
|
||||||
if (selectedItem != 'null') {
|
if (selectedItem != 'null' && selectedItem === standard_Element.snowFlakeId) {
|
||||||
assessmentRecordDetails.value.push({
|
assessmentRecordDetails.value.push({
|
||||||
ckGroupId: element.snowFlakeId, //选项的雪花Id
|
ckGroupId: element.snowFlakeId, //选项的雪花Id
|
||||||
ckItemId: item.snowFlakeId, //已选择的ID
|
ckItemId: standard_Element.ckItemId, //已选择的ID
|
||||||
ckStandardId: selectedItem, //已选择的雪花ID
|
ckStandardId: selectedItem, //已选择的雪花ID
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,17 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<nut-signature @confirm="confirm" @clear="clear"></nut-signature>
|
<nut-signature @confirm="confirm" @clear="clear"></nut-signature>
|
||||||
<img v-if="imgData" :src="imgData" class="imgData" style="width: 100%" />
|
<image mode="widthFix" v-if="imgData" :src="imgData" style="width: 100%"></image>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useDailyStore } from '@/store/daily'
|
import { useDailyStore } from '@/store/daily'
|
||||||
const store = useDailyStore()
|
const store = useDailyStore()
|
||||||
import Taro, { useLoad } from '@tarojs/taro'
|
import Taro, { useLoad } from '@tarojs/taro'
|
||||||
import { ref } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
|
const base64_1 = computed(() => store.get_base64_1)
|
||||||
|
const base64_2 = computed(() => store.get_base64_2)
|
||||||
|
|
||||||
const _index = ref(0)
|
const _index = ref(0)
|
||||||
useLoad((options) => {
|
useLoad((options) => {
|
||||||
console.log(options)
|
console.log(options)
|
||||||
_index.value = Number(options.index)
|
_index.value = Number(options.index)
|
||||||
|
if (_index.value === 1) {
|
||||||
|
imgData.value = base64_1.value
|
||||||
|
} else {
|
||||||
|
imgData.value = base64_2.value
|
||||||
|
}
|
||||||
})
|
})
|
||||||
const imgData = ref('')
|
const imgData = ref('')
|
||||||
const convertToBase64 = (imgUrl: string): Promise<string> => {
|
const convertToBase64 = (imgUrl: string): Promise<string> => {
|
||||||
|
@ -21,6 +28,7 @@ const convertToBase64 = (imgUrl: string): Promise<string> => {
|
||||||
filePath: imgUrl, // 本地路径
|
filePath: imgUrl, // 本地路径
|
||||||
encoding: 'base64',
|
encoding: 'base64',
|
||||||
success(res) {
|
success(res) {
|
||||||
|
// resolve({})
|
||||||
resolve('data:image/png;base64,' + res.data) // 前缀加上 image 类型,适应 img 标签
|
resolve('data:image/png;base64,' + res.data) // 前缀加上 image 类型,适应 img 标签
|
||||||
},
|
},
|
||||||
fail(err) {
|
fail(err) {
|
||||||
|
@ -31,14 +39,17 @@ const convertToBase64 = (imgUrl: string): Promise<string> => {
|
||||||
}
|
}
|
||||||
const confirm = async (canvas: any, data: string) => {
|
const confirm = async (canvas: any, data: string) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
imgData.value = data
|
|
||||||
console.log('imgData', canvas, data)
|
console.log('imgData', canvas, data)
|
||||||
try {
|
try {
|
||||||
const base64Image = await convertToBase64(data)
|
const base64Image = await convertToBase64(data)
|
||||||
if (_index.value === 1) {
|
if (_index.value === 1) {
|
||||||
|
// imgData.value = base64Image
|
||||||
store.change_base64_1(base64Image)
|
store.change_base64_1(base64Image)
|
||||||
|
Taro.navigateBack({ delta: 1 })
|
||||||
} else {
|
} else {
|
||||||
|
// imgData.value = base64Image
|
||||||
store.change_base64_2(base64Image)
|
store.change_base64_2(base64Image)
|
||||||
|
Taro.navigateBack({ delta: 1 })
|
||||||
}
|
}
|
||||||
// console.log('Base64 Image:', base64Image)
|
// console.log('Base64 Image:', base64Image)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|
Loading…
Reference in New Issue