Commit 5d31e0ad authored by 徐俊's avatar 徐俊
parents 003e1d71 797b83de
import Vue from 'vue'
import Api from '@/api/index.js'
import api from '@/api'
const state = {
dict: {},
queue: []
......@@ -24,10 +25,10 @@ const mutations = {
}
}
const actions = {
getDict: (state) => {
getDict: ({ commit, state }, type) => {
return state.dict
},
getDictByType: (state) => (type) => {
getDictByType: ({ dispatch, state }, type) => {
/**
* 闭包特性。返回一个函数,该函数接收一个type参数。
* 同时由于闭包还持有state对象,故可以返回需要的值。
......@@ -43,25 +44,24 @@ const actions = {
// 没有缓存则请求数据
if (!isExistence) {
// 在异步请求之前将该任务标记为已缓存(存入队列)
commit('SET_QUEUE', 'dict/' + type)
return new Promise((resolve, reject) => {
return Api.getDict(type)
.then((res) => {
const { code, data } = res
if (code && code !== 200) {
// 获取失败移除缓存队列
commit('DEL_QUEUE', 'dict/' + type)
reject(res)
this.commit('cache/SET_QUEUE', 'dict/' + type)
return new Promise(async (resolve, reject) => {
await api.parameter.getArrayListByType({ typeId: type })
.then(({ data = {} }) => {
if (data) {
try {
this.commit('cache/SET_DICT', { type: type, list: data })
resolve(data)
} catch (error) {
reject(error)
}
} else {
// 获取到的值存入字典
commit('SET_DICT', { type: type, list: data })
resolve(res)
reject('error')
}
})
.catch((error) => {
}).catch(err => {
// 获取失败移除缓存队列
commit('DEL_QUEUE', 'dict/' + type)
reject(error)
this.commit('cache/DEL_QUEUE', 'dict/' + type)
reject(err.response)
})
})
} else {
......
......@@ -74,11 +74,11 @@ export default {
value: {
handler (value) {
if (!!value) {
this.selected = getSpecArray(this.value)
if (!!this.selected && this.selected.length == 3) {
this.$emit("input", this.selected[2])
this.$emit("change");
}
// this.selected = getSpecArray(this.value)
// if (!!this.selected && this.selected.length == 3) {
// this.$emit("input", this.selected[2])
// this.$emit("change");
// }
}
},
},
......
<template>
<div style=" width:auto; display:inline-block !important; display:inline;">
<a-select :style="{width: width? width+ 'px':'80%'}" v-model="selected" @change="paraChange($event)" :key="0">
<a-select :style="{width: width? width+ 'px':'80%'}" v-model="selected" @change="onChange($event)" :key="0">
<a-select-option v-for="item in selectArray" :key="item.key" :value="item.key" select>{{ item.title }}</a-select-option>
</a-select>
</div>
</template>
<script>
// 用法 <para-select v-model="formData.projClass" :typeId="52" />
export default {
name: "paraSelect",
data () {
......@@ -49,17 +49,16 @@ export default {
},
},
created () {
this.loadSelected()
this.load()
},
methods: {
loadSelected () {
load () {
let pars = { typeId: this.typeId }
this.$api.parameter.getParameterList(pars).then(({ data = { data } }) => {
if (data) {
this.selectArray = data.data
this.selectArray.unshift(this.defaultValue)
if (!!this.value) {
this.loadState = true
this.selected = this.value
}
else
......@@ -67,7 +66,7 @@ export default {
}
}).catch(() => { })
},
paraChange (value) {
onChange (value) {
this.$emit("input", value);
var newArr = this.selectArray.filter(x => x.key == value);
if (!!newArr && newArr.length > 0) {
......
This diff is collapsed.
......@@ -11,9 +11,8 @@
<div v-show="tabsActive==='1'" style="height:100%;">
<div style="height:calc(100% - 40px);overflow: auto;">
<a-form-model ref="form" :model="formData" :rules="rules" class="from-table font-line-space">
<technology-evalucation v-if="totalFunding >= 50" v-model="formData"></technology-evalucation>
<economy v-if="totalFunding < 50" v-model="formData" />
<economy v-model="formData" v-if="false"/>
<technology-evalucation v-if="totalFunding >= 50" v-model="formData"></technology-evalucation>
<div v-else>
<a-row type="flex">
<a-col :span="4" class="bg-gray">
......@@ -191,6 +190,10 @@ export default {
remark: [{ required: true, message: '请填写评审意见', trigger: 'blur' },],
supportState: { required: true, message: "请选择是否支持立项", trigger: "blur" },
evaluationType: { required: true, message: "*", trigger: "blur" },
score18: { required: true, message: "*", trigger: "blur" },
score19: { required: true, message: "*", trigger: "blur" },
additionalScore: { required: true, message: "*", trigger: "blur" },
recommendFunding: { required: true, message: "*", trigger: "blur" },
},
projectInfo: {
projName: '',
......@@ -287,6 +290,10 @@ export default {
if (this.projectInfo.fileList[i].fileExplain.indexOf("项目申报简要信息首页") == -1 && this.projectInfo.fileList[i].fileExplain.indexOf("项目组成员签字") == -1)
fileArr.push(this.projectInfo.fileList[i])
}
this.formData.projName = data.projName
this.formData.appUnitName = data.appUnitName
this.formData.appPersonName = data.appPersonName
this.formData.applyFunding = data.govFunding
this.projectInfo.fileList = fileArr
this.isProjectInfoLoad = true
this.loading = false
......
......@@ -15,13 +15,12 @@
</a-form-item>
<a-form-item>
<a-button type="primary" icon="search" @click="search">搜索</a-button>
<a-button icon="reload" style="margin-left: 10px" @click="reset" class="bt-normal">重置</a-button>
<a-button icon="reload" style="margin-left: 10px" @click="reset" class="bt-normal">重置</a-button>
</a-form-item>
</a-form>
<a-divider style="height: 1px; background-color: #e8e8e8;" />
<div class="submit-btn">
<a-button type="primary" @click="exportData" icon="download">Excel</a-button>
<!-- <a-button type="primary" @click="scoreClick" icon="download">评分</a-button> -->
</div>
<a-table :dataSource="tableData" :columns="columns" :scroll="{ x: 'max-content' }" rowKey="id" :pagination="false" :loading="loading">
<template slot="projName" slot-scope="record">
......@@ -40,9 +39,6 @@
<a-modal v-model="visibleView" v-if="visibleView" title="项目详情" width="94%" :footer="null" :dialog-style="{ top: '8%' }" destroyOnClose :maskClosable="false">
<project-view v-model="id" @close="closeWindow"></project-view>
</a-modal>
<a-modal v-model="visibleScore" v-if="visibleScore" title="评分" width="94%" :footer="null" :dialog-style="{ top: '8%' }" destroyOnClose :maskClosable="false">
<score-edit />
</a-modal>
</div>
</template>
......@@ -51,11 +47,10 @@ import { getType } from '@/views/utils/auth'
import moment from 'moment'
import { isEmptyParams, filterExportExcelData, tableColumnsName } from "@/views/utils/common";
import projectView from '@/views/report/project/components/projectView'
import scoreEdit from '@/views/evaluation/components/economy'
export default {
name: 'queryProject',
components: {
projectView, scoreEdit
projectView,
},
data () {
return {
......@@ -79,7 +74,6 @@ export default {
loading: false,
// 弹窗标志
visibleView: false,
visibleScore: false,
id: null,
loadState: false
}
......@@ -87,9 +81,6 @@ export default {
created () {
},
methods: {
scoreClick () {
this.visibleScore = true
},
search () {
this.pagination.pageIndex = 1
this.getListByPage()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment