main
parent
29cb357a1b
commit
444b7c550f
|
|
@ -43,6 +43,9 @@
|
||||||
<uv-checkbox
|
<uv-checkbox
|
||||||
:customStyle="{ margin: '8px' }"
|
:customStyle="{ margin: '8px' }"
|
||||||
v-for="(op, i) in item.options"
|
v-for="(op, i) in item.options"
|
||||||
|
:activeColor="
|
||||||
|
(op.selected!=op.is_true && op.selected) ? '#e3e3e3' : '#3678f7'
|
||||||
|
"
|
||||||
:key="i"
|
:key="i"
|
||||||
:label="op.text"
|
:label="op.text"
|
||||||
:name="i"
|
:name="i"
|
||||||
|
|
@ -50,9 +53,9 @@
|
||||||
<view class="flex items-center">
|
<view class="flex items-center">
|
||||||
<view>{{ op.text }}</view>
|
<view>{{ op.text }}</view>
|
||||||
<uv-icon
|
<uv-icon
|
||||||
v-if="op.selected"
|
v-if="op.selected || op.is_true"
|
||||||
:color="op.is_true ? '#ee2c37' : '#5ac725'"
|
:color="op.is_true&&op.selected ? '#4caf50' : '#ee2c37'"
|
||||||
:name="op.is_true ? 'checkbox-mark' : 'close'"
|
:name="op.is_true&&op.selected ? 'checkbox-mark' : 'close'"
|
||||||
></uv-icon>
|
></uv-icon>
|
||||||
</view>
|
</view>
|
||||||
</uv-checkbox>
|
</uv-checkbox>
|
||||||
|
|
@ -60,6 +63,7 @@
|
||||||
</template>
|
</template>
|
||||||
<template v-if="item.cate == 1">
|
<template v-if="item.cate == 1">
|
||||||
<uv-radio-group
|
<uv-radio-group
|
||||||
|
v-if="!readonly"
|
||||||
activeColor="#ee2c37"
|
activeColor="#ee2c37"
|
||||||
v-model="item.answer"
|
v-model="item.answer"
|
||||||
placement="column"
|
placement="column"
|
||||||
|
|
@ -81,6 +85,33 @@
|
||||||
</view>
|
</view>
|
||||||
</uv-radio>
|
</uv-radio>
|
||||||
</uv-radio-group>
|
</uv-radio-group>
|
||||||
|
<template v-else>
|
||||||
|
<uv-checkbox-group
|
||||||
|
activeColor="#ee2c37"
|
||||||
|
v-model="item.answer"
|
||||||
|
placement="column"
|
||||||
|
>
|
||||||
|
<uv-checkbox
|
||||||
|
:customStyle="{ margin: '8px' }"
|
||||||
|
v-for="(op, i) in item.options"
|
||||||
|
:activeColor="
|
||||||
|
(op.selected!=op.is_true && op.selected) ? '#e3e3e3' : '#3678f7'
|
||||||
|
"
|
||||||
|
:key="i"
|
||||||
|
:label="op.text"
|
||||||
|
:name="i"
|
||||||
|
>
|
||||||
|
<view class="flex items-center">
|
||||||
|
<view>{{ op.text }}</view>
|
||||||
|
<uv-icon
|
||||||
|
v-if="op.selected || op.is_true"
|
||||||
|
:color="op.is_true&&op.selected ? '#4caf50' : '#ee2c37'"
|
||||||
|
:name="op.is_true&&op.selected ? 'checkbox-mark' : 'close'"
|
||||||
|
></uv-icon>
|
||||||
|
</view>
|
||||||
|
</uv-checkbox>
|
||||||
|
</uv-checkbox-group>
|
||||||
|
</template>
|
||||||
</template>
|
</template>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -117,17 +148,30 @@ const loading = ref(false)
|
||||||
const list = computed(() => {
|
const list = computed(() => {
|
||||||
const content = info.value?.content ?? []
|
const content = info.value?.content ?? []
|
||||||
content.forEach((item) => {
|
content.forEach((item) => {
|
||||||
if (item.cate == 1) {
|
const trueIndices = item.options.reduce((indices, item, index) => {
|
||||||
item.answer = item.user_answer?.[0] ?? ''
|
if (item.is_true || item.selected) {
|
||||||
} else {
|
indices.push(index)
|
||||||
item.answer = item.user_answer ?? []
|
}
|
||||||
}
|
return indices
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
item.answer = trueIndices
|
||||||
|
// if (item.cate == 1) {
|
||||||
|
// item.answer = item.user_answer?.[0] ?? ''
|
||||||
|
// } else {
|
||||||
|
// item.answer = item.user_answer ?? []
|
||||||
|
// }
|
||||||
})
|
})
|
||||||
return info.value.content || []
|
return info.value.content || []
|
||||||
})
|
})
|
||||||
const total = computed(() => list.value.length)
|
const total = computed(() => list.value.length)
|
||||||
const readonly = computed(() => (info.value.finished_at ? true : false))
|
const readonly = computed(() => (info.value.finished_at ? true : false))
|
||||||
|
|
||||||
|
function findAllIndices(arr, predicate) {
|
||||||
|
console.log(arr)
|
||||||
|
return arr.filter(predicate).keys()
|
||||||
|
}
|
||||||
|
|
||||||
const answer = computed(() => {
|
const answer = computed(() => {
|
||||||
const arr = list.value.reduce((a, b) => {
|
const arr = list.value.reduce((a, b) => {
|
||||||
const c = [].concat(b.answer ?? [])
|
const c = [].concat(b.answer ?? [])
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,14 @@
|
||||||
}}</view>
|
}}</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mt-14rpx text-hex-999 text-26rpx"> {{ item?.content }} </view>
|
<view class="mt-14rpx text-hex-999 text-26rpx"> {{ item?.content }} </view>
|
||||||
|
<view
|
||||||
|
class="text-right text-hex-999 text-24rpx flex items-center justify-end"
|
||||||
|
>
|
||||||
|
<view class="flex items-center">
|
||||||
|
<view>点击查看详情</view>
|
||||||
|
<uv-icon size="22rpx" class="ml-10rpx" name="arrow-right"></uv-icon>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
<view class="absolute right-10rpx top-10rpx" v-if="item.is_read == 0">
|
<view class="absolute right-10rpx top-10rpx" v-if="item.is_read == 0">
|
||||||
<uv-badge :isDot="true" type="error"></uv-badge>
|
<uv-badge :isDot="true" type="error"></uv-badge>
|
||||||
</view>
|
</view>
|
||||||
|
|
@ -15,6 +23,34 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
import { timeFormat } from '@climblee/uv-ui/libs/function/index'
|
||||||
import statusFun from '@/utils/status'
|
import statusFun from '@/utils/status'
|
||||||
|
import { http } from '@/utils/request'
|
||||||
|
|
||||||
|
const pageData = {
|
||||||
|
task_hygienes: {
|
||||||
|
path: '/pages/task/detail',
|
||||||
|
},
|
||||||
|
reimbursements: {
|
||||||
|
path: '/pages/expense-account/detail',
|
||||||
|
},
|
||||||
|
employee_promotions: {
|
||||||
|
path: '/pages/work/detail',
|
||||||
|
},
|
||||||
|
employee_sign_repairs: {
|
||||||
|
path: '/pages/make-card/detail',
|
||||||
|
},
|
||||||
|
holiday_applies: {
|
||||||
|
path: '/pages/ask-leave/detail',
|
||||||
|
},
|
||||||
|
offical_business: {
|
||||||
|
path: '/pages/business/detail',
|
||||||
|
},
|
||||||
|
overtime_applies: {
|
||||||
|
path: '/pages/overtime/detail',
|
||||||
|
},
|
||||||
|
agreements: {
|
||||||
|
path: '/pages/contract/detail',
|
||||||
|
},
|
||||||
|
}
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
item: {
|
item: {
|
||||||
type: Object,
|
type: Object,
|
||||||
|
|
@ -23,11 +59,42 @@ const props = defineProps({
|
||||||
})
|
})
|
||||||
|
|
||||||
const onClick = () => {
|
const onClick = () => {
|
||||||
props.item.is_read = 1
|
// props.item.is_read = 1
|
||||||
|
|
||||||
|
const { type, is_read, id } = props.item
|
||||||
const { additional } = props.item
|
const { additional } = props.item
|
||||||
const { subject_id, subject_type } = additional.workflow_check
|
|
||||||
uni.navigateTo({
|
if (is_read == 0) {
|
||||||
url: `/pages/audits/detail?id=${subject_id}&type=${subject_type}`,
|
http.get(`/message/messages/${id}`)
|
||||||
})
|
props.item.is_read = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (type == 'approval') {
|
||||||
|
//详情
|
||||||
|
if (additional.workflow_check) {
|
||||||
|
const { subject_id, subject_type } = additional.workflow_check
|
||||||
|
const path = pageData[subject_type].path
|
||||||
|
if (path) {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `${path}?id=${subject_id}&type=${subject_type}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//审批
|
||||||
|
if (additional.workflow_log) {
|
||||||
|
const { check } = additional.workflow_log
|
||||||
|
const { subject_type, subject_id } = check
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/audits/detail?id=${subject_id}&type=${subject_type}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else if (type == 'exam') {
|
||||||
|
//考试
|
||||||
|
const { paper } = additional
|
||||||
|
const { id } = paper
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/examination/detail?id=${id}`,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@
|
||||||
<view
|
<view
|
||||||
class="font-600 flex-center h-80rpx"
|
class="font-600 flex-center h-80rpx"
|
||||||
:class="[
|
:class="[
|
||||||
ledger.sales_growth_rate < 0 ? 'text-primary' : 'text-green',
|
ledger.sales_growth_rate > 0 ? 'text-primary' : 'text-green',
|
||||||
]"
|
]"
|
||||||
>{{ ledger.sales_growth_rate }}%</view
|
>{{ ledger.sales_growth_rate }}%</view
|
||||||
>
|
>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue