zhuliu 7 月之前
父節點
當前提交
9800369e66

+ 206 - 160
src/views/components/import/conditionImport/components/projectListDialog.vue

@@ -39,173 +39,168 @@
               </el-form-item>
             </div>
           </template>
-          
-          <!-- <el-form-item label="作为对比文件">
-                  <el-switch
-                    v-model="form.asCompare"
-                    active-value="1"
-                    active-text="是"
-                    inactive-text="否">
-                  </el-switch>
-                </el-form-item> -->
-          <el-form-item label="选择需要关联的标引与分类" v-if="form.importToId && form.importToType!=2">
-            <div style="margin-top: 50px">
-              <span>栏位:</span>
-              <span>
-                <el-select
-                  v-model="customFieldId"
-                  @change="changeCustomField"
-                  placeholder="请选择"
-                  clearable
-                >
-                  <el-option
-                    v-for="item in customField"
-                    :key="item.name"
-                    :label="item.name"
-                    :value="item.keyValue"
-                  >
-                  </el-option>
-                </el-select>
-              </span>
-            </div>
-            <div style="margin-top: 20px" v-if="customFieldId">
-              <template v-if="choseField.type === 0 || choseField.type === 2">
-                <el-input
-                  v-model="choseField.fieldValue"
-                  placeholder="请输入内容"
-                  size="small"
-                  @change="changeValue"
-                ></el-input>
-              </template>
-              <template v-if="choseField.type === 1">
-                <el-date-picker
-                  v-model="choseField.fieldValue"
-                  value-format="yyyy-MM-dd"
-                  type="date"
-                  size="small"
-                  placeholder="选择日期"
-                  style="width: 100%"
-                  @change="changeValue"
-                ></el-date-picker>
-              </template>
-              <template v-if="choseField.type === 4">
-                <el-radio-group v-model="choseField.fieldValue">
-                  <el-radio
-                    v-for="option in choseField.options"
-                    :key="option.name"
-                    :label="option.id"
-                    @change="changeValue(option.id, option)"
-                    >{{ option.name }}</el-radio
+
+          <template v-if="form.DBType == 'CN' || form.DBType == 'WD'">
+            <el-form-item label="选择需要关联的标引与分类" v-if="form.importToId && form.importToType!=2">
+              <div style="margin-top: 50px">
+                <span>栏位:</span>
+                <span>
+                  <el-select
+                    v-model="customFieldId"
+                    @change="changeCustomField"
+                    placeholder="请选择"
+                    clearable
                   >
-                </el-radio-group>
-              </template>
-              <template v-if="choseField.type === 5">
-                <el-checkbox-group v-model="choseField.fieldValue">
-                  <el-checkbox
-                    v-for="option in choseField.options"
-                    :key="option.name"
-                    :label="option.id"
-                    @change="changeValue(option.id, option)"
-                    >{{ option.name }}</el-checkbox
+                    <el-option
+                      v-for="item in customField"
+                      :key="item.name"
+                      :label="item.name"
+                      :value="item.keyValue"
+                    >
+                    </el-option>
+                  </el-select>
+                </span>
+              </div>
+              <div style="margin-top: 20px" v-if="customFieldId">
+                <template v-if="choseField.type === 0 || choseField.type === 2">
+                  <el-input
+                    v-model="choseField.fieldValue"
+                    placeholder="请输入内容"
+                    size="small"
+                    @change="changeValue"
+                  ></el-input>
+                </template>
+                <template v-if="choseField.type === 1">
+                  <el-date-picker
+                    v-model="choseField.fieldValue"
+                    value-format="yyyy-MM-dd"
+                    type="date"
+                    size="small"
+                    placeholder="选择日期"
+                    style="width: 100%"
+                    @change="changeValue"
+                  ></el-date-picker>
+                </template>
+                <template v-if="choseField.type === 4">
+                  <el-radio-group v-model="choseField.fieldValue">
+                    <el-radio
+                      v-for="option in choseField.options"
+                      :key="option.name"
+                      :label="option.id"
+                      @change="changeValue(option.id, option)"
+                      >{{ option.name }}</el-radio
+                    >
+                  </el-radio-group>
+                </template>
+                <template v-if="choseField.type === 5">
+                  <el-checkbox-group v-model="choseField.fieldValue">
+                    <el-checkbox
+                      v-for="option in choseField.options"
+                      :key="option.name"
+                      :label="option.id"
+                      @change="changeValue(option.id, option)"
+                      >{{ option.name }}</el-checkbox
+                    >
+                  </el-checkbox-group>
+                </template>
+                <template v-if="choseField.type === 6">
+                  <el-tree
+                    :ref="choseField.id"
+                    :data="choseField.options"
+                    node-key="id"
+                    :props="treeProp"
+                    :expand-on-click-node="false"
+                    :default-expand-all="true"
                   >
