Merge pull request 'master' (#506) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/506
This commit is contained in:
@@ -31,7 +31,9 @@ const searchConfig = reactive([
|
||||
props: {
|
||||
placeholder: '请选择时间',
|
||||
clearable: true,
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
type:'month',
|
||||
format: 'YYYY-MM',
|
||||
valueFormat:'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
colProps: {}
|
||||
},
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="年度计划名称" prop="annualPlanName">
|
||||
<!-- <el-input v-model="formData.annualPlanName" placeholder="请输入年度计划名称" clearable>-->
|
||||
<!-- </el-input>-->
|
||||
<span>{{ formData.annualPlanName }}</span>
|
||||
<div v-if="isEdit">
|
||||
<el-input v-model="formData.annualPlanName" placeholder="请输入年度计划名称" clearable>
|
||||
</el-input>
|
||||
<el-button color="#DED0B2" style="margin-left: 10px" @click="editName">提交</el-button>
|
||||
</div>
|
||||
<span v-else>{{ formData.annualPlanName }}</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@@ -18,6 +21,7 @@
|
||||
</el-form>
|
||||
<div class="query-btn">
|
||||
<el-button color="#DED0B2" style="float: right;margin: 0 10px 10px 0" @click="exportTable">导出</el-button>
|
||||
<el-button color="#DED0B2" v-perm="['annual:plan:edit']" style="float: right;margin: 0 10px 10px 0" @click="editBtn">编辑</el-button>
|
||||
</div>
|
||||
<el-table ref="table" :data="formData.projectList" border :header-cell-style="{background:'#f5f7fa'}">
|
||||
<el-table-column label="四川省国有资产经营投资管理有限责任公司科技创新项目年度计划表" align="center">
|
||||
@@ -124,7 +128,7 @@
|
||||
<script setup>
|
||||
import {toThousands} from '@/utils/changePrice.js'
|
||||
import {ElNotification} from "element-plus";
|
||||
import {getPlan} from "@/api/project-demand/summary";
|
||||
import {getPlan,editPlan} from "@/api/project-demand/summary";
|
||||
import {useCacheStore} from '@/stores/cache.js'
|
||||
import {exportExcel} from "@/utils/export-excel";
|
||||
|
||||
@@ -133,6 +137,7 @@ const loading = ref(false)
|
||||
const formData = ref({})
|
||||
const table = ref()
|
||||
const route = useRoute()
|
||||
const isEdit = ref(false)
|
||||
const exportTable = () => {
|
||||
const $e = table.value.$el
|
||||
let $table = $e.querySelector('.el-table__fixed')
|
||||
@@ -141,12 +146,31 @@ const exportTable = () => {
|
||||
}
|
||||
exportExcel($table, (5 + (Object.keys(formData.value.projectList[0]).length - 5) * 5), "四川省国有资产经营投资管理有限责任公司科技创新项目年度计划表", 2)
|
||||
}
|
||||
const editName=()=>{
|
||||
let param={
|
||||
annualPlanId:route.query.annualPlanId,
|
||||
annualPlanName:formData.value.annualPlanName
|
||||
}
|
||||
editPlan(param).then(res => {
|
||||
ElNotification({
|
||||
title: '提示',
|
||||
message: res.msg,
|
||||
type: res.code === 1000 ? 'success' : 'error'
|
||||
})
|
||||
if (res.code === 1000) {
|
||||
isEdit.value=false
|
||||
}
|
||||
})
|
||||
}
|
||||
const editBtn = () => {
|
||||
isEdit.value=true
|
||||
}
|
||||
const filterDict = (data, value) => {
|
||||
if (data === undefined || value === undefined) return;
|
||||
let label = ''
|
||||
let result = []
|
||||
if (JSON.parse(value) instanceof Array) {
|
||||
JSON.parse(value).forEach(item1 => {
|
||||
if (value instanceof Array) {
|
||||
value.forEach(item1 => {
|
||||
data.find(item => {
|
||||
if (item.value == item1) {
|
||||
result.push(item.label)
|
||||
|
||||
Reference in New Issue
Block a user