HZH-PC\HZH vor 4 Jahren
Ursprung
Commit
f900794a49

+ 2 - 20
src/api/department.js

@@ -7,29 +7,11 @@ export function getTree(flag){
     }).then(result => result.data)
 }
 
-//新增
-export function addPlan(item) {
-    return axios({
-        method: 'post',
-        url: '/weekly/add',
-        data: qs.stringify(item)
-    }).then(res => res.data)
-}
-
 //修改
-export function updatePlan(item) {
-    return axios({
-        method: 'post',
-        url: '/weekly/update',
-        data: qs.stringify(item)
-    }).then(res => res.data)
-}
-
-//删除
-export function deletePlan(item) {
+export function updateUser(item) {
     return axios({
         method: 'post',
-        url: '/weekly/delete',
+        url: '/user/updateInfo',
         data: qs.stringify(item)
     }).then(res => res.data)
 }

+ 36 - 14
src/components/MainPage/Department.vue

@@ -10,43 +10,52 @@
   .depart-content{
     width: calc(100% - 300px);
     padding: 0 20px;
+    &>div:last-child{
+      padding: 15px 0;
+      text-align: right;
+    }
   }
 }
 </style>
 <template>
 <div class="depart">
   <div class="depart-tree">
-    <UserTree></UserTree>
+    <UserTree :setUserId="currentPerson.id" @chooseUser="chooseUser"></UserTree>
   </div>
   <div class="depart-content">
     <el-collapse v-model="activeNames" @change="handleChange">
       <el-collapse-item title="姓名" name="1">
-        <div>人员XX</div>
+        <div v-if="!ableEdit">{{currentPerson.name}}</div>
+        <el-input  v-if="ableEdit" placeholder="请输入" v-model="currentPerson.name"></el-input>
       </el-collapse-item>
-      <el-collapse-item title="部门" name="2">
-        <div>XXXX部门</div>
+      <el-collapse-item title="职位" name="2">
+        <div>{{currentPerson.departmentName}}</div>
       </el-collapse-item>
       <el-collapse-item title="简介" name="3">
-        <p>
-          在校期间遵守校纪校规,尊敬老师,吃苦耐劳,先后被评为“优秀团员”,“优秀班干”,“优秀团干”,“三好学生”等一系列的光荣称号。在思想上积极要求进步,早就向党组织递交了入党申请书,并定时参加双学小组学习。担任班级团支书期间,工作勤勤恳恳,尽心尽力,在生活中乐于助人,团结同学,主动帮助其他有困难的同学。
-        </p>
-        <br/>
-        <p>
-          在学习上认真刻苦,上课专心听讲,认真完成老师布置的各项作业,成绩名列班级前茅,在专业知识学习上努力认真。
-在专业技术方面,虚心地向学校的各位老师学习,加强技能训练,经常参加校、系组织的各项活动,在校组织的雕刻比赛中获得一等奖、系水果拼盘比赛获得二等奖,在07年江苏省中等职业学校学生技能比赛中,冷拼和热炒分别获得第二名的好成绩,并获得高级工的荣誉称号,且有幸代表江苏省参加中国职业学校技能比赛。
-        </p>
       </el-collapse-item>
       <el-collapse-item title="联系方式" name="4">
-        <div>手机:111111111111</div>
-        <div>邮箱:wwwwwwwwwwwwwwwwwwwwwww</div>
+        <div v-if="!ableEdit">
+          <p>手机:{{currentPerson.phone}}</p>
+          <p>邮箱:{{currentPerson.email}}</p>
+        </div>
+        <div v-if="ableEdit">
+          <p>手机:<el-input  placeholder="请输入" v-model="currentPerson.phone"></el-input></p>
+          <p>邮箱:<el-input  placeholder="请输入" v-model="currentPerson.email"></el-input></p>
+        </div>
       </el-collapse-item>
     </el-collapse>
+    <div>
+       <el-button type="primary" icon="el-icon-edit" v-if="!ableEdit" @click="ableEdit = true"></el-button>
+       <el-button type="primary" v-if="ableEdit" @click="save">保存</el-button>
+    </div>
   </div>
 </div>
 </template>
 
 <script>
