Переглянути джерело

调整绿色通道添加项目

sunjh 6 роки тому
батько
коміт
04b5cd2524

+ 129 - 0
src/components/authen/AuthenticationManage.vue

@@ -0,0 +1,129 @@
+<template>
+  <div class="create-container">
+    <div class="create-body">
+      <div class="title">审核认证信息</div>
+      <el-table
+        :data="authenticationList"
+        stripe
+        style="width: 100%">
+        <el-table-column prop="code" label="编号" width="180">
+          <template slot-scope="scope">
+            <span>{{scope.row.code}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="userInfo" label="用户信息" width="180">
+          <template slot-scope="scope">
+            <span style="cursor: pointer">
+              <el-link type="primary">{{scope.row.userInfo}}</el-link>
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="type" label="认证类型" width="180">
+          <template slot-scope="scope">
+            <span>
+              <el-tag v-if="scope.row.type=='个人'" type="success">{{scope.row.type}}</el-tag>
+              <el-tag v-if="scope.row.type=='机构'">{{scope.row.type}}</el-tag>
+              <el-tag v-if="scope.row.type=='企业'" type="warning">{{scope.row.type}}</el-tag>
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="detail" label="认证详情" width="180">
+          <template slot-scope="scope">
+            <el-link type="primary">{{scope.row.detail}}</el-link>
+          </template>
+        </el-table-column>
+        <el-table-column prop="status" label="认证状态" width="180">
+          <template slot-scope="scope">
+            <span>
+              <el-tag v-if="scope.row.status==authenticationStatusUntreated" type="info">{{scope.row.status}}</el-tag>
+              <el-tag v-if="scope.row.status==authenticationStatusPass" type="success">{{scope.row.status}}</el-tag>
+              <el-tag v-if="scope.row.status===authenticationStatusReject" type="danger">{{scope.row.status}}</el-tag>
+            </span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="date" label="申请时间">
+          <template slot-scope="scope">
+            <span>{{scope.row.date}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button type="primary" size="mini" @click="handleAuthenticationPass(scope.row)">通过</el-button>
+            <el-button type="warning" size="mini" @click="handleAuthenticationReject(scope.row)">驳回</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <el-pagination
+        :page-size="20"
+        hide-on-single-page
+        :pager-count="5"
+        :current-page.sync="currentPage"
+        layout="prev, pager, next"
+        @current-change="handleCurrentChange"
+        :total="100">
+      </el-pagination>
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  name: 'AuthenticationManage',
+  data () {
+    return {
+      currentPage: 1,
+      authenticationStatusUntreated:'审核中',
+      authenticationStatusPass:'审核通过',
+      authenticationStatusReject:'审核未通过',
+      authenticationList: [{
+        code: '123122',
+        userInfo: '郭超',
+        type: '个人',
+        status: '审核中',
+        detail: '查看详情',
+        date: '2016-05-04'
+      }, {
+        code: '123123',
+        userInfo: '郭超',
+        type: '企业',
+        status: '审核未通过',
+        detail: '查看详情',
+        date: '2016-05-04'
+      },{
+        code: '123124',
+        userInfo: '郭超',
+        type: '机构',
+        status: '审核通过',
+        detail: '查看详情',
+        date: '2016-05-04'
+      }],
+      tableData: [{
+        date: '2016-05-02',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1518 弄'
+      }, {
+        date: '2016-05-04',
+        name: '王小虎',
+        address: '上海市普陀区金沙江路 1517 弄'
+      }]
+    }
+  },
+  methods: {
+    handleCurrentChange (param) {
+      console.log(param)
+    },
+    handleAuthenticationPass (item) {
+      item.status = this.authenticationStatusPass
+      console.log('通过')
+    },
+    handleAuthenticationReject (item) {
+      item.status = this.authenticationStatusReject
+      console.log('拒绝')
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>

+ 57 - 45
src/components/cheat/ProjectAdd.vue

@@ -93,7 +93,6 @@
                   将文件拖到此处,或
                   <em>点击上传</em>
                 </div>
-                <div class="el-upload__tip" slot="tip">请上传报告文件</div>
               </el-upload>
               <!--<div v-if="!isModifyMode">-->
               <!--<span v-if="project.file==null || project.file.length === 0">暂无文件</span>-->
@@ -151,7 +150,6 @@
                   将文件拖到此处,或
                   <em>点击上传</em>
                 </div>
-                <div class="el-upload__tip" slot="tip">请上传报告文件</div>
               </el-upload>
               <!--<div v-if="!isModifyMode">-->
               <!--<span v-if="project.file==null">暂无文件</span>-->
@@ -173,37 +171,49 @@
           <el-table
             :data="projectList"
             style="width: auto">
-      <el-table-column
-        prop="projectDetails.name"
-        label="项目名称">
-      </el-table-column>
-            <el-table-column
-              prop="projectDetails.platform"
-              label="项目测试平台">
+            <el-table-column prop="name" label="项目名称">
+              <template slot-scope="scope">
+                <span>{{scope.row.name}}</span>
+              </template>
+            </el-table-column>
+            <el-table-column width="300px" prop="platform" label="项目测试平台">
+              <template slot-scope="scope">
+                <span v-for="item in platforms" :key="item">
+                   <el-tag type="success">{{item}}</el-tag>&nbsp;&nbsp;
+                </span>
+              </template>
             </el-table-column>
-            <el-table-column
-              prop="projectDetails.contactName"
-              label="项目联系人">
+            <el-table-column prop="linkMan" label="项目联系人">
+              <template slot-scope="scope">
+                <span>{{scope.row.linkMan}}</span>
+              </template>
             </el-table-column>
-            <el-table-column
-              prop="projectDetails.contactPhone"
-              label="联系方式">
+            <el-table-column prop="linkManMobile" label="联系方式">
+              <template slot-scope="scope">
+                <span>{{scope.row.linkManMobile}}</span>
+              </template>
             </el-table-column>
-            <el-table-column
-              prop="projectDetails.type"
-              label="项目测试类型">
+            <el-table-column prop="type" label="项目测试类型">
+              <template slot-scope="scope">
+                <span v-for="item in JSON.parse(scope.row.type)" :key="item">
+                   <el-tag type="success">{{item}}</el-tag>&nbsp;&nbsp;
+                </span>
+              </template>
             </el-table-column>
-            <el-table-column
-              prop="projectDetails.desc"
-              label="项目需求描述">
+            <el-table-column prop="description" label="项目需求描述">
+              <template slot-scope="scope">
+                <span>{{scope.row.description}}</span>
+              </template>
             </el-table-column>
-            <el-table-column
-              prop="projectDetails.desc"
-              label="测试报告内容">
+            <el-table-column prop="description" label="测试报告内容">
+              <template slot-scope="scope">
+                <span>{{scope.row.description}}</span>
+              </template>
             </el-table-column>
-            <el-table-column
-              prop="projectDetails.desc"
-              label="测试报告结论">
+            <el-table-column prop="description" label="测试报告结论">
+              <template slot-scope="scope">
+                <span>{{scope.row.description}}</span>
+              </template>
             </el-table-column>
     </el-table>
         </span>
@@ -224,14 +234,14 @@
 import Http from '@/js/http.js'
 import Apis from '@/js/api.js'
 import {notify} from '@/constants/index'
-import {getAllPlatformTypes, getAllServiceTypes,storageGet} from '@/js/index'
+import {getAllPlatformTypes, getAllServiceTypes, storageGet} from '@/js/index'
 
 export default {
   name: 'ProjectAdd',
   data () {
     return {
       userId: 0,
-      user:{},
+      user: {},
       dialogVisible: false,
       isModifyMode: true,
       serviceType: [],
@@ -470,7 +480,7 @@ export default {
       )
     },
     beforeRemove (file, fileList) {
-      return this.$confirm(`确定移除 ${file.name}?`)
+      //return this.$confirm(`确定移除 ${file.name}?`)
     },
     beforeFileUpload () {
 
@@ -482,7 +492,7 @@ export default {
         headers: {'Content-Type': 'multipart/form-data'},
       }
       formData.append('file', param.file)
-      Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, formData, config).then((res) => {
+      Http.upload(Apis.PROJECT.ADD_PROJECT_BY_EXCEL_PRE, formData, config).then((res) => {
         console.log(res)
         this.projectList = res.data
         this.showDialog()
@@ -524,21 +534,23 @@ export default {
       })
     },
     handleDialogClose (done) {
-      this.$confirm('确认退出?退出前请记录下登录账号和密码,否则无法找回!!!')
-        .then(_ => {
-          //done()
-          this.hideDialog()
-        })
-        .catch(_ => {
-        })
+      this.hideDialog()
+      this.project.excelFile = []
+      // this.$confirm('确认退出?退出前请记录下登录账号和密码,否则无法找回!!!')
+      //   .then(_ => {
+      //     //done()
+      //     this.hideDialog()
+      //   })
+      //   .catch(_ => {
+      //   })
     },
     ensureSubmitExcel () {
-      notify('success', '添加成功')
-      // Http.post('',this.projectList).then((res)=>{
-      //
-      // }).catch((error)=>{
-      //
-      // })
+      Http.post(Apis.PROJECT.ADD_PROJECT_BY_EXCEL, this.projectList).then((res) => {
+        notify('success', '添加成功')
+        this.hideDialog()
+      }).catch((error) => {
+        notify('error', error.data)
+      })
     },
     showDialog () {
       this.dialogVisible = true
@@ -593,7 +605,7 @@ export default {
         datetime: ''
       }
     },
-    setUserinfo(){
+    setUserinfo () {
       this.user = storageGet('user')
     }
   },

+ 2 - 1
src/js/api.js

@@ -5,7 +5,8 @@ export default {
     UPDATE_PROJECT: '/api/project/{projectId}/',
     DELETE_PROJECT: '/api/project/{projectId}/',
     ADD_PROJECT: '/api/greenChannel/project/',
-    ADD_PROJECT_BY_EXCEL: '/api/greenChannel/projects',
+    ADD_PROJECT_BY_EXCEL_PRE: '/api/greenChannel/excel/projects',
+    ADD_PROJECT_BY_EXCEL: '/api/greenChannel/projects'
   },
   TASK: {
     GET_TASK: '/api/project/{projectId}/task/{taskId}/',

+ 12 - 2
src/js/index.js

@@ -23,8 +23,8 @@ export const getCurrentUser = () => {
     userVO: {
       id: 3,
       name: '郭超',
-      mobile:'110',
-      email:'12345@qq.com',
+      mobile: '110',
+      email: '12345@qq.com',
     },
     agency: '',
   }
@@ -266,3 +266,13 @@ export const getProvinceCodeByProvinceName = (provinceName, cityName) => {
 export const getGreenChannelAddProjectExcelTemplateFile = () => {
   return '123.excel'
 }
+
+//获取所有认证消息
+export const getAllAuthentications = () => {
+  return [{
+    userVO: {},
+    type: '',
+    status: '',
+    authenticationDetail: {}
+  }]
+}

+ 4 - 0
src/main.js

@@ -25,6 +25,7 @@ import {
   FormItem,
   Input,
   InputNumber,
+  Link,
   Menu,
   MenuItem,
   MenuItemGroup,
@@ -32,6 +33,7 @@ import {
   MessageBox,
   Notification,
   Option,
+  Pagination,
   Radio,
   RadioButton,
   RadioGroup,
@@ -111,6 +113,8 @@ Vue.use(Dialog)
 Vue.use(Card)
 Vue.use(Tag)
 Vue.use(Avatar)
+Vue.use(Pagination)
+Vue.use(Link)
 
 Vue.prototype.$msgbox = MessageBox
 Vue.prototype.$alert = MessageBox.alert

+ 9 - 0
src/router/index.js

@@ -173,5 +173,14 @@ export default new Router({
         requireAuth: false,
       },
     },
+    {
+      path: '/authentication/manage',
+      name: 'AuthenticationManage',
+      component: resolve => require(['@/components/authen/AuthenticationManage.vue'], resolve),
+      meta: {
+        title: '',
+        requireAuth: false,
+      },
+    },
   ]
 })