-                </el-checkbox-group>
-              </template>
-              <template v-if="choseField.type === 6">
-                <el-tree
-                  :ref="choseField.id"
-                  :data="choseField.options"
-                  node-key="id"
-                  :props="treeProp"
-                  :expand-on-click-node="false"
-                  :default-expand-all="true"
-                >
-                  <span class="custom-tree-node" slot-scope="{ node, data }">
-                    <el-checkbox-group v-model="choseField.fieldValue">
-                      <el-checkbox
-                        :label="data.id"
-                        @change="changeValue(data.id, data)"
-                        >{{ data.name }}</el-checkbox
-                      >
-                    </el-checkbox-group>
-                  </span>
-                </el-tree>
-              </template>
-            </div>
-            <div v-if="assoImportTaskFieldVOS.length > 0">
-              <el-tag
-                v-for="(item, index) in assoImportTaskFieldVOS"
-                :key="item.fieldValueId"
-                >{{ item.fieldName }} = {{ item.fieldValueStr }}
-                <span
-                  ><i @click="del(index, item)" class="el-icon-error"></i></span
-              ></el-tag>
-            </div>
-          </el-form-item>
+                    <span class="custom-tree-node" slot-scope="{ node, data }">
+                      <el-checkbox-group v-model="choseField.fieldValue">
+                        <el-checkbox
+                          :label="data.id"
+                          @change="changeValue(data.id, data)"
+                          >{{ data.name }}</el-checkbox
+                        >
+                      </el-checkbox-group>
+                    </span>
+                  </el-tree>
+                </template>
+              </div>
+              <div v-if="assoImportTaskFieldVOS.length > 0">
+                <el-tag
+                  v-for="(item, index) in assoImportTaskFieldVOS"
+                  :key="item.fieldValueId"
+                  >{{ item.fieldName }} = {{ item.fieldValueStr }}
+                  <span
+                    ><i @click="del(index, item)" class="el-icon-error"></i></span
+                ></el-tag>
+              </div>
+            </el-form-item>
 
 
-          <el-form-item label="下载内容">
-            <el-select
-              v-model="importContent"
-              multiple
-              collapse-tags
-            >
-              <el-option
-                v-for="item in importContents"
-                :key="item.value"
-                :label="item.label"
-                :value="item.value"
+            <el-form-item label="下载内容">
+              <el-select
+                v-model="importContent"
+                multiple
+                collapse-tags
               >
-              </el-option>
-            </el-select>
-          </el-form-item>
-          
-          <el-form-item label="是否更新" prop="ifUpdate" v-if="(!form.isUpdateCriteria || (form.isUpdateCriteria && !update.ifUpdate))&&(!form.patentNos || form.patentNos.length==0)">
-            <el-switch
-              v-model="form.ifUpdate"
-              :active-value="true"
-              :inactive-value="false"
-              active-color="#13ce66"
-            >
-            </el-switch>
-          </el-form-item>
-          <template v-if="form.ifUpdate == true && !update.ifUpdate">
-            <div>
-              <el-form-item label="更新间隔" prop="updateCycle">
-                <el-select
-                  v-model="form.updateCycle "
-                  @change="getDateType"
-                  clearable
-                  placeholder="请选择更新时间间隔"
-                  style="margin-right: 20px"
+                <el-option
+                  v-for="item in importContents"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
                 >
-                  <el-option
-                    v-for="item in $constants.updateCycle"
-                    :key="item.value"
-                    :label="item.label"
-                    :value="item.value"
+                </el-option>
+              </el-select>
+            </el-form-item>
+            
+            <el-form-item label="是否更新" prop="ifUpdate" v-if="(!form.isUpdateCriteria || (form.isUpdateCriteria && !update.ifUpdate))&&(!form.patentNos || form.patentNos.length==0)">
+              <el-switch
+                v-model="form.ifUpdate"
+                :active-value="true"
+                :inactive-value="false"
+                active-color="#13ce66"
+              >
+              </el-switch>
+            </el-form-item>
+            <template v-if="form.ifUpdate == true && !update.ifUpdate">
+              <div>
+                <el-form-item label="更新间隔" prop="updateCycle">
+                  <el-select
+                    v-model="form.updateCycle "
+                    @change="getDateType"
+                    clearable
+                    placeholder="请选择更新时间间隔"
+                    style="margin-right: 20px"
                   >
