123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964 |
- <template>
- <div>
- <el-dialog :title="title" :visible.sync="showDialog" width="1000px" :close-on-click-modal="false"
- @close="handleClose(false)" :append-to-body="true">
- <el-form :model="form" :rules="rules" ref="reportForm" label-width="120px" v-loading="loading"
- :element-loading-text="load_text" element-loading-spinner="el-icon-loading"
- element-loading-background-color="rgba(0, 0, 0, 0.8)">
- <el-row>
- <el-col :span="12">
- <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">
- <el-input v-model="form.name" autocomplete="off" placeholder="请输入报告名称"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-form-item label="是否完成" v-if="!form.id">
- <el-switch v-model="form.status" active-color="#13ce66" inactive-color="#ff4949" @change="changeStatus"
- :active-value="3" :inactive-value="1">
- </el-switch>
- </el-form-item>
- <template v-if="!form.id && form.status == 3">
- <div>
- <el-form-item label="核心结论">
- <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-group>
- </el-form-item>
- <el-form-item label="结论论述">
- <el-input v-model="form.cronDescription" type="textarea" placeholder="请输入结论论述"></el-input>
- </el-form-item>
- <el-form-item label="后续跟进事项" v-if="$permission('/rms/matter')">
- <span v-if="form.followUps"><span v-for="item in form.followUps" :key="item.followUpName"
- style="margin-right:10px">{{ item.followUpName }}</span></span>
- <span>
- <el-popover ref="popover" placement="bottom" @hide="hidePopover" @show="showPopover" trigger="click">
- <div>
- <addMatter :type="matterType" :sign="matterSign" @value="getMatter"></addMatter>
- </div>
- <el-button slot="reference">添加后续事项</el-button>
- </el-popover>
- </span>
- </el-form-item>
- </div>
- </template>
- <el-row>
- <el-col :span="12">
- <el-form-item label="承担部门" prop="departmentId">
- <mySelectTree style="width:100%" v-model="form.departmentId" :options="departmentList"></mySelectTree>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="负责人" prop="headId">
- <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="Number(item.id)" :label="item.name"
- :value="Number(item.id)"></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <template>
- <div>
- <el-form-item label="委托方" prop="entrustId" v-if="userinfo.tenantType == 1">
- <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>
- </el-form-item>
- </div>
- </template>
- </el-col>
- <el-col :span="12">
- <el-form-item label="卷号" prop="volumeNumber">
- <el-input v-model="form.volumeNumber" autocomplete="off" placeholder="请输入卷号"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="24">
- <el-form-item label="产品/技术">
- <el-input v-model="form.productOrTech" autocomplete="off" placeholder="请输入产品/技术"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="form.track ? 12 : 24">
- <el-form-item label="关联报告">
- <el-input v-model="form.associateReportName" autocomplete="off" placeholder="请输入关联报告"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="需要复制的选项" v-show="form.track">
- <el-select v-model="form.copyIds" multiple clearable placeholder="请选择需要复制的选项" :popper-append-to-body="false"
- @change="changeCopyIds">
- <el-option v-for="item in copyList" :key="item.dictChildValue" :label="item.dictChildLabel"
- :value="item.dictChildValue"></el-option>
- </el-select>
- </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>
- <el-col :span="12">
- <el-form-item label="案件编号">
- <el-input v-model="form.caseNumber" autocomplete="off" placeholder="请输入案件编号"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="发文序号">
- <el-input v-model="form.issueNumber" autocomplete="off" placeholder="请输入发文序号"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="12">
- <el-form-item label="发明创造名称">
- <el-input v-model="form.inventionName" autocomplete="off" placeholder="请输入发明创造名称"></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="12">
- <el-form-item label="无效宣告请求人">
- <el-input v-model="form.invalidApplication" autocomplete="off" placeholder="请输入无效宣告请求人"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- </template>
- <el-form-item :label="(!form.id && form.status == 3) ? '上传报告文档' : '上传附件'">
- <myUpload :file-list="form.systemFileList" @on-change="onchangeFile" @on-remove="onRemove"
- @on-preview="onPreview" style="height: 180px;" :autoUpload="true"></myUpload>
- </el-form-item>
- <el-form-item label="备注" prop="description">
- <el-input type='textarea' v-model="form.description" autocomplete="off" placeholder="请输入备注"></el-input>
- </el-form-item>
- </el-form>
- <div slot="footer" v-if="$reportPermission(form.id, [0, 1])">
- <el-button @click="handleClose(false)">取 消</el-button>
- <el-button type="primary" @click="ifNext" v-if="form.reportType == 7 && !form.id">下一步</el-button>
- <el-button type="primary" @click="submit" v-else>确 定</el-button>
- </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">
- <el-input v-model="taskForm.taskName" type="text" placeholder="输入任务名称" />
- </el-form-item>
- <el-form-item label="审核人:" prop="personnelId">
- <el-select style="width:100%;" ref="select1" v-model="taskForm.personnelId" clearable filterable remote
- :remote-method="remoteMethodPerson" v-SelectLazyLoading="lazyLoadingPerson">
- <el-option v-for="item in personnelList" :key="item.id" :label="item.personnelName" :value="item.id"
- placeholder="请选择审核人"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="完成日期:" prop="endTime">
- <el-date-picker style="width:100%" v-model="taskForm.endTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetime"
- placeholder="选择日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item label="审核备注:" prop="description">
- <el-input v-model="taskForm.description" type="textarea" placeholder="输入备注" />
- </el-form-item>
- </el-form>
- <span slot="footer" class="dialog-footer">
- <el-button @click="handleCloseTask">取 消</el-button>
- <el-button type="primary" @click="submitTask">确 定</el-button>
- </span>
- </el-dialog>
- <!-- 无效应对报告下一步所打开弹窗 -->
- <el-dialog :visible.sync="showEvidenceAndRequest" width="1000px" :close-on-click-modal="false">
- <evidenceAndRequest ref="evidence" :examine="true" :reportId="reportId" @show="showEvidenceAndRequest = false">
- </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>
- <script>
- 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() {
- const isExist = (rule, value, callback) => {
- if (!this.form.signPatentNo) {//没有专利号进入报错提示
- if ([3].includes(Number(this.form.reportType))) {
- var text = '请输入标的产品'
- } else {
- var text = '请输入标的专利号'
- }
- callback(new Error(text))
- } else {
- callback()
- }
- }
- const isTime = (rule, value, callback) => {
- if (this.isEndTime) {
- this.isEndTimes = Date.parse(new Date)
- }
- let b = Date.parse(value)
- if (value) {
- if (b < this.isEndTimes) {
- callback(new Error('禁止选择现在及以前时间,请重新选择'))
- } else {
- callback()
- }
- } else {
- callback(new Error('请选择时间'))
- }
- }
- return {
- //弹窗标题
- title: '',
- //控制弹窗是否打开
- showDialog: false,
- //表单数据
- form: {
- matterIds: [],
- systemFileList: [],
- fileGuids: [],
- },
- //表单规则
- rules: {
- name: [{ required: true, message: '请输入报告名称', 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' },],
- },
- //加载
- loading: false,
- //加载时显示的文字
- load_text: '加载中',
- //应用场景
- commonData: {},
- //核心结论
- conclusion: [],
- //部门数据
- departmentList: [],
- //需要复制的选项集合
- copyList: [],
- //上传文件列表
- files: [],
- //核心结论类型字典
- reportAsDicItem: {
- "0": "INVALID_ASSESS",
- "1": "THIRD_ASSESS",
- "2": "STABILITY_ASSESS",
- "3": "FTO_ASSESS",
- "4": "TORT_ASSESS",
- "5": "AVOID_ASSESS",
- "7": "REINVALID_ASSESS",
- },
- //需要复制的内容字典
- reportAsDicItemCopy: {
- "0": "INVALID_COPY",
- "1": "THIRD_COPY",
- "2": "STABILITY_COPY",
- "3": "FTO_COPY",
- "4": "TORT_COPY",
- "5": "AVOID_COPY",
- },
- /**
- * 委托方
- */
- clientList: {
- queryParams: {
- current: 1,
- size: 10
- },
- data: [],
- cb: null
- },
- visible: false,
- //人员列表懒加载
- personnelList: {
- queryParams: {
- current: 1,
- size: 10
- },
- data: []
- },
- //产品列表懒加载
- productList: {
- queryParams: {
- current: 1,
- size: 10
- },
- isLazy: true,
- data: []
- },
- matterType: null,
- //事件列表
- eventList: {
- queryParams: {
- current: 1,
- size: 10
- },
- data: []
- },
- // 控制调查类型是否显示
- show: false,
- //调查类型列表
- dictAssociates: [],
- /*审核弹窗所需变量start*/
- showTask: false,
- // 任务表单
- taskForm: {},
- isEndTime: true,
- isEndTimes: null,
- // 任务表单校验
- TaskRules: {
- taskName: [{ required: true, message: '请输入任务名称', trigger: 'blur' },],
- personnelId: [{ required: true, message: '请选择审核人', trigger: 'change' },],
- endTime: [{ required: true, validator: isTime, trigger: 'change' }],
- },
- /*审核弹窗所需变量end*/
- /*无效应对报告下一步弹窗所需变量start*/
- // 报告id
- reportId: null,
- // 控制弹窗的关闭
- showEvidenceAndRequest: false,
- /*无效应对报告下一步弹窗所需变量end*/
- };
- },
- watch: {},
- computed: {
- ...mapGetters(['webSocket', 'userinfo']),
- dictMessage() {
- return this.$store.state.dictMessage.dictMessage
- },
- scenario() {
- return this.$store.state.dictMessage.scenario || []
- }
- },
- created() { },
- mounted() {
- //获取所有部门列表
- 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) {
- return false
- }
- this.eventList.queryParams.current += 1
- this.getEventList()
- },
- //远程搜索
- remoteEvent(query) {
- this.eventList.data = []
- this.eventList.queryParams.current = 1
- this.eventList.name = query
- this.getEventList()
- },
- //获取事件列表
- async getEventList(type) {
- this.eventList.loading = true;
- let params = {
- ...this.eventList.queryParams,//分页信息
- searchQuery: this.eventList.name ? `name=${this.eventList.name}` : '',//检索条件
- orderDTOList: [{ orderBy: "createTime", orderType: 1 },]//排序
- }
- await this.$api.queryEvent(params).then(response => {
- if (response.code == 200) {
- this.eventList.loading = false;
- if (!type) {
- if (this.form.eventId) {
- var index = response.data.data.findIndex(item => {
- return item.id == this.form.eventId
- })
- if (index != -1) {
- response.data.data.splice(index, 1)
- }
- }
- this.eventList.queryParams.total = response.data.total
- }
- this.eventList.data.push(...response.data.data)
- // this.eventList.queryParams.total = response.data.total
- }
- })
- },
- //切换事件
- async changeEvent(val) {
- if (!val) {
- this.form.scenarioIds = []
- this.show = false
- this.form.matterIds = []
- return
- }
- var obj = this.eventList.data.find(item => {
- return item.id == val
- })
- if (obj) {
- this.form.scenarioIds = [obj.scenarioId]
- this.show = true
- await this.onChange()
- }
- },
- //调查类型选择切换
- async onChange() {
- if (this.form.scenarioIds.length != 0) {
- await this.$api.getMatter(this.form.scenarioIds).then(response => {
- this.show = true
- this.dictAssociates = response.data.data
- })
- } else {
- 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 = '编辑'
- } else {
- a = '查看'
- }
- } else {
- 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.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.clientList.queryParams.id = this.form.entrustId
- // await this.getAllClientList(1)
- // this.clientList.queryParams.id = null
- // }
- this.getPermissionPersonnel()
- // console.log(4);
- // this.getAllClientList()
- // this.getEventList()
- this.showDialog = true
- // console.log(5);
- },
- /**
- * 产品
- * @param {*} query
- */
- // 产品列表远程搜索
- remoteMethodProduct(query) {
- this.productList.isLazy = true
- if (query !== '') {
- this.productList.loading = true;
- this.productList.queryParams = {
- current: 1,
- size: 10,
- searchQuery: `name=${query}`
- }
- this.$api.queryProductCategory(this.productList.queryParams).then(response => {
- if (response.code == 200) {
- this.productList.loading = false;
- this.productList.data = response.data.data
- }
- }).catch(error => {
- this.productList.loading = false;
- })
- } else {
- this.productList.queryParams.name = null
- this.productList = [];
- this.getAllProduct()
- }
- },
- // 产品列表懒加载
- lazyLoadingProduct() {
- if (!this.productList.isLazy) {
- return false
- }
- this.productList.queryParams.current++;
- this.getAllProduct();
- },
- getAllProduct() {
- if (!this.productList.isLazy) {
- return false
- }
- this.$api.queryProductCategory(this.productList.queryParams).then(response => {
- if (response.code == 200) {
- if (response.data.data && response.data.data.length == 0) {
- this.productList.isLazy = false
- }
- this.productList.data = [...this.productList.data, ...response.data.data];
- }
- }).catch(error => {
- })
- },
-
- //获取所有部门列表
- getDepartment() {
- this.$api.getPermissionDepartmentList().then((response) => {
- this.departmentList = response.data;
- });
- },
- //切换是否完成状态
- async changeStatus(val) {
- if (val == 3) {
- this.rules.headId[0].required = false
- this.rules.entrustId[0].required = false
- if (!this.form.id) {
- this.$set(this.form, 'cronIds', [])
- }
- let params = {
- reportType: this.form.reportType
- }
- await this.$api.queryCrons(params).then(res => {
- if (res.code == 200) {
- this.conclusion = res.data.data
- }
- }).catch(error => {
- this.conclusion = []
- this.$message.error(error.message)
- })
- // this.conclusion = this.dictMessage[this.reportAsDicItem[this.form.reportType]]
- this.matterType = 2
- } else {
- this.rules.headId[0].required = true
- this.rules.entrustId[0].required = true
- this.matterType = null
- }
- },
- //获取专利号且填入报告名称
- getPatentNo() {
- if (!this.form.name) {
- var a = this.dictMessage.REPORT_TYPE.filter(item => { return item.dictChildValue == this.form.reportType })[0].dictChildLabel
- 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) {
- var index = this.copyList.findIndex(item => {
- return item.dictChildLabel == '对比文件'
- })
- if (index != -1) {
- var id = this.copyList[index].dictChildValue
- var index2 = this.copyList.findIndex(item => {
- return item.dictChildLabel == '标引信息'
- })
- if (val.indexOf(id) != -1) {
- if (index2 == -1) {
- this.copyList.splice(index + 1, 0, this.copyIndex)
- }
- } else {
- if (index2 != -1) {
- this.copyList.splice(index2, 1)
- this.form.copyIds.splice(this.form.copyIds.indexOf(this.copyIndex.dictChildValue), 1)
- }
- }
- } else {
- }
- }
- },
- // 上传的文件监听
- onchangeFile(file, fileList) {
- if (file.guid) {
- let index = this.form.systemFileList.findIndex(item => {
- return item.uid == file.uid
- })
- if (index != -1) {
- this.form.systemFileList.splice(index, 1, file)
- }
- } else {
- this.form.systemFileList.push(file.raw)
- }
- },
- // 删除上传的文件
- onRemove(file, fileList) {
- let index = this.form.systemFileList.findIndex(item => {
- return item.uid == file.uid
- })
- if (index != -1) {
- this.form.systemFileList.splice(index, 1)
- }
- },
- //上传附件时点击查看附件内容
- onPreview(file) {
- var item = {
- name: file.name,
- suffix: '',
- downLoad: true
- }
- var index = file.raw.type.lastIndexOf('/')
- var type = file.raw.type.substring(index + 1, file.raw.type.length)
- var arr = ['png', 'jpeg', 'bmp', 'jpg']
- if (arr.includes(type)) {
- var FileUrl = URL.createObjectURL(file.raw)
- var isPicture = 1
- } else if (type == 'pdf') {
- var FileUrl = URL.createObjectURL(file.raw)
- var isPicture = 0
- } else {
- return false
- }
- const router = this.$router.resolve({
- path: '/checkFile',
- query: {
- row: JSON.stringify(item),
- FileUrl: FileUrl,
- isPicture: isPicture
- }
- })
- window.open(router.href, '_blank');
- },
- //提交填写的信息
- submit() {
- this.$refs.reportForm.validate((valid) => {
- if (valid) {
- this.form.type = 2//项目类型(1专利数据库 2报告 3专利挖掘项目)
- // 判断文件是否都上传完毕
- 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) {
- this.form.events = []
- this.form.scenarioIds = []
- this.form.matterIds.forEach(item => {
- this.form.events.push(
- {
- matterId: item,
- scenarioId: scenarioIds[0],
- eventId: this.form.eventId
- }
- )
- })
- }
- let formData = this.form
- if (!this.form.id) {//新增报告
- this.$confirm('是否需要进行审核?', '提示', {
- confirmButtonText: '是',
- cancelButtonText: '否',
- closeOnClickModal: false,
- distinguishCancelAndClose: true,
- }).then(() => {//审核打开审核弹窗
- this.showTask = true
- this.$set(this.taskForm, 'taskName', this.form.name + '审核')
- }).catch(action => {//不审核直接创建报告
- // 调用创建报告公用,接口
- this.addReport(formData, scenarioIds)
- });
- } else {//编辑报告
- this.$api.updateReportProject(formData).then(response => {
- if (response.code == 200) {
- this.files = []
- this.$message.success('报告更新成功')
- this.$emit('getList', '更新成功')
- this.handleClose()
- }
- })
- }
- }
- })
- },
- //关闭弹窗
- handleClose(val) {
- if (this.form.reportType == 7 && val) {
- this.showEvidenceAndRequest = true
- // this.$s.setSession('params', {})
- this.reportId = val
- }
- this.personnelList.queryParams.name = ''
- this.$refs.reportForm.resetFields()
- this.form = {
- matterIds: [],
- systemFileList: [],
- 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, scenarioIds) {
- this.$api.addReportProject(formData).then(response => {
- if (response.code == 200) {
- this.files = []
- this.$message.success('报告创建成功')
- this.$emit('getList', '新增成功')
- // response.data是创建成功后返回的报告id
- this.handleClose(response.data)
- }
- }).catch(error => {
- // 如果报告未创建成功,则赋值
- this.form.scenarioIds = JSON.parse(JSON.stringify(scenarioIds))
- this.show = true
- })
- },
- //提交审核任务
- submitTask() {
- this.isEndTime = false
- this.$refs.TaskForm.validate((valid) => {
- if (valid) {
- let formData = new FormData()
- if (this.files && this.files.length > 0) {
- for (var i = 0; i < this.files.length; i++) {
- formData.append("files", this.files[i]);
- }
- }
- let a = {
- report: this.form,
- personIds: [this.taskForm.personnelId],
- taskName: this.taskForm.taskName,
- endTime: this.taskForm.endTime,
- description: this.taskForm.description,
- type: 0,
- }
- formData.append('taskVO', JSON.stringify(a))
- this.$api.AddTask(formData).then(response => {
- if (response.code == 200) {
- this.files = []
- this.$message.success('报告创建成功并发送审核')
- this.$emit('getList', true)
- this.handleCloseTask()
- this.handleClose()
- }
- }).catch(error => {
- this.$message.error('报告创建失败')
- this.handleCloseTask()
- })
- }
- })
- },
- //关闭审核弹窗
- handleCloseTask() {
- this.matterType = null
- this.$refs.TaskForm.resetFields()
- this.taskForm = {}
- this.showTask = false
- this.isEndTime = true
- },
- // 创建无效应对报告下一步
- ifNext() {
- this.$refs.reportForm.validate((valid) => {
- if (valid) {
- let formData = new FormData()
- if (this.files && this.files.length > 0) {
- for (var i = 0; i < this.files.length; i++) {
- formData.append("files", this.files[i]);
- }
- }
- formData.append('report', this.form)
- this.addReport(formData)
- } else {
- this.loading = false
- this.$alert('校验未通过,请按照要求创建报告', '提示', {
- confirmButtonText: '确定',
- type: 'warning',
- callback: action => {
- }
- });
- return false;
- }
- })
- },
- },
-
- };
- </script>
- <style lang="scss" scoped></style>
|