Browse Source

提交草稿

liuxiangqi 2 years ago
parent
commit
f207ffa734

+ 9 - 0
src/api/enterprise/project/project.js

@@ -101,3 +101,12 @@ export function entUserAudit(data) {
     data: data
   })
 }
+
+//保存草稿
+export function draftApi(data) {
+  return request({
+    url: `/ent/project/save-draft`,
+    method: 'post',
+    data: data
+  })
+}

+ 3 - 2
src/utils/request.js

@@ -100,12 +100,13 @@ service.interceptors.response.use(res => {
       });
     }
       return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
-    } else if (code === 500) {
+    } else if (code === 500 || code === 400) {
+      console.log("code为400")
       Message({
         message: msg,
         type: 'error'
       })
-      return Promise.reject(new Error(msg))
+      return res.data
     } else if(code == -2) {
       return Promise.reject('-2')
     } else if(code == -1) {

+ 3 - 3
src/views/enterprise/ent/edit.vue

@@ -70,14 +70,14 @@
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="7">
-          <el-form-item prop="cityId" label-width="60px">
+        <el-col :span="5">
+          <el-form-item prop="cityId" label-width="25px">
             <el-select v-model="form.cityId" placeholder="市" @change="getDistrictData" style="width: 220px;" filterable>
               <el-option v-for="(item, index) in cityDataList" :key="index" :label="item.name" :value="item.id"></el-option>
             </el-select>
           </el-form-item>
         </el-col>
-        <el-col :span="8">
+        <el-col :span="5">
           <el-form-item label-width="0px" prop="districtId">
             <el-select v-model="form.districtId" placeholder="区" style="width: 220px;" filterable @change="changeDistrict">
               <el-option v-for="(item, index) in districtDataList" :key="index" :label="item.name" :value="item.id"></el-option>

+ 3 - 4
src/views/enterprise/ent/info.vue

@@ -133,13 +133,12 @@
       <tr>
         <th>企业营业执照</th>
         <td>
-          <a class="link" :href="info.licensePath" target="_blank">企业营业执照</a>
+          <a class="link" :href="info.licensePath" target="_blank" v-if="info.licensePath">企业营业执照</a>
         </td>
         <th>其他附件</th>
         <td>
           <div v-for="(file, index) in list" :key="index">
-            <a class="link">{{file.fileName}}</a>
-            <el-button type="text" @click="handleView(file.id)">查看</el-button>
+            <a class="link" :href="file.url" target="_blank">{{file.fileName}}</a>
           </div>
         </td>
       </tr>
@@ -151,7 +150,7 @@
       <tr>
         <th>公司logo</th>
         <td>
-          <a class="link" :href="info.logo" target="_blank">公司logo</a>
+          <a class="link" :href="info.logo" target="_blank" v-if="info.logo">公司logo</a>
           <!-- <img :src="info.logo" alt="logo"> -->
         </td>
       </tr>

+ 16 - 1
src/views/enterprise/project/components/EntBasic.vue

@@ -149,6 +149,7 @@
             <el-form-item style="width:100%;text-align: center;" label-width="0px">
               <el-button :loading="loading" size="medium" type="primary" @click.native.prevent="submitForm" style="width: 100px;">自填保存</el-button>
               <el-button size="medium" type="primary" style="width: 100px;" @click="cancel">取消</el-button>
+              <el-button size="medium" type="primary" @click="submitDraft">保存草稿</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -158,7 +159,7 @@
 </template>
 
 <script>
-import { editProjectApi,getProjectInfoApi } from "@/api/enterprise/project/project"
+import { editProjectApi,getProjectInfoApi,draftApi } from "@/api/enterprise/project/project"
 import { techScopeOptions,yesOrNoOptions,businessIndustryOptions } from "@/utils/dataFormat"
 import FileUpload from '@/components/FileUpload'
 import { listEntUserApi } from "@/api/ent/ent"
@@ -375,6 +376,20 @@ export default {
           })
         }
       })
