Merge pull request 'fix : 修复审核意见位置' (#284) from dj into master

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/284
This commit is contained in:
2024-06-04 16:51:52 +00:00
11 changed files with 252 additions and 69 deletions

View File

@@ -1,27 +1,37 @@
<template>
<div v-loading="loading">
<div v-loading="loading">
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
<el-form :model="formData" label-width="auto" >
<el-form :model="formData" label-width="auto">
<file-component :title="getTagName(type)+'附件'" :tag="getTagName(type)"
v-model:value="formData.fileList" :processViewer="processViewer"
:file-list-show="fileListShow"/>
</el-form>
<div v-if="data.taskId">
<baseTitle title="审核意见"></baseTitle>
<el-form-item prop="_value">
<el-input
v-model="_value"
:rows="3"
type="textarea"
placeholder="请输入审核意见"
/>
</el-form-item>
</div>
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processViewer" :operation-list="data.operationList"
:state="data.state"/>
<process-diagram-viewer v-if="processViewer" :id-name="type"/>
</div>
<baseTitle title="审批记录"></baseTitle>
<div class="process">
<operation-render v-if="processViewer" :operation-list="data.operationList"
:state="data.state"/>
<process-diagram-viewer v-if="processViewer" :id-name="type"/>
</div>
</div>
</div>
</template>
<script setup lang="jsx">
import { computed, markRaw, reactive, ref, watchEffect } from 'vue';
import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue';
import { ElLoading } from 'element-plus';
import {ElLoading} from 'element-plus';
import {downloadFile} from "@/api/project-demand";
const props = defineProps({
@@ -53,12 +63,16 @@ const props = defineProps({
loading: {
type: Boolean,
default: false
},
value: {
type: String,
default: ''
}
})
const form = ref()
const schema = computed(()=>{
const schema = computed(() => {
let arr
if(props.type == 'approval') {
if (props.type == 'approval') {
arr = [
{
label: '前置流程',
@@ -73,24 +87,24 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
<div>
{
props.formData.singleFile?.originalFileName?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
>
component: () => (
<div>
{
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
<span>{'--'}</span>
}
</div>
<span>{'--'}</span>
}
</div>
)
},
]
} else if(props.type == 'execute') {
} else if (props.type == 'execute') {
arr = [
{
label: '前置流程',
@@ -105,13 +119,13 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
component: () => (
<div>
{
props.formData.singleFile?.originalFileName?
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
@@ -122,7 +136,7 @@ const schema = computed(()=>{
)
},
]
} else if(props.type == 'archivist'){
} else if (props.type == 'archivist') {
arr = [
{
label: '项目归档附件',
@@ -130,13 +144,13 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
component: () => (
<div>
{
props.formData.singleFile?.originalFileName?
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
@@ -147,7 +161,7 @@ const schema = computed(()=>{
)
},
]
} else if(props.type == 'phase'){
} else if (props.type == 'phase') {
arr = [
{
label: '阶段变更附件',
@@ -155,13 +169,13 @@ const schema = computed(()=>{
colProps: {
span: 24
},
component: ()=>(
component: () => (
<div>
{
props.formData.singleFile?.originalFileName?
props.formData.singleFile?.originalFileName ?
<span
style={{color: '#409EFF', cursor: 'pointer'}}
onClick={()=>handleDownload(props.formData.singleFile)}
onClick={() => handleDownload(props.formData.singleFile)}
>
{props.formData.singleFile?.originalFileName}
</span> :
@@ -175,6 +189,17 @@ const schema = computed(()=>{
}
return arr
})
const emit = defineEmits(['update:value'])
const _value = computed({
get() {
return props.value;
},
set(val) {
emit("update:value", val);
}
})
const getTagName = (type) => {
switch (type) {
case 'approval':
@@ -198,7 +223,7 @@ const handleDownload = (row) => {
loading.close()
})
}
watchEffect(()=>{
watchEffect(() => {
Object.keys(props.formData).length && (form.value.setValues(props.formData))
})

View File

@@ -42,6 +42,19 @@
v-model:value="formData.fileList" :processViewer="processViewer"
:file-list-show="fileListShow"/>
</el-col>
<el-col :span="24">
<div v-if="data.taskId">
<baseTitle title="审核意见"></baseTitle>
<el-form-item prop="_value">
<el-input
v-model="_value"
:rows="3"
type="textarea"
placeholder="请输入审核意见"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
@@ -60,6 +73,7 @@ import OperationRender from '@/views/workflow/common/OperationRender.vue'
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
import {downloadFile} from "@/api/project-demand";
const emit = defineEmits(['update:value'])
const props = defineProps({
formData: {
type: Array,
@@ -88,8 +102,23 @@ const props = defineProps({
type: {
type: String,
default: ''
},
value: {
type: String,
default: ''
}
})
const _value = computed({
get() {
return props.value;
},
set(val) {
emit("update:value", val);
}
})
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])

View File

@@ -1,6 +1,6 @@
<template>
<baseTitle title="审核意见"></baseTitle>
<fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>
<!-- <baseTitle title="审核意见"></baseTitle>-->
<!-- <fvForm :schema="schema" @getInstance="(e)=>form = e"></fvForm>-->
<div class="oper-page-btn">
<el-button type="danger" @click="handleReject">驳回</el-button>
<el-button color="#DED0B2" @click="handleAgree">同意</el-button>
@@ -23,6 +23,10 @@ const props = defineProps({
formData: {
type: Object,
default: {}
},
value: {
type: String,
default: ''
}
})
@@ -44,6 +48,14 @@ const schema = computed(() => {
}
]
})
const _value = computed({
get() {
return props.value;
},
set(val) {
emit("update:value", val);
}
})
const back = () => {
switch (route.name) {
case 'Initiation/detail':
@@ -91,17 +103,25 @@ const back = () => {
}
break;
case 'Share/detail':
router.push({name: 'Expense/share'})
if (route.query.source === 'home') {
router.push('/home')
} else {
router.push({name: 'Expense/share'})
}
break;
case 'Phase/detail':
router.push({name: 'Implementation'})
if (route.query.source === 'home') {
router.push('/home')
} else {
router.push({name: 'Implementation'})
}
break;
}
}
// 驳回
const handleReject = async () => {
const values = form.value.getValues()
if (!values.auditOpinion) {
// const values = form.value.getValues()
if (!_value.value) {
ElNotification({
title: '提示',
message: '请填写审核意见',
@@ -111,8 +131,10 @@ const handleReject = async () => {
}
const params = {
taskId: props.taskId,
...values
// ...values
auditOpinion: _value.value
}
console.log('params', params)
const res = await rejectTask(params)
ElNotification({
title: '提示',
@@ -124,11 +146,11 @@ const handleReject = async () => {
}
const handleAgree = async () => {
const values = form.value.getValues()
// const values = form.value.getValues()
const params = {
taskId: props.taskId,
formData: props.formData,
...values
auditOpinion: _value.value
}
const res = await agreeTask(params)
ElNotification({

View File

@@ -136,6 +136,19 @@
v-model:value="localFormData.fileList" :processViewer="processViewer"
:file-list-show="fileListShow"/>
</el-col>
<el-col :span="24">
<div v-if="data.taskId">
<baseTitle title="审核意见"></baseTitle>
<el-form-item prop="_value">
<el-input
v-model="_value"
:rows="3"
type="textarea"
placeholder="请输入审核意见"
/>
</el-form-item>
</div>
</el-col>
</el-row>
<div class="approval-record">
<baseTitle title="审批记录"></baseTitle>
@@ -159,6 +172,7 @@ import {useCacheStore} from '@/stores/cache.js'
import {getSubCompOpt} from "@/api/user/user";
import FileComponent from "./FileComponent.vue";
const emit = defineEmits(['update:value'])
const tagsViewStore = useTagsView()
const cacheStore = useCacheStore()
const props = defineProps({
@@ -181,6 +195,10 @@ const props = defineProps({
loading: {
type: Boolean,
default: false
},
value: {
type: String,
default: ''
}
})
const localFormData = ref({})
@@ -191,6 +209,14 @@ const dictName = ref({})
const rules = reactive({
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
})
const _value = computed({
get() {
return props.value;
},
set(val) {
emit("update:value", val);
}
})
const filterDict = (data, value) => {
if (data === undefined || value === undefined) return;
let label = ''

42
src/utils/date.js Normal file
View File

@@ -0,0 +1,42 @@
export const dateFormat = (time = new Date().getTime(),flag) => { //YYYY年MM月DD日 星期d
const _time = time.toString().length > 10 ? time : time * 1000
const weekList = ["日","一", "二", "三", "四", "五", "六" ];
const date = new Date(_time);
const Y = date.getFullYear();
const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1);
const Mm = (date.getMonth() + 1 < 10 ? (date.getMonth() + 1) : date.getMonth() + 1);
const D = (date.getDate() < 10 ? '0' + date.getDate() : date.getDate());
const h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
const m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
const s = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds());
let weekDay = new Date().getDay();
const week= weekList[weekDay]
// const strDate = `${Y}/${M}/${D} ${h}:${m}:${s}`
if(flag){
return `${Mm}`;
}else {
return `${Y}${M}${D}日 星期${week}`;
}
}
export const getNowFormatDate = (flag) => {
let date = new Date(),
year = date.getFullYear(), //获取完整的年份(4位)
month = date.getMonth() + 1, //获取当前月份(0-11,0代表1月)
strDate = date.getDate() // 获取当前日(1-31)
if (month < 10) month = `0${month}` // 如果月份是个位数在前面补0
if (strDate < 10) strDate = `0${strDate}` // 如果日是个位数在前面补0
if(flag){
return `${year}-${month}-${strDate}`
}else {
return `${year}-${month}`
}
}
export default {
dateFormat,
getNowFormatDate
}

View File

@@ -193,6 +193,24 @@ const handleView = (row) => {
source: 'home'
}
})
}else if (row.targetState == '80' && row.targetId) {
router.push({
name: 'Share/detail',
query: {
id: row.targetId,
state: row.state,
source: 'home'
}
})
}else if (row.targetState == '90' && row.targetId) {
router.push({
name: 'Phase/detail',
query: {
id: row.targetId,
state: row.state,
source: 'home'
}
})
}
}
</script>

View File

@@ -23,9 +23,9 @@
<el-config-provider>
<el-date-picker
v-model="formData.deadline"
type="datetime"
type="date"
placeholder="截止时间"
value-format="YYYY-MM-DD HH:mm:ss"
value-format="YYYY-MM-DD"
/>
</el-config-provider>
</el-form-item>
@@ -317,7 +317,6 @@ const handleResubmit = () => {
const getDetailInfo = async () => {
getFormInfo(route.query.id).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
formData.value = res.data
showTinymce.value = false
showTable.value = false
@@ -326,7 +325,11 @@ const getDetailInfo = async () => {
showTable.value = true
})
} else {
ElMessage.error(res.msg)
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}
})
}
@@ -341,13 +344,21 @@ const handleDelete = (row) => {
type: 'warning'
}).then(() => {
deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
ElMessage.success("删除成功");
formData.value.fileList.splice(formData.value.fileList.findIndex((item) => item.id === row.fileId), 1);
}
});
}).catch(() => {
ElMessage.warning("用户取消删除! ");
ElNotification({
title: '提示',
message: '用户取消删除! ',
type: 'warning'
})
})
}

View File

@@ -2,8 +2,8 @@
<baseTitle title="需求征集详情"></baseTitle>
<collection-detail :formData="collectData.formData" :data="collectData" type="singleDetail"
:fileListShow="fileListShow"
:processViewer="processViewer" :loading="loading"/>
<opinion v-if="collectData.taskId" :formData="formData" :taskId="collectData.taskId"></opinion>
:processViewer="processViewer" :loading="loading" v-model:value="auditOpinion"/>
<opinion v-if="collectData.taskId" :formData="formData" :taskId="collectData.taskId" v-model:value="auditOpinion"></opinion>
</template>
<script setup lang="jsx">
@@ -25,6 +25,7 @@ const specialFundOption = ref([])
const processInstanceData = ref({})
const fileListShow = ref("READ")
const showTable = ref(false)
const auditOpinion = ref('')
const processViewer = ref(false)
const processTree = ref()
const collectData = ref([])

View File

@@ -238,7 +238,7 @@
<!-- </div>-->
</div>
<div class="oper-page-btn">
<el-button type="info" @click="staging">存为草稿</el-button>
<!-- <el-button type="info" @click="staging">存为草稿</el-button>-->
<el-button color="#DED0B2" v-if="name==='Summary/add'" @click="handleSubmit(summaryForm)">发布</el-button>
<el-button color="#DED0B2" v-else @click="handleResubmit">重新发布</el-button>
</div>

View File

@@ -1,19 +1,26 @@
<template>
<steps :active="route.query.id==='-1'?0:1" @setDetail="setDetail" @stepChange="stepChange" :reportType="route.query.id==='-1'?'direct':''">
<steps :active="route.query.id==='-1'?0:1" @setDetail="setDetail" @stepChange="stepChange"
:reportType="route.query.id==='-1'?'direct':''">
<template #content>
<collection-detail v-show="showActive == '00'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<summary-detail v-show="showActive == '10'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<ApprovalDetail v-show="showActive == '20'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<ApprovalDetail type="execute" v-show="showActive == '40'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"
v-model:value="auditOpinion"/>
<ApprovalDetail type="archivist" v-show="showActive == '50'" :formData="summaryData.formData" :data="summaryData"
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"/>
:processViewer="summaryProcessViewer" :loading="loading" :fileListShow="fileListShow"
v-model:value="auditOpinion"/>
</template>
</steps>
<opinion v-if="summaryData.taskId" :formData="summaryData.formData" :taskId="summaryData.taskId"></opinion>
<opinion v-if="summaryData.taskId" :formData="summaryData.formData" :taskId="summaryData.taskId"
v-model:value="auditOpinion"></opinion>
</template>
<script setup lang="jsx">
@@ -30,14 +37,15 @@ const loading = ref(false)
const fileListShow = ref('READ')
const processStore = useProcessStore()
const active = ref(route.query.state)
const auditOpinion = ref('')
const showActive = ref()
const getInfo = async (state) => {
fileListShow.value='READ'
fileListShow.value = 'READ'
const projectId = route.query.projectId
summaryProcessViewer.value = false
loading.value = true
const {code, data,msg} = await getMapProjectStateInfo(projectId, state)
if(code===1000){
const {code, data, msg} = await getMapProjectStateInfo(projectId, state)
if (code === 1000) {
summaryData.value = data;
loading.value = false
processStore.setDesign(data)
@@ -52,14 +60,14 @@ const getInfo = async (state) => {
fileListShow.value = data.formPermMap["fileList"].perm
}
})
}else {
} else {
ElNotification({
title: '提示',
message: msg,
type: 'error'
type: 'error'
})
if(msg==='查询结果为空'){
summaryData.value=[]
if (msg === '查询结果为空') {
summaryData.value = []
}
loading.value = false
}
@@ -71,6 +79,7 @@ const setDetail = (active) => {
}
const stepChange = (data) => {
auditOpinion.value = ''
showActive.value = data.active
getInfo(data.active)
}

View File

@@ -46,7 +46,7 @@ const processKeyChange = () => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
type: 'error'
})
}
})