-                  </el-option>
-                </el-select>
-              </el-form-item>
-              <!-- <el-form-item label="选择更新具体时间" v-if="form.dateType">
-                <myTimeChoose
-                  :type="form.dateType"
-                  @value="handleData"
-                  :cron="form.crons"
-                  style="width: 300px"
-                ></myTimeChoose>
-              </el-form-item> -->
-            </div>
+                    <el-option
+                      v-for="item in $constants.updateCycle"
+                      :key="item.value"
+                      :label="item.label"
+                      :value="item.value"
+                    >
+                    </el-option>
+                  </el-select>
+                </el-form-item>
+                <!-- <el-form-item label="选择更新具体时间" v-if="form.dateType">
+                  <myTimeChoose
+                    :type="form.dateType"
+                    @value="handleData"
+                    :cron="form.crons"
+                    style="width: 300px"
+                  ></myTimeChoose>
+                </el-form-item> -->
+              </div>
+            </template>
+            <el-form-item label="立即导入" prop="importNow" v-if="form.isUpdateCriteria && (!form.patentNos || form.patentNos.length==0)">
+              <el-switch
+                v-model="form.importNow"
+                :active-value="true"
+                :inactive-value="false"
+                active-color="#13ce66"
+              >
+              </el-switch>
+            </el-form-item>
           </template>
-          <el-form-item label="立即导入" prop="importNow" v-if="form.isUpdateCriteria && (!form.patentNos || form.patentNos.length==0)">
-            <el-switch
-              v-model="form.importNow"
-              :active-value="true"
-              :inactive-value="false"
-              active-color="#13ce66"
-            >
-            </el-switch>
-          </el-form-item>
+         
         </el-form>
         <div class="button">
           <template v-if="form.isUpdateCriteria">
@@ -220,7 +215,7 @@
           </template>
           <template v-else>
             <el-button
-              v-if="form.importToType == 0"
+              v-if="form.importToType == 0 && (form.DBType == 'CN' || form.DBType == 'WD')"
               type="primary"
               size="small"
               @click="onSubmit(2)"
@@ -467,10 +462,61 @@ export default {
       this.$refs.form.resetFields();
       this.dialogVisible = false;
     },