+import { updateUser } from '@/api/department';
 import UserTree from "@/components/MainPage/Department/UserTree";
+
 export default {
   name: 'Department',
   components: {
@@ -56,6 +65,8 @@ export default {
   data() {
     return {
       activeNames: ['1','2','3','4'],
+      currentPerson: this.$store.state.loginUser,
+      ableEdit: false
     };
   },
 
@@ -66,6 +77,17 @@ export default {
   },
 
   methods: {
+    chooseUser(val){
+      this.currentPerson = val;
+    },
+    save(){
+      updateUser(this.currentPerson).then((data) => {
+        if(!data.result){
+          this.$message(data.message);
+        }
+        this.ableEdit = false;
+      })
+    },
     handleChange(val) {
     }
   },

+ 2 - 0
src/components/MainPage/Department/UserTree.vue

@@ -28,6 +28,8 @@ export default {
     showUser: {
       type: Boolean, default: true
     },
+    setUserId: {
+    }
   },
   data() {
     return {

+ 8 - 3
src/components/MainPage/Judge/Judge.vue

@@ -5,7 +5,7 @@
   <div
     v-wang-editor="{
     config:editorConfig,
-    text: plan.evaluation,
+    text: planJudge,
     changeSignal:changeSignal
     }"
   >
@@ -22,16 +22,21 @@ export default {
   components: {
   },
   props:{
+    planJudge:{
+      type: String, default: ''
+    },
+    changeSignal:{
+      type: Boolean, default: false
+    }
   },
   data() {
     return {
       editorConfig:{
         ...editorDefaultSet,
         onchange: html => {
-          this.plan.evaluation = html;
+          this.$emit('setEvaluation', html);
         }
       },
-      changeSignal: false
     };
   },
 

+ 77 - 11
src/components/MainPage/Month.vue

@@ -5,7 +5,7 @@
 .dialog-style{
   div{
     text-align: center;
-    margin: 5px;
+    margin: 5px 0;
     label,/deep/ .el-input,/deep/ .el-textarea{
       display: inline-block;
       vertical-align: middle;
@@ -14,7 +14,10 @@
       width: 200px;
     }
     /deep/ .el-textarea{
-      width: 600px;
+      width: 460px;
+    }
+    .el-select /deep/ .el-input{
+      width: 70px;
     }
   }
   .add-bt{
@@ -24,9 +27,12 @@
   }
   .del-bt{
     cursor: pointer;
-    font-size: 15px;
+    font-size: 18px;
   }
 }
+.hide{
+  opacity: 0;
+}
 </style>
 <template>
 <div>
@@ -37,7 +43,7 @@
       <div class="day-cell" @click="chooseDay(data)">
         <p>{{getDayNum(data.day)}}</p>
         <div v-if="new Date(data.day).getMonth() == searchMonth.getMonth()">
-          <p v-for="item in planList[getDayNum(data.day)]" :key="item.id">
+          <p v-for="item in planList[getDayNum(data.day)]" :key="item.id" :style="{'color':colorSet[item.status]}">
             {{item.name}}
           </p>
         </div>
@@ -56,7 +62,18 @@
           <label>内容:</label>
           <el-input type="textarea" autosize placeholder="" v-model="item.content" :disabled="!ableEdit"></el-input>
           &nbsp;
-          <i class="el-icon-remove-outline del-bt" @click="deletePlan(item,index)" v-if="ableEdit"></i>
+          <label :class="{'hide':!item.id}">状态:</label>
+          <el-select v-model="item.status" placeholder="请选择" size="mini" :class="{'hide':!item.id}" :disabled="item.id == null || !ableEdit">
+            <el-option :label="'准备'" :value="0"></el-option>
+            <el-option :label="'执行'" :value="1"></el-option>
+            <el-option :label="'暂搁'" :value="2"></el-option>
+            <el-option :label="'完成'" :value="3"></el-option>
+            <el-option :label="'中止'" :value="4"></el-option>
+          </el-select>
+          &nbsp;
+          <el-button @click="judgePlan(item)" type="text" :class="{'hide':!item.id}" :disabled="item.id == null">评价</el-button>
+          &nbsp;
+          <i class="el-icon-remove-outline del-bt" @click="visibleDelete = true;plan = item;deleteIndex = index" v-if="ableEdit"></i>
       </div>
       <i class="el-icon-circle-plus-outline add-bt" @click="addDayPlan()" v-if="ableEdit"></i>
       <span slot="footer" class="dialog-footer" v-if="ableEdit">
@@ -64,17 +81,49 @@
         <el-button type="primary" @click="editTask">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+        :title="plan.name + ' 任务评价'"
+        :visible.sync="visibleJudge"
+        width="800px">
+        <div v-html="plan.evaluation" v-show="noEdit"></div>
+        <Judge :planJudge="plan.evaluation" :changeSignal="changeSignal" @setEvaluation="setEvaluation" v-show="!noEdit"></Judge>
+        <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="noEdit = false;" v-if="noEdit">编辑</el-button>
+            <el-button type="primary" @click="visibleJudge = false;plan={}" v-if="!noEdit">取消</el-button>
+            <el-button type="primary" @click="editTask" v-if="!noEdit">确 定</el-button>
+        </span>
+    </el-dialog>
+    <el-dialog
+      title="提示"
+      :visible.sync="visibleDelete"
+      width="200px">
+      <p class="center-text">确认删除?</p>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="visibleDelete = false;plan={}">取 消</el-button>
+        <el-button type="primary" @click="deletePlan">确 定</el-button>
+      </span>
+    </el-dialog>
 </div>
 </template>
 
 <script>
 import { getMonthPlan,addPlan,updatePlan,deletePlan } from '@/api/month';
+import Judge from "@/components/MainPage/Judge/Judge";
+
 export default {
   name: 'Month',
   components: {
+    Judge
   },
   data () {
     return {
+      colorSet:{
+        0:'gray',
+        1:'blue',
+        2:'red',
+        3:'green',
+        4:'yellow',
+      },
       searchMonth: new Date(),
       params:{
         startTime: '',
@@ -82,7 +131,13 @@ export default {
       },
       visibleChange: false,
       planList: {},
-      dayPlan: []
+      dayPlan: [],
+      visibleDelete: false,
+      plan:{},
+      deleteIndex: '',
+      noEdit: false,
+      visibleJudge: false,
+      changeSignal: false
 	  }
   },
   created() {
@@ -159,26 +214,37 @@ export default {
         "startTime": this.searchMonth.getTime(),
       })
     },
-    deletePlan(item,index){
-      if(item.id){
+    deletePlan(){
+      if(this.plan.id){
         let temp = {
-          id:item.id
+          id: this.plan.id
         }
         deletePlan(temp).then((data) => {
           if(!data.result){
             this.$message(data.message);
           }
           else{
-            this.dayPlan.splice(index,1);
+            this.dayPlan.splice(this.deleteIndex,1);
           }
         })
       }
       else{
-        this.dayPlan.splice(index,1);
+        this.dayPlan.splice(this.deleteIndex,1);
       }
+      this.visibleDelete = false;
+      this.plan={};
     },
     getDayNum(day){
       return ~~day.split('-')[2];
+    },
+    setEvaluation(val){
+      this.plan.evaluation = val;
+    },
+    judgePlan(item){
+      this.visibleJudge = true;
+      this.noEdit = true;
+      this.plan = JSON.parse(JSON.stringify( item ));
+      this.changeSignal = !this.changeSignal;
     }
   }
 }

+ 37 - 9
src/components/MainPage/Quarter.vue

@@ -50,7 +50,7 @@ table{
     }
     .el-textarea,.el-input,.el-select{
       display: inline-block;
-      width: 300px;
+      width: 400px;
     }
     .text-label{
       vertical-align: top;
@@ -82,7 +82,7 @@ table{
                 <th>年份</th>
                 <th style="width:50px">季度</th>
                 <th>内容</th>
-                <th style="width:120px">操作</th>
+                <th style="width:140px;text-align: center;">操作</th>
             </tr>
         </thead>
         <tbody>
@@ -100,9 +100,9 @@ table{
                 &nbsp;&nbsp;
                 <a @click="openChildPlan(item)">子项</a>
                 &nbsp;&nbsp;
+                <a @click="judgePlan(item)">评价</a>
+                &nbsp;&nbsp;
                 <a @click="visibleDelete = true;plan.id = item.id">删除</a>
-                <!-- &nbsp;&nbsp;
-                <a>完成</a> -->
               </td>
             </tr>
         </tbody>
@@ -111,7 +111,7 @@ table{
         class="dialog-style"
         :title="noEdit?'详情':'编辑'"
         :visible.sync="visibleChange"
-        width="500px">
+        width="600px">
         <div>
           <label>名称:</label>
           <el-input name="name" v-model="plan.name" placeholder="请输入名称" required="required" :disabled="noEdit"></el-input>
@@ -145,6 +145,18 @@ table{
             <el-button type="primary" @click="change" v-if="!noEdit">确 定</el-button>
         </span>
     </el-dialog>
+    <el-dialog
+        :title="plan.name + ' 任务评价'"
+        :visible.sync="visibleJudge"
+        width="800px">
+        <div v-html="plan.evaluation" v-show="noEdit"></div>
+        <Judge :planJudge="plan.evaluation" :changeSignal="changeSignal" @setEvaluation="setEvaluation" v-show="!noEdit"></Judge>
+        <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="noEdit = false;" v-if="noEdit">编辑</el-button>
+            <el-button type="primary" @click="visibleJudge = false;plan={}" v-if="!noEdit">取消</el-button>
+            <el-button type="primary" @click="change" v-if="!noEdit">确 定</el-button>
+        </span>
+    </el-dialog>
     <el-dialog
       title="提示"
       :visible.sync="visibleDelete"
@@ -168,10 +180,13 @@ table{
 <script>
 import { getPlanList,addPlan,updatePlan,deletePlan } from '@/api/quarter';
 import ChildPlan from "@/components/MainPage/Quarter/ChildPlan";
+import Judge from "@/components/MainPage/Judge/Judge";
+
 export default {
   name: 'Quarter',
   components: {
-    ChildPlan
+    ChildPlan,
+    Judge
   },
   data () {
       return {
@@ -189,6 +204,8 @@ export default {
         visibleDelete: false,
         noEdit: false,
         childPlanFlag: false,
+        visibleJudge: false,
+        changeSignal: false
       }
   },
   created() {
@@ -204,7 +221,7 @@ export default {
     },
     deletePlan(){
       deletePlan(this.plan).then((result) => {
-        alert(result?'删除成功':'删除失败');
+        this.$message(result?'删除成功':'删除失败');
         this.visibleDelete = false;
         this.plan = {};
         this.getPlanList();
@@ -220,15 +237,16 @@ export default {
       this.plan.year = this.yearData.getFullYear();
       if(this.plan.id){
         updatePlan(this.plan).then((result) => {
-          alert(result.result?'更新成功':'更新失败');
+          this.$message(result.result?'更新成功':'更新失败');
           this.visibleChange = false;
+          this.visibleJudge = false;
           this.plan = {};
           this.getPlanList();
         })
       }
       else{
         addPlan(this.plan).then((result) => {
-          alert(result.result?'添加成功':'添加失败');
+          this.$message(result.result?'添加成功':'添加失败');
           this.visibleChange = false;
           this.plan = {};
           this.getPlanList();
@@ -238,6 +256,16 @@ export default {
     openChildPlan(item){
       this.childPlanFlag = true;
       this.plan = item;
+    },
+    setEvaluation(val){
+      this.plan.evaluation = val;
+    },
+    judgePlan(item){
+      this.visibleJudge = true;
+      this.noEdit = true;
+      this.plan = JSON.parse(JSON.stringify( item ));
+      this.changeSignal = !this.changeSignal;
+      this.yearData = new Date(item.year,1,1);
     }
   }
 }

+ 37 - 9
src/components/MainPage/Quarter/ChildPlan.vue

@@ -13,7 +13,7 @@
     }
     .el-textarea,.el-input{
       display: inline-block;
-      width: 300px;
+      width: 400px;
     }
     .text-label{
       vertical-align: top;
@@ -36,10 +36,11 @@
     <el-table-column property="name" label="计划"></el-table-column>
     <el-table-column property="content" label="简要说明"></el-table-column>
     <el-table-column property="departmentName" label="部门"></el-table-column>
-    <el-table-column fixed="right" label="操作" width="120">
+    <el-table-column fixed="right" label="操作" width="95">
       <template slot-scope="scope">
         <el-button @click="changeData(scope.row, true)" type="text" size="small">详情</el-button>
         <el-button @click="changeData(scope.row, false)" type="text" size="small">修改</el-button>
+        <el-button @click="judgePlan(scope.row)" type="text" size="small" style="margin-left:0">评价</el-button>
         <el-button @click="visibleDelete = true;plan.id = scope.row.id" type="text" size="small">删除</el-button>
       </template></el-table-column>
   </el-table>
@@ -51,7 +52,7 @@
         :title="noEdit?'详情':'编辑'"
         :visible.sync="visibleChange"
         :modal="false"
-        width="500px">
+        width="600px">
         <div>
           <label>名称:</label>
           <el-input name="name" v-model="plan.name" placeholder="请输入名称" required="required" :disabled="noEdit"></el-input>
@@ -62,7 +63,7 @@
         </div>
         <div>
           <label>部门:</label>
-          <el-input v-model="currentDepart.name" required="required" disabled style="width:280px"></el-input>
+          <el-input v-model="currentDepart.name" required="required" disabled style="width:380px"></el-input>
           <i class="el-icon-edit" @click="departChange = true"></i>
         </div>
         <div>
@@ -98,12 +99,26 @@
         <el-button type="primary" @click="changeCheckDepart">确 定</el-button>
       </span>
     </el-dialog>
+    <el-dialog
+        :title="plan.name + ' 任务评价'"
+        :modal="false"
+        :visible.sync="visibleJudge"
+        width="800px">
+        <div v-html="plan.evaluation" v-show="noEdit"></div>
+        <Judge :planJudge="plan.evaluation" :changeSignal="changeSignal" @setEvaluation="setEvaluation" v-show="!noEdit"></Judge>
+        <span slot="footer" class="dialog-footer">
+            <el-button type="primary" @click="noEdit = false;" v-if="noEdit">编辑</el-button>
+            <el-button type="primary" @click="visibleJudge = false;plan={}" v-if="!noEdit">取消</el-button>
+            <el-button type="primary" @click="saveChildPlan" v-if="!noEdit">确 定</el-button>
+        </span>
+    </el-dialog>
 </div>
 </template>
 
 <script>
 import { getPlanList,addPlan,updatePlan,deletePlan } from '@/api/childPlan';
 import UserTree from "@/components/MainPage/Department/UserTree";
+import Judge from "@/components/MainPage/Judge/Judge";
 
 export default {
   name: 'ChildPlan',
@@ -127,11 +142,14 @@ export default {
         departChange: false,
         currentDepart: {
           name:''
-        }
+        },
+        visibleJudge: false,
+        changeSignal: false
       }
   },
   components:{
-    UserTree
+    UserTree,
+    Judge
   },
   created() {
     this.getPlanList();
@@ -167,7 +185,7 @@ export default {
     },
     deletePlan(){
       deletePlan(this.plan).then((result) => {
-        alert(result?'删除成功':'删除失败');
+        this.$message(result?'删除成功':'删除失败');
         this.visibleDelete = false;
         this.plan = {};
         this.getPlanList();
@@ -181,15 +199,16 @@ export default {
     saveChildPlan(){
       if(this.plan.id){
         updatePlan(this.plan).then((result) => {
-          alert(result.result?'更新成功':'更新失败');
+          this.$message(result.result?'更新成功':'更新失败');
           this.visibleChange = false;
+          this.visibleJudge = false;
           this.plan = {};
           this.getPlanList();
         })
       }
       else{
         addPlan(this.plan).then((result) => {
-          alert(result.result?'添加成功':'添加失败');
+          this.$message(result.result?'添加成功':'添加失败');
           this.visibleChange = false;
           this.plan = {};
           this.getPlanList();
@@ -202,6 +221,15 @@ export default {
     changeCheckDepart(){
       this.plan.departmentId = this.currentDepart.id;
       this.departChange = false;
+    },
+    setEvaluation(val){
+      this.plan.evaluation = val;
+    },
+    judgePlan(item){
+      this.visibleJudge = true;
+      this.noEdit = true;
+      this.plan = JSON.parse(JSON.stringify( item ));
+      this.changeSignal = !this.changeSignal;
     }
   }
 }

+ 16 - 9
src/components/MainPage/Year.vue

@@ -75,7 +75,7 @@ table{
             <!-- <th>参与成员</th> -->
             <th>年份</th>
             <th>内容</th>
-            <th style="width:120px">操作</th>
+            <th style="width:120px;text-align: center;">操作</th>
         </tr>
     </thead>
     <tbody>
@@ -90,9 +90,9 @@ table{
             &nbsp;&nbsp;
             <a @click="changeData(item)">修改</a>
             &nbsp;&nbsp;
-            <a @click="visibleDelete = true;plan.id = item.id">删除</a>
-            &nbsp;&nbsp;
             <a @click="judgePlan(item)">评价</a>
+            &nbsp;&nbsp;
+            <a @click="visibleDelete = true;plan.id = item.id">删除</a>
           </td>
         </tr>
     </tbody>
@@ -128,10 +128,12 @@ table{
         :title="plan.name + ' 任务评价'"
         :visible.sync="visibleJudge"
         width="800px">
-        <Judge></Judge>
+        <div v-html="plan.evaluation" v-show="noEdit"></div>
+        <Judge :planJudge="plan.evaluation" :changeSignal="changeSignal" @setEvaluation="setEvaluation" v-show="!noEdit"></Judge>
         <span slot="footer" class="dialog-footer">
-            <el-button type="primary" @click="visibleJudge = false;plan={}">取消</el-button>
-            <el-button type="primary" @click="change">确 定</el-button>
+            <el-button type="primary" @click="noEdit = false;" v-if="noEdit">编辑</el-button>
+            <el-button type="primary" @click="visibleJudge = false;plan={}" v-if="!noEdit">取消</el-button>
+            <el-button type="primary" @click="change" v-if="!noEdit">确 定</el-button>
         </span>
     </el-dialog>
     <el-dialog
@@ -168,6 +170,7 @@ export default {
         visibleChange: false,
         visibleDelete: false,
         visibleJudge: false,
+        changeSignal: false
       }
   },
   created() {
@@ -181,7 +184,7 @@ export default {
     },
     deletePlan(){
       deletePlan(this.plan).then((result) => {
-        alert(result?'删除成功':'删除失败');
+        this.$message(result?'删除成功':'删除失败');
         this.visibleDelete = false;
         this.plan = {};
         this.getPlanList();
@@ -197,7 +200,7 @@ export default {
       this.plan.year = this.yearData.getFullYear();
       if(this.plan.id){
         updatePlan(this.plan).then((result) => {
-          alert(result.result?'更新成功':'更新失败');
+          this.$message(result.result?'更新成功':'更新失败');
           this.visibleChange = false;
           this.visibleJudge = false;
           this.plan = {};
@@ -207,7 +210,7 @@ export default {
       }
       else{
         addPlan(this.plan).then((result) => {
-          alert(result.result?'添加成功':'添加失败');
+          this.$message(result.result?'添加成功':'添加失败');
           this.visibleChange = false;
           this.plan = {};
           this.getPlanList();
@@ -215,8 +218,12 @@ export default {
         })
       }
     },
+    setEvaluation(val){
+      this.plan.evaluation = val;
+    },
     judgePlan(item){
       this.visibleJudge = true;
+      this.noEdit = true;
       this.plan = JSON.parse(JSON.stringify( item ));
       this.changeSignal = !this.changeSignal;
       this.yearData = new Date(item.year,1,1);