|
@@ -7,24 +7,22 @@
|
|
|
element-loading-background-color="rgba(0, 0, 0, 0.8)">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
- <!-- <el-form-item :label="[3].includes(Number(form.type)) ? '标的产品' : '标的专利'" prop="signPatentNo">
|
|
|
- <el-input v-model="form.signPatentNo" autocomplete="off"
|
|
|
- :placeholder="[3].includes(Number(form.type)) ? '请输入标的产品' : '请输入标的专利'" @change="getPatentNo"></el-input>
|
|
|
- </el-form-item> -->
|
|
|
- <el-form-item v-if="form.reportType == 3" label="标的产品" prop="signPatentNo">
|
|
|
- <el-select style="width:100%" v-model="form.signProjectId" placeholder="请选择产品" filterable remote
|
|
|
- :popper-append-to-body="false" :remote-method="remoteMethodProduct"
|
|
|
- v-SelectLazyLoading="lazyLoadingProduct" :loading="productList.loading">
|
|
|
- <el-option v-for="item in productList.data" :key="item.id" :label="item.name"
|
|
|
- :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- <!-- <el-input v-model="form.signProjectId" autocomplete="off"
|
|
|
- placeholder="请输入标的产品" @change="getPatentNo"></el-input> -->
|
|
|
- </el-form-item>
|
|
|
- <el-form-item v-else label="标的专利" prop="signPatentNo">
|
|
|
- <el-input v-model="form.signPatentNo" autocomplete="off" placeholder="请输入标的专利"
|
|
|
- @change="getPatentNo"></el-input>
|
|
|
- </el-form-item>
|
|
|
+ <template>
|
|
|
+ <div>
|
|
|
+ <el-form-item v-if="form.reportType == 3" label="标的产品" prop="signProjectId">
|
|
|
+ <el-select style="width:100%" v-model="form.signProjectId" placeholder="请选择产品" filterable remote
|
|
|
+ :popper-append-to-body="false" :remote-method="remoteMethodProduct"
|
|
|
+ v-SelectLazyLoading="lazyLoadingProduct" :loading="productList.loading" @change="getPatentNo">
|
|
|
+ <el-option v-for="item in productList.data" :key="item.id" :label="item.name"
|
|
|
+ :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item v-else label="标的专利" prop="signPatentNo">
|
|
|
+ <el-input v-model="form.signPatentNo" autocomplete="off" placeholder="请输入标的专利"
|
|
|
+ @change="getPatentNo"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="报告名称" prop="name">
|
|
@@ -43,8 +41,6 @@
|
|
|
<el-checkbox-group v-model="form.cronIds">
|
|
|
<el-checkbox v-for="item in conclusion" :key="item.value" :label="item.value">{{
|
|
|
item.label }}</el-checkbox>
|
|
|
- <!-- <el-checkbox v-for="item in conclusion" :key="item.dictChildValue" :label="item.dictChildValue">{{
|
|
|
- item.dictChildLabel }}</el-checkbox> -->
|
|
|
</el-checkbox-group>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="结论论述">
|
|
@@ -75,8 +71,8 @@
|
|
|
<el-select style="width:100%" v-model="form.headId" placeholder="请选择负责人" filterable remote
|
|
|
:popper-append-to-body="false" :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson"
|
|
|
:loading="personnelList.loading">
|
|
|
- <el-option v-for="item in personnelList.data" :key="item.id" :label="item.name"
|
|
|
- :value="item.id"></el-option>
|
|
|
+ <el-option v-for="item in personnelList.data" :key="Number(item.id)" :label="item.name"
|
|
|
+ :value="Number(item.id)"></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -86,11 +82,14 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<el-form-item label="委托方" prop="entrustId" v-if="userinfo.tenantType == 1">
|
|
|
- <el-select style="width:100%" v-model="form.entrustId" placeholder="请选择委托方" filterable remote
|
|
|
- :popper-append-to-body="false" :remote-method="remoteMethodClient"
|
|
|
- v-SelectLazyLoading="lazyLoadingClient" :loading="clientObj.loading">
|
|
|
- <el-option v-for="item in clientList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
+ <mySelectButton size='large' style="width:100%" @click="handleSelect">
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-autocomplete style="width:100%" v-model="form.entrustName" ref="client" value-key="name"
|
|
|
+ :fetch-suggestions="querySearch" v-SelectLazyLoading="loadClient" @input="input"
|
|
|
+ placeholder="请输入内容" :trigger-on-focus="false" @select="handleChange">
|
|
|
+ </el-autocomplete>
|
|
|
+ </div>
|
|
|
+ </mySelectButton>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="委托部门" prop="departmentId" v-else>
|
|
|
<mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
|
|
@@ -104,13 +103,6 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
-
|
|
|
- <!-- <el-form-item label="应用场景">
|
|
|
- <el-checkbox-group v-model="form.scenarioList">
|
|
|
- <el-checkbox v-for="item in commonData.ENTERPRISE_APPLICATION_SCENARIO" :key="item.value"
|
|
|
- :label="parseInt(item.value)">{{ item.label }}</el-checkbox>
|
|
|
- </el-checkbox-group>
|
|
|
- </el-form-item> -->
|
|
|
<el-row>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="产品/技术">
|
|
@@ -134,35 +126,40 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row>
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="事件:">
|
|
|
- <mySelectButton size='large' style="width:100%" @click="addEvent">
|
|
|
- <div style="width:100%">
|
|
|
- <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote clearable
|
|
|
- placeholder="请选择" :loading="eventList.loading" v-SelectLazyLoading="loadEvent"
|
|
|
- :remote-method="remoteEvent">
|
|
|
- <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </mySelectButton>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row v-if="show == true">
|
|
|
- <el-col :span="24">
|
|
|
- <el-form-item label="调查类型:" prop="matterIds">
|
|
|
- <el-checkbox-group v-model="form.matterIds">
|
|
|
- <template>
|
|
|
- <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
|
|
|
- {{ item.name }}
|
|
|
- </el-checkbox>
|
|
|
- </template>
|
|
|
- </el-checkbox-group>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
+ <template v-if="!form.id">
|
|
|
+ <div>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="事件:">
|
|
|
+ <mySelectButton size='large' style="width:100%" @click="addEvent">
|
|
|
+ <div style="width:100%">
|
|
|
+ <el-select style="width:100%" v-model="form.eventId" @change="changeEvent" filterable remote
|
|
|
+ clearable placeholder="请选择" :loading="eventList.loading" v-SelectLazyLoading="loadEvent"
|
|
|
+ :remote-method="remoteEvent">
|
|
|
+ <el-option v-for="item in eventList.data" :key="item.id" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ </mySelectButton>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row v-if="show == true">
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="调查类型:" prop="matterIds">
|
|
|
+ <el-checkbox-group v-model="form.matterIds">
|
|
|
+ <template>
|
|
|
+ <el-checkbox v-for="item in dictAssociates" :key="item.id" :label="parseInt(item.id)">
|
|
|
+ {{ item.name }}
|
|
|
+ </el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template v-if="form.reportType == 7">
|
|
|
<div>
|
|
|
<el-row>
|
|
@@ -206,7 +203,7 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 审核弹窗 -->
|
|
|
+ <!-- 审核弹窗,做公用组件 -->
|
|
|
<el-dialog title="添加审核任务" :visible.sync="showTask" width="500px" @close="handleCloseTask">
|
|
|
<el-form :model="taskForm" :rules="TaskRules" ref="TaskForm" label-width="120px" v-loading="loading">
|
|
|
<el-form-item label="任务名称:" prop="taskName">
|
|
@@ -240,6 +237,11 @@
|
|
|
</evidenceAndRequest>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 委托方弹窗 -->
|
|
|
+ <el-dialog title="选择委托方" :visible.sync="visible" width="800px" append-to-body destroy-on-close :before-close="close2"
|
|
|
+ top="10vh">
|
|
|
+ <ClientTable :choseClient="true" @getClient="getClient"></ClientTable>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -247,10 +249,12 @@
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import evidenceAndRequest from './evidenceAndRequest.vue'
|
|
|
import addMatter from './addMatter.vue'
|
|
|
+import ClientTable from '@/views/client'
|
|
|
export default {
|
|
|
components: {
|
|
|
evidenceAndRequest,
|
|
|
addMatter,
|
|
|
+ ClientTable,
|
|
|
},
|
|
|
props: {},
|
|
|
data() {
|
|
@@ -296,7 +300,8 @@ export default {
|
|
|
//表单规则
|
|
|
rules: {
|
|
|
name: [{ required: true, message: '请输入报告名称', trigger: 'blur' },],
|
|
|
- signPatentNo: [{ required: true, validator: isExist, trigger: 'blur' },],
|
|
|
+ signProjectId: [{ required: true, validator: isExist, trigger: 'blur' },],//产品
|
|
|
+ signPatentNo: [{ required: true, validator: isExist, trigger: 'blur' },],//专利
|
|
|
headId: [{ required: true, message: '请选择负责人', trigger: 'change' },],
|
|
|
entrustId: [{ required: true, message: '请选择委托方', trigger: 'change' },],
|
|
|
},
|
|
@@ -312,10 +317,6 @@ export default {
|
|
|
departmentList: [],
|
|
|
//需要复制的选项集合
|
|
|
copyList: [],
|
|
|
- //人员列表
|
|
|
- // personnelList: [],
|
|
|
- //客户/委托方列表
|
|
|
- clientList: [],
|
|
|
//上传文件列表
|
|
|
files: [],
|
|
|
//核心结论类型字典
|
|
@@ -337,17 +338,18 @@ export default {
|
|
|
"4": "TORT_COPY",
|
|
|
"5": "AVOID_COPY",
|
|
|
},
|
|
|
- // 客户懒加载obj
|
|
|
- clientObj: {
|
|
|
+ /**
|
|
|
+ * 委托方
|
|
|
+ */
|
|
|
+ clientList: {
|
|
|
queryParams: {
|
|
|
current: 1,
|
|
|
- size: 10,
|
|
|
+ size: 10
|
|
|
},
|
|
|
- loading: false,
|
|
|
- //是否懒加载
|
|
|
- isLazy: true,
|
|
|
- data:[],
|
|
|
+ data: [],
|
|
|
+ cb: null
|
|
|
},
|
|
|
+ visible: false,
|
|
|
//人员列表懒加载
|
|
|
personnelList: {
|
|
|
queryParams: {
|
|
@@ -406,26 +408,81 @@ export default {
|
|
|
return this.$store.state.dictMessage.dictMessage
|
|
|
},
|
|
|
scenario() {
|
|
|
- console.log(this.$store.state.dictMessage);
|
|
|
return this.$store.state.dictMessage.scenario || []
|
|
|
}
|
|
|
},
|
|
|
created() { },
|
|
|
mounted() {
|
|
|
- // 获取所有产品
|
|
|
- this.getAllProduct()
|
|
|
- //获取所有人员列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
|
|
|
- this.getPermissionPersonnel()
|
|
|
- //获取所有客户列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
|
|
|
- this.getAllClientList()
|
|
|
//获取所有部门列表
|
|
|
this.getDepartment()
|
|
|
},
|
|
|
methods: {
|
|
|
+ /**
|
|
|
+ * 客户/委托方
|
|
|
+ */
|
|
|
+ //远程搜索委托方(建议调取接口获取)
|
|
|
+ async querySearch(queryString, cb) {
|
|
|
+ this.clientList.queryParams.current = 1
|
|
|
+ this.clientList.queryParams.name = queryString
|
|
|
+ this.clientList.data = []
|
|
|
+ this.clientList.cb = cb
|
|
|
+ await this.getClientList()
|
|
|
+ // 调用 callback 返回建议列表的数据
|
|
|
+ // cb(this.clientList.data);
|
|
|
+ },
|
|
|
+ loadClient() {
|
|
|
+ if (this.clientList.queryParams.current * this.clientList.queryParams.size >= this.clientList.queryParams.total) {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this.clientList.queryParams.current += 1
|
|
|
+ this.getClientList()
|
|
|
+ },
|
|
|
+ //获取委托方
|
|
|
+ async getClientList() {
|
|
|
+ await this.$api.getAdminClientList(this.clientList.queryParams).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.clientList.data.push(...res.data.records)
|
|
|
+ this.clientList.queryParams.total = res.data.total
|
|
|
+ this.clientList.cb(this.clientList.data);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ //输入框输入事件(委托方)
|
|
|
+ input() {
|
|
|
+ this.$set(this.form, 'entrustId', -1)
|
|
|
+ },
|
|
|
+ //切换选择委托方
|
|
|
+ handleChange(row) {
|
|
|
+ this.$set(this.form, 'entrustId', row.id)
|
|
|
+ this.$set(this.form, 'entrustName', row.name)
|
|
|
+ this.close2()
|
|
|
+ },
|
|
|
+ //打开选择委托方弹窗
|
|
|
+ handleSelect() {
|
|
|
+ this.visible = true
|
|
|
+ },
|
|
|
+ //获取委托方信息
|
|
|
+ getClient(row) {
|
|
|
+ this.$set(this.form, 'entrustId', row.id)
|
|
|
+ this.$set(this.form, 'entrustName', row.name)
|
|
|
+ this.close2()
|
|
|
+ },
|
|
|
+ //关闭委托方弹窗
|
|
|
+ close2() {
|
|
|
+ this.visible = false
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 事件处理
|
|
|
+ */
|
|
|
//打开事件弹窗
|
|
|
addEvent() {
|
|
|
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 事件
|
|
|
+ */
|
|
|
//懒加载事件
|
|
|
loadEvent() {
|
|
|
if (this.eventList.queryParams.current * this.eventList.queryParams.size >= this.eventList.queryParams.total) {
|
|
@@ -485,6 +542,8 @@ export default {
|
|
|
await this.onChange()
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
//调查类型选择切换
|
|
|
async onChange() {
|
|
|
if (this.form.scenarioIds.length != 0) {
|
|
@@ -496,10 +555,12 @@ export default {
|
|
|
this.show = false
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
//打开弹窗
|
|
|
async open(form) {
|
|
|
var a = ''
|
|
|
this.form = JSON.parse(JSON.stringify(form))
|
|
|
+ console.log(form);
|
|
|
if (this.form.id) {
|
|
|
if (this.$reportPermission(this.form.id, [0, 1])) {
|
|
|
a = '编辑'
|
|
@@ -507,47 +568,41 @@ export default {
|
|
|
a = '查看'
|
|
|
}
|
|
|
} else {
|
|
|
- this.$set(this.form,'matterIds',[])
|
|
|
- this.$set(this.form,'systemFileList',[])
|
|
|
- this.$set(this.form,'fileGuids',[])
|
|
|
+ this.$set(this.form, 'matterIds', [])
|
|
|
+ this.$set(this.form, 'systemFileList', [])
|
|
|
+ this.$set(this.form, 'fileGuids', [])
|
|
|
a = '创建'
|
|
|
+ console.log(1);
|
|
|
}
|
|
|
+ console.log(2);
|
|
|
var reportType = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.reportType })[0].dictChildLabel
|
|
|
this.title = a + reportType + '报告'
|
|
|
- // 事件
|
|
|
- if (this.form.eventIds && this.form.eventIds.length > 0) {
|
|
|
- this.form.eventId = this.form.eventIds[0]
|
|
|
- this.onChange()
|
|
|
- this.eventList.queryParams.id = this.form.eventId[0]
|
|
|
- await this.getEventList(1)
|
|
|
- this.eventList.queryParams.id = null
|
|
|
- this.show = true
|
|
|
- } else {
|
|
|
- this.show = false
|
|
|
- }
|
|
|
- // 文件
|
|
|
- if (this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
|
- this.$set(this.form, 'fileGuids', [])
|
|
|
- this.form.systemFileList.forEach(item => {
|
|
|
- this.form.fileGuids.push(item.guid)
|
|
|
- })
|
|
|
- }
|
|
|
// 负责人
|
|
|
if (this.form.headId) {
|
|
|
this.personnelList.queryParams.id = this.form.headId
|
|
|
await this.getPermissionPersonnel(1)
|
|
|
this.personnelList.queryParams.id = null
|
|
|
}
|
|
|
+ console.log(3);
|
|
|
// 委托方
|
|
|
- if (this.form.entrustId) {
|
|
|
- this.personnelList.queryParams.id = this.form.headId
|
|
|
- await this.getPermissionPersonnel(1)
|
|
|
- this.personnelList.queryParams.id = null
|
|
|
- }
|
|
|
+ // if (this.form.entrustId) {
|
|
|
+ // this.clientList.queryParams.id = this.form.entrustId
|
|
|
+ // await this.getAllClientList(1)
|
|
|
+ // this.clientList.queryParams.id = null
|
|
|
+ // }
|
|
|
+
|
|
|
this.getPermissionPersonnel()
|
|
|
- this.getEventList()
|
|
|
+ console.log(4);
|
|
|
+ // this.getAllClientList()
|
|
|
+ // this.getEventList()
|
|
|
this.showDialog = true
|
|
|
+ console.log(5);
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 产品
|
|
|
+ * @param {*} query
|
|
|
+ */
|
|
|
// 产品列表远程搜索
|
|
|
remoteMethodProduct(query) {
|
|
|
this.productList.isLazy = true
|
|
@@ -594,6 +649,11 @@ export default {
|
|
|
}).catch(error => {
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 人员
|
|
|
+ * @param {*} query
|
|
|
+ */
|
|
|
// 人员列表远程搜索
|
|
|
remoteMethodPerson(query) {
|
|
|
this.personnelList.data = []
|
|
@@ -631,51 +691,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 客户列表远程搜索
|
|
|
- remoteMethodClient(query) {
|
|
|
- if (query != '') {
|
|
|
- this.clientObj.loading = true;
|
|
|
- this.clientObj.queryParams.current = 1
|
|
|
- this.clientObj.queryParams.name = query
|
|
|
- this.$api.getAllClientList(this.clientObj.queryParams).then(response => {
|
|
|
- if (response.code == 200) {
|
|
|
- this.clientObj.loading = false;
|
|
|
- this.clientList = response.data.records
|
|
|
- }
|
|
|
- }).catch(error => {
|
|
|
- this.clientObj.loading = false;
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.clientObj.queryParams.name = null
|
|
|
- this.clientList = [];
|
|
|
- this.getAllClientList()
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取所有客户列表懒加载
|
|
|
- lazyLoadingClient() {
|
|
|
- if (this.clientObj.queryParams.current * this.clientObj.queryParams.size >= this.clientObj.queryParams.total) {
|
|
|
- return false
|
|
|
- }
|
|
|
- this.clientObj.queryParams.current += 1
|
|
|
- this.getAllClientList()
|
|
|
- },
|
|
|
- //获取所有客户列表(修改不要一次性获取,可以使用懒加载加远程搜索 )
|
|
|
- getAllClientList() {
|
|
|
- this.$api.getAdminClientList(this.clientObj.queryParams).then(response => {
|
|
|
- this.clientList.push(...response.data.records)
|
|
|
- this.clientObj.queryParams.total = response.data.total
|
|
|
- }).catch(error => {
|
|
|
- this.clientList = []
|
|
|
- this.$message.error(error.message)
|
|
|
- })
|
|
|
- },
|
|
|
+
|
|
|
//获取所有部门列表
|
|
|
- //获取部门列表
|
|
|
getDepartment() {
|
|
|
this.$api.getPermissionDepartmentList().then((response) => {
|
|
|
this.departmentList = response.data;
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
//切换是否完成状态
|
|
|
async changeStatus(val) {
|
|
|
if (val == 3) {
|
|
@@ -685,11 +708,11 @@ export default {
|
|
|
this.$set(this.form, 'cronIds', [])
|
|
|
}
|
|
|
let params = {
|
|
|
- reportType:this.form.reportType
|
|
|
+ reportType: this.form.reportType
|
|
|
}
|
|
|
await this.$api.queryCrons(params).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
- this.conclusion=res.data.data
|
|
|
+ this.conclusion = res.data.data
|
|
|
}
|
|
|
}).catch(error => {
|
|
|
this.conclusion = []
|
|
@@ -703,13 +726,23 @@ export default {
|
|
|
this.matterType = null
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
//获取专利号且填入报告名称
|
|
|
getPatentNo() {
|
|
|
if (!this.form.name) {
|
|
|
var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.reportType })[0].dictChildLabel
|
|
|
- this.$set(this.form, 'name', this.form.signPatentNo + a)
|
|
|
+ if (this.form.signProjectId) {
|
|
|
+ let name=this.productList.data.filter(item => {
|
|
|
+ return item.id == this.form.signProjectId
|
|
|
+ })
|
|
|
+ this.$set(this.form,'name',name[0].name + a)
|
|
|
+ } else {
|
|
|
+ this.$set(this.form, 'name', this.form.signPatentNo + a)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
//修改需要复制的选项
|
|
|
changeCopyIds(val) {
|
|
|
if (Object.keys(this.copyIndex).length > 0) {
|
|
@@ -736,6 +769,7 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
// 上传的文件监听
|
|
|
onchangeFile(file, fileList) {
|
|
|
if (file.guid) {
|
|
@@ -744,35 +778,18 @@ export default {
|
|
|
})
|
|
|
if (index != -1) {
|
|
|
this.form.systemFileList.splice(index, 1, file)
|
|
|
- this.form.fileGuids.push(file.guid)
|
|
|
}
|
|
|
} else {
|
|
|
this.form.systemFileList.push(file.raw)
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
// 删除上传的文件
|
|
|
onRemove(file, fileList) {
|
|
|
- if (file.guid) {
|
|
|
- let index = this.form.systemFileList.findIndex(item => {
|
|
|
- return item.guid == file.guid
|
|
|
- })
|
|
|
- if (index!=-1) {
|
|
|
- this.form.systemFileList.splice(index, 1)
|
|
|
- }
|
|
|
- let index2 = this.form.fileGuids.findIndex(item => {
|
|
|
- return item == file.guid
|
|
|
- })
|
|
|
- if (index2 != -1) {
|
|
|
- this.form.fileGuids.splice(index2, 1)
|
|
|
- }
|
|
|
- } else {
|
|
|
- let index3 = this.form.systemFileList.findIndex(item => {
|
|
|
- return item.uid == file.uid
|
|
|
- })
|
|
|
- if (index3 != -1) {
|
|
|
- this.form.fileGuids.splice(index3, 1)
|
|
|
- }
|
|
|
+ let index = this.form.systemFileList.findIndex(item => {
|
|
|
+ return item.uid == file.uid
|
|
|
+ })
|
|
|
+ if (index != -1) {
|
|
|
+ this.form.systemFileList.splice(index, 1)
|
|
|
}
|
|
|
},
|
|
|
//上传附件时点击查看附件内容
|
|
@@ -804,12 +821,27 @@ export default {
|
|
|
})
|
|
|
window.open(router.href, '_blank');
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
//提交填写的信息
|
|
|
submit() {
|
|
|
this.$refs.reportForm.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.form.type = 2//项目类型(1专题库 2报告 3专利挖掘项目)
|
|
|
- if (this.form.scenarioIds && this.form.scenarioIds.length>0) {
|
|
|
+ // 判断文件是否都上传完毕
|
|
|
+ if (this.form.systemFileList && this.form.systemFileList.length > 0) {
|
|
|
+ this.form.fileGuids = []
|
|
|
+ for (let i = 0; i < this.form.systemFileList.length; i++) {
|
|
|
+ if (this.form.systemFileList[i].guid) {
|
|
|
+ this.form.fileGuids.push(this.form.systemFileList[i].guid)
|
|
|
+ } else {
|
|
|
+ this.$message.error('文件未全部上传,请耐心等待')
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 事件及调查类型处理
|
|
|
+ if (this.form.scenarioIds && this.form.scenarioIds.length > 0) {
|
|
|
var scenarioIds = JSON.parse(JSON.stringify(this.form.scenarioIds))
|
|
|
}
|
|
|
if (this.form.eventId) {
|
|
@@ -837,7 +869,7 @@ export default {
|
|
|
this.$set(this.taskForm, 'taskName', this.form.name + '审核')
|
|
|
}).catch(action => {//不审核直接创建报告
|
|
|
// 调用创建报告公用,接口
|
|
|
- this.addReport(formData)
|
|
|
+ this.addReport(formData, scenarioIds)
|
|
|
});
|
|
|
|
|
|
} else {//编辑报告
|
|
@@ -845,7 +877,7 @@ export default {
|
|
|
if (response.code == 200) {
|
|
|
this.files = []
|
|
|
this.$message.success('报告更新成功')
|
|
|
- this.$emit('getList', true)
|
|
|
+ this.$emit('getList', '更新成功')
|
|
|
this.handleClose()
|
|
|
}
|
|
|
})
|
|
@@ -857,7 +889,7 @@ export default {
|
|
|
handleClose(val) {
|
|
|
if (this.form.reportType == 7 && val) {
|
|
|
this.showEvidenceAndRequest = true
|
|
|
- this.$s.setSession('params', {})
|
|
|
+ // this.$s.setSession('params', {})
|
|
|
this.reportId = val
|
|
|
}
|
|
|
this.personnelList.queryParams.name = ''
|
|
@@ -868,17 +900,33 @@ export default {
|
|
|
fileGuids: [],
|
|
|
}
|
|
|
this.showDialog = false
|
|
|
+ this.clear()
|
|
|
+ },
|
|
|
+ //清空组件缓存数据
|
|
|
+ clear() {
|
|
|
+ // 清空事件相关
|
|
|
+ this.form.eventIds = []
|
|
|
+ this.eventList.queryParams.current = 1
|
|
|
+ this.eventList.data = []
|
|
|
+ // 清空负责人相关
|
|
|
+ this.personnelList.data = []
|
|
|
+ this.personnelList.queryParams.current = 1
|
|
|
+ this.personnelList.queryParams.name = null
|
|
|
},
|
|
|
// 创建报告创建接口公用
|
|
|
- addReport(formData) {
|
|
|
+ addReport(formData, scenarioIds) {
|
|
|
this.$api.addReportProject(formData).then(response => {
|
|
|
if (response.code == 200) {
|
|
|
this.files = []
|
|
|
this.$message.success('报告创建成功')
|
|
|
- this.$emit('getList', true)
|
|
|
+ this.$emit('getList', '新增成功')
|
|
|
// response.data是创建成功后返回的报告id
|
|
|
this.handleClose(response.data)
|
|
|
}
|
|
|
+ }).catch(error => {
|
|
|
+ // 如果报告未创建成功,则赋值
|
|
|
+ this.form.scenarioIds = JSON.parse(JSON.stringify(scenarioIds))
|
|
|
+ this.show = true
|
|
|
})
|
|
|
},
|
|
|
//提交审核任务
|
|
@@ -948,18 +996,9 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
- },
|
|
|
- // 组件销毁函数
|
|
|
- destroyed() {
|
|
|
- // 清空事件相关
|
|
|
- this.form.eventIds = []
|
|
|
- this.eventList.queryParams.current=1
|
|
|
- this.eventList.data=[]
|
|
|
- // 清空负责人相关
|
|
|
- this.personnelList.data = []
|
|
|
- this.personnelList.queryParams.current=1
|
|
|
+
|
|
|
},
|
|
|
+
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped></style>
|