+    //导入专利到项目中
+    importPatentToProject(){
+      var params = {
+        stringRequest:{
+          projectId: this.form.projectId,
+          searchQuery: this.form.searchCondition,
+          orderDTOList:[]
+        },
+        fromProjectId:this.form.projectId, //来源专题库项目id
+        toProjectId:this.form.importToId, //目标报告项目id
+        isAdd:this.queryParams.patentNos, //去除专利号
+      }
+      if(this.form.orderBy && this.form.orderType){
+        var orderDTOList = [
+          {
+            orderBy:this.queryParams.OrderBy,
+            orderType:this.queryParams.OrderByType == 'DESC'?1:0
+          }
+        ]
+        params.stringRequest.orderDTOList = orderDTOList
+      }
+      var message = this.$message({
+        type:'warning',
+        message: '正在将专利导入报告中...',
+        duration: 0 // 设置为0表示不自动关闭
+      })
+      this.handleClose()
+      this.$api.addProjectPatentToReport(params).then(res=>{
+        if(res.code == 200){
+          message.close()
+          this.$message(
+            {
+              type:'success',
+              message:'导入成功'
+            }
+          )
+        }
+      }).catch(error=>{
+        message.close()
+        this.$message(
+            {
+              type:'error',
+              message:'导入失败'
+            }
+          )
+      })
+    },
     //导入
     onSubmit(type) {
       this.$refs.form.validate((valid) => {
         if (valid) {
+          if(this.form.DBType == 'inner_CN' || this.form.DBType == 'inner_WD'){
+            this.importPatentToProject()
+            return
+          }
           var importContent = []
             this.importContents.forEach(item => {
                 var index = this.importContent.indexOf(item.value)

+ 21 - 21
src/views/components/import/conditionImport/internal_search/indexMixins.js

@@ -106,7 +106,7 @@ export default{
         //图表分析
         async handleAnalyses() {
             var params = {
-                condition: this.condition.searchCondition || '',//检索条件
+                condition: this.getConditionStr() || '',//检索条件
                 numberQuery:this.condition.NO,
                 customFields:  [],
                 groupField:null,
@@ -116,12 +116,12 @@ export default{
                         orderType:this.queryParams.OrderByType == 'DESC'?1:0
                     }
                 ],//排序信息
-                projectId:null
+                projectId:this.innerProjectId || this.condition.otherCondition.projectId || null
             }
             const router = this.$router.resolve({
                 path: '/customChart',
                 query: {
-                    projectId: null,
+                    projectId: this.innerProjectId || this.condition.otherCondition.projectId || null,
                     search:JSON.stringify(params),
                     patentNum:this.total
                 }
@@ -141,7 +141,7 @@ export default{
                 isDelete: this.queryParams.isDelete,
                 startNumber: this.startNumber,
                 endNumber: this.endNumber,
-                searchQuery: this.condition.searchCondition || '',//检索条件
+                searchQuery: this.getConditionStr() || '',//检索条件
                 customFields:  [],
                 groupField:null,
                 orderDTOList:[
@@ -158,7 +158,7 @@ export default{
             let router = this.$router.resolve({
             path: '/exportPatent',
             query: {
-                projectId: null,
+                projectId: this.innerProjectId || this.condition.otherCondition.projectId || null,
                 condition: JSON.stringify(obj)
             }
             })
@@ -174,12 +174,12 @@ export default{
             }
             if(sign){
             var params = {
-                projectId: null,
+                projectId: this.innerProjectId || this.condition.otherCondition.projectId || null,
                 isAdd: this.queryParams.isAdd,
                 isDelete: this.queryParams.isDelete,
                 startNumber: this.startNumber,
                 endNumber: this.endNumber,
-                searchQuery: this.condition.searchCondition || '',//检索条件
+                searchQuery: this.getConditionStr() || '',//检索条件
                 customFields:  [],
                 groupField:null,
                 orderDTOList:[
@@ -191,8 +191,8 @@ export default{
             }
             }else{
             var params = {
-                projectId: null,
-                searchQuery: this.condition.searchCondition || '',//检索条件
+                projectId: this.innerProjectId || this.condition.otherCondition.projectId || null,
+                searchQuery: this.getConditionStr() || '',//检索条件
                 customFields:  [],
                 groupField:null,
                 orderDTOList:[
@@ -217,18 +217,18 @@ export default{
                     h('span', null, '任务正在导入,查看任务进度请前往 '),
                     h('span', {
                     style: 'color: #ff7d38;cursor: pointer;',
-                    // on: {
-                    //     click: () => {//
-                    //     let router = this.$router.resolve({
-                    //         path: '/taskList',
-                    //         query: {
-                    //         importToId: null,
-                    //         }
-                    //     })
-                    //     window.open(router.href, '_blank')
-                    //     this.$msgbox.close(false)
-                    //     }
-                    // }
+                    on: {
+                        click: () => {//
+                        let router = this.$router.resolve({
+                            path: '/taskList',
+                            query: {
+                                importToId: this.innerProjectId || this.condition.otherCondition.projectId || null,
+                            }
+                        })
+                        window.open(router.href, '_blank')
+                        this.$msgbox.close(false)
+                        }
+                    }
                     }, '立即前往',)
                 ]),
                 type: 'warning',

+ 6 - 4
src/views/components/import/conditionImport/internal_search/searchResult_internal.vue

@@ -167,7 +167,7 @@
                   </el-dropdown> -->
                 </div>
               </menu-in-row-item>
-              <menu-in-row-item name="importPatent" @click="importToProject">
+              <menu-in-row-item name="importPatent" @click.native="importToProject">
                 <div>
                   <svg-icon icon-class="daoru"></svg-icon>
                   <span class="margin-left_5">导入到项目</span>
@@ -681,10 +681,12 @@ export default {
     },
     //导入到专题库
     importToProject() {
-      if(this.outside){
+      if(this.outside || this.condition.DBType == 'inner_CN' || this.condition.DBType == 'inner_WD'){
         var form = {
           // ...this.searchData,
           ...this.condition,
+          searchCondition:this.getConditionStr() || '',
+          projectId:this.condition.otherCondition.projectId,
           orderBy: this.queryParams.OrderBy,
           orderByType: this.queryParams.OrderByType,
           // startNumber: this.selectedTotal > 0 ? this.startNumber : 1,
@@ -702,11 +704,11 @@ export default {
         stringRequest:{
           projectId: this.innerProjectId || (this.condition.otherCondition?this.condition.otherCondition.projectId:''),
           searchQuery: this.getConditionStr() || '',
-          orderDTOList:this.sort,
+          orderDTOList:[],
         },
         startNumber:1, //开始位置
         endNumber:(this.queryParams.isAdd && this.queryParams.isAdd.length>0)?0:this.total,//结束位置
-        fromProjectId:this.innerProjectId, //来源专题库项目id
+        fromProjectId:this.innerProjectId || (this.condition.otherCondition?this.condition.otherCondition.projectId:''), //来源专题库项目id
         toProjectId:this.projectId, //目标报告项目id
         isAdd:this.queryParams.isAdd, //去除专利号
       }