Merge pull request 'master' (#1098) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/1098
This commit is contained in:
@@ -12,7 +12,7 @@ import fvSelect from '@/fvcomponents/fvSelect/index.vue'
|
|||||||
import {toThousands} from '@/utils/changePrice.js'
|
import {toThousands} from '@/utils/changePrice.js'
|
||||||
import {switchAttachmentState} from "@/api/project-manage/attachment";
|
import {switchAttachmentState} from "@/api/project-manage/attachment";
|
||||||
import {ElMessageBox, ElNotification} from "element-plus";
|
import {ElMessageBox, ElNotification} from "element-plus";
|
||||||
import { getSubCompOpt } from '@/api/user/user.js';
|
import {getSubCompOpt} from '@/api/user/user.js';
|
||||||
import {filterProjectName} from "@/api/project-manage";
|
import {filterProjectName} from "@/api/project-manage";
|
||||||
import {filterRequirementName} from "@/api/project-demand";
|
import {filterRequirementName} from "@/api/project-demand";
|
||||||
|
|
||||||
@@ -57,16 +57,16 @@ const searchConfig = ref([
|
|||||||
filterable: true,
|
filterable: true,
|
||||||
options: [],
|
options: [],
|
||||||
remote: true,
|
remote: true,
|
||||||
remoteMethod:async (val)=>{
|
remoteMethod: async (val) => {
|
||||||
if(val){
|
if (val) {
|
||||||
const res=await filterRequirementName(val)
|
const res = await filterRequirementName(val)
|
||||||
if(res.code==1000){
|
if (res.code == 1000) {
|
||||||
let optionObj={}
|
let optionObj = {}
|
||||||
let options=[]
|
let options = []
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item => {
|
||||||
optionObj={
|
optionObj = {
|
||||||
value:item,
|
value: item,
|
||||||
label:item
|
label: item
|
||||||
}
|
}
|
||||||
options.push(optionObj)
|
options.push(optionObj)
|
||||||
})
|
})
|
||||||
@@ -86,7 +86,7 @@ const searchConfig = ref([
|
|||||||
data: [],
|
data: [],
|
||||||
filterable: true,
|
filterable: true,
|
||||||
checkStrictly: true,
|
checkStrictly: true,
|
||||||
remote:true
|
remote: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -99,16 +99,16 @@ const searchConfig = ref([
|
|||||||
filterable: true,
|
filterable: true,
|
||||||
options: [],
|
options: [],
|
||||||
remote: true,
|
remote: true,
|
||||||
remoteMethod:async (val)=>{
|
remoteMethod: async (val) => {
|
||||||
if(val){
|
if (val) {
|
||||||
const res=await filterProjectName(val,'50')
|
const res = await filterProjectName(val, '50')
|
||||||
if(res.code==1000){
|
if (res.code == 1000) {
|
||||||
let optionObj={}
|
let optionObj = {}
|
||||||
let options=[]
|
let options = []
|
||||||
res.data.forEach(item=>{
|
res.data.forEach(item => {
|
||||||
optionObj={
|
optionObj = {
|
||||||
value:item,
|
value: item,
|
||||||
label:item
|
label: item
|
||||||
}
|
}
|
||||||
options.push(optionObj)
|
options.push(optionObj)
|
||||||
})
|
})
|
||||||
@@ -211,7 +211,7 @@ const tableConfig = reactive({
|
|||||||
type: 'index',
|
type: 'index',
|
||||||
label: '序号',
|
label: '序号',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width:85,
|
width: 85,
|
||||||
index: index => {
|
index: index => {
|
||||||
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
|
return (tableIns.value.getQuery().pageNum - 1) * tableIns.value.getQuery().pageSize + index + 1
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ const tableConfig = reactive({
|
|||||||
label: '预估经费预算(元)',
|
label: '预估经费预算(元)',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
width: 150,
|
width: 150,
|
||||||
currentRender:({row})=>{
|
currentRender: ({row}) => {
|
||||||
return <span>{toThousands(row.economicEstimate)}</span>
|
return <span>{toThousands(row.economicEstimate)}</span>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -302,11 +302,11 @@ const tableConfig = reactive({
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
width: 120,
|
width: 120,
|
||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
if(row.state=='3'||row.state=='4'){
|
if (row.state == '3' || row.state == '4') {
|
||||||
return <span>{row.taskNode}</span>
|
return <span>{row.taskNode}</span>
|
||||||
}else if(row.state=='1'){
|
} else if (row.state == '1') {
|
||||||
return <span>{row.approveName}</span>
|
return <span>{row.approveName}</span>
|
||||||
}else {
|
} else {
|
||||||
return <span>--</span>
|
return <span>--</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,12 +319,17 @@ const tableConfig = reactive({
|
|||||||
showOverflowTooltip: false,
|
showOverflowTooltip: false,
|
||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
let buttons = new Set(Array.from(row.buttons))
|
let buttons = new Set(Array.from(row.buttons))
|
||||||
if (!buttons.has("openFileSwitch")&&row.state!=1) {
|
if (!buttons.has("openFileSwitch") && row.state != 1) {
|
||||||
console.log('row',row)
|
console.log('row', row)
|
||||||
return (<Tag dictType={'project_filing'} value={'0'}/>)
|
if (!buttons.has("openFileSwitch") && !buttons.has("closeFileSwitch") && row.state == 4) {
|
||||||
}else if (buttons.has("openFileSwitch")) {
|
//下属公司, 没这两个按钮时, 状态为4
|
||||||
|
return (<Tag dictType={'project_filing'} value={'4'}/>)
|
||||||
|
} else {
|
||||||
|
return (<Tag dictType={'project_filing'} value={'0'}/>)
|
||||||
|
}
|
||||||
|
} else if (buttons.has("openFileSwitch")) {//科创部, 有这权限时
|
||||||
return (<Tag dictType={'project_filing'} value={'4'}/>)
|
return (<Tag dictType={'project_filing'} value={'4'}/>)
|
||||||
}else{
|
} else {
|
||||||
if (row.state !== null) {
|
if (row.state !== null) {
|
||||||
return (<Tag dictType={'project_filing'} value={row.state}/>)
|
return (<Tag dictType={'project_filing'} value={row.state}/>)
|
||||||
} else {
|
} else {
|
||||||
@@ -337,29 +342,59 @@ const tableConfig = reactive({
|
|||||||
prop: 'oper',
|
prop: 'oper',
|
||||||
label: '操作',
|
label: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed:'right',
|
fixed: 'right',
|
||||||
width: 150,
|
width: 150,
|
||||||
showOverflowTooltip: false,
|
showOverflowTooltip: false,
|
||||||
currentRender: ({row, index}) => {
|
currentRender: ({row, index}) => {
|
||||||
let btn = []
|
let btn = []
|
||||||
let buttons = new Set(Array.from(row.buttons))
|
let buttons = new Set(Array.from(row.buttons))
|
||||||
if (buttons.has("details")) {
|
if (buttons.has("details")) {
|
||||||
btn.push({label: '详情', prem: ['project:management:filing:detail'], func: () => handleDetail(row), type: 'primary'})
|
btn.push({
|
||||||
|
label: '详情',
|
||||||
|
prem: ['project:management:filing:detail'],
|
||||||
|
func: () => handleDetail(row),
|
||||||
|
type: 'primary'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (buttons.has("attachments")) {
|
if (buttons.has("attachments")) {
|
||||||
btn.push({label: '附件', prem: ['project:management:filing:attachment'], func: () => handleAttachment(row), type: 'primary'})
|
btn.push({
|
||||||
|
label: '附件',
|
||||||
|
prem: ['project:management:filing:attachment'],
|
||||||
|
func: () => handleAttachment(row),
|
||||||
|
type: 'primary'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (buttons.has("entry")) {
|
if (buttons.has("entry")) {
|
||||||
btn.push({label: '结项', prem: ['project:management:filing:conclusion'], func: () => handleConclusion(row), type: 'primary'})
|
btn.push({
|
||||||
|
label: '结项',
|
||||||
|
prem: ['project:management:filing:conclusion'],
|
||||||
|
func: () => handleConclusion(row),
|
||||||
|
type: 'primary'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (buttons.has("edit")) {
|
if (buttons.has("edit")) {
|
||||||
btn.push({label: '编辑', prem: ['project:management:filing:conclusion'], func: () => handleEdit(row), type: 'primary'})
|
btn.push({
|
||||||
|
label: '编辑',
|
||||||
|
prem: ['project:management:filing:conclusion'],
|
||||||
|
func: () => handleEdit(row),
|
||||||
|
type: 'primary'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (buttons.has("openFileSwitch")) {
|
if (buttons.has("openFileSwitch")) {
|
||||||
btn.push({label: '开启上传', prem: ['filing:attachment:switch'], func: () => handleOpenUpload(row,true), type: 'primary'})
|
btn.push({
|
||||||
|
label: '开启上传',
|
||||||
|
prem: ['filing:attachment:switch'],
|
||||||
|
func: () => handleOpenUpload(row, true),
|
||||||
|
type: 'primary'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
if (buttons.has("closeFileSwitch")) {
|
if (buttons.has("closeFileSwitch")) {
|
||||||
btn.push({label: '关闭上传', prem: ['filing:attachment:switch'], func: () => handleOpenUpload(row,false), type: 'primary'})
|
btn.push({
|
||||||
|
label: '关闭上传',
|
||||||
|
prem: ['filing:attachment:switch'],
|
||||||
|
func: () => handleOpenUpload(row, false),
|
||||||
|
type: 'primary'
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div style={{width: '100%'}}>
|
<div style={{width: '100%'}}>
|
||||||
@@ -411,7 +446,7 @@ const handleAttachment = (row) => {
|
|||||||
name: 'Filing/attachment',
|
name: 'Filing/attachment',
|
||||||
query: {
|
query: {
|
||||||
id: row.projectId,
|
id: row.projectId,
|
||||||
requirementId:row.requirementId
|
requirementId: row.requirementId
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -433,21 +468,21 @@ const handleEdit = (row) => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleOpenUpload=(row,flag)=>{
|
const handleOpenUpload = (row, flag) => {
|
||||||
console.log('tableIns',tableIns.value)
|
console.log('tableIns', tableIns.value)
|
||||||
ElMessageBox.confirm(`是否确认${flag?'开启':'关闭'}上传文件?`, '提示', {
|
ElMessageBox.confirm(`是否确认${flag ? '开启' : '关闭'}上传文件?`, '提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
let params={
|
let params = {
|
||||||
open: flag,
|
open: flag,
|
||||||
projectId: row.projectId
|
projectId: row.projectId
|
||||||
}
|
}
|
||||||
switchAttachmentState(params).then(res=>{
|
switchAttachmentState(params).then(res => {
|
||||||
if(res.code==1000){
|
if (res.code == 1000) {
|
||||||
tableIns.value.refresh()
|
tableIns.value.refresh()
|
||||||
}else{
|
} else {
|
||||||
ElNotification({
|
ElNotification({
|
||||||
title: '提示',
|
title: '提示',
|
||||||
message: res.msg,
|
message: res.msg,
|
||||||
@@ -459,7 +494,7 @@ const handleOpenUpload=(row,flag)=>{
|
|||||||
}
|
}
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const res = await getSubCompOpt()
|
const res = await getSubCompOpt()
|
||||||
searchConfig.value.find(item=>item.prop == 'affiliatedCompanyId').props.data = res.data
|
searchConfig.value.find(item => item.prop == 'affiliatedCompanyId').props.data = res.data
|
||||||
}
|
}
|
||||||
|
|
||||||
init()
|
init()
|
||||||
|
|||||||
Reference in New Issue
Block a user