fix : 修复页面细节
This commit is contained in:
@@ -1,17 +1,16 @@
|
||||
<template>
|
||||
<div class="apply-block">
|
||||
<el-form :model="formData" ref="applyForm" label-width="auto" :rules="rules">
|
||||
<baseTitle title="项目结项"></baseTitle>
|
||||
<AttachmentUpload ref="attachment" label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList"
|
||||
@getAttachment="getAttachment"
|
||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData" :preview="name === 'Filing/edit'"/>
|
||||
<div class="approval-record">
|
||||
<baseTitle title="流程"></baseTitle>
|
||||
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
||||
</div>
|
||||
</el-form>
|
||||
<baseTitle title="项目结项"></baseTitle>
|
||||
<AttachmentUpload ref="attachment" label="项目结项附件" :showTable="showTable" :otherFileList="otherFileList"
|
||||
@getAttachment="getAttachment"
|
||||
@getOtherFile="getOtherFile" :showFileList="true" :formData="formData"
|
||||
:preview="name === 'Filing/edit'"/>
|
||||
<div class="approval-record">
|
||||
<baseTitle title="流程"></baseTitle>
|
||||
<process-diagram-viewer mode="view" v-if="processDiagramViewer"/>
|
||||
</div>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" v-if="name==='Filing/conclusion'" @click="handleSubmit(applyForm)">提交</el-button>
|
||||
<el-button color="#DED0B2" v-if="name==='Filing/conclusion'" @click="handleSubmit">提交</el-button>
|
||||
<el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -23,19 +22,22 @@ import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.v
|
||||
import {downloadFile} from "@/api/project-demand";
|
||||
import {ElNotification} from "element-plus";
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getProjectConclusionProcess, projectConclusion,getConclusionDetail, resubmitConclusion} from "@/api/project-manage";
|
||||
import {
|
||||
getProjectConclusionProcess,
|
||||
projectConclusion,
|
||||
getConclusionDetail,
|
||||
resubmitConclusion
|
||||
} from "@/api/project-manage";
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const tagsViewStore = useTagsView()
|
||||
const formData = ref({})
|
||||
const rules = reactive({
|
||||
attachment: [{required: true, message: '请上传项目结项附件', trigger: 'blur'}],
|
||||
})
|
||||
|
||||
const attachment = ref()
|
||||
const name=ref(router.currentRoute.value.name)
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const loading = ref(false)
|
||||
const file = ref({})
|
||||
const applyForm = ref()
|
||||
const deploymentId = ref()
|
||||
const showTable = ref(true)
|
||||
const otherFileList = ref([])
|
||||
@@ -93,7 +95,7 @@ const handleDownload = (row) => {
|
||||
}
|
||||
const compositeParam = (item) => {
|
||||
let tag = ''
|
||||
if (name.value === 'Filing/conclusion'||name.value === 'Filing/edit') {
|
||||
if (name.value === 'Filing/conclusion' || name.value === 'Filing/edit') {
|
||||
tag = '项目结项'
|
||||
}
|
||||
return {
|
||||
@@ -107,7 +109,7 @@ const compositeParam = (item) => {
|
||||
}
|
||||
const getAttachment = (val) => {
|
||||
console.log('上传文件getAttachment', val)
|
||||
file.value=compositeParam(val)
|
||||
file.value = compositeParam(val)
|
||||
}
|
||||
const getOtherFile = (val) => {
|
||||
console.log('上传文件getOtherFile', val)
|
||||
@@ -125,82 +127,77 @@ const getFileParam = (item) => {
|
||||
tag: item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
if(JSON.stringify(file.value) === "{}"){
|
||||
attachment.value.validate()
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
if (!valid) return
|
||||
let files = []
|
||||
let singleFile={}
|
||||
if(file.value.fileId!==undefined){
|
||||
singleFile = {
|
||||
fileId: file.value.fileId
|
||||
}
|
||||
}
|
||||
otherFileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: files,
|
||||
singleFile: singleFile,
|
||||
projectId:route.query.projectId,
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await projectConclusion(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Filing'
|
||||
})
|
||||
const handleSubmit = async () => {
|
||||
if (JSON.stringify(file.value) === "{}") {
|
||||
attachment.value.validate()
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
let files = []
|
||||
let singleFile = {}
|
||||
if (file.value.fileId !== undefined) {
|
||||
singleFile = {
|
||||
fileId: file.value.fileId
|
||||
}
|
||||
}
|
||||
otherFileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: files,
|
||||
singleFile: singleFile,
|
||||
projectId: route.query.projectId,
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await projectConclusion(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Filing'
|
||||
})
|
||||
}
|
||||
}
|
||||
const handleResubmit = () => {
|
||||
let singleFile = {}
|
||||
let otherFiles = []
|
||||
let fileArray
|
||||
if (JSON.stringify(file.value) === "{}"||attachment.value.singleFile===null) {
|
||||
if (JSON.stringify(file.value) === "{}" || attachment.value.singleFile === null) {
|
||||
attachment.value.validate()
|
||||
} else {
|
||||
attachment.value.clearValidate()
|
||||
}
|
||||
if(attachment.value.singleFile!==null&&name.value === 'Filing/edit'){
|
||||
if (attachment.value.singleFile !== null && name.value === 'Filing/edit') {
|
||||
singleFile = {
|
||||
fileId: attachment.value.singleFile.fileId
|
||||
}
|
||||
fileArray=attachment.value.allFileList
|
||||
}else {
|
||||
fileArray = attachment.value.allFileList
|
||||
} else {
|
||||
if (file.value.fileId !== undefined) {
|
||||
singleFile = {
|
||||
fileId: file.value.fileId
|
||||
}
|
||||
}
|
||||
fileArray=otherFileList.value
|
||||
fileArray = otherFileList.value
|
||||
}
|
||||
fileArray.forEach(item => {
|
||||
otherFiles.push(getFileParam(item))
|
||||
})
|
||||
//todo requirementId
|
||||
let params={
|
||||
let params = {
|
||||
deploymentId: deploymentId.value,
|
||||
requirementId: route.query.id,
|
||||
fileList: otherFiles,
|
||||
singleFile: singleFile,
|
||||
projectId:route.query.projectId,
|
||||
projectId: route.query.projectId,
|
||||
}
|
||||
console.log('重新提交params',params)
|
||||
console.log('重新提交params', params)
|
||||
resubmitConclusion(params).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -224,11 +221,11 @@ const getDetailInfo = async () => {
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
formData.value = res.data.formData
|
||||
loading.value=false
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
const init = () => {
|
||||
const init = () => {
|
||||
getProjectConclusionProcess().then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
@@ -238,7 +235,7 @@ const init = () => {
|
||||
processDiagramViewer.value = false
|
||||
if (res.code === 1000) {
|
||||
let data = res.data
|
||||
deploymentId.value=data.deploymentId
|
||||
deploymentId.value = data.deploymentId
|
||||
processInstanceData.value = data
|
||||
processStore.setDesign(data)
|
||||
processStore.runningList.value = data.runningList;
|
||||
@@ -255,7 +252,7 @@ const init = () => {
|
||||
onMounted(async () => {
|
||||
await init()
|
||||
if (name.value === 'Filing/edit') {
|
||||
loading.value=true
|
||||
loading.value = true
|
||||
await getDetailInfo()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -14,11 +14,11 @@ import {reactive, shallowRef} from "vue";
|
||||
const router = useRouter()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
label: '需求名称',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入需求名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
|
||||
@@ -8,13 +8,16 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
label: '项目名称',
|
||||
prop: 'projectName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入项目名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
@@ -82,13 +85,13 @@ const tableConfig = reactive({
|
||||
}
|
||||
],
|
||||
api: '/workflow/mosr/expense/ledger',
|
||||
params: {},
|
||||
params: {
|
||||
projectId:route.query.id
|
||||
},
|
||||
btns: [
|
||||
{name: '上传费用', key: 'add', color: '#DED0B2',auth: ''}
|
||||
]
|
||||
})
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
const tableIns=ref()
|
||||
const headBtnClick = (key) => {
|
||||
switch (key) {
|
||||
|
||||
@@ -1,20 +1,11 @@
|
||||
<template>
|
||||
<el-form :model="attachment" inline class="query-form" ref="queryForm" rules="rules">
|
||||
<el-form :model="attachment" inline class="query-form">
|
||||
<el-form-item label="标签" prop="tag">
|
||||
<el-select v-model="attachment.tag" placeholder="请选择标签" clearable filterable style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in tagsOption"
|
||||
:key="item.label"
|
||||
:label="item.value"
|
||||
:value="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
<el-input v-model="attachment.tag" placeholder="请输入标签" clearable style="width: 200px"/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button @click="handleSearch(queryForm)" color="#DED0B2">搜索</el-button>
|
||||
<el-button color="#DED0B2" :disabled="!attachment.tag" style="padding: 0" title="请先选择标签再上传附件!">
|
||||
<file-upload @getFile="getFile" :disabled="!attachment.tag"/>
|
||||
</el-button>
|
||||
<el-button @click="handleSearch" color="#DED0B2">搜索</el-button>
|
||||
<el-button color="#DED0B2" @click="handleUpload">上传附件</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-card style="width: 100%">
|
||||
@@ -29,7 +20,7 @@
|
||||
|
||||
<script setup lang="jsx">
|
||||
import {downloadFile} from "@/api/project-demand";
|
||||
import {getImplementationAttachment,searchFile} from "@/api/project-manage";
|
||||
import {getImplementationAttachment} from "@/api/project-manage";
|
||||
import {ElNotification} from "element-plus";
|
||||
|
||||
const route = useRoute()
|
||||
@@ -37,11 +28,6 @@ const router = useRouter()
|
||||
const attachment = reactive({
|
||||
tag: ''
|
||||
})
|
||||
const rules = reactive({
|
||||
tag: [{required: true, message: '请选择标签', trigger: 'blur'}]
|
||||
})
|
||||
const queryForm = ref()
|
||||
const tagsOption = ref([])
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
@@ -71,6 +57,7 @@ const tableConfig = reactive({
|
||||
prop: 'oper',
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
return (
|
||||
<div>
|
||||
@@ -84,58 +71,39 @@ const tableConfig = reactive({
|
||||
const showTable = ref(true)
|
||||
const otherFileList = ref([])
|
||||
|
||||
const compositeParam = (item) => {
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
tag: attachment.tag,
|
||||
const handleSearch = () => {
|
||||
let params
|
||||
if (attachment.tag) {
|
||||
params = {
|
||||
projectId: route.query.id,
|
||||
tag: attachment.tag
|
||||
}
|
||||
} else {
|
||||
params = {
|
||||
projectId: route.query.id
|
||||
}
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
console.log('上传文件', val)
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
otherFileList.value.push(fileObj)
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
}
|
||||
const getTagsOption = (id = route.query.id) => {
|
||||
if (!route.query.id) return
|
||||
getImplementationAttachment(id).then(res => {
|
||||
getImplementationAttachment(params).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
showTable.value = false
|
||||
if (res.code === 1000) {
|
||||
tagsOption.value = res.data
|
||||
otherFileList.value = res.data
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleSearch = (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
let tagName = ''
|
||||
tagsOption.value.forEach(item => {
|
||||
if (item.label === attachment.tag) {
|
||||
tagName = item.value
|
||||
}
|
||||
})
|
||||
searchFile(route.query.id, tagName).then(res => {
|
||||
showTable.value = false
|
||||
if (res.code === 1000) {
|
||||
otherFileList.value = res.data
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
}
|
||||
})
|
||||
const handleUpload = () => {
|
||||
router.push({
|
||||
name: 'Implementation/upload',
|
||||
query: {
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleDownload = (row) => {
|
||||
@@ -147,7 +115,7 @@ const handleDownload = (row) => {
|
||||
a.click()
|
||||
})
|
||||
}
|
||||
getTagsOption()
|
||||
handleSearch()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -14,11 +14,11 @@ import {reactive, shallowRef} from "vue";
|
||||
const router = useRouter()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
label: '项目名称',
|
||||
prop: 'projectName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入项目名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
|
||||
@@ -12,11 +12,11 @@ import {reactive} from "vue";
|
||||
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
label: '需求名称',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入需求名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
|
||||
@@ -1,22 +1,46 @@
|
||||
<template>
|
||||
<baseTitle title="标签名称"></baseTitle>
|
||||
<el-input v-model="tagName" placeholder="请输入标签名称"/>
|
||||
<el-form :model="formData" ref="tagForm" label-width="auto" :rules="rules">
|
||||
<el-form-item label="标签名称" prop="tagName">
|
||||
<el-input v-model="formData.tagName" placeholder="请输入标签名称" style="width: 400px"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<baseTitle title="其他文件"></baseTitle>
|
||||
<el-card style="width: 100%;margin: 15px 0">
|
||||
<file-upload @getFile="getOtherFile"/>
|
||||
<file-upload @getFile="getFile"/>
|
||||
<fvTable style="width: 100%;max-height: 250px;height: 250px" v-if="showTable" :tableConfig="tableConfig"
|
||||
:data="otherFileList" :isSettingCol="false" :pagination="false">
|
||||
:data="fileList" :isSettingCol="false" :pagination="false">
|
||||
<template #empty>
|
||||
<el-empty :image-size="90" description="暂无数据" style="padding: 0"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</el-card>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit(tagForm)">提交</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="jsx">
|
||||
const tagName = ref('')
|
||||
const otherFileList = ref([])
|
||||
import {uploadAttachment} from "@/api/project-manage";
|
||||
import {ElNotification} from "element-plus";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
|
||||
const tagsViewStore = useTagsView()
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
const fileList = ref([])
|
||||
const formData = ref({
|
||||
tagName:''
|
||||
})
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
prop: 'index',
|
||||
type: 'index',
|
||||
label: '序号',
|
||||
align: 'center',
|
||||
width: '80',
|
||||
},
|
||||
{
|
||||
prop: 'originalFileName',
|
||||
label: '附件名称',
|
||||
@@ -47,8 +71,70 @@ const tableConfig = reactive({
|
||||
]
|
||||
})
|
||||
const showTable = ref(true)
|
||||
const getOtherFile = () => {
|
||||
|
||||
const tagForm = ref()
|
||||
const name = ref(router.currentRoute.value.name)
|
||||
const rules = reactive({
|
||||
tagName: [{required: true, message: '请输入标签名称', trigger: 'blur'}],
|
||||
})
|
||||
const compositeParam = (item) => {
|
||||
let tag = ''
|
||||
if (name.value === 'Implementation/upload') {
|
||||
tag = '项目实施'
|
||||
}
|
||||
return {
|
||||
fileId: item.id,
|
||||
size: item.size,
|
||||
originalFileName: item.originalFilename,
|
||||
fileType: item.fileType,
|
||||
url: item.url,
|
||||
tag: tag,
|
||||
}
|
||||
}
|
||||
const getFile = (val) => {
|
||||
console.log('上传文件', val)
|
||||
showTable.value = false
|
||||
let fileObj = compositeParam(val)
|
||||
fileList.value.push(fileObj)
|
||||
nextTick(() => {
|
||||
showTable.value = true
|
||||
})
|
||||
}
|
||||
const getFileParam = (item) => {
|
||||
return {
|
||||
fileId: item.fileId,
|
||||
tag: item.tag
|
||||
}
|
||||
}
|
||||
const handleSubmit = async (instance) => {
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
let files = []
|
||||
fileList.value.forEach(item => {
|
||||
files.push(getFileParam(item))
|
||||
})
|
||||
let params = {
|
||||
fileList: files,
|
||||
projectId: route.query.id,
|
||||
tag: formData.value.tagName
|
||||
}
|
||||
console.log('params', params)
|
||||
let res = await uploadAttachment(params)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
await router.push({
|
||||
name: 'Implementation/attachment',
|
||||
query:{
|
||||
id: route.query.id
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<baseTitle title="上传费用"></baseTitle>
|
||||
<el-form :model="tableForm" :rules="rules">
|
||||
<el-table :data="tableForm.tableData" style="width: 100%">
|
||||
<el-form :model="tableData" ref="form" :rules="rules">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column prop="projectName" label="项目名称">
|
||||
<template #default="scope">
|
||||
<el-form-item prop="projectName">
|
||||
@@ -12,38 +12,60 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" label="时间">
|
||||
<template #default="scope">
|
||||
<el-date-picker
|
||||
v-model="scope.row.time"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
<el-form-item prop="time">
|
||||
<el-date-picker
|
||||
v-model="scope.row.time"
|
||||
type="date"
|
||||
format="YYYY-MM-DD"
|
||||
value-format="YYYY-MM-DD"
|
||||
placeholder="选择时间"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="projectCost" label="项目费用">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.projectCost" placeholder="请输入项目费用" clearable>
|
||||
</el-input>
|
||||
<el-form-item prop="projectCost">
|
||||
<el-select v-model="scope.row.projectCost" placeholder="请选择费用性质" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in cacheStore.getDict('project_cost')"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="researchStage" label="研发阶段">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable>
|
||||
</el-input>
|
||||
<el-form-item prop="researchStage">
|
||||
<el-select v-model="scope.row.researchStage" placeholder="请选择研发阶段" clearable filterable>
|
||||
<el-option
|
||||
v-for="item in cacheStore.getDict('research_stage')"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="digest" label="摘要">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.digest" placeholder="请输入摘要" clearable>
|
||||
</el-input>
|
||||
<el-form-item prop="digest">
|
||||
<el-input v-model="scope.row.digest" placeholder="请输入摘要" clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="afterTax" label="税后余额(元)">
|
||||
<template #default="scope">
|
||||
<el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable>
|
||||
</el-input>
|
||||
<el-form-item prop="afterTax">
|
||||
<el-input v-model="scope.row.afterTax" placeholder="请输入税后余额" clearable>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="oper" label="操作">
|
||||
@@ -57,7 +79,7 @@
|
||||
<el-button type="primary" @click="handleAdd" link style="font-size: 18px">添加一行</el-button>
|
||||
</div>
|
||||
<div class="oper-page-btn">
|
||||
<el-button color="#DED0B2" @click="handleSubmit">提交</el-button>
|
||||
<el-button color="#DED0B2" @click="handleSubmit(form)">提交</el-button>
|
||||
<el-button @click="handleBack">返回</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -67,26 +89,45 @@ import {ElNotification} from "element-plus";
|
||||
import {addLedger} from "@/api/project-manage";
|
||||
import {useTagsView} from '@/stores/tagsview.js'
|
||||
import {useRoute} from "vue-router";
|
||||
import {useCacheStore} from '@/stores/cache.js'
|
||||
|
||||
const cacheStore = useCacheStore()
|
||||
const route = useRoute()
|
||||
const tagsViewStore = useTagsView()
|
||||
const formData = ref({})
|
||||
const form = ref()
|
||||
const rules = reactive({
|
||||
auditOpinion: [{required: true, message: '请输入审核意见', trigger: 'blur'}],
|
||||
})
|
||||
const tableForm = reactive({
|
||||
tableData: [
|
||||
{
|
||||
projectId: route.query.id,
|
||||
projectName: '',
|
||||
time: '',
|
||||
projectCost: '',
|
||||
researchStage: '',
|
||||
digest: '',
|
||||
afterTax: ''
|
||||
}
|
||||
]
|
||||
projectName: [{required: true, message: '请输入项目名称', trigger:["blur", 'change']}],
|
||||
time: [{required: true, message: '请选择时间', trigger: 'blur'}],
|
||||
projectCost: [{required: true, message: '请输入项目费用', trigger: 'blur'}],
|
||||
researchStage: [{required: true, message: '请输入研发阶段', trigger: 'blur'}],
|
||||
digest: [{required: true, message: '请输入摘要', trigger: 'blur'}],
|
||||
afterTax: [{required: true, message: '请输入税后余额', trigger: 'blur'}]
|
||||
})
|
||||
const tableData=ref([
|
||||
{
|
||||
projectId: route.query.id,
|
||||
projectName: '',
|
||||
time: '',
|
||||
projectCost: '',
|
||||
researchStage: '',
|
||||
digest: '',
|
||||
afterTax: ''
|
||||
}
|
||||
])
|
||||
// const tableForm = reactive({
|
||||
// tableData: [
|
||||
// {
|
||||
// projectId: route.query.id,
|
||||
// projectName: '',
|
||||
// time: '',
|
||||
// projectCost: '',
|
||||
// researchStage: '',
|
||||
// digest: '',
|
||||
// afterTax: ''
|
||||
// }
|
||||
// ]
|
||||
// })
|
||||
const handleAdd = () => {
|
||||
let row = {
|
||||
projectId: route.query.id,
|
||||
@@ -97,30 +138,29 @@ const handleAdd = () => {
|
||||
digest: '',
|
||||
afterTax: ''
|
||||
}
|
||||
tableForm.tableData.push(row)
|
||||
tableData.value.push(row)
|
||||
}
|
||||
const handleDelete = (index) => {
|
||||
tableForm.tableData.splice(index, 1)
|
||||
tableData.value.splice(index, 1)
|
||||
}
|
||||
const handleSubmit = (instance) => {
|
||||
// if (!instance) return
|
||||
// instance.validate(async (valid) => {
|
||||
// if (!valid) return
|
||||
let params = {}
|
||||
console.log('params', tableForm.tableData)
|
||||
const res = addLedger(tableForm.tableData)
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
if (!instance) return
|
||||
instance.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
console.log('params', tableData.value)
|
||||
// const res = addLedger(tableData.value)
|
||||
// ElNotification({
|
||||
// title: '提示',
|
||||
// message: res.msg,
|
||||
// type: res.code === 1000 ? 'success' : 'error'
|
||||
// })
|
||||
// if (res.code === 1000) {
|
||||
// tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
// router.push({
|
||||
// name: 'Implementation'
|
||||
// })
|
||||
// }
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
tagsViewStore.delVisitedViews(router.currentRoute.value.path)
|
||||
router.push({
|
||||
name: 'Implementation'
|
||||
})
|
||||
}
|
||||
// })
|
||||
}
|
||||
const handleBack = () => {
|
||||
history.back()
|
||||
|
||||
@@ -14,13 +14,12 @@ import {reactive, shallowRef} from "vue";
|
||||
const router = useRouter()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
label: '需求名称',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
placeholder: '请输入需求名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
@@ -30,6 +29,7 @@ const searchConfig = reactive([
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择项目类型',
|
||||
cacheKey: 'project_type',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
@@ -39,6 +39,7 @@ const searchConfig = reactive([
|
||||
prop: 'projectEffect',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
cacheKey: 'project_impact',
|
||||
placeholder: '请选择项目影响',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
@@ -51,6 +52,7 @@ const searchConfig = reactive([
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择研发主体',
|
||||
cacheKey: 'rd_subject',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
@@ -130,7 +132,10 @@ const tableConfig = reactive({
|
||||
{
|
||||
prop: 'startTime',
|
||||
label: '起止时间',
|
||||
align: 'center'
|
||||
align: 'center',
|
||||
currentRender: ({row}) => {
|
||||
return row.startTime + ' 至 ' + row.endTime
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'taskNode',
|
||||
|
||||
Reference in New Issue
Block a user