main
unknown 2024-04-25 19:52:40 +08:00
parent 60108397c9
commit 2103dfff4e
5 changed files with 150 additions and 20 deletions

View File

@ -340,6 +340,12 @@
"style": {
"navigationBarTitleText": "审核详情"
}
},
{
"path": "log",
"style": {
"navigationBarTitleText": "审核流程"
}
}
]
}

View File

@ -1,24 +1,48 @@
<template>
<!-- <uv-list v-if="colums.length && data && Object.keys(data).length">
<template v-for="(item, i) in columsList" :key="i">
<slot :slotName="item.dataIndex" :data="item">
<uv-list-item :title="item.title" :right-text="item?.value">
</uv-list-item>
</slot>
</template>
</uv-list> -->
<uv-form labelWidth="160rpx">
<template v-for="(item, i) in columsList" :key="i">
<slot :slotName="item.dataIndex" :data="item">
<uv-form-item :label="item.title" :labelPosition="item.labelPosition">
<uv-input inputAlign="right" :border="`none`" v-model="item.value"></uv-input>
</uv-form-item>
</slot>
<uv-form-item
v-if="item.type == 'album'"
:label="item.title"
labelPosition="top"
>
<!-- {{ item.value }} -->
<view class="mt-20rpx w-full">
<uv-album
multipleSize="190rpx"
singleSize="190rpx"
:urls="item.value"
:rowCount="3"
space="18rpx"
:showMore="false"
></uv-album>
</view>
</uv-form-item>
<uv-form-item
v-else
:label="item.title"
:labelPosition="item.labelPosition"
>
<view
class="w-full text-hex-999"
:style="[addStyle(item.customStyle)]"
:class="[
[item.labelPosition == 'top' ? 'text-left mt-10rpx' : 'text-right'],
]"
>{{ item.value }}</view
>
</uv-form-item>
<uv-line
v-if="i < columsList.length - 1 && (item?.bottomBorder || true)"
color="#f5f5f5"
></uv-line>
</template>
</uv-form>
</template>
<script setup>
import { computed } from 'vue'
import { addStyle } from '@climblee/uv-ui/libs/function/index'
const props = defineProps({
colums: {
@ -35,9 +59,7 @@ const columsList = computed(() => {
const arr = []
props.colums.forEach((e) => {
const { dataIndex, format } = e
// console.log(props.data)
// props.data[dataIndex]
let str =getValue(props.data,dataIndex)
let str = getValue(props.data, dataIndex)
if (isFunction(format)) {
str = format(str)
}

View File

@ -9,6 +9,8 @@ export default {
{
title: '所属门店',
dataIndex: 'taskable.store.address',
borderBottom: false,
labelPosition: 'top'
},
{
title: '电话号码',
@ -27,6 +29,7 @@ export default {
{
title: '清洁结果',
dataIndex: 'taskable.photos',
type: 'album',
},
]
}

View File

@ -1,22 +1,108 @@
<template>
<view>
<CuNavbar title="任务详情">
<!-- <BaseData ></BaseData> -->
<template #right>
<view class="text-sm text-white" @click="goPath('/pages/audits/log')"></view>
</template>
</CuNavbar>
{{ colums }}
<view class="px-base mt-30rpx">
<view class="card-shadow bg-white rounded-19rpx px-base">
<BaseData :colums="colums" :data="data"></BaseData>
</view>
</view>
<view class="h-100rpx">
<view
class="fixed bottom-0 left-0 right-0 h-120rpx bg-white flex items-center px-base space-x-30rpx"
>
<view class="flex-1">
<uv-button @click="onJj" color="#999999" shape="circle" plain block>
拒绝
</uv-button>
</view>
<view class="flex-1">
<uv-button type="primary" shape="circle" block @click="onTg">
通过
</uv-button>
</view>
</view>
</view>
<uv-modal
ref="modalRef"
title="提示"
:content="modelOptions.content"
@confirm="modelOptions.onConfirm"
:showCancelButton="true"
>
<view class="flex-1" v-if="modelOptions.isValue">
<view class="w-full">
<uv-textarea v-model="value" placeholder="拒绝原因"></uv-textarea>
</view>
</view>
</uv-modal>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
import { onLoad } from '@dcloudio/uni-app'
import { ref, computed } from 'vue'
import { ref, computed, reactive } from 'vue'
import { http } from '@/utils/request'
import BaseData from './base-data.vue'
import datajson from './data.data'
const value = ref('')
const colums = computed(() => datajson[type.value] ?? [])
const id = ref(null)
const type = ref(null)
const data = ref(null)
const modalRef = ref(null)
const modelOptions = reactive({
title: '提示',
content: '确定通过吗?',
isValue: false,
onConfirm: () => {},
})
const onConfirm = async () => {
try {
await http.post(
`/workflow/${id.value}/check`,
{
subject_type: type.value,
status: !modelOptions.isValue,
remarks: modelOptions.isValue ? value.value : '',
},
{
headers: {
Accept: 'application/json',
},
}
)
uni.$emit('audits:onRefresh')
uni.navigateBack()
} catch (error) {}
}
const onTg = () => {
value.value = ''
modelOptions.title = '提示'
modelOptions.content = '确定通过吗?'
modelOptions.isValue = false
modelOptions.onConfirm = onConfirm
modalRef.value.open()
}
const onJj = () => {
value.value = ''
modelOptions.title = '拒绝原因'
modelOptions.content = '确定拒绝吗?'
modelOptions.isValue = true
modelOptions.onConfirm = onConfirm
modalRef.value.open()
}
onLoad((opt) => {
id.value = opt.id
type.value = opt.type
@ -29,7 +115,12 @@ const getData = async () => {
subject_type: type.value,
},
})
data.value = resData
console.log(resData)
}
const goPath = (url) => {
uni.navigateTo({ url })
}
</script>

View File

@ -0,0 +1,8 @@
<template>
<view>
<CuNavbar title="审核流程"></CuNavbar>
</view>
</template>
<script setup>
import CuNavbar from '@/components/cu-navbar/index'
</script>