刘湘琪 преди 2 години
родител
ревизия
5864eea3a7

+ 8 - 0
src/api/enterprise/declare/declare.js

@@ -31,3 +31,11 @@ export function listDeclareCommonApi(query) {
     params: query
   })
 }
+//项目回退
+export function projectBackApi(ids,data) {
+  return request({
+    url: `/admin/project/cancel/${ids}`,
+    method: 'put',
+    data: data
+  })
+}

+ 3 - 1
src/views/common/registerFirst.vue

@@ -362,6 +362,7 @@ import { regTypeOptions,mainProductsOptions,yesOrNoOptions } from "@/utils/dataF
 import FileUpload from '@/components/FileUpload'
 import ImageUpload from '@/components/ImageUpload'
 import { validIDcard,validAmount} from '@/utils/validate'
+import { validNumber } from '@/utils/validate'
 
 export default {
   name: "First",
@@ -475,7 +476,8 @@ export default {
         ],
         zipCode: [
           { required: true, trigger: "blur", message: "请输入邮政编码" },
-          {max: 6, message: '最多输入6个字母', trigger: 'blur' }
+          { validator: validNumber, trigger: 'blur'},
+          {max: 6, message: '最多输入6位数字', trigger: 'blur' }
         ],
         provinceId: [
           { required: true, trigger: "change", message: "请选择省份" },

+ 38 - 5
src/views/enterprise/declare/index.vue

@@ -53,11 +53,12 @@
     <h3 class="toolbar">
       <span class="title">列表</span>
       <div class="tool">
-        <!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDel">批量删除</el-button> -->
+         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDel" v-if="roleType == 'entAdmin' || roleType == 'entUser' || roleType == 'manager'">批量删除</el-button>
         <!-- <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDow">批量下载</el-button> -->
       </div>
     </h3>
-    <el-table v-loading="loading" :data="list" border>
+    <el-table v-loading="loading" :data="list" border @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="项目编号" prop="projectNo" width="150" align="center" />
       <el-table-column label="项目名称" prop="projectName" align="center" width="150"></el-table-column>
       <el-table-column label="企业名称" prop="entName" align="center" width="150"/>
@@ -86,7 +87,7 @@
 <!-- 科德管理员、企业角色、税务角色都有项目申报角色 -->
 <script>
   import {getProvinceDataApi,getRegionChildrenApi} from "@/api/common/common"
-  import {listDeclareApi,listDeclareCommonApi} from '@/api/enterprise/declare/declare'
+  import {listDeclareApi,listDeclareCommonApi,projectBackApi} from '@/api/enterprise/declare/declare'
   import {entStateOptions, getLabel, authStateOptions} from '@/utils/dataFormat'
   export default {
     data () {
@@ -95,8 +96,11 @@
         provinceDataList: [],
         cityDataList: [],
         districtDataList: [],
+        ids: [],
+        selectCount: '',
         entStateOptions: entStateOptions,
         authStateOptions: authStateOptions,
+        roleType: '',
         queryParams: {
           pageNum: 1,
           pageSize: 10,
@@ -137,6 +141,32 @@
       }
     },
     methods: {
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.id)
+        this.selectCount = selection.length;
+      },
+      handleBatchDel() {
+        if(this.selectCount <= 0) {
+          this.$message.error('请选择要删除的数据');
+          return
+        }
+        const delIds = this.ids.join(',')
+        this.$confirm('是否确认删除该数据?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+            return projectBackApi(delIds);
+          }).then(() => {
+            this.queryParams.pageNum = 1;
+            this.getList();
+            this.$message({
+              message: '删除成功',
+              type: 'success'
+            });
+          })
+      },
       getAreaData() {
         getRegionChildrenApi(this.scopeId).then(res => {
           if(res.code == 200) {
@@ -198,11 +228,14 @@
             cancelButtonText: "取消",
             type: "warning"
           }).then(function() {
-            return deleteEntApi(id);
+            return projectBackApi(id);
           }).then(() => {
             this.queryParams.pageNum = 1;
             this.getList();
-            this.msgSuccess("删除成功");
+            this.$message({
+              message: '删除成功',
+              type: 'success'
+            });
           })
       },
       // 重置

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

@@ -379,7 +379,7 @@ import ImageUpload from '@/components/ImageUpload'
 import {getEnclosureApi} from "@/api/enterprise/project/project"
 import UploadEnclosure from "./components/UploadEnclosure"
 import {deleteEnclosureApi} from '@/api/enterprise/project/project'
-import { validIDcard,validAmount} from '@/utils/validate'
+import { validIDcard,validAmount,validNumber } from '@/utils/validate'
 
 export default {
   name: "First",
@@ -508,7 +508,8 @@ export default {
         ],
         zipCode: [
           { required: true, trigger: "blur", message: "请输入邮政编码" },
-          {max: 6, message: '最多输入6个字母', trigger: 'blur' }
+          { validator: validNumber, trigger: 'blur'},
+          {max: 6, message: '最多输入6位数字', trigger: 'blur' }
         ],
         provinceId: [
           { required: true, trigger: "change", message: "请选择省份" },

+ 0 - 2
src/views/enterprise/ent/index.vue

@@ -66,8 +66,6 @@
           <span>{{scope.row.provinceName}}{{scope.row.cityName}}{{scope.row.districtName}}</span>
         </template>
       </el-table-column>
-      <!-- <el-table-column label="市" prop="cityName" align="center" width="120" />
-      <el-table-column label="区" prop="districtName" align="center" width="120" /> -->
       <el-table-column label="社会信用代码" prop="license" align="center" width="160"></el-table-column>
       <el-table-column label="联系人" align="center" prop="nickName" width="150"></el-table-column>
       <el-table-column label="联系人手机号" prop="phonenumber" align="center" width="160"></el-table-column>

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

@@ -126,7 +126,7 @@
           </el-col>
           <el-col :span="24">
             <el-form-item label="证书有效期限" prop="lisenceTime">
-              <el-date-picker v-model="form.lisenceTime" placeholder="选择日期" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="lisenceChange"></el-date-picker>
+              <el-date-picker v-model="form.lisenceTime" placeholder="选择日期" type="daterange" value-format="yyyy-MM-dd" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
             </el-form-item>
           </el-col>
           <el-col :span="24">
@@ -280,16 +280,8 @@ export default {
     setTimeout(() => {        // 加延时
       this.getEntData()
     }, 500);
-    if(this.form.techFlag == 1) {
-      this.techVisible = true
-    }else {
-      this.techVisible = false
-    }
   },
   methods: {
-    lisenceChange(date) {
-      console.log(date)
-    },
     getEntData() {
       listEntUserApi().then(res => {
         this.form.entName = res.data.entName

+ 8 - 6
src/views/enterprise/project/components/FinBasic.vue

@@ -7,7 +7,7 @@
       <el-row :gutter="40">
         <el-col :span="12">
           <el-form-item label="企业名称" prop="entName">
-            <el-input v-model="form.entName" type="text" auto-complete="off" placeholder="请输入企业名称" disabled></el-input>
+            <el-input v-model="form.entName" type="text" placeholder="请输入企业名称" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -188,6 +188,7 @@ export default {
       form: {
         id: undefined,
         entId: undefined,
+        entName: '',
         projectOwner: 3,
         lisenceTime: [],
         techStartDate: '',
@@ -271,21 +272,22 @@ export default {
       loading: false,
       captchaOnOff: true
     };
+  },
+  mounted() {
+    this.getEntData()
   },
   created() {
     this.form.id = this.$route.query.id || undefined;
     this.form.entId = this.$route.query.entId || undefined;
     if(this.form.id) {
       this.getData()
-    }
-    setTimeout(() => {        // 加延时
-      this.getEntData()
-    }, 500);
+    }
   },
   methods: {
     getEntData() {
       listEntUserApi().then(res => {
         this.form.entName = res.data.entName
+        // this.$set(this.form, 'entName', res.data.entName)
       })
     },
     //同步技术资料
@@ -352,7 +354,7 @@ export default {
       this.$refs.form.validate(valid => {
         if(valid) {
           this.loading = true
-          this.form.techScope = this.techScopeArray.join(',')
+          this.form.techScope = this.form.techScopeArray.join(',')
           editProjectApi(this.form).then(res => {
             this.loading = false
             this.$store.dispatch("tagsView/delView", this.$route);

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

@@ -7,7 +7,7 @@
       <el-row :gutter="40">
         <el-col :span="12">
           <el-form-item label="企业名称" prop="entName">
-            <el-input v-model="form.entName" type="text" auto-complete="off" placeholder="请输入企业名称" disabled></el-input>
+            <el-input v-model="form.entName" type="text" placeholder="请输入企业名称" disabled></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="12">
@@ -331,7 +331,7 @@ export default {
       this.$refs.form.validate(valid => {
         if(valid) {
           this.loading = true
-          this.form.techScope = this.techScopeArray.join(',')
+          this.form.techScope = this.form.techScopeArray.join(',')
           editProjectApi(this.form).then(res => {
             this.loading = false
             this.$store.dispatch("tagsView/delView", this.$route);

+ 23 - 6
src/views/enterprise/project/components/addProject.vue

@@ -1,6 +1,6 @@
 <template>
-  <el-dialog title="新增项目" :visible.sync="open" width="500px" append-to-body>
-    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+  <el-dialog title="新增项目" :visible.sync="open" width="600px" append-to-body>
+    <el-form ref="form" :model="form" :rules="rules" label-width="130px">
       <el-form-item label="项目编号" prop="projectNo">
         <el-input v-model="form.projectNo"></el-input>
       </el-form-item>
@@ -60,11 +60,28 @@
           projectTime: [],
         },
         rules: {
-          checkStatus: [
-            {required: true, message: '请选择审核结果', trigger: 'change'}
+          projectNo: [
+            {required: true, message: '请输入项目编号', trigger: 'blur'},
+            {max: 100, message: '最多输入100个字符', trigger: 'blur' }
           ],
-          serviceTime: [
-            {required: true, message: '请设置服务时间段', trigger: 'change'}
+          projectName: [
+            {required: true, message: '请输入项目名称', trigger: 'blur'},
+            {max: 100, message: '最多输入100个字符', trigger: 'blur' }
+          ],
+          projectYear: [
+            {required: true, message: '请输入项目年份', trigger: 'change'}
+          ],
+          techUserId: [
+            {required: true, message: '请选择技术员', trigger: 'change'}
+          ],
+          finUserId: [
+            {required: true, message: '请选择财务员', trigger: 'change'}
+          ],
+          overYearFlag: [
+            {required: true, message: '请选择是否跨年', trigger: 'change'}
+          ],
+          projectTime: [
+            {required: true, message: '请选择项目周期', trigger: 'change', type: 'array'}
           ]
         }
       }

+ 1 - 1
src/views/enterprise/project/components/declare.vue

@@ -3,7 +3,7 @@
     <el-form ref="form" :model="form" :rules="rules" label-width="140px">
         <el-form-item label="项目资料选择" prop="projectData">
           <el-select v-model="form.projectData">
-            <el-option value="1">财务数据</el-option>
+            <el-option value="1" label="财务数据">财务数据</el-option>
           </el-select>
         </el-form-item>
     </el-form>

+ 23 - 8
src/views/enterprise/project/edit.vue

@@ -1,9 +1,8 @@
 <template>
   <div class="app-container" v-loading="loading">
-    <el-tabs :tab-position="tabPosition" stretch v-model="activeName">
+    <el-tabs :tab-position="tabPosition" stretch v-model="activeName" @tab-click="handleClick">
       <el-tab-pane label="企业自填" name="1">
-        <!-- <first></first> -->
-        <el-tabs type="border-card">
+        <el-tabs type="border-card" v-if="entVisible">
           <el-tab-pane label="项目基本信息">
             <ent-basic></ent-basic>
           </el-tab-pane>
@@ -13,8 +12,7 @@
         </el-tabs>
       </el-tab-pane>
       <el-tab-pane label="企业技术" name="2">
-        <!-- <second></second> -->
-        <el-tabs type="border-card">
+        <el-tabs type="border-card" v-if="techVisible">
           <el-tab-pane label="项目基本信息">
             <tech-basic></tech-basic>
           </el-tab-pane>
@@ -24,8 +22,7 @@
         </el-tabs>
       </el-tab-pane>
       <el-tab-pane label="企业财务" name="3">
-        <!-- <third></third> -->
-        <el-tabs type="border-card">
+        <el-tabs type="border-card" v-if="finVisible">
           <el-tab-pane label="项目基本信息">
             <fin-basic></fin-basic>
           </el-tab-pane>
@@ -79,7 +76,10 @@ export default {
       tabPosition: 'left',
       activeName: '1',
       loading: false,
-      id: undefined
+      id: undefined,
+      entVisible: true,
+      finVisible: false,
+      techVisible: false
     };
   },
   created() {
@@ -91,6 +91,21 @@ export default {
         this.form.entName = res.data.entName
       })
     },
+    handleClick(tab,event) {
+      if(tab.name == '1') {
+        this.entVisible = true
+        this.techVisible = false
+        this.finVisible = false
+      }else if(tab.name == '2') {
+        this.techVisible = true
+        this.entVisible = false
+        this.finVisible = false
+      }else if(tab.name == '3') {
+        this.finVisible = true
+        this.entVisible = false
+        this.techVisible = false
+      }
+    }
   }
 };
 </script>

+ 31 - 9
src/views/enterprise/project/index.vue

@@ -44,7 +44,8 @@
         <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleBatchDel" v-if="roleType == 'entAdmin' || roleType == 'entUser'">批量删除</el-button>
       </div>
     </h3>
-    <el-table v-loading="loading" :data="list" border>
+    <el-table v-loading="loading" :data="list" border @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="项目编号" prop="projectNo" width="120" align="center" />
       <el-table-column label="项目名称" prop="projectName" align="center" width="120"></el-table-column>
       <el-table-column label="企业名称" prop="entName" align="center" width="120"/>
@@ -138,6 +139,8 @@
         addProjectVisible: false,
         declareVisible: false,
         auditVisible: false,
+        ids: [],
+        selectCount: '',
         provinceDataList: [],
         cityDataList: [],
         districtDataList: [],
@@ -179,6 +182,33 @@
       this.roleType = this.roles.join(',')
     },
     methods: {
+      // 多选框选中数据
+      handleSelectionChange(selection) {
+        this.ids = selection.map(item => item.id)
+        console.log(this.ids)
+        this.selectCount = selection.length;
+      },
+      handleBatchDel() {
+        if(this.selectCount <= 0) {
+          this.$message.error('请选择要删除的数据');
+          return
+        }
+        const delIds = this.ids.join(',')
+        this.$confirm('是否确认删除该数据?', "警告", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning"
+          }).then(function() {
+            return deleteProjectApi(delIds);
+          }).then(() => {
+            this.queryParams.pageNum = 1;
+            this.getList();
+            this.$message({
+              message: '删除成功',
+              type: 'success'
+            });
+          })
+      },
       //选择省份
       getCityData() {
         this.queryParams.cityId = ''
@@ -206,8 +236,6 @@
         })
       },
       getList() {
-        // console.log(this.queryParams.year)
-        // return
         this.loading = true;
         if(this.userType == 'ENT_ADMIN' || this.userType == 'ENT_TECH' || this.userType == 'ENT_ADMIN_TECH' || this.userType == 'ENT_FIN' || this.userType == 'ENT_ADMIN_FIN') {
           listProjectApi(this.queryParams).then(response => {
@@ -230,17 +258,11 @@
           this.$refs.addProject.init()
         })
       },
-      handleBatchAdd() {
-
-      },
       handleDownload(row) {
         downloadProjectByIDApi(row.id).then(response => {
           this.download(response.msg);
         });
       },
-      handleBatchDel() {
-
-      },
       handleDownloadBatch() {
 
       },