Merge pull request 'master' (#984) from master into prod

Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/984
This commit is contained in:
2025-04-14 13:19:48 +00:00
9 changed files with 395 additions and 46 deletions

View File

@@ -68,6 +68,13 @@ export const editAllocation = (data) => {
data
});
};
export const applyCcSend = (data) => {
return request({
url: '/workflow/mosr/cc/send',
method: "post",
data
});
};
export const deleteAllocation = (id) => {
return request({
url: `/workflow/mosr/cost/allocation/${id}`,

View File

@@ -226,3 +226,15 @@ export const ledgerTemplateDownload = () => {
}
);
};
//费用明细模板下载
export const costTemplateDownload = () => {
return axios.get(
`${import.meta.env.VITE_BASE_URL}/workflow/mosr/rd/expense/download/template`,
{
responseType: 'blob',
headers: {
Authorization: getToken()
}
}
);
};

View File

@@ -0,0 +1,114 @@
<template>
<el-upload :file-list="[]"
:limit="maxSize"
with-credentials
:multiple="multiple"
:http-request="httpRequestHandle"
:data="uploadParams"
:auto-upload="true"
:show-file-list="false"
:before-upload="beforeUpload"
:before-remove="beforeRemove"
:on-remove="handleRemove"
>
<el-button color="#DED0B2" style="margin-right: 10px;" :disabled="disabled">导入</el-button>
</el-upload>
</template>
<script setup>
import {ElMessageBox, ElNotification} from "element-plus";
import {getToken} from '@/utils/auth'
import axios from "axios";
const props = defineProps({
value: {
type: Array,
default: () => {
return []
}
},
maxSize: {
type: Number,
default: 30
},
disabled: {
type: Boolean,
default: false
},
multiple: {
type: Boolean,
default: false
},
})
const baseURL = import.meta.env.VITE_BASE_URL
const uploadFileUrl = ref(baseURL + "/workflow/mosr/rd/expense/import")
const headers = reactive({
authorization: getToken()
})
// const loading = ref(false)
const uploadParams = ref({})
const emit = defineEmits(["input", "getFile", "delete"])
const beforeRemove = (file) => {
return ElMessageBox.confirm(`确认删除名称为${file.name}的文件吗?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => true)
}
const handleRemove = (file) => {
emit("delete", file.response.data.id)
}
const beforeUpload = () => {
// loading.value = true
return true
}
const httpRequestHandle = (param) => {
let file = param.file
axios.post(uploadFileUrl.value, {
file: file
}, {
headers: {
'Content-Type': 'multipart/form-data',
...headers
}
}).then(res => {
handleUploadSuccess(res)
}).catch(error => {
uploadError(error)
})
}
const handleUploadSuccess = (res) => {
let data = res.data
ElNotification({
title: '提示',
message: data.code === 1000 ? '上传成功' : '上传失败',
type: data.code === 1000 ? 'success' : 'error'
})
emit("success")
}
const uploadError = (error) => {
console.log("🚀 ~ file:'error ", error.response.data.msg)
// loading.value = false
ElNotification({
title: '提示',
message: error.response.data.msg,
type: 'error'
})
}
defineExpose({
handleRemove
})
</script>
<style lang="scss" scoped>
a {
font-size: 14px;
color: #2a99ff;
}
</style>

View File

@@ -38,7 +38,7 @@ import 'tinymce/plugins/wordcount'
import 'tinymce/plugins/autosave'
import '@/assets/axupimgs/plugin.js'//多图上传插件
const emit = defineEmits(['update:value'])
const emit = defineEmits(['update:value','getFiles'])
const props = defineProps({
//默认值
value: {
@@ -78,6 +78,7 @@ const props = defineProps({
default: 500
}
})
const fileLists=ref([])
const content = ref(props.value);
const imgUrl = ref();
// const apiKey = reactive("v4zo4n22oanvco29ws5drh0pecuf3gh53clx53cccj3grjwg");
@@ -168,6 +169,15 @@ const init = reactive({
type: res.code === 1000 ? 'success' : 'error'
})
loading.close()
console.log("🚀 ~ file:res.data ", res.data)
res.data.originalFileName=res.data.originalFilename
console.log("🚀 ~ file:'meta.filetype ",meta.filetype )
if (res && res.data && res.data.fileType &&
!["png", "jpg", "jpeg","gif", "svg","ico"].includes(res.data.fileType.toLowerCase())){
fileLists.value.push(res.data)
emit('getFiles',fileLists.value)
}
const fileUrl = res.data.url;
// '?fileId='+res.data.id+
callback(fileUrl + '?fileName=' + res.data.originalFilename, {text: file.name, title: file.name});

View File

@@ -1,5 +1,8 @@
<template>
<div class="fv-table-container">
<el-button v-if="tableConfig.export && tableConfig.export.open&&changeExportPosition" @click="exportTable" color="#DED0B2"
style="float: left;margin-right: 10px">导出
</el-button>
<!-- 表格头部按钮 -->
<div class="fv-table-btn" v-if="tableConfig.btns">
<div class="table-head-btn">
@@ -15,7 +18,7 @@
</el-button>
</div>
</div>
<el-button v-if="tableConfig.export && tableConfig.export.open" @click="exportTable" color="#DED0B2"
<el-button v-if="tableConfig.export && tableConfig.export.open&&!changeExportPosition" @click="exportTable" color="#DED0B2"
style="margin-bottom: 10px">导出
</el-button>
<!-- 列显示配置 -->
@@ -121,6 +124,11 @@ const props = defineProps({
type: Boolean,
default: true
},
//是否改变导出位置, 导出在btns前面
changeExportPosition: {
type: Boolean,
default: false
},
// 是否显示列配置
isSettingCol: {
type: Boolean,

View File

@@ -1,36 +1,68 @@
<template>
<div v-loading="loading" class="add-block">
<baseTitle title="文章信息录入"></baseTitle>
<el-form :model="formData" ref="fundForm" :rules="rules" style="margin-left: 5px;margin-bottom: -18px">
<el-form :model="formData" ref="fundForm" :rules="rules" style="margin-left: 5px;margin-bottom: -18px">
<el-row gutter="30">
<el-col :span="6" style="margin-left: 10px">
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="formData.articleTitle" placeholder="请输入文章标题" clearable></el-input>
</el-form-item>
<el-form-item label="文章标题" prop="articleTitle">
<el-input v-model="formData.articleTitle" placeholder="请输入文章标题" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="文章类型" prop="articleType">
<el-select v-model="formData.articleType" placeholder="请选择文章类型" clearable filterable>
<el-option
v-for="item in cacheStore.getDict('article_type')"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="文章类型" prop="articleType">
<el-select v-model="formData.articleType" placeholder="请选择文章类型" clearable filterable>
<el-option
v-for="item in cacheStore.getDict('article_type')"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-col :span="6">
<el-form-item label="备注" prop="remarks">
<el-input v-model="formData.remarks" placeholder="请输入备注" clearable></el-input>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-left: 10px">
<el-form-item label="文章内容" prop="articleContent">
<Tinymce v-model:value="formData.articleContent" imageUrl="/workflow/process/file/upload" :height="500" v-if="showTinymce" :toolbar="['undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image axupimgs']" />
<!-- link-->
<Tinymce v-model:value="formData.articleContent"
imageUrl="/workflow/process/file/upload" :height="500" v-if="showTinymce"
:toolbar="['undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | image axupimgs']"/>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-bottom: -10px">
<el-form-item label="附件上传" prop="" style="margin-left: 20px;">
<file-upload @getFile="getFiles"/>
</el-form-item>
</el-col>
<el-col :span="24" style="margin-left:90px;">
<el-form-item label="公告附件列表" prop=""
style="display: flex;flex-direction: column;justify-content: flex-start;">
<template #label>
<div style="width: 100%;display: flex;align-items: center;justify-content: flex-start">
<el-icon size="16">
<Paperclip/>
</el-icon>
公告附件列表
</div>
</template>
<el-col :span="24" style="margin-left: -15px">
<div style="display: flex;flex-direction: column">
<div v-for="(item,index) in formData.fileList" style="display: flex;align-items: center">
附件{{ index + 1 }} <a :href="item.url" style="color: #409eff;" class="a-style" target="_blank">{{ item.originalFileName }}</a>
<el-icon size="18" style="margin:0 20px;cursor: pointer" color="#409eff" @click="handleDelete(item,index)">
<CircleClose/>
</el-icon>
<el-button type="primary" link @click="handleDownload(item)" style="font-size: 16px;margin-left: 10px">下载</el-button>
</div>
</div>
</el-col>
</el-form-item>
</el-col>
</el-row>
</el-form>
<div class="oper-page-btn">
@@ -42,10 +74,14 @@
</template>
<script setup lang="jsx">
import {ElNotification} from "element-plus";
import {ElMessageBox, ElNotification} from "element-plus";
import {addArticle, editArticle, getArticleDetail} from "@/api/article";
import {useTagsView} from '@/stores/tagsview.js'
import { useCacheStore } from "@/stores/cache.js";
import {useCacheStore} from "@/stores/cache.js";
import {deleteFile, downloadFile} from "../../api/project-demand";
import FileUpload from "../../components/FileUpload.vue";
import Tinymce from "../../components/Tinymce.vue";
const cacheStore = useCacheStore();
const tagsViewStore = useTagsView()
const router = useRouter()
@@ -53,26 +89,79 @@ const route = useRoute()
const loading = ref(false)
const showTinymce = ref(true)
const fundForm = ref()
const formData = ref({})
const formData = ref({
fileList:[]
})
const routerName = ref(router.currentRoute.value.name)
const rules = reactive({
articleTitle: [{required: true, message: '请输入文章标题', trigger: ['blur', 'change']}],
articleType: [{required: true, message: '请输入文章类型', trigger: ['blur', 'change']}],
articleContent: [{required: true, message: '请输入文章内容', trigger: ['blur', 'change']}],
})
const handleDelete = (row,index) => {
ElMessageBox.confirm(`确认删除名称为${row.originalFileName}的文件吗?`, '系统提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
formData.value.fileList.splice(index, 1)
}
})
})
}
const handleBack = () => {
history.back()
}
const getFiles = (val) => {
console.log("🚀 ~ file:val ", val)
val.originalFileName=val.originalFilename
let file = compositeParam(val)
formData.value.fileList.push(file)
}
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const submitParam = (item) => {
console.log("🚀 ~ file:item.fileList ", item.fileList)
item.fileList= item.fileList.map((it)=>{
return {
...it,
articleId:item.articleId
}
})
return {
articleContent: item.articleContent,
articleTitle: item.articleTitle,
articleType: item.articleType,
remarks: item.remarks,
articleId: item.articleId,
fileList: item.fileList
}
}
const compositeParam = (item) => {
return {
fileId: item.id,
size: item.size,
originalFileName: item.originalFilename,
fileType: item.fileType,
url: item.url,
newFile: true,
tag: 'article'
}
}
const handleSubmit = async (instance) => {
if (!instance) return
instance.validate(async (valid) => {
@@ -104,6 +193,7 @@ const handleResubmit = () => {
articleId: route.query.id,
...submitParam(formData.value)
}
console.log('params', params)
editArticle(params).then(res => {
ElNotification({
title: '提示',
@@ -124,11 +214,11 @@ const getDetailInfo = async () => {
if (res.code === 1000) {
formData.value = res.data
loading.value = false
showTinymce.value=false
showTinymce.value = false
nextTick(() => {
showTinymce.value=true
showTinymce.value = true
})
}else{
} else {
ElNotification({
title: '提示',
message: res.msg,
@@ -145,6 +235,9 @@ onMounted(async () => {
</script>
<style scoped lang="scss">
.a-style:hover{
text-decoration: underline !important;
}
.company-select {
:deep(.el-form-item__content .el-select__wrapper ) {
width: 750px;
@@ -166,6 +259,7 @@ onMounted(async () => {
height: auto;
}
}
:deep(.el-table--fit ) {
height: 300px !important;
}
@@ -176,9 +270,11 @@ onMounted(async () => {
:deep(.el-input-number) {
width: 88.5%;
.el-input__wrapper{
padding: 1px 11px!important;
.el-input__wrapper {
padding: 1px 11px !important;
}
.el-input__inner {
text-align: left;
}

View File

@@ -9,9 +9,12 @@
</div>
<el-row gutter="20">
<el-col :span="24">
<el-form-item>
<div class="article-a" v-html="formData.articleContent" @click="clickHandle"></div>
</el-form-item>
<div style="display: flex;flex-direction: column">
<div v-for="(item,index) in formData.fileList" style="display: flex;align-items: center">
附件{{ index + 1 }} <a :href="item.url" style="color: #409eff;" class="a-style" target="_blank">{{ item.originalFileName }}</a>
<el-button type="primary" link @click="handleDownload(item)" style="font-size: 16px;margin-left: 10px">下载</el-button>
</div>
</div>
</el-col>
</el-row>
</el-form>
@@ -43,7 +46,7 @@ const clickHandle = (e) => {
fileName
}
// handleDownload(fileId,fileName)
download(item)
// download(item)
// }else {
// e.preventDefault()
// }
@@ -64,6 +67,15 @@ const clickHandle = (e) => {
// })
// })
// }
const handleDownload = (row) => {
downloadFile(row.fileId).then(res => {
const blob = new Blob([res])
let a = document.createElement('a')
a.href = URL.createObjectURL(blob)
a.download = row.originalFileName
a.click()
})
}
const download = (row) => {
const x = new window.XMLHttpRequest();
x.open('GET', row.url, true);
@@ -101,6 +113,7 @@ onMounted(async () => {
</script>
<style lang="scss">
.article-a {
a {
color: #409eff !important;
@@ -112,7 +125,9 @@ onMounted(async () => {
}
</style>
<style scoped lang="scss">
.a-style:hover{
text-decoration: underline !important;
}
.article-detail {
padding: 0 30px;
padding-top: 15px;

View File

@@ -1,6 +1,9 @@
<template>
<fvSearchForm :searchConfig="searchConfig" @search="search" style="margin-left: 16px"></fvSearchForm>
<fvTable ref="tableIns" :tableConfig="tableConfig">
<div style="float: left">
<import-cost-excel @success="importTheExpenseLedger"/>
</div>
<fvTable ref="tableIns" class="tablte" :tableConfig="tableConfig" @headBtnClick="headBtnClick" :changeExportPosition="true">
<template #empty>
<el-empty description="暂无数据"/>
</template>
@@ -8,11 +11,10 @@
</template>
<script setup lang="jsx">
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
import {toThousands} from '@/utils/changePrice.js'
import { getSubCompOpt } from '@/api/user/user.js';
import {reactive, ref} from "vue";
import {useRoute, useRouter} from "vue-router";
import {costTemplateDownload, exportExcel, ledgerTemplateDownload} from "../../../api/project-manage";
import ImportCostExcel from "@/components/ImportCostExcel.vue";
const router = useRouter()
const route = useRoute()
const searchConfig = ref([
@@ -160,24 +162,65 @@ const tableConfig = reactive({
],
api: '/workflow/mosr/payment/list',
params: {},
btns: [
{name: '模板下载', key: 'down', color: '#DED0B2'},
// {name: '导入', key: 'import', color: '#DED0B2'}
],
export:{
open :true,
fileName:`研发费用明细表.xlsx`
fileName:`研发费用明细表`
}
})
const search = (val) => {
tableConfig.params = {...val}
tableIns.value.refresh()
}
const init = async () => {
const res = await getSubCompOpt()
searchConfig.value.find(item=>item.prop == 'affiliatedCompanyIds').props.data = res.data
const headBtnClick = (key) => {
switch (key) {
case 'down':
handleImportTemplateDownload()
break;
case 'import':
handleAdd()
break;
}
}
const exportTable = () => {
const $e = tableIns.value.$el
let $table = $e.querySelector('.el-table__fixed')
if (!$table) {
$table = $e
}
exportExcel($table, (5 + (Object.keys(tableData.value[0]).length - 5) * 5), "四川省国有资产经营投资管理有限责任公司科技创新项目人工成本分摊明细表", 2)
}
//导入模板下载
const handleImportTemplateDownload=()=>{
costTemplateDownload().then(res => {
let link = document.createElement('a')
try {
let blob = new Blob([res.data],{type: 'application/vnd.ms-excel'});
let _fileName = "研发费用明细表模板.xlsx"//文件名,中文无法解析的时候会显示 _(下划线),生产环境获取不到
link.style.display='none';
// 兼容不同浏览器的URL对象
const url = window.URL || window.webkitURL || window.moxURL;
link.href=url.createObjectURL(blob);
link.setAttribute('download', _fileName.substring(_fileName.lastIndexOf('_')+1))
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
url.revokeObjectURL(link.href);//销毁url对象
}catch (e) {
console.log('下载的文件出错',e)
}
})
}
const importTheExpenseLedger = () => {
tableIns.value.refresh()
}
// init()
</script>
<style scoped lang="scss">
:deep(.el-table__header) {
.is-leaf:first-child {
.cell {

View File

@@ -59,6 +59,9 @@
<el-button type="primary" size="mini"
@click="handleEdit(scope.row.deploymentId)" link>编辑
</el-button>
<el-button type="primary" size="mini"
@click="handleCarbonCopy(scope.row)" link>立即抄送
</el-button>
<!-- <el-button type="primary" size="mini"-->
<!-- @click="viewHistoricalVersion(scope.row)" link>历史-->
<!-- </el-button>-->
@@ -68,6 +71,8 @@
</el-table-column>
</el-table>
</div>
<user-picker :multiple="true" ref="carbonCopyUserRef" title="请选择抄送人员"
v-model:value="carbonCopyUserList" @ok="carbonCopyUserPickerOk" @cancelOrClear="carbonCopyUserPickerOk"/>
<paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]"
:total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/>
<el-dialog v-model="isVisited" title="历史" width="800px">
@@ -118,14 +123,18 @@ import {
deleteHistoryVersion
} from "@/api/workflow/process-definition.js";
import {Search, Refresh, Delete, Plus, Edit, Download, Document} from '@element-plus/icons-vue'
import {ElMessage, ElMessageBox} from "element-plus";
import {ElMessage, ElMessageBox, ElNotification} from "element-plus";
import {useCacheStore} from '@/stores/cache.js'
import PointTag from "@/components/PointTag.vue";
import Paging from "@/components/pagination/index.vue";
import UserPicker from "./common/UserPicker.vue";
import {applyCcSend} from "@/api/expense-manage";
const dictStore = useCacheStore()
dictStore.setCacheKey(['normal_disable'])
const router = useRouter()
const carbonCopyUserList = ref([])
const carbonCopyUserRef = ref()
//查询参数
const queryParams = reactive({
@@ -144,6 +153,7 @@ const loading = ref(true)
const list = ref([])
const queryForm = ref()
const total = ref()
const chooseRow = ref({})
const selectDefinition = ref(null)
const historyVersionList = ref([])
const singleTable = ref()
@@ -151,6 +161,41 @@ const isVisited = ref(false)
onActivated(() => {
getList()
})
const handleCarbonCopy=(row)=>{
carbonCopyUserRef.value.showUserPicker()
chooseRow.value=row
}
const carbonCopyUserPickerOk = (userList) => {
carbonCopyUserList.value = userList.map(item => item.id)
console.log("🚀 ~ file:'carbonCopyUserList.value ", carbonCopyUserList.value)
// addUser()
}
const addUser=async () => {
const res = await applyCcSend({
instanceId: chooseRow.value.deploymentId,
message: chooseRow.value.remark,
projectId:0,
state: chooseRow.value.state,
userIds: carbonCopyUserList.value
})
console.log('res',res)
if (res.code === 1000) {
ElNotification({
title: '提示',
message: '抄送成功',
type: 'error'
})
tableIns.value.refresh()
} else {
ElNotification({
title: '提示',
message: res.msg,
type: 'error'
})
}
}
//重置搜索
const handleReset = () => {
queryForm.value.resetFields()
@@ -182,7 +227,6 @@ const handleAdd = () => {
path: '/workflow/process/add',
})
}
const handleEdit = (deploymentId) => {
router.push({
path: `/workflow/process/edit/${deploymentId}`,