Merge pull request 'dj' (#189) from dj into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/189
This commit is contained in:
@@ -60,9 +60,25 @@ export const deleteFile = (fileId) => {
|
||||
method: "delete"
|
||||
});
|
||||
};
|
||||
export const downloadFile = (fileId) => {
|
||||
return request({
|
||||
url: '/workflow/process/file/download',
|
||||
method: "get",
|
||||
responseType:'blob',
|
||||
params:{
|
||||
fileId:fileId
|
||||
}
|
||||
});
|
||||
};
|
||||
export const getCompanyOption = () => {
|
||||
return request({
|
||||
url: '/admin/mosr/sub/company/companyOption',
|
||||
method: "get"
|
||||
});
|
||||
};
|
||||
export const deleteDemand = (id) => {
|
||||
return request({
|
||||
url: `/workflow/mosr/requirement/${id}`,
|
||||
method: "delete"
|
||||
});
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button :type="btnType" size="mini" :disabled="isDisabled" :icon="btnIcon" :plain="isPlain">
|
||||
<el-button :type="btnType" size="mini" :disabled="isDisabled" :icon="btnIcon" :plain="isPlain" :link="link">
|
||||
{{ btnText }}
|
||||
</el-button>
|
||||
</template>
|
||||
@@ -30,6 +30,10 @@ const props = defineProps({
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
link: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
btnIcon: {
|
||||
type: String,
|
||||
default: ''
|
||||
@@ -61,6 +65,7 @@ const handleCancel = () => {
|
||||
visible.value = false
|
||||
}
|
||||
const handleDelete = () => {
|
||||
console.log('确认')
|
||||
emit("delete")
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
import OperationRender from '@/views/workflow/common/OperationRender.vue'
|
||||
import ProcessDiagramViewer from '@/views/workflow/common/ProcessDiagramViewer.vue'
|
||||
import {useProcessStore} from '@/stores/processStore.js';
|
||||
import {getInfo, agreeTask, rejectTask} from "@/api/project-demand/index.js";
|
||||
import {getInfo, agreeTask, rejectTask,downloadFile} from "@/api/project-demand/index.js";
|
||||
import {getSubCompOpt} from '@/api/user/user.js'
|
||||
import {ElMessage} from "element-plus";
|
||||
import {useRouter} from "vue-router";
|
||||
@@ -129,7 +129,9 @@ const tableConfig = reactive({
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
currentRender: ({row, index}) => {
|
||||
return (<a style="cursor: pointer;font-size: 14px;color: #2a99ff;" href={row.url}>下载</a>)
|
||||
return (
|
||||
<el-button type="primary" link onClick={() => handleDownload(row)}>下载</el-button>
|
||||
)
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -200,6 +202,16 @@ const getDataSourceOptionItem = (val) => {
|
||||
}
|
||||
return companyNameArray.value.join(',');
|
||||
}
|
||||
|
||||
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 init = async () => {
|
||||
if (!route.query.id) return;
|
||||
await getCompanyOption()
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
<script setup lang="jsx">
|
||||
import Tag from '@/components/Tag.vue'
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {ElMessage} from "element-plus";
|
||||
import {deleteDemand} from "@/api/project-demand";
|
||||
|
||||
const router = useRouter()
|
||||
const searchConfig = reactive([
|
||||
@@ -85,7 +87,6 @@ const tableConfig = reactive({
|
||||
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
|
||||
if (row.state === '3' || row.state === '2') {
|
||||
btn.push({label: '编辑', func: () => handleEdit(row), type: 'primary'})
|
||||
btn.push({label: '删除', func: () => handleDelete(row), type: 'danger'})
|
||||
} else if (row.state === '4') {
|
||||
btn.push({label: '上报', func: () => handleReport(row), type: 'primary'})
|
||||
}
|
||||
@@ -103,6 +104,10 @@ const tableConfig = reactive({
|
||||
</el-button>
|
||||
))
|
||||
}
|
||||
{
|
||||
row.state === '3' || row.state === '2' ?
|
||||
<popover-delete name={row.requirementName} type={'需求征集'} btnType={'danger'} onDelete={() => handleDelete(row)}/> : ''
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -136,6 +141,16 @@ const handleEdit = (row) => {
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleDelete = (row) => {
|
||||
deleteDemand(row.requirementId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
ElMessage.success(res.msg)
|
||||
tableIns.value.refresh()
|
||||
} else {
|
||||
ElMessage.error(res.msg)
|
||||
}
|
||||
})
|
||||
}
|
||||
const handleDetail = (row) => {
|
||||
router.push({
|
||||
name: 'Collection/detail',
|
||||
|
||||
@@ -1,15 +1,186 @@
|
||||
<template>
|
||||
<div>
|
||||
项目归档
|
||||
</div>
|
||||
<fvSearchForm :searchConfig="searchConfig" @search="search"></fvSearchForm>
|
||||
<fvTable ref="tableIns" :tableConfig="tableConfig">
|
||||
<template #empty>
|
||||
<el-empty description="暂无数据"/>
|
||||
</template>
|
||||
</fvTable>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "index"
|
||||
<script setup lang="jsx">
|
||||
import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
||||
import {reactive, shallowRef} from "vue";
|
||||
|
||||
const router = useRouter()
|
||||
const searchConfig = reactive([
|
||||
{
|
||||
label: '名称',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入名称查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目类型',
|
||||
prop: 'collectType',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择项目类型',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '项目影响',
|
||||
prop: 'projectEffect',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择项目影响',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
},
|
||||
colProps: {}
|
||||
},
|
||||
{
|
||||
label: '研发主体',
|
||||
prop: 'collectType',
|
||||
component: shallowRef(fvSelect),
|
||||
props: {
|
||||
placeholder: '请选择研发主体',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
label: '起始时间',
|
||||
prop: 'time',
|
||||
component: 'el-date-picker',
|
||||
props: {
|
||||
placeholder: '请选择起止时间',
|
||||
clearable: true,
|
||||
},
|
||||
colProps: {}
|
||||
},
|
||||
{
|
||||
label: '最小金额',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入金额查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '最大金额',
|
||||
prop: 'requirementName',
|
||||
component: 'el-input',
|
||||
props: {
|
||||
placeholder: '请输入金额查询',
|
||||
clearable: true,
|
||||
filterable: true,
|
||||
checkStrictly: true
|
||||
}
|
||||
},
|
||||
])
|
||||
const tableIns = ref()
|
||||
const tableConfig = reactive({
|
||||
columns: [
|
||||
{
|
||||
prop: 'name',
|
||||
label: '名称',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'company',
|
||||
label: '所属公司',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'projectType',
|
||||
label: '项目类型',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'productMainBody',
|
||||
label: '研发主体',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'projectEffect',
|
||||
label: '项目影响',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'survey',
|
||||
label: '经营概况',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '起止时间',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => (<Tag dictType={'process_state'} value={row.state}/>)
|
||||
},
|
||||
{
|
||||
prop: 'oper',
|
||||
label: '操作',
|
||||
align: 'center',
|
||||
showOverflowTooltip: false,
|
||||
currentRender: ({row, index}) => {
|
||||
let btn = [{label: '详情', func: () => handleDetail(row), type: 'primary'}]
|
||||
if (row.state === '3') {
|
||||
btn.push({label: '附件', func: () => handleCheck(row), type: 'primary'})
|
||||
} else if (row.state === '4') {
|
||||
btn.push({label: '结项', func: () => handleStandingBook(row), type: 'primary'})
|
||||
}
|
||||
return (
|
||||
<div style={{width: '100%'}}>
|
||||
{
|
||||
btn.map(item => (
|
||||
<el-button
|
||||
type={item.type}
|
||||
// v-perm={item.auth}
|
||||
onClick={() => item.func()}
|
||||
link
|
||||
>
|
||||
{item.label}
|
||||
</el-button>
|
||||
))
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
],
|
||||
api: '',
|
||||
params: {},
|
||||
})
|
||||
|
||||
const search = (val) => {
|
||||
tableConfig.params = {...val}
|
||||
tableIns.value.refresh()
|
||||
}
|
||||
|
||||
const handleDetail = (row) => {
|
||||
router.push({
|
||||
name:'Implementation/detail',
|
||||
query: {
|
||||
id: row.requirementId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@@ -60,29 +60,49 @@ const tableConfig = reactive({
|
||||
},
|
||||
{
|
||||
prop: 'projectType',
|
||||
label: '项目费用',
|
||||
label: '研发人员',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'productMainBody',
|
||||
label: '研发阶段',
|
||||
label: '应发工资',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'projectEffect',
|
||||
label: '摘要',
|
||||
label: '绩效',
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
prop: 'survey',
|
||||
label: '税后余额(元)',
|
||||
label: '公积金',
|
||||
align: 'center'
|
||||
},{
|
||||
prop: 'survey',
|
||||
label: '社保',
|
||||
align: 'center'
|
||||
},{
|
||||
prop: 'survey',
|
||||
label: '年金',
|
||||
align: 'center'
|
||||
},{
|
||||
prop: 'survey',
|
||||
label: '工作日(天)',
|
||||
align: 'center'
|
||||
},{
|
||||
prop: 'survey',
|
||||
label: '研发工时(天)',
|
||||
align: 'center'
|
||||
},{
|
||||
prop: 'survey',
|
||||
label: '小计',
|
||||
align: 'center'
|
||||
}
|
||||
],
|
||||
api: '',
|
||||
params: {},
|
||||
btns: [
|
||||
{name: '生成分摊报表', key: '_export', color: '#DED0B2',auth: ''}
|
||||
{name: '上传分摊', key: '_export', color: '#DED0B2',auth: ''}
|
||||
]
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user