فهرست منبع

项目按钮优化

sunjh 6 سال پیش
والد
کامیت
5e9df9c231
2فایلهای تغییر یافته به همراه68 افزوده شده و 33 حذف شده
  1. 63 28
      src/components/project/Project.vue
  2. 5 5
      src/components/task/Task.vue

+ 63 - 28
src/components/project/Project.vue

@@ -169,23 +169,28 @@
           <div class="btn btn-small" @click="cancelMode('project')">取消</div>
         </el-form-item>
         <el-form-item v-if="!isModifyMode">
-          <div v-if="projectOperationControl.confirmFinish" class="btn btn-small btn-warning-soft"
-               @click="endProject()">结束项目
-          </div>
-          <!--<div class="btn btn-small btn-info" @click="submitProjectRequest()">发布项目</div>-->
-          <div v-if="projectOperationControl.finish" class="btn btn-small btn-info" @click="submitProjectRequest()">
+
+          <el-button v-if="projectOperationControl.confirmFinish" type="success" size="mini" @click="endProject()">
+            结束项目
+          </el-button>
+          <el-button v-if="projectOperationControl.finish" type="primary" size="mini" @click="submitProjectRequest()">
             提交项目
-          </div>
-          <div v-if="projectOperationControl.receive" class="btn btn-small btn-info" @click="receiveProject()">接受项目
-          </div>
-          <div v-if="projectOperationControl.reject" class="btn btn-small btn-danger" @click="rejectProject()">拒绝项目
-          </div>
-          <div v-if="projectOperationControl.update" class="btn btn-small btn-info" @click="modifyForm()">修改项目</div>
-          <!--<div class="btn btn-medium btn-info" @click="analyseDemand()">分析需求</div>-->
-          <div v-if="projectOperationControl.createTask" class="btn btn-small btn-info" @click="createNewTask()">新建任务
-          </div>
-          <div v-if="projectOperationControl.uploadReport" class="btn btn-small btn-info" @click="createReport()">上传报告
-          </div>
+          </el-button>
+          <el-button v-if="projectOperationControl.receive" type="primary" size="mini" @click="receiveProject()">
+            接受项目
+          </el-button>
+          <el-button v-if="projectOperationControl.reject" type="danger" size="mini" @click="rejectProject()">
+            拒绝项目
+          </el-button>
+          <el-button v-if="projectOperationControl.update" type="primary" size="mini" @click="modifyForm()">
+            修改项目
+          </el-button>
+          <el-button v-if="projectOperationControl.createTask" type="primary" size="mini" @click="createNewTask()">
+            新建任务
+          </el-button>
+          <el-button v-if="projectOperationControl.uploadReport" type="primary" size="mini" @click="createReport()">
+            上传报告
+          </el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -247,13 +252,13 @@ import {
   getAllInstitutions,
   getAllPlatformTypes,
   getAllServiceTypes,
+  getFormalTimeFromDate,
   getProvinceCodeByProvinceName,
   getProvinceNameByProvinceCode,
   receiveProjectRequest,
   rejectProject,
   storageGet,
-  submitProjectRequest,
-  getFormalTimeFromDate
+  submitProjectRequest
 } from '@/js/index'
 
 export default {
@@ -552,9 +557,16 @@ export default {
     },
     //接收项目
     receiveProject () {
-      this.showLoading()
-      console.log('接收项目')
-      receiveProjectRequest(this.projectId, this.user.userVO.id, this.receiveProjectSuccess, this.receiveProjectFail)
+      this.$confirm('确认接收项目?', '提示', {
+        confirmButtonText: '确认接收',
+        cancelButtonText: '取消',
+        type: 'success'
+      }).then(() => {
+        this.showLoading()
+        console.log('接收项目')
+        receiveProjectRequest(this.projectId, this.user.userVO.id, this.receiveProjectSuccess, this.receiveProjectFail)
+      }).catch(() => {
+      })
     },
     receiveProjectSuccess (res) {
       this.hideLoading()
@@ -569,8 +581,16 @@ export default {
     },
     //拒绝项目
     rejectProject () {
-      this.showLoading()
-      rejectProject(this.projectId, this.rejectProjectSuccess, this.rejectProjectFail)
+      this.$confirm('确认拒绝项目?', '提示', {
+        confirmButtonText: '确认拒绝',
+        cancelButtonText: '取消',
+        type: 'success'
+      }).then(() => {
+        this.showLoading()
+        rejectProject(this.projectId, this.rejectProjectSuccess, this.rejectProjectFail)
+      }).catch(() => {
+      })
+
     },
     rejectProjectSuccess (res) {
       this.hideLoading()
@@ -582,8 +602,15 @@ export default {
     },
     //提交项目
     submitProjectRequest () {
-      this.showLoading()
-      submitProjectRequest(this.projectId, this.submitProjectRequestSuccess, this.submitProjectRequestFail)
+      this.$confirm('确认提交项目?', '提示', {
+        confirmButtonText: '确认提交',
+        cancelButtonText: '取消',
+        type: 'success'
+      }).then(() => {
+        this.showLoading()
+        submitProjectRequest(this.projectId, this.submitProjectRequestSuccess, this.submitProjectRequestFail)
+      }).catch(() => {
+      })
     },
     submitProjectRequestSuccess (res) {
       this.hideLoading()
@@ -598,8 +625,16 @@ export default {
     },
     //结束项目
     endProject () {
-      this.showLoading()
-      ensureEndProject(this.projectId, this.endProjectSuccess, this.endProjectFail)
+      this.$confirm('确认结束项目?', '提示', {
+        confirmButtonText: '确认结束',
+        cancelButtonText: '取消',
+        type: 'success'
+      }).then(() => {
+        this.showLoading()
+        ensureEndProject(this.projectId, this.endProjectSuccess, this.endProjectFail)
+      }).catch(() => {
+      })
+
     },
     endProjectSuccess (res) {
       this.hideLoading()
@@ -798,7 +833,7 @@ export default {
     hideLoading () {
       this.loading = false
     },
-    reformDate(date){
+    reformDate (date) {
       return getFormalTimeFromDate(date)
     }
   }

+ 5 - 5
src/components/task/Task.vue

@@ -122,7 +122,7 @@
             width="200"
             trigger="hover"
             content="测评机构已提交结束申请,请确认是否结束该任务">
-            <el-button v-if="!taskOperationControl.confirmFinish" type="success" size="mini" slot="reference"
+            <el-button v-if="taskOperationControl.confirmFinish" type="success" size="mini" slot="reference"
                        @click="endTask()">确认结束
             </el-button>
           </el-popover>
@@ -133,7 +133,7 @@
             width="200"
             trigger="hover"
             content="提交任务后不可更改,等待区域管理员验收">
-            <el-button v-if="!taskOperationControl.finish" type="primary" size="mini" slot="reference"
+            <el-button v-if="taskOperationControl.finish" type="primary" size="mini" slot="reference"
                        @click="submitTaskRequest()">提交任务
             </el-button>
           </el-popover>
@@ -144,7 +144,7 @@
             width="200"
             trigger="hover"
             content="拒绝后不可再接收此任务,且该任务对您不可见">
-            <el-button v-if="!taskOperationControl.reject" type="danger" size="mini" slot="reference"
+            <el-button v-if="taskOperationControl.reject" type="danger" size="mini" slot="reference"
                        @click="rejectTask()">拒绝任务
             </el-button>
           </el-popover>
@@ -155,7 +155,7 @@
             width="200"
             trigger="hover"
             content="接收任务后请认真完成!">
-            <el-button v-if="!taskOperationControl.receive" type="primary" size="mini" slot="reference"
+            <el-button v-if="taskOperationControl.receive" type="primary" size="mini" slot="reference"
                        @click="receiveTask()">接收任务
             </el-button>
           </el-popover>
@@ -163,7 +163,7 @@
 
           <el-button v-if="taskOperationControl.update" type="primary" size="mini" @click="modifyForm()">修改任务
           </el-button>
-          <el-button v-if="!taskOperationControl.uploadReport" type="primary" size="mini" @click="toCreateReport()">
+          <el-button v-if="taskOperationControl.uploadReport" type="primary" size="mini" @click="toCreateReport()">
             上传报告
           </el-button>
           <!--<div class="btn btn-small btn-info"-->