+    },
+    submitDraft() {
+      this.loading = true
+      if(this.form.techScopeArray.length > 0) {
+        this.form.techScope = this.form.techScopeArray.join(',')
+      }
+      if(this.form.industryArray.length > 0) {
+        this.form.industry = this.form.industryArray.join(',')
+      }
+      draftApi(this.form).then(res => {
+        this.loading = false
+        this.$store.dispatch("tagsView/delView", this.$route);
+        this.$router.go(-1);
+      })
     }
   },
   watch: {

+ 21 - 5
src/views/enterprise/project/components/FinBasic.vue

@@ -151,6 +151,7 @@
               <el-button @click="synEntSubmit" size="medium" type="primary">同步企业填报</el-button>
               <el-button :loading="loading" size="medium" type="primary" @click.native.prevent="submitForm" style="width: 100px;">财务保存</el-button>
               <el-button size="medium" type="primary" style="width: 100px;" @click="cancel">取消</el-button>
+              <el-button size="medium" type="primary" @click="submitDraft">保存草稿</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -160,7 +161,7 @@
 </template>
 
 <script>
-import { editProjectApi,getProjectInfoApi,synFinApi } from "@/api/enterprise/project/project"
+import { editProjectApi,getProjectInfoApi,synFinApi,draftApi } from "@/api/enterprise/project/project"
 import { techScopeOptions,yesOrNoOptions,businessIndustryOptions } from "@/utils/dataFormat"
 import FileUpload from '@/components/FileUpload'
 import { listEntUserApi } from "@/api/ent/ent"
@@ -326,10 +327,11 @@ export default {
       this.loading = true
       synFinApi(this.techId).then(res => {
         this.loading = false
-        this.$message.success('已同步完成');
-        if(res.data) {
+        if(res.code == 200) {
+          this.$message.success('已同步完成');
           this.getData()
         }
+
       })
     },
     //同步企业自填资料
@@ -337,8 +339,8 @@ export default {
       this.loading = true
       synFinApi(this.adminId).then(res => {
         this.loading = false
-        this.$message.success('已同步完成');
-        if(res.data) {
+        if(res.code == 200) {
+          this.$message.success('已同步完成');
           this.getData()
         }
       })
@@ -403,6 +405,20 @@ export default {
           })
         }
       })
+    },
+    submitDraft() {
+      this.loading = true
+      if(this.form.techScopeArray.length > 0) {
+        this.form.techScope = this.form.techScopeArray.join(',')
+      }
+      if(this.form.industryArray.length > 0) {
+        this.form.industry = this.form.industryArray.join(',')
+      }
+      draftApi(this.form).then(res => {
+        this.loading = false
+        this.$store.dispatch("tagsView/delView", this.$route);
+        this.$router.go(-1);
+      })
     }
   },
   watch: {

+ 19 - 2
src/views/enterprise/project/components/TechBasic.vue

@@ -152,6 +152,7 @@
               <el-button @click="synSubmit" size="medium" type="primary">同步企业填报</el-button>
               <el-button :loading="loading" size="medium" type="primary" @click.native.prevent="submitForm" style="width: 100px;">技术保存</el-button>
               <el-button size="medium" type="primary" style="width: 100px;" @click="cancel">取消</el-button>
+              <el-button size="medium" type="primary" @click="submitDraft">保存草稿</el-button>
             </el-form-item>
           </el-col>
         </el-row>
@@ -161,7 +162,7 @@
 </template>
 
 <script>
-import { editProjectApi,getProjectInfoApi,synTechApi } from "@/api/enterprise/project/project"
+import { editProjectApi,getProjectInfoApi,synTechApi,draftApi } from "@/api/enterprise/project/project"
 import { techScopeOptions,yesOrNoOptions,businessIndustryOptions } from "@/utils/dataFormat"
 import FileUpload from '@/components/FileUpload'
 import { listEntUserApi } from "@/api/ent/ent"
@@ -308,8 +309,10 @@ export default {
   },
   methods: {
     synSubmit() {
+      this.loading = true
       synTechApi(this.adminId).then(res => {
-        if(res.data) {
+        this.loading = false
+        if(res.code == 200) {
           this.$message.success('已同步完成');
           this.getData()
         }
@@ -377,6 +380,20 @@ export default {
           })
         }
       })
+    },
+    submitDraft() {
+      this.loading = true
+      if(this.form.techScopeArray.length > 0) {
+        this.form.techScope = this.form.techScopeArray.join(',')
+      }
+      if(this.form.industryArray.length > 0) {
+        this.form.industry = this.form.industryArray.join(',')
+      }
+      draftApi(this.form).then(res => {
+        this.loading = false
+        this.$store.dispatch("tagsView/delView", this.$route);
+        this.$router.go(-1);
+      })
     }
   },
   watch: {