山水共长天一色 преди 3 години
родител
ревизия
a1679d49b8

+ 4 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/awayOffice/awayOffice.vue

@@ -183,7 +183,7 @@
                         </el-select>
                         
                     </div>
-                    <div><span style="color: #606266">请假时间</span>
+                    <div><span style="color: #606266">时间</span>
                         <el-date-picker v-model="createDate" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" @change="billss()" value-format="yyyy-MM-dd" placeholder="选择日期" size="small" clearable style="width:280px"></el-date-picker>
                     </div>
                 </div>
@@ -325,7 +325,7 @@
                 <el-col :span="18" >
                     <el-scrollbar style="height:100%;border:1px solid #dddddd;margin-right:20px;" >
                         <div class="tree" :style="'height:'+ (tableHeight-120) + 'px'">
-                            <div style="padding:5px;color:#333;" v-if="depData != null">设置 &lt;<span style="color:#20a0ff;">{{depData.label}}&gt;</span> 直属人员请假审批流程
+                            <div style="padding:5px;color:#333;" v-if="depData != null">设置 &lt;<span style="color:#20a0ff;">{{depData.label}}&gt;</span> 直属人员出差审批流程
                                 <el-tooltip effect="dark" v-if="depData != null && depData.children!=null" content="仅适用于当前部门的直属人员,子部门人员的审批流程需要单独设置" placement="top-start">
                                     <i class="el-icon-question"></i>
                                 </el-tooltip>
@@ -560,13 +560,13 @@ export default {
                 cityFrom:[{ required: true, message: "请选择出发城市", trigger: "blur" }],
                 cityTo:[{ required: true, message: "请选择目的城市", trigger: "blur" }],
                 startDate:[{ required: true, message: "请选择开始时间", trigger: "blur" }],
-                endDate:[{ required: true, message: "请选择开始时间", trigger: "blur" }]
+                endDate:[{ required: true, message: "请选择结束时间", trigger: "blur" }]
             },
             editItemRules:{
                 cityFrom:[{ required: true, message: "请选择出发城市", trigger: "blur" }],
                 cityTo:[{ required: true, message: "请选择目的城市", trigger: "blur" }],
                 startDate:[{ required: true, message: "请选择开始时间", trigger: "blur" }],
-                endDate:[{ required: true, message: "请选择开始时间", trigger: "blur" }]
+                endDate:[{ required: true, message: "请选择结束时间", trigger: "blur" }]
             },
             cityList:[],
             cityList2:[],

+ 43 - 8
fhKeeper/formulahousekeeper/timesheet/src/views/leave/list.vue

@@ -75,14 +75,20 @@
                 <!-- 请假类型 -->
                 <el-form-item label="请假类型" prop="leaveType" style="width: 100%">
                     <!--普通员工只能自己填报自己的 -->
-                    <el-select v-model="addForm.leaveType" @change="selts()" placeholder="请选择请假类型" style="width: 240px">
+                    <el-select v-model="addForm.leaveType" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假类型" style="width: 240px">
                           <el-option v-for="item in qjType" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     </el-select>
+                    <template  v-if="addForm.leaveType == 6">
+                      <span style="margin-left:18px;color:#777;">剩余可调休 {{addForm.ownerId != '' ? txselnum : '~'}} 天</span>
+                      <el-tooltip effect="dark" content="加班时长可用于调休抵扣" placement="top-start">
+                        <i class="el-icon-question" style="color:#606266;"></i>
+                      </el-tooltip>
+                    </template>
                 </el-form-item>
                 <!-- 请假人 -->
                 <el-form-item label="请假人" prop="ownerId"  style="width: 300px">
                     <!--普通员工只能自己填报自己的 -->
-                    <el-select v-model="addForm.ownerId" @change="selts()" placeholder="请选择请假人" style="width: 240px" :disabled="!permissions.leaveFil" filterable="true">
+                    <el-select v-model="addForm.ownerId" @change="txselts(addForm.leaveType,addForm.ownerId)" placeholder="请选择请假人" style="width: 240px" :disabled="!permissions.leaveFil" filterable="true">
                         <span v-for="(item, index) in users" :key="index">
                         <el-option :label="item.name" :value="item.id"></el-option>
                         </span> 
@@ -96,7 +102,7 @@
                 <el-form-item style="display: block" label="时长单位">
                     <el-radio-group v-model="addForm.timeType" @change="chanRadio()">
                         <el-radio label="0">按天请假</el-radio>
-                        <el-radio label="1">按小时请假</el-radio>
+                        <el-radio label="1" v-if="addForm.leaveType != 6">按小时请假</el-radio>
                     </el-radio-group>
                 </el-form-item>
                 <!-- 时间选择 -->
@@ -117,9 +123,9 @@
                 <el-form-item :label="flg ? '请假天数' : '请假时长'" prop="timeDays" style="margin-right: 500px">
                    <!-- {{flg ? addForm.timeDays : addForm.timeHours}}{{flg ? '天' : '小时'}} -->
                    <!-- <div v-if="flg">{{addForm.timeDays}} 天</div> -->
-                   <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 天</div>
+                   <div v-if="flg"> <el-input v-model="addForm.timeDays" @blur="inputs()" @input="addForm.timeDays=addForm.timeDays.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;" type="number" :step="0.5"></el-input> 天</div>
                    <div v-else>
-                      <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 100px; margin-right: 20px;"></el-input> 小时
+                      <el-input v-model="addForm.timeHours" @blur="inputss()" @input="addForm.timeHours=addForm.timeHours.replace(/[^\d.]/g,'')" style="width: 120px; margin-right: 20px;"></el-input> 小时
                    </div>
                 </el-form-item>
                 <!-- 备注 -->
@@ -129,7 +135,7 @@
             </el-form>
 
             <div>
-              <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini">提交</el-button></p>
+              <p style="margin-left: 20%"><el-button type="primary" @click="submits('addFormRules')" size="mini" :disabled="txselnum == 0 && addForm.leaveType == 6 && addForm.ownerId != '' ? true : false">提交</el-button></p>
             </div>
         </div>
     </div>
@@ -520,7 +526,7 @@
 </template>
 
 <script>
-import { config } from 'dingtalk-jsapi';
+import { config, error } from 'dingtalk-jsapi';
 export default {
   name: "expense",
   components: {},
@@ -684,9 +690,10 @@ export default {
       Nsdata : [],
       AlData : [],
       iAlDataS: [],
-      iAlData : []
+      iAlData : [],
 
       // ---------
+      txselnum: 0
     };
   },
   computed: {},
@@ -1211,6 +1218,34 @@ export default {
           }
         });
     },
+    txselts(a,b){
+      this.selts()
+      console.log('txselts',this.addForm.ownerId);
+      if(a == 6 && this.addForm.ownerId != ''){
+        this.http.post('/leave-sheet/getOTAvaiDays',{ userId:b },
+        res => {
+          if(res.code == "ok") {
+            console.log('post',res.data);
+            if(res.data < 0.5){
+              this.txselnum = 0
+            }else{
+              this.txselnum = res.data.toFixed(1)
+            }
+          } else {
+            this.$message({
+              message: res.msg,
+              type: "error"
+            });
+          }
+        },
+        error => {
+          this.$message({
+            message: error,
+            type: "error"
+          });
+        })
+      }
+    },
     selts() {
       for(var i in this.users) {
         if(this.users[i].id == this.addForm.ownerId) {

+ 541 - 40
fhKeeper/formulahousekeeper/timesheet/src/views/project/projectInside.vue

@@ -148,7 +148,7 @@
                                                     <i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;margin-top:8px;'" ></i>
                                                     </div>
                                                 <div style="margin: 10px 0px;color:#666;" @click="timess(element.endDate)">
-                                                    <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date">&nbsp;&nbsp;{{element.endDate}}</i></span>
+                                                    <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date" style="margin-left:5px">&nbsp;&nbsp;{{element.endDate}}</i></span>
                                                     <span v-else><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date"><span  class="element_span"> &nbsp;&nbsp;{{element.endDate}} 截止</span></i></em></span>
                                                     <span v-if="element.executorName">
                                                     <span v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="'background:'+element.executorColor.split(',')[exeIndex]" class="user_name_icon">{{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}</span>
@@ -156,10 +156,17 @@
                                                     <el-button v-if="!element.executorName" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">认领</el-button>
                                                 </div>
                                                 <!--子任务 -->
-                                                <div v-if="element.subTaskList.length > 0">
-                                                    <el-tooltip class="item" effect="dark" content="查看子任务" placement="top">
-                                                    <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span></el-link>
+                                                <div v-if="element.subTaskList.length > 0" class="taskCardCircleBox">
+                                                    <el-progress type="circle" :percentage="(element.subTaskFinishNum/element.subTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress><span style="margin-left:5px;font-size:12px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span>
+                                                </div>
+                                                <!-- <div v-if="element.taskType == 1 && element.refTaskList != null">
+                                                    <el-tooltip class="item" effect="dark" content="查看关联任务" placement="top">
+                                                    <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span></el-link>
                                                     </el-tooltip>
+                                                </div> -->
+                                                <div v-if="element.taskType == 1 && element.refTaskList != null"  class="taskCardCircleBox">
+                                                    <el-progress type="circle" :percentage="(element.finishRefTaskCount/element.refTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress>
+                                                    <span style="margin-left:5px;font-size:12px">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span>
                                                 </div>
                                             </div>
                                         </draggable>
@@ -244,7 +251,7 @@
         
         <!--新增任务界面-->
         <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" 
-        :close-on-click-modal="false" customClass="customWidth" width="800px">
+        :close-on-click-modal="false" customClass="customWidth" width="800px" ref="addDialog">
         <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
 
             <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
@@ -255,7 +262,9 @@
                     </el-select>
                 </el-form-item>
                 <el-form-item label="类型">
-                    <el-select v-model="addForm.taskType" style="width:100%;" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id">
+                    <!-- <el-button @click="test">test</el-button> -->
+                    <!-- 0011 -->
+                    <el-select v-model="addForm.taskType" style="width:100%;" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="selchg()">
                         <el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
                             <i :class="item.icon" ></i>
                             <span>{{item.name}}</span>
@@ -265,10 +274,10 @@
                 <el-form-item label="任务内容" prop="name">
                     <el-input v-model="addForm.name" :maxlength="40" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" placeholder="请输入任务内容" clearable></el-input>
                 </el-form-item>
-                <el-form-item label="开始时间" prop="startDate">
+                <el-form-item :label="!timelabel ? '开始时间' : '截至时间'" prop="startDate">
                     <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"  
-                    placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()"></el-date-picker>
-                    <span style="margin-left:30px;margin-right:10px;">截止时间</span>
+                    placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()" v-if="!timelabel"></el-date-picker>
+                    <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">截止时间</span>
                     <el-date-picker v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"  
                     placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()"></el-date-picker>
                     </el-form-item>
@@ -301,6 +310,8 @@
                 <div v-if="addForm.id != null">
                     <el-divider ></el-divider>
                     <!-- 任务进展 -->
+                    <template v-if="!timelabel || isRelationItem">
+                    
                     <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">任务进展</i>
                         <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">添加任务进展</el-link></span>
                     </p>
@@ -406,12 +417,40 @@
                     </span>
                     </el-dialog>
 
-                    <!-- 子任务 -->
-                    <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">子任务</i>
-                        <el-link style="float:right;" @click="addSubTask">添加子任务</el-link>
+                    </template>
+
+                    <!-- 子任务/关联任务 -->
+                    <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? '关联任务' : '子任务'}}</i>
+                        <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">添加关联任务</el-link>
+                        <el-link style="float:right;" @click="addSubTask" v-else>添加子任务</el-link>
                     </p>
+                    <!-- 关联任务列表 -->
+                    <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
+                    :header-cell-style="{'font-weight':'normal'}"
+                    highlight-current-row
+                    v-loading="listLoading"
+                    style="width: 100%;margin-top:10px;"
+                    @row-click="relationTaskClick">
+                        <el-table-column prop="taskStatus" label="完成" width="50" >
+                            <template slot-scope="scope">
+                                <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)" @click.stop.native=""></el-checkbox>
+                            </template>
+                        </el-table-column>
+                        <el-table-column prop="taskName" label="标题" >
+                            <template slot-scope="scope">
+                                <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top">
+                                    <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
+                                </el-tooltip>
+                            </template>
+                        </el-table-column>
+                        <el-table-column label="操作" width="130" align="left">
+                            <template slot-scope="scope">
+                                <el-button @click="deleteRelationItem(scope.row.id)" size="mini">解除关联</el-button>
+                            </template>
+                        </el-table-column>
+                    </el-table>
                     <!--子任务列表 -->
-                    <el-table :data="addForm.subTaskList" 
+                    <el-table key="zi" :data="addForm.subTaskList" v-else
                             :header-cell-style="{'font-weight':'normal'}"
                             highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
                                 <el-table-column prop="taskStatus" label="完成" width="50" >
@@ -440,17 +479,92 @@
                                     <p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
                                 </template>
                             </el-table-column>
-                        </el-table>
-                    </div>
+                    </el-table>
+                </div>
             </el-form>
+
+            <!-- 关联文件列表 -->
+            <template v-if="isEditFile">
+                <div style="width:100%;margin:1em 0;">
+                    <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">相关文件/交付成果</i>
+                    <el-link @click="relationFileClick()" style="float:right;margin-left:10px">关联文件</el-link>
+                    <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
+                        <el-link>上传文件</el-link>
+                    </el-upload>
+                    
+                </div>
+                <el-table
+                    v-loading="fileListLoading"
+                    ref="filetable"
+                    :data="taskFileList"
+                    :header-cell-style="{'font-weight':'normal'}"
+                    highlight-current-row
+                    max-height="240"
+                    style="width: 100%;margin-top:10px;margin-bottom:15px">
+                    <el-table-column label="序号" prop="documentType" min-width="40" align="center"></el-table-column>
+                    <el-table-column label="文件名称" prop="documentName" min-width="180"></el-table-column>
+                    <el-table-column label="文件大小" prop="size" min-width="60" align="center"></el-table-column>
+                    <el-table-column label="创建人" prop="creatorName" min-width="60" align="center"></el-table-column>
+                    <el-table-column label="创建时间" prop="indate" min-width="120" align="center">
+                        <template slot-scope="scope">
+                            <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
+                        </template>
+                    </el-table-column>
+                    <el-table-column label="操作" min-width="90">
+                        <template slot-scope="scope">
+                            <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">下载</el-link>
+                            <el-link @click="taskFileDelete(scope.row.id)">删除</el-link>
+                        </template>
+                    </el-table-column>
+                </el-table>
+            </template>
+
+            <!-- 关联文件dialog -->
+            <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" title="关联文件" append-to-body>
+                <span>从文件中心选择已有文件进行关联</span>
+                <div>
+                    <span>选择文件</span>
+                    <el-select v-model="addFileId">
+                        <el-option
+                            v-for="item in projectFileList"
+                            :key="item.id"
+                            :label="item.documentName"
+                            :value="item.id"
+                        ></el-option>
+                    </el-select>
+                    <el-button @click="addTaskFile()">确定</el-button>
+                    <!-- <el-button @click="relationFileDialog = false">取消</el-button> -->
+                </div>
+            </el-dialog>
+
+            <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" title="添加关联任务" width="800px" append-to-body>
+                <el-form ref="relationItemForm" label-width="100px">
+                    <el-form-item label="选择任务" prop="taskType">
+                        <el-select v-model="relationvalue" multiple>
+                            <el-option
+                            v-for="item in relationdata"
+                            :key="item.id"
+                            :label="item.name"
+                            :value="item.id"
+                            ></el-option>
+                        </el-select>
+                    </el-form-item>
+                </el-form>
+                <div slot="footer" class="dialog-footer">
+                    <el-button @click="isRelationTab = false">取消</el-button>
+                    <el-button type="primary" @click="addRelationTask()">确认</el-button>
+                </div>
+            </el-dialog>
+
+
             <div slot="footer" class="dialog-footer">
                 <el-button v-if="user.id == this.addForm.createrId || currentProject.inchargerId == user.id" @click.native="deleteTask" style="float:left;">删除</el-button>
                 <el-button @click.native="addFormVisible = false">取消</el-button>
                 <el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
             </div>
-            <div slot="title" v-if="addForm.parentTid != null" >
+            <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
                 <!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
-                <el-page-header  @back="backToParentTask" title="返回父任务" :content="addForm.parentTname"></el-page-header>
+                <el-page-header  @back="backToParentTask" :title="timelabel ? '返回里程碑' : '返回父任务'" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
             </div>
             <!-- 评论 -->
             <div class="remark" v-show="addForm.id != null">
@@ -509,7 +623,7 @@
             <!-- 评论 -->
         </el-dialog>
         <!-- 子任务列表 -->
-        <el-dialog title="查看子任务" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
+        <el-dialog :title="addForm.taskType == 1 ? '查看关联任务' : '查看子任务'" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
             <el-table :data="addForm.subTaskList" 
                 :header-cell-style="{'font-weight':'normal'}"
                 highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
@@ -696,6 +810,8 @@
     import 'quill/dist/quill.bubble.css'
     // 导入富文本
     import { quillEditor } from 'vue-quill-editor'
+import { error } from 'dingtalk-jsapi';
+import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
     let id=1;
     export default {
         name: "two-list-headerslots",
@@ -853,11 +969,334 @@
                 checkLists: [], // 选中人数据的ID
                 taskIid: null,
                 gstimday:[],
-                gstimhour:[]
+                gstimhour:[],
+                timelabel: false,
+                relationdata: [],
+                isRelationTab: false,
+                relationvalue:[],
+                relationSubTaskList:[],
+                relationItemData: null,
+                relationPar:{name: ''},
+                isRelationItem: false,
+
+                // 关联文件
+                fileListLoading:false,
+                projectFileList:[],
+                taskFileList:[],
+                relationFileDialog: false,
+                addFileId: null,
+                isEditFile: false
             };
             
         },
         methods: {
+            // 0011
+            // test(){
+            //     // console.log("test",this.addFileId);
+            //     this.getTaskFileList()
+            // },
+            // 关联文件按钮
+            relationFileClick(){
+                this.relationFileDialog = true
+                this.addFileId = null
+                this.getProjectFileList()
+            },
+            // 确认关联文件
+            addTaskFile(){
+                if(this.addFileId == null){
+                    this.$message({message: '请选择关联文件' , type: 'warning'})
+                    return
+                }
+                this.http.post('/task-files/addDocumentRef',{
+                    documentId: this.addFileId,
+                    taskId: this.addForm.id,
+                    projectId: this.curProjectId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.$message({
+                            message: '关联成功',
+                            type: 'success'
+                        })
+                        this.relationFileDialog = false
+                        this.getTaskFileList()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+            // 获取项目下的文档列表
+            getProjectFileList(){
+                this.http.post('/task-files/getDocumentList',{
+                    projectId: this.curProjectId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.projectFileList = res.data
+                        console.log('list',res.data);
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+            // 获取任务下的文档列表
+            getTaskFileList(e,eid){
+                let etaskId
+                if(e == 1){etaskId = eid}
+                else{etaskId = this.addForm.id}
+                this.fileListLoading = true
+                this.http.post('/task-files/getTaskFiles',{
+                    taskId: etaskId
+                },res => {
+                    if(res.code == 'ok'){
+                        this.fileListLoading = false
+                        this.taskFileList = res.data
+                        console.log('taskFileList',res.data);
+                    }else {
+                        this.fileListLoading = false
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.fileListLoading = false
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+            // 列表的删除按钮
+            taskFileDelete(eid){
+                this.$confirm('是否确定取消关联此文件?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(()=>{
+                    this.http.post('/task-files/delete',{
+                        id: eid
+                    },res => {
+                        if(res.code == 'ok'){
+                            this.$message({
+                                message: res.data,
+                                type: 'success'
+                            })
+                            this.getTaskFileList()
+                        }else {
+                            this.$message({
+                                message: res.msg,
+                                type: 'error'
+                            })
+                        }
+                    },error => {
+                        this.$message({
+                            message: error,
+                            type: 'error'
+                        })
+                    })
+                }).catch(()=>{
+                    this.$message({
+                        message: '已取消删除',
+                        type: 'info'
+                    })
+                })
+            },
+            // 列表的上传按钮
+            uploadFileClick(item){
+                console.log("upload",item.file);
+                let files = new FormData()
+                files.append("projectId",this.curProjectId);
+                files.append("taskId", this.addForm.id);
+                files.append("files", item.file);
+                this.http.uploadFile('/task-files/uploadFile',files,
+                res => {
+                    if(res.code == 'ok'){
+                        console.log(res);
+                        this.$message({
+                            message: '已上传',
+                            type: 'success'
+                        })
+                        this.getTaskFileList()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+
+
+            selchg(){   //类型切换
+                if(this.addForm.taskType == 1){
+                    this.timelabel = true
+                }else{
+                    this.timelabel = false
+                }
+            },
+            addRelation(){  //关联任务卡片
+                this.isRelationTab = true
+                this.getrelation()
+                
+            },
+            addRelationTask(){  //添加关联任务
+                this.http.post('/task/addMileStoneTask',{
+                    milestoneId: this.addForm.id,
+                    taskIds: JSON.stringify(this.relationvalue)
+                },
+                res =>{
+                    if(res.code == "ok") {
+                        this.isRelationTab = false
+                        this.$message({
+                            message: '添加成功',
+                            type: 'success'
+                        })
+                        this.$forceUpdate()
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+            getRelationTaskList(i,e){  //获取关联任务列表
+                let eid = null
+                if(i){
+                    eid = e
+                }else{
+                    eid = this.addForm.id
+                }
+                this.http.post('/task/getMilestoneTaskList',{
+                    milestoneId: eid
+                },res => {
+                    if(res.code == 'ok') {
+                        this.relationSubTaskList = res.data
+                        // console.log('res',res.data);
+                    }else {
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+            getrelation(){  //获取选择关联列表
+                this.http.post('/task/getTaskOnlyList',{
+                    projectId: this.curProjectId
+                },
+                res => {
+                    if (res.code == "ok") {
+                        this.relationdata = []
+                        res.data.forEach( (item) =>{
+                            if(item.taskType != 1){
+                                this.relationdata.push(item)
+                            }
+                        })
+                        
+                        // console.log('map',this.relationdata);
+                    } else {
+                        this.$message({
+                        message: res.msg,
+                        type: "error"
+                        });
+                    }
+                },
+                error => {
+                    this.$message({
+                        message: error,
+                        type: "error"
+                    });
+                });
+            },
+            // 里程碑关联任务列表
+
+            // 解除关联
+            deleteRelationItem(eid){
+                this.listLoading = true
+                this.http.post('/task/removeMileStoneTask',{
+                    id: eid
+                },res => {
+                    if(res.code == 'ok') {
+                        this.getRelationTaskList()
+                        this.listLoading = false
+                        this.$message({
+                            message: '解除成功',
+                            type: 'success'
+                        })
+                    }else {
+                        this.listLoading = false
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.listLoading = false
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+            // 关联任务列表是否完成修改
+            relationFinishTask(row){
+                this.http.post('/task/finish',{
+                    id: row.taskId,
+                    taskStatus: row.taskStatus
+                },res => {
+                    if(res.code == 'ok'){
+                        if(this.groupType == 0){
+                            this.getStageList();
+                        }else {
+                            this.getViewTaskList();
+                        }
+                    }else{
+                        this.$message({
+                            message: res.msg,
+                            type: 'error'
+                        })
+                    }
+                },error => {
+                    this.$message({
+                        message: error,
+                        type: 'error'
+                    })
+                })
+            },
+
+
             //保存分组负责人
             saveGroupIncharger() {
                 this.http.post('/task-group/saveGroupIncharger', {id: this.groupForm.id, inchargerId: this.groupForm.inchargerId},
@@ -1307,12 +1746,21 @@
             showSubTaskList(task) {
                 this.subTaskVisible = true;
                 this.addForm = task;
+                // console.log('click',task.subTaskList);
             },
             backToParentTask() {
-                this.getTaskDetail(this.addForm.parentTid);
+                // this.getTaskDetail(this.addForm.parentTid);
+                this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
+                if(this.timelabel){
+                    this.isRelationItem = false
+                    // this.relationPar = {name: ''}
+                    this.getRelationTaskList(1, this.relationPar.id)
+                    this.gain(this.relationPar)
+                }
             },
             //显示子任务创建卡片
             addSubTask() {
+                if(this.isRelationItem){return}
                 this.addFormVisible = true;
                 this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId,  taskLevel:0, planHours: 8, taskType: 0};
                 this.addForm.executorListFront = [{executorId:null, planHours:8}];
@@ -1339,6 +1787,7 @@
                 });
             },
             taskLineClick(row, column, event) {
+                if(this.isRelationItem){return}
                 this.editTask(row);
             },
             //排序发生改变
@@ -1457,20 +1906,45 @@
             },
             // 点击卡片事件
             editTask(task) {
-                console.log(task)
+                // console.log('editTask',task)
+                if(task.taskType == 1){
+                    this.timelabel = true
+                    this.isRelationItem = false
+                }else{
+                    this.timelabel = false
+                }
                 this.addFormVisible = true;
+                this.isEditFile = true;
                 this.addLoading = false;
                 this.title = "编辑任务";
                 this.getTaskDetail(task.id);
                 this.getTaskProgressList(task.id); // 获取任务进展列表 
                 this.getUsers(); // 获取名单数据
                 this.gain(task); // 获取评论列表
+                this.getRelationTaskList(1, task.id)
+                this.getTaskFileList(1,task.id)
             },  
+            // 关联任务点击事件
+            relationTaskClick(row,column,event){
+                // console.log('relationTaskClick',row);
+                this.relationPar = JSON.parse(JSON.stringify(this.addForm))
+                // console.log(this.relationPar);
+                this.addFormVisible = true;
+                this.addLoading = false;
+                this.isRelationItem = true;
+                this.isEditFile = true;
+                this.title = "编辑任务";
+                this.getTaskDetail(row.taskId);
+                this.getUsers();
+                this.gain(row,1);
+                this.getRelationTaskList(1, row.taskId)
+                this.getTaskFileList(1,row.taskId)
+            },
             // 获取评论列表
-            gain (task) {
+            gain (task,e) {
                 this.commentList = [];
-                this.taskId = task.id;
-                this.http.post('/task-comment/getList', {taskId: task.id},
+                this.taskId = e == 1 ? task.taskId : task.id;
+                this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
                 res => {
                     if (res.code == "ok") {
                         this.commentList = res.data
@@ -1575,23 +2049,43 @@
                 this.gstimhour = [this.user.timeType.allday]
                 this.gstimday = [1]
                 this.addLoading = false;
+                this.isEditFile = false;
                 this.title="创建任务";
                 this.commentList = [];
             },
-            addExecutorLine() {
-                if (this.addForm.executorListFront == null) {
-                    this.addForm.executorListFront = [];//初始化
-                }
-                this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
-                this.gstimday.push(1)
-                this.gstimhour.push(this.user.timeType.allday)
-                this.$forceUpdate();
+            addExecutorLine(e) {
+                if(e == 1){
+                    if (this.relationItemData.executorList == null) {
+                        this.relationItemData.executorList = [];//初始化
+                    }
+                    this.relationItemData.executorList.push({executorId:null, planHours:this.user.timeType.allday});
+                    this.gstimday.push(1)
+                    this.gstimhour.push(this.user.timeType.allday)
+                    this.$forceUpdate();
+                }else{
+                    if (this.addForm.executorListFront == null) {
+                        this.addForm.executorListFront = [];//初始化
+                    }
+                    this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
+                    this.gstimday.push(1)
+                    this.gstimhour.push(this.user.timeType.allday)
+                    this.$forceUpdate();
+                    }
+                
             },
-            removeExecutorLine(index) {
-                this.addForm.executorListFront.splice(index,1);
-                this.gstimday.splice(index,1)
-                this.gstimhour.splice(index,1)
-                this.$forceUpdate();
+            removeExecutorLine(index,e) {
+                if(e == 1){
+                    this.relationItemData.executorList.splice(index,1);
+                    this.gstimday.splice(index,1)
+                    this.gstimhour.splice(index,1)
+                    this.$forceUpdate();
+                }else{
+                    this.addForm.executorListFront.splice(index,1);
+                    this.gstimday.splice(index,1)
+                    this.gstimhour.splice(index,1)
+                    this.$forceUpdate();
+                }
+                
             },
             renameStage(item) {
                 this.stageForm = JSON.parse(JSON.stringify(item));
@@ -1645,6 +2139,7 @@
                 });
             },
             timess(){
+                // console.log('timess');
                 var date = new Date()
                 let Y = date.getFullYear()
                 let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
@@ -1692,7 +2187,7 @@
                 this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
                 this.getStageList();
                 this.displayTable = false;
-                console.log("1223");
+                // console.log("1223");
                 this.$forceUpdate()
             },
             //本地搜索组
@@ -2058,6 +2553,7 @@
                 this.$refs.form1.validate(valid => {
                     if (valid) {
                         delete this.addForm.subTaskList;
+                        delete this.addForm.refTaskList;
                         delete this.addForm.progress;
                         this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
                         this.addLoading = true;
@@ -2109,7 +2605,7 @@
                         }
                         this.$forceUpdate()
                     }
-                    console.log("gstimday",this.gstimday);
+                    // console.log("gstimday",this.gstimday);
                     
                 }
                 
@@ -2203,7 +2699,12 @@
 
 
 <style >
-
+.taskCardCircleBox{
+    padding-left: 5px;
+    display: flex;
+    justify-content: left;
+    align-items: center;
+}
 .flip-list-move {
   transition: transform 0.5s;
 }

+ 2 - 1
fhKeeper/formulahousekeeper/timesheet/src/views/task/list.vue

@@ -77,7 +77,7 @@
                         <template slot-scope="scope">
                             <div style="display: flex;justify-content: space-between;padding-right: 40px">
                             <span style="display: inline-block;margin-right: 55px">
-                                <span  :class="judgedate(scope.row.endDate) ? 'redwarningspan autodatespan' : 'autodatespan'">{{scope.row.endDate}}</span>
+                                <span  :class="judgedate(scope.row.endDate) && searchField == '0' ? 'redwarningspan autodatespan' : 'autodatespan'">{{scope.row.endDate}}</span>
                             </span>
                             <el-button v-if="searchField == 0" size="small" type="primary" @click="completes(scope.row.id, 0)">完成</el-button>
                             <el-button v-if="searchField == 1" size="small" type="warning" @click="completes(scope.row.id, 1)">重启</el-button>
@@ -743,6 +743,7 @@ import { error } from 'dingtalk-jsapi';
                 taskLevelColor:['#262626','#E6A23C','#F56C6C'],
                 stageList: '',
                 selectedGroup:{},
+                dateClass: true
             };
         },
         methods: {