123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394 |
- <template>
- <div>
- <div style="height: 72vh;overflow: auto;">
- <el-form ref="form1" :model="addForm" :rules="taskRules" label-width="120px">
- <el-form-item :label="$t('subordinatetotheproject')" v-if="showOrNot" prop="projectId">
- <el-select v-model="addForm.projectId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(1)" filterable="true" style="width:100%;">
- <el-option-group v-for="group in integrationProjectList" :key="group.label" :label="group.label">
- <el-option v-for="item in group.peojectList" :key="item.id" :label="item.projectName + '\u3000' + item.projectCode" :value="item.id">
- <span style="float: left; color: #8492a6; font-size: 13px;">{{ item.projectCode }}</span>
- <span style="float: right;">{{ item.projectName }}</span>
- </el-option>
- </el-option-group>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('suoShuRenWuFenZu')" v-if="showOrNot" prop="groupId">
- <el-select v-model="addForm.groupId" :placeholder="$t('defaultText.pleaseChoose')" @change="agentCreatesEvents(2)" filterable="true" style="width:100%;">
- <el-option v-for="item in groupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('suoShuRenWuLieBiao')" v-if="showOrNot" prop="stagesId">
- <el-select v-model="addForm.stagesId" :placeholder="$t('defaultText.pleaseChoose')" filterable="true" style="width:100%;">
- <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!--子任务需要选择任务列表 -->
- <el-form-item :label="$t('tasklist')" prop="stages" v-if="addForm.parentTid != null">
- <el-select v-model="addForm.stagesId" style="width:100%;" >
- <el-option v-for="item in stageList" :key="item.id" :label="item.stagesName" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('qianZhiRenWu')" prop="aheadTidList" >
- <el-select v-model="addForm.aheadTidList" style="width:100%;" multiple filterable @change="$forceUpdate()">
- <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-item :label="$t('types')">
- <el-select v-model="addForm.taskType" style="width:100%;" :disabled="((this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask) && !(groupResponsibleId == 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>
- </el-option>
- </el-select>
- </el-form-item>
- <!-- <el-form-item v-if="this.user.companyId==3092" :label="$t('taskdefinition')" prop="serviceId">
- <el-select filterable style="width:100%;" v-model="addForm.serviceId" placeholder="请选择任务内容">
- <el-option
- v-for="item in sapServiceList"
- :key="item.serviceCode"
- :label="item.serviceName+'-'+item.serviceCode"
- :value="item.serviceCode">
- </el-option>
- </el-select>
- </el-form-item> -->
- <el-form-item :label="$t('taskdefinition')" prop="name">
- <el-input v-model="addForm.name" :maxlength="40" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" :placeholder="$t('enterthetaskcontent')" clearable></el-input>
- </el-form-item>
- <!-- {{timelabel}}{{mileageCup}} -->
- <el-form-item :label="!timelabel ? $t('starttimes') : $t('jie-zhi-shi-jian')" prop="startDate">
- <el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
- :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" @change="DateChange()" v-if="!timelabel"></el-date-picker>
- <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">{{ $t('deadline') }}</span>
- <el-date-picker style="width:40%;" v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
- :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
- <span style="margin-left:30px;margin-right:10px;" v-if="timelabel && mileageCup">{{ $t('wan-cheng-shi-jian') }}</span>
- <el-date-picker style="width:40%;" v-if="timelabel && mileageCup" v-model="addForm.finishDate" type="date" value-format="yyyy-MM-dd"
- :placeholder="$t('pleaseselectadate')" :disabled="(this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" @change="DateChange()"></el-date-picker>
- </el-form-item>
- <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
- <div class="container" :style="{ height: containerHeight }" @scroll="handleScroll" ref="container">
- <div class="list" :style="{ top: listTop }">
- <el-form-item :label="$t('zhi-hang-ren') + (executorItem.indexList + 1)" v-for="(executorItem, index) in showData" :key="index">
- <div class="editingTask">
- <div style="margin-right: 30px">
- <el-select v-if="user.userNameNeedTranslate != 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" size="small" filterable clearable :placeholder="$t('pleaseselectanexecutor')" style="width: 150px" @change="$forceUpdate()">
- <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
- <span style="float: left">{{ item.name }}</span>
- <span style="float: right; color: #8492a6; font-size: 13px;margin-left: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
- </el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'mini'" :filterable="true" :subject="users" :subjectId="executorItem.executorId" :distinction="'1'" @selectCal="selectCal" :index="executorItem.indexList" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" :key="executorItem.indexList"></selectCat>
- <!-- <selectPersonnel v-if="user.userNameNeedTranslate == 1" v-model="executorItem.executorId" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" @change="$forceUpdate()" :key="executorItem.indexList" /> -->
- </div>
- <!-- 项目服务 -->
- <div v-if="user.companyId==3092">
- <span style="margin-left:30px;margin-right:10px;">{{ $t('xiangMuFuWu') }}</span>
- <el-select clearable collapse-tags filterable v-model="executorItem.serviceId" size="small" :placeholder="$t('qingXuanZeXiangMuFuWu')" style="width: 300px" @change="serviceIdChange()" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)">
- <el-option
- v-for="item in sapServiceList"
- :key="item.id"
- :label="item.serviceName+'-'+item.serviceCode"
- :value="item.id">
- </el-option>
- </el-select>
- </div>
- <!-- 计划工时 -->
- <div>
- <span style="margin-right:10px;">{{ $t('plantime') }}</span>
- <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" v-model="gstimday[executorItem.indexList]" style="width:120px;" :min="1" :max="100" :placeholder="$t('danweitian')" @change="chggstim(0,executorItem.indexList)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.day') }}</span>
- <el-input-number size="small" :disabled="(addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id) && !permissions.projectManagement && !permissions.editAnyTask && !(groupResponsibleId == user.id)" v-model="gstimhour[executorItem.indexList]" style="width:120px;" :min="1" :max="999" :placeholder="$t('pleaseentertheplannedworking')" @change="chggstim(1,executorItem.indexList)"></el-input-number ><span style="margin-left:5px;">{{ $t('time.hour') }}</span>
- <!-- <el-input-number v-model="numnnumnum" @change="handleChange" :min="1" :max="10" label="描述文字"></el-input-number> -->
- <!-- 移除执行人 -->
- <!-- <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || permissions.editAnyTask|| groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i> -->
- <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id|| permissions.projectManagement || permissions.editAnyTask|| groupResponsibleId == user.id)" style="margin-left:5px" @click="removeExecutorLineNew(executorItem)"></i>
- </div>
- </div>
- </el-form-item>
- </div>
- <div class="bar" :style="{ height: barHeight }"></div>
- </div>
- <el-link type="primary" v-if="(((addForm.executorListFront == null || addForm.executorListFront.length<100) &&
- (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id || permissions.projectManagement || permissions.editAnyTask)) ||
- groupResponsibleId == user.id)"
- style="margin:0 0 10px 35px;position: relative;z-index: 999;" @click.stop="addExecutorLine">{{ $t('addinganexecutor') }}</el-link>
- </div>
- <el-form-item :label="$t('priority')">
- <el-select v-model="addForm.taskLevel" style="width:100%;" >
- <el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!-- 富文本 -->
- <el-form-item :label="$t('detaileddescription')" style="height: 200px">
- <!-- <Editor id="tinymce" v-model="tinymceHtml" :init="editorInit"></Editor> -->
- <!-- <el-input type="textarea" v-model="addForm.taskDesc" :rows="3"></el-input> -->
- <!-- <quill-edito v-model="addForm.taskDesc"></quill-edito> -->
- <quill-editor style="height: 150px" ref="text" v-model="addForm.taskDesc" class="myQuillEditor" :options="editorOption" @blur="onEditorBlur($event)" @focus="onEditorFocus($event)"/>
- </el-form-item>
- <!-- 富文本 -->
- <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;">{{ $t('taskprogress') }}</i>
- <span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">{{ $t('addtaskprogress') }}</el-link></span>
- </p>
- <!-- 任务进展展示 -->
- <div style="display: none;" ref="proBox" class="progress">
- <!-- <el-form :model="> -->
- <el-radio-group v-model="radio">
- <el-radio :label="0" class="rala1">{{ $t('normals') }}</el-radio>
- <el-radio :label="1" class="rala2">{{ $t('atrisk') }}</el-radio>
- <el-radio :label="2" class="rala3">{{ $t('withinthetimelimit') }}</el-radio>
- </el-radio-group>
- <el-input
- type="textarea"
- border="0"
- :autosize="{ minRows: 2, maxRows: 6}"
- :placeholder="$t('detailedprogressdescription')"
- v-model="text2"
- style="margin:10px 0 0 0">
- </el-input>
- <h4 style="font-weight: normal;">{{ $t('tixiang') }}{{checkLists.length}}</h4>
- <i class="el-icon-circle-plus pron_i" style="font-size: 28px;color: #409EFF;" @click="addI(0)"></i>
- <div class="remind" ref="addRem" style="display: none">
- <el-checkbox-group v-model="checkboxGrounp" v-for="item in users" :key="item.id">
- <p>
- <el-checkbox :label="item.name" @change="kkk(item)">
- <span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{item.name}}
- </span>
- <span v-if="user.userNameNeedTranslate == '1'">
- <TranslationOpenDataText type='userName' :openid='item.name'></TranslationOpenDataText>
- </span>
- </span>
- </el-checkbox>
- </p>
- </el-checkbox-group>
- </div>
- <div class="ssp" @click="sss"></div>
- <!-- </el-form> -->
- <div class="pro_btn">
- <el-button size="mini" @click="shutPro">{{ $t('btn.cancel') }}</el-button>
- <el-button size="mini" type="primary" @click="addTaskProgress">{{ $t('fa-bu') }}</el-button>
- </div>
- </div>
-
- <div class="ddl" v-if="recentProgressInfo != null && recentProgressInfo.id != null">
- <div class="elCard" style="margin-bottom: 10px; height:" >
- <i class="el-icon-success" style="color: #43d14f;" v-if="recentProgressInfo.status == 0"></i>
- <i class="el-icon-success" style="color: #fd7624;" v-else-if="recentProgressInfo.status == 1"></i>
- <i class="el-icon-success" style="color: #fd4d47;" v-else></i>
- <span v-if="recentProgressInfo.status == 0">{{ $t('normals') }}</span>
- <span v-else-if="recentProgressInfo.status == 1">{{ $t('normals') }}</span>
- <span v-else>{{ $t('withinthetimelimit') }}</span>
- <el-dropdown trigger="click" style="float:right;cursor:pointer; float: right;">
- <i class="el-icon-more" ></i>
- <el-dropdown-menu slot="dropdown">
- <el-dropdown-item divided>
- <span @click="deleteTaskProgress(recentProgressInfo.id)"><i class="el-icon-delete"></i>{{ $t('deleteList ') }}</span></el-dropdown-item>
- </el-dropdown-menu>
- </el-dropdown>
- <!-- <div class="elCard_qu">{{recentProgressInfo.creatorName}}{{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}</div> -->
- <div class="elCard_qu">
- <span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{recentProgressInfo.creatorName}}
- </span>
- <span v-if="user.userNameNeedTranslate == '1'">
- <TranslationOpenDataText type='userName' :openid='recentProgressInfo.creatorName'></TranslationOpenDataText>
- </span>
- </span>
- {{ $t('geng-xin-yu') }}{{recentProgressInfo.indate | relativeTime}}
- </div>
- <p style="padding-left: 20px;">{{recentProgressInfo.content}}</p>
- <div class="examine"><el-button type="text" @click="innerVisibless = true" style="color: #8F87A3;">{{ $t('viewingHistory') }}</el-button></div>
- </div>
- </div>
- <!-- 任务列表没有数据的时候展示 -->
- <div class="nones" v-if="ProgressList.length <= 0">
- {{ $t('nodata') }}
- </div>
- <!-- 任务进展完整状态 -->
- <el-dialog :title="$t('other.prompts')" :visible.sync="innerVisibless" append-to-body width="500px">
- <div class="integrity">
- <h3 style="font-weight: normal;display: inline-block;margin: 0 0 20px 0;">{{ $t('taskprogress') }} :{{ProgressList.length}}</h3>
- <!-- <span class="write"><i class="el-icon-circle-plus"></i>填写进展</span> -->
- <el-divider></el-divider>
- <!-- -->
- <div class="block" style="height: 200px;">
- <el-timeline style="padding:20px 0 0 0;">
- <el-timeline-item
- v-for="(activity, index) in ProgressList"
- :key="index">
- <div class="tb">
- <span v-if="activity.status == 0" style="color: #43D14F" class="icon"></span>
- <span v-if="activity.status == 1" style="color: #FD7624" class="icon"></span>
- <span v-if="activity.status == 2" style="color: red" class="icon"></span>
- <div>
- <span v-if="activity.status == 0" style="color: #43D14F">{{ $t('normals') }}</span>
- <span v-if="activity.status == 1" style="color: #FD7624">{{ $t('atrisk') }}</span>
- <span v-if="activity.status == 2" style="color: red">{{ $t('withinthetimelimit') }}</span>
- <span style="display: inline-block; float: right; color: #8C8C8C">{{activity.indate | relativeTime}}</span>
- </div>
- <p style="color: #8C8C8C">{{activity.content}}</p>
-
- </div>
- </el-timeline-item>
- </el-timeline>
- </div>
- <!-- -->
- </div>
- <span slot="footer" class="dialog-footer foooot">
- <el-button type="primary" @click="innerVisibless = false">{{ $t('Shutdown') }}</el-button>
- </span>
- </el-dialog>
- </template>
- <!-- 子任务/关联任务 -->
- <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? $t('guanlian') : $t('zirwu')}}</i>
- <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">{{ $t('associatedTask') }}</el-link>
- <el-link style="float:right;" @click="addSubTask" v-else>{{ $t('addingsubtask') }}</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="$t('wan-cheng')" 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)"></el-checkbox>
- </template>
- </el-table-column>
- <el-table-column prop="taskName" :label="$t('biao-ti')" >
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top" style="cursor:pointer;color:#409eff;">
- <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" width="130" align="left">
- <template slot-scope="scope">
- <el-button @click.stop.native="deleteRelationItem(scope.row.id)" size="mini">{{ $t('dissociated') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--子任务列表 -->
- <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="$t('wan-cheng')" 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="finishTask(scope.row)"
- ></el-checkbox>
- </template>
- </el-table-column>
- <el-table-column prop="name" :label="$t('biao-ti')" >
- <template slot-scope="scope">
- <el-tooltip class="item" effect="dark" :content="scope.row.name" placement="top">
- <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.name}}</span>
- </el-tooltip>
- </template>
- </el-table-column>
- <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" width="100" >
- <template slot-scope="scope">
- <span v-if="user.userNameNeedTranslate != 1">
- {{scope.row.executorName == null?$t('dai-fen-pei'):scope.row.executorName}}
- </span>
- <span v-if="user.userNameNeedTranslate == 1">
- <span v-if="scope.row.executorName == null">
- {{$t('dai-fen-pei')}}
- </span>
- <span v-else>
- <span v-for="item,index in scope.row.executorName" :key="index">
- <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
- <span v-if="index < scope.row.executorName.length - 1">,</span>
- </span>
- </span>
- </span>
- </template>
- </el-table-column>
- <el-table-column prop="endDate" :label="$t('deadline')" width="100" >
- <template slot-scope="scope">
- <p v-if="scope.row.endDate >= times">{{scope.row.endDate}}</p>
- <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-form>
- <!-- 关联文件列表 -->
- <template v-if="isEditFile">
- <div style="width:100%;margin:1em 0;">
- <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{ $t('jiafuchengguo') }}</i>
- <el-link @click="relationFileClick()" style="float:right;margin-left:10px">{{ $t('associatedfiles') }}</el-link>
- <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
- <el-link>{{ $t('uoloadFiles') }}</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"
- :span-method="objectSpanMethod"
- style="width: 100%;margin-top:10px;margin-bottom:15px">
- <el-table-column :label="$t('headerTop.serialNumber')" prop="documentType" min-width="60" align="center">
- <template slot-scope="scope">
- <div>
- {{scope.$index + 1}}
- </div>
- </template>
- </el-table-column>
- <el-table-column :label="$t('filenames')" prop="documentName" min-width="180"></el-table-column>
- <el-table-column :label="$t('filesize')" prop="size" min-width="80" align="center"></el-table-column>
- <el-table-column :label="$t('founder')" prop="creatorName" min-width="60" align="center">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate != 1">{{scope.row.creatorName}}</span>
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='scope.row.creatorName'></TranslationOpenDataText>
- </span>
- </div>
- </template>
- </el-table-column>
- <el-table-column :label="$t('creationtime')" prop="indate" min-width="140" 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="$t('operation')" min-width="90" fixed="right">
- <template slot-scope="scope">
- <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">{{ $t('other.download') }}</el-link>
- <el-link @click="taskFileDelete(scope.row.id)">{{ $t('btn.delete') }}</el-link>
- </template>
- </el-table-column>
- <el-table-column label="状态" min-width="140" v-if="user.timeType.taskFileCharge == 1" fixed="right">
- <template slot-scope="scope">
- <template v-if="scope.row.fileChargeStatus != 2">
- <el-link :type="{'0': 'warning', '1': 'info', '2': 'danger'}[scope.row.fileChargeStatus]" :underline="false">
- {{ scope.row.fileChargeStatusTextList[0] || '' }}
- <template v-if="(scope.row.fileChargeStatusTextList || []).length > 1">
- <TranslationOpenDataText :openid='scope.row.fileChargeStatusTextList[1]'></TranslationOpenDataText>
- {{ scope.row.fileChargeStatusTextList[2] || '' }}
- </template>
- </el-link>
- </template>
- <template v-else>
- <el-tooltip class="item" effect="dark" content="点击查看" placement="top">
- <el-link :type="'danger'" :underline="false" @click="showReasonForRejection(scope.row)">
- {{ scope.row.fileChargeStatusTextList[0] || '' }}
- <template v-if="(scope.row.fileChargeStatusTextList || []).length > 1">
- <TranslationOpenDataText :openid='scope.row.fileChargeStatusTextList[1]'></TranslationOpenDataText>
- {{ scope.row.fileChargeStatusTextList[2] || '' }}
- </template>
- </el-link>
- </el-tooltip>
- </template>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <!-- 关联文件dialog -->
- <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" :title="$t('associatedfiles')" append-to-body>
- <span>{{ $t('wenjian1guanli') }}</span>
- <div>
- <span>{{ $t('xuanzwenjian') }}</span>
- <el-select v-model="addFileId" filterable >
- <el-option
- v-for="item in projectFileList"
- :key="item.id"
- :label="item.documentName"
- :value="item.id"
- ></el-option>
- </el-select>
- <el-button @click="addTaskFile()">{{ $t('btn.determine') }}</el-button>
- </div>
- </el-dialog>
- <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" :title="$t('associatedTask')" width="800px" append-to-body>
- <el-form ref="relationItemForm" label-width="100px">
- <el-form-item :label="$t('selecttask')" prop="taskType">
- <el-select v-model="relationvalue" multiple style="width:80%">
- <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 foooot">
- <el-button @click="isRelationTab = false">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="addRelationTask()">{{ $t('btn.determine') }}</el-button>
- </div>
- </el-dialog>
- </div>
- <div slot="footer" class="dialog-footer foooot">
- <el-button v-if="(user.id == addForm.createrId || currentProject.inchargerId == user.id || currentProject.creatorId == user.id || permissions.projectManagement) && canAddTask" @click.native="deleteTask()" style="float:left;">{{ $t('btn.delete') }}</el-button>
- <el-button type="primary" v-if="user.userNameNeedTranslate == 1 && !meetingId && !integrationTask.stage && addForm.executorListFront[0].executorId" @click="meetingCli()">{{ $t('faQiHuiYi') }}</el-button>
- <el-button @click.native="closeBounceds()">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
- </div>
-
- <!-- <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
- <el-page-header @back="backToParentTask" :title="timelabel ? $t('returnmilestone') : $t('parenttask')" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
- </div> -->
- <!-- 评论 -->
- <div class="remark" v-show="addForm.id != null">
- <span class="zh">
- <div class="player">
- <p>{{ $t('participantin') }}</p>
- <div class="bj">
- <span v-for="(pl, i) in critic" :key="i">
- <span style="background: #778899" v-if="user.userNameNeedTranslate != 1">{{pl.length > 2 ? pl.substring(pl.length - 2, pl.length) : pl}}</span>
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='pl'></TranslationOpenDataText>
- </span>
- </span>
- <!-- <span style="background: #778899">{{pl.length}}</span> -->
- </div>
- </div>
- <div class="subject">
- <div class="sub-all">
- <div :class="dynamicTab ? 'subOn' : ''" @click="dynamicTab = true">{{ $t('alldynamic') }}</div>
- <div :class="dynamicTab ? '' : 'subOn'" @click="dynamicTab = false">{{ $t('xiang-guan-ri-bao') }}</div>
- </div>
- <div class="sub-details" ref="main" v-if="dynamicTab">
- <ul class="infinite-list" v-infinite-scroll="load" ref="contRoll">
- <div style="width: 100%" v-if="commentList.length <= 0">
- <img src="../assets/image/xiao.png" alt="">
- </div>
- <li v-for="i in count" class="infinite-list-item counli" :key="i">
- <p><i class="el-icon-s-fold"></i> <em>{{ $t('managerQucompletedthedependencytask') }}</em><span>{{ $t('onApril20') }}</span></p>
- </li>
- <li class="carts" v-for="item in commentList" :key="item.id">
- <!-- <el-image style="width: 30px; height: 30px" :src="url" :fit="fit"></el-image> -->
- <!-- <i :style="'background' + item.userColor"> -->
- <i :style="'background' + item.userColor">
- <i v-if="user.userNameNeedTranslate != 1">
- {{item.userName.length > 2 ? item.userName.substring(item.userName.length - 2, item.userName.length) : item.userName}}
- </i>
- <i v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText>
- </i>
- </i>
- <div>
- <!-- <p>{{item.userName}}</p> -->
- <!-- <p> -->
- <p v-if="user.userNameNeedTranslate != 1">
- {{item.userName}}
- </p>
- <p v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='item.userName'></TranslationOpenDataText>
- </p>
- <!-- </p> -->
- <em>
- <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate == 1">
- <template v-for="listItem in item.newContent">
- <template v-if="listItem.type == 'user'">
- <TranslationOpenDataText type='userName' :openid='listItem.value'></TranslationOpenDataText>
- </template>
- <template v-if="listItem.type == 'text'">{{ listItem.value }}</template>
- </template>
- </p>
- <p style="display: inline-block;padding: 0;margin: 0;" v-if="user.userNameNeedTranslate != 1">{{item.content}}</p>
- <!-- 重启原因和责任人 -->
- <span class="commentSpan" v-if="user.timeType.restartTaskNeedReason == 1 && item.reason != ''">{{ $t('zhongQiYuanYin') }}:{{item.reason}}</span>
- <span class="commentSpan" v-if="user.timeType.restartTaskNeedReason == 1 && item.taskPersonLiableList.length > 0">{{ $t('zeRenRen') }}
- <span v-for="responsibility, responsibilityIndex in item.taskPersonLiableList" :key="responsibilityIndex">
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='responsibility.userName'></TranslationOpenDataText>
- </span>
- <span v-if="user.userNameNeedTranslate != 1">{{responsibility.userName}}</span>
- <span v-if="responsibilityIndex < item.taskPersonLiableList.length - 1">,</span>
- </span>
- </span>
- </em>
- </div>
- <span>{{item.createTime | relativeTime}}</span>
- </li>
- </ul>
- </div>
- <div class="Daily" v-if="!dynamicTab">
- <div class="one_daily_body DailyBody">
- <el-card shadow="never" v-for="(item2,index2) in dailyList" :key="index2" style="margin-bottom: 20px;">
- <p>
- {{ $t('tian-bao-ren') }}: <span v-if="user.userNameNeedTranslate != 1">{{item2.userName}}</span>
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='item2.userName'></TranslationOpenDataText>
- </span>
- <span style="float: right;">{{item2.createDate}}</span>
- </p>
- <p>{{ $t('other.approvalStatus') }}:
- <span v-if="user.company.packageEngineering == 0">
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0">
- <span v-if="item2.isDeptAudit==0">
- <span v-if="item2.projectAuditState==0">
- <!-- 待项目审核人 --> {{$t('other.waitForTheProjectReviewer')}}
- <span v-if="item2.projectAuditorName != null">(
- <span v-if="user.userNameNeedTranslate == '1'">
- <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
- )</span>
- <!-- 审核 --> {{$t('other.audit')}}
- </span>
- <span style="color:#32CD32;" v-else-if="item2.projectAuditState==1">
- <!-- 项目审核人 --> {{$t('other.projectAuditor')}}
- <span v-if="item2.projectAuditorName != null">(
- <!-- {{item2.projectAuditorName}} -->
- <span v-if="user.userNameNeedTranslate == '1'">
- <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{item2.projectAuditorName}}</span>
- )</span>
- <!-- 审核通过 --> {{$t('state.approved')}}
- </span>
- </span>
- <span v-else-if="item2.isDeptAudit==1">
- ({{$t('other.await')}}
- <span v-if="user.userNameNeedTranslate == '1'">
- <TranslationOpenDataText type='departmentName' :openid='item2.auditDeptName'></TranslationOpenDataText>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{item2.auditDeptName}}</span>
- {{$t('other.audit')}})
- </span>
- </span>
- <span style="margin-left:15px;color:#DAA520;" v-else-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}
- <span style="color:#c7e944" v-if="item2.reportAutoApprove == 1">{{$t('other.automaticReview')}}</span>
- </span>
-
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
- </span>
- <span v-if="user.company.packageEngineering == 1">
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == -1">{{$t('other.importWaitingForReview')}}</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == -1">{{$t('other.waitingForProfessionalReview')}}</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 0">{{$t('other.waitingForDepartmentReview')}}</span>
- <span style="margin-left:15px;color:#DAA520;" v-if="item2.state == 0 && item2.departmentAuditState == 1">{{$t('other.waitForTheProjectReviewer')}}<span v-if="item2.projectAuditorName != null">
- (
- <span v-if="user.userNameNeedTranslate != 1">
- {{item2.projectAuditorName}}
- </span>
- <span v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='item2.projectAuditorName'></TranslationOpenDataText>
- </span>
- )
- </span>{{$t('other.audit')}}</span>
- <span style="margin-left:15px;color:#32CD32;" v-else-if="item2.state == 1">{{$t('state.alreadyPassed')}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 2">{{$t('state.rejected')}} {{$t('other.reason')}}:{{item2.rejectReason}}</span>
- <span style="margin-left:15px;color:#FF0000;" v-else-if="item2.state == 3">{{$t('state.waitingsubmit')}}</span>
- </span>
- </p>
- <p v-if="user.timeType.customDegreeActive==1 && item2.degree_id != null && item2.degree_id != -1">{{user.timeType.customDegreeName}}:{{item2.degreeName}}</p>
- <p v-if="user.timeType.customDataActive==1">{{user.timeType.customDataName}}:{{item2.customData}}</p>
- <!-- 自定义日报文本 -->
- <p v-if="user.timeType.customTextActive==1">{{user.timeType.customTextName}}:{{item2.customText}}</p>
- <p v-if="user.company.packageEngineering == 1">
- {{$t('other.professionalProgress')}}:
- <span style="margin-right:10px;" v-for="progressItem in item2.professionProgress" :key="progressItem.id">{{progressItem.professionName}}({{progressItem.progress}}%)
- <el-tooltip v-if="progressItem.auditState == 0" :content="$t('state.WaitingAudit')" effect="light" placement="top">
- <i class="iconfont firerock-icondaibandengdaishenhe"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 1" :content="$t('state.alreadyPassed')" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhetongguo"></i>
- </el-tooltip>
- <el-tooltip v-if="progressItem.auditState == 2" :content="$t('state.notThrough')" effect="light" placement="top">
- <i class="iconfont firerock-iconshenhebohui"></i>
- </el-tooltip>
- </span>
- </p>
- <div v-if="item2.multiWorktime==0">
- <p style="display: inline-block;">{{$t('time.duration')}}:
- <span v-if="item2.reportTimeType == 0" style="margin-right:10px;">{{typeList[item2.timeType]}}</span>
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{item2.startTime+'-'+item2.endTime}}</span>
- {{item2.time.toFixed(1)}}h
- <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{$t('other.WorkOvertime')}}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag>
- </p>
- <p>{{$t('other.matters')}}:<span v-html="item2.content"></span></p>
- </div>
- <div v-if="item2.multiWorktime==1" >
- <p>{{$t('other.projectDuration')}}:{{item2.time.toFixed(1)}}h <el-tag type="danger" size="mini" style="margin-left: 65px" v-if="item2.isOvertime === 1">{{ $t('other.WorkOvertime') }}<span v-if="item2.overtimeHours">{{item2.overtimeHours.toFixed(1)}}h</span></el-tag></p>
- <div v-for="(timeItem, tIndex) in item2.worktimeList" :key="tIndex"
- style="border: 0.5px #ddd solid;margin-bottom:5px;padding:5px;">
- <p style="display: inline-block;">{{$t('time.duration')}}:
- <span v-if="item2.reportTimeType == 2" style="margin-right:10px;">{{timeItem.startTime+'-'+timeItem.endTime}}</span>
- {{timeItem.time.toFixed(1)}}h
- </p>
- <p>{{$t('other.matters')}}:<span v-html="timeItem.content"></span></p>
- </div>
- </div>
- <p v-if="item2.state == 1 && user.timeType.needEvaluate == 1">{{$t('other.evaluation')}}:<span v-html="item2.evaluate"></span></p>
-
- <!--照片的显示 -->
- <p v-if="item2.pics != null && item2.pics.length > 0">
- <el-image v-for="(pic, index) in item2.pics" :key="index"
- style="width: 100px; height: 100px; margin-right:10px;"
- :src="pic"
- :preview-src-list="item2.pics">
- </el-image>
- </p>
- </el-card>
- </div>
- </div>
- </div>
- <div class="issue" v-if="dynamicTab">
- <!-- <el-input type="textarea" class="textareays" label-width="100%" label-height="140px"></el-input> -->
- <div class="issue_fixation">
- <div class="inputDeep"><el-input
- type="textarea"
- :placeholder="$t('pleaseentercontent')"
- :autosize="{ minRows: 6, maxRows: 6}"
- v-model="textarea2"
- class="inputDeeps"
- >
- </el-input></div>
- <el-button class="issue-button" type="primary" @click="release()">{{ $t('fa-bu') }}</el-button>
- </div>
- </div>
- </span>
- </div>
- </div>
- </template>
- <script>
- import selectCat from "@/components/select.vue"
- import selectPersonnel from "@/components/selectPersonnel.vue"
- // 富文本样式
- import 'quill/dist/quill.core.css'
- import 'quill/dist/quill.snow.css'
- import 'quill/dist/quill.bubble.css'
- // 导入富文本
- import { quillEditor } from 'vue-quill-editor'
- export default {
- props: {
- integrationTask:{
- type: Object,
- default: {}
- },
- // 是否显示选择任务
- showOrNot: {
- type: Boolean,
- default: false
- }
- },
- components: {
- quillEditor, // 富文本
- selectCat,
- selectPersonnel
- },
- data() {
- return {
- startNum: 0,
- endNum: 5,
- shownumber: 5,
- sizeNum: JSON.parse(sessionStorage.getItem("user")).companyId == '3092' ? 105 : 65,
- meeting: false,
- numnnumnum: 2,
- componentFlg: false,
- mileageCup: false,
- loadingExport : false,
- saveTemplateLoading: false,
- joinMembList:[],
- setInchargerDialog: false,
- recentProgressInfo:{},
- addToTmpDialog:false,
- templateForm:{},
- importTaskDialog:false,
- importToStageId:null,
- exportDialog: false,
- exportTaskType:null,
- groupTemplateList:[],
- createGroupWay:'new',
- modGroupDialog:false,
- subTaskVisible:false,
- orderList:[{id:"seq",name:this.$t('manuallydragthesequence'),isDesc:false},{id:"create_date",name:this.$t('creationtimeisthelatest'),isDesc:true},
- {id:"end_date",name:this.$t('deadlineisthelatest'),isDesc:true},
- {id:"task_level",name:this.$t('highestpriority'),isDesc:true}],
- order:"seq",
- isDesc:false,
- taskDataList:[],
- displayTable: false,
- viewList: [{id:1,name:this.$t('alltaskss')},{id:2,name:this.$t('taskinprogress')},{id:3,name:this.$t('missionscompleted')},{id:4,name:this.$t('taskscheduled')},
- {id:5,name:this.$t('createdthetask')},{id:6,name:this.$t('missionIwason')},{id:7,name:this.$t('todaytask')},{id:8,name:this.$t('taskthatisoverdue')}],
- importanceList:[{id:0,name:this.$t('yi-ban')},{id:1,name:this.$t('zhong-yao')},{id:2,name:this.$t('jin-ji')},],
- taskTypeList:[{id:0,name:this.$t('other.task'), icon:"iconfont firerock-iconrenwu"},{id:1,name:this.$t('other.milestone'),icon:"iconfont firerock-iconicon-"},{id:2,name:this.$t('risk'),icon:"iconfont firerock-iconfengxian"}],
- taskTypeColor:['#20A0FF','#8613ad','#bf0404'],
- taskTypeIcon:['iconfont firerock-iconrenwu','iconfont firerock-iconicon-','iconfont firerock-iconfengxian'],
- taskStatusList:[this.$t('ongoing'),this.$t('state.completed'),this.$t('state.undone')],
- //优先级
- taskLevelColor:['#262626','#E6A23C','#F56C6C'],
- stageListHeight:0,
- taskListinH:0,
- groupWidth:260,
- drag: false,
- stageDrag: false,
- dragging: false,
- stageList:[],
- selectedGroup:{},
- allGroupData:[],
- defaultGroupId:null,
- addGroupDialog: false,
- addStageDialog: false,
- groupSearch:null,
- groupType:0,//0-分组,1-视图
- groupList: [],
- groupForm:{},
- stageForm:[],
- curProjectId:null,
- projectList:null,
- activeIndex:"1",
- activeName:"projectInside",
- searchField:null,
- keyword:null,
- user: JSON.parse(sessionStorage.getItem("user")),
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- userDetailVisible: false,
- userDetail:{},
- date: new Date(),
- users: [],
- tableHeight: 0,
- listLoading: false,
-
- subProjectVisible: false,
- subProjectList: [],//子项目列表
- currentProject:{},
- addSubProject: false,
- addFormVisible: false,
- addLoading: false,
- title: "",
- addForm: {
- name: '',
- executorListFront: [
- {
- executorId:null
- }
- ]
- },
- rules: {
- name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
- },
- rules2: {
- stagesName: [{ required: true, message: this.$t('pleaseenteratasklistname'), trigger: "blur" }],
- },
- taskRules : {
- name: [{ required: true, message: this.$t('enterthetaskcontent'), trigger: "blur" }],
- serviceId: [{ required: true, message: this.$t('qingXuanZeFuWu'), trigger: "blur" }],
- projectId: [{ required: true, message: this.$t('qingXuanZeSuoShuXiangMu'), trigger: "blur" }],
- groupId: [{ required: true, message: this.$t('qingXuanZeSuoShuRenWuFenZu'), trigger: "blur" }],
- stagesId: [{ required: true, message: this.$t('qingXuanZeSuoShuRenWuLieBiao'), trigger: "blur" }],
- },
- formGrouping: {
- name: [{ required: true, message: this.$t('pleaseenteragroupname'), trigger: "blur" }],
- },
- sleectId: null,
- sleectProjectId: null,
- sidebarIndex: 0, // 侧边栏索引
- url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
- count: 0,
- textarea2: '',
- taskId: null,
- commentList: [],
- radio: 0,
- critic: [], // 评论头像的数组
- editorOption: { // 富文本框里面的默认值
- placeholder: this.$t('pleaseentethetext'),
- modules: {
- toolbar:[
- ['bold', 'italic', 'underline', 'strike'], //加粗,斜体,下划线,删除线
- // ['blockquote', 'code-block'], //引用,代码块
-
- [{ 'header': 1 }, { 'header': 2 }], // 标题,键值对的形式;1、2表示字体大小
- // [{ 'list': 'ordered'}, { 'list': 'bullet' }], //列表
- // [{ 'script': 'sub'}, { 'script': 'super' }], // 上下标
- // [{ 'indent': '-1'}, { 'indent': '+1' }], // 缩进
- // [{ 'direction': 'rtl' }], // 文本方向
-
- [{ 'size': ['small', false, 'large', 'huge'] }], // 字体大小
- [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //几级标题
-
- [{ 'color': [] }, { 'background': [] }], // 字体颜色,字体背景颜色
- // [{ 'font': [] }], //字体
- [{ 'align': [] }], //对齐方式
-
- ['clean'], //清除字体样式
- // ['image','video'] //上传图片、上传视频
- ['image'] //上传图片、上传视频
- ], //工具栏设置
- },
- theme: 'snow',
- },
- textContent: true, // 控制提交
- times: null,
- text2: '',
- innerVisibless: false, // 任务展示弹出层
- activities: [{
- content: this.$t('normals'),
- timestamp: this.$t('hoursago'),
- size: 'large',
- type: 'primary',
- icon: 'el-icon-circle-check',
- color: '#409EFF'
- }, {
- content: this.$t('withinthetimelimit'),
- timestamp: this.$t('hoursago8'),
- color: '#F87872'
- }],
- ProgressList: [],
- checkboxGrounp: [], // 选中人的数据
- checkLists: [], // 选中人数据的ID
- taskIid: null,
- gstimday:[1],
- gstimhour:[8],
- timelabel: false,
- relationdata: [],
- isRelationTab: false,
- relationvalue:[],
- relationSubTaskList:[],
- relationItemData: null,
- relationPar:{name: ''},
- isRelationItem: false,
- // 关联文件
- fileListLoading:false,
- projectFileList:[],
- taskFileList:[],
- relationFileDialog: false,
- addFileId: null,
- isEditFile: false,
- // 设置项目参与人
- participantsDialog: false,
- participantsFilterText: '',
- deptMembData: [
- {
- id: 0,
- label: this.$t('lable.unassigned'),
- }
- ],
- defaultProps: {
- children: 'children',
- label: 'label'
- },
- chosenMembCount: 0,
- ididid:null,
- alreadyPartArray: [],
- projectCreatorId: null,
- projectInchargerId: null,
- canAddTask: false, // 是否可创建任务的判断标志
- canEditStageList: false, //是否可编辑列表的判断标志
- groupResponsibleId: '', // 分组负责人的id
- groupDetailsShow: false,
- groupDetailData: {},
- groupDetailTil: '',
- setTemplateData: {},
- setTemplateDialog: false,
-
- taskListPage: 1,
- taskListSize: 20,
- taskListTotal: 0,
- dynamicTab: true,
- dailyList: [],
- meetingId: '',
- integrationProjectList: [],
- sapServiceList:[],
- };
- },
- computed: {
- showData() {
- // return this.addForm.executorListFront.slice(this.startNum, this.endNum)
- let newList = this.addForm.executorListFront
- newList.forEach((item, index) => {
- item.indexList = index
- })
- console.log(newList.slice(this.startNum, this.endNum), '<==== newList')
- return newList.slice(this.startNum, this.endNum)
- },
- containerHeight() {
- if(this.addForm.executorListFront.length < this.shownumber) {
- return this.sizeNum * this.addForm.executorListFront.length + 'px'
- } else {
- return (this.sizeNum * this.shownumber) - 20 + 'px'
- }
- },
- barHeight() {
- return this.sizeNum * (this.addForm.executorListFront || []).length + 'px'
- },
- listTop() {
- return this.startNum * this.sizeNum + 'px'
- }
- },
- watch: {},
- created() {},
- mounted() {
- console.log('我获取到的数据', this.integrationTask, this.showOrNot)
- this.triggerEvent(this.integrationTask)
- this.gstimhour = [this.user.timeType.allday]
- this.gstimday = [1]
- this.getSapServiceList()
- this.timess();
-
- },
- methods: {
- // 容器的滚动事件
- handleScroll() {
- const scrollTop = this.$refs.container.scrollTop
- this.startNum = Math.floor(scrollTop / this.sizeNum)
- console.log(this.startNum, this.shownumber, '<==== 计算')
- this.endNum = this.startNum + this.shownumber
- },
- bottomScrollClick(val) {
- this.$nextTick(() => {
- let scrollEl = this.$refs.container;
- let bum = scrollEl.scrollHeight
- let current = scrollEl.scrollTop + 1
- scrollEl.scrollTo({ top: val ? current : bum, behavior: 'smooth' });
- });
- },
- // 刷新数据
- refreshData() {
- this.$forceUpdate()
- },
- serviceIdChange() {
- this.refreshData()
- },
- // 触发外层的会议
- meetingCli() {
- this.$parent.$parent.parentMeetingCli(this.integrationTask.id)
- },
- // 触发事件
- triggerEvent(obj) {
- console.log(obj, '触发事件')
- this.curProjectId = obj.curProjectId
- this.getProjectList()
- if(!obj.taskVue) {
- this.getStageList(obj.integrationTaskNingwai)
- }
- if(obj.create) {
- this.getUsers(); // 获取名单数据
- this.mileageCup = false
- this.addFormVisible = true;
- this.curProjectId = obj.stage.projectId;
- this.addForm = {projectId: obj.stage.projectId, groupId: obj.stage.groupId, stagesId: obj.stage.id, taskLevel:0, planHours: 8, taskType: 0};
- this.addForm.executorListFront = [{executorId:null, planHours:this.user.timeType.allday}];
- this.gstimhour = [this.user.timeType.allday]
- this.gstimday = [1]
- this.addLoading = false;
- this.isEditFile = false;
- this.title=this.$t('createtask ');
- this.commentList = [];
- this.timelabel = false
- } else {
- if(!obj.taskVue) {
- this.isEditFile = true;
- this.getDetail(obj.curProjectId)
- }
- this.curProjectId = obj.task.projectId;
- // this.getTaskDetail(obj.id);
- this.getTaskProgressList(obj.id); // 获取任务进展列表
- this.gain(obj.task); // 获取评论列表
- this.getDailyList(obj.id) // 获取来自日报
- this.getRelationTaskList(obj.num, obj.id)
- this.getTaskFileList(obj.num,obj.id)
- setTimeout(() => {
- this.getTaskDetail(obj.id);
- }, 200)
- }
- this.getrelation();
- },
- // 代办任务创建事件
- agentCreatesEvents(num) {
- if(num == 1) {
- this.addForm.groupId = ''
- this.addForm.stagesId = ''
- this.getTaskGrouping()
- this.getrelation();
- } else if(num == 2) {
- this.addForm.stagesId = ''
- this.getTaskList()
- }
- },
- //获取项目列表
- getProjectList() {
- this.http.post(this.port.project.list, {},
- res => {
- if (res.code == "ok") {
- this.projectList = res.data;
- this.getRecentlyProject()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取最近项目列表
- getRecentlyProject() {
- this.http.post('/project/nearProject',{},res => {
- if(res.code == 'ok'){
- let topObj = {
- label: this.$t('zuiJinXuanZeXiangMu'),
- peojectList: res.data
- }
- let botomObj = {
- label: this.$t('other.allProject'),
- peojectList: this.projectList
- }
- this.integrationProjectList = [topObj, botomObj]
- console.log(this.integrationProjectList, '整合')
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },err => {
- this.$message({
- message: err,
- type: 'error'
- })
- })
- },
- // 获取任务分组
- getTaskGrouping() {
- this.http.post('/task-group/list', {projectId:this.addForm.projectId},
- res => {
- if (res.code == "ok") {
- this.groupList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- getTaskList() {
- let obj = {
- groupId: this.addForm.groupId,
- projectId: this.addForm.projectId,
- order: 'seq',
- isDesc: false
- }
- this.getStageList(obj)
- },
- // 关闭最外层弹窗
- closeBounceds() {
- console.log('我被触发了')
- this.$emit('closeBounced', {})
- },
- chggstim(e,i){
- if(e){
- this.gstimday[i] = Math.ceil(this.gstimhour[i] / this.user.timeType.allday)
- }else{
- this.gstimhour[i] = this.gstimday[i] * this.user.timeType.allday
- }
- },
- 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();
- }
- },
- removeExecutorLineNew(item, e) {
- let index = item.indexList
- 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();
- }
- this.replacementResult()
- setTimeout(() => {
- this.bottomScrollClick(true)
- }, 100)
- },
- 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();
- this.replacementResult()
- setTimeout(() => {
- this.bottomScrollClick()
- }, 100)
- }
- },
- replacementResult() {
- let lengths = (this.addForm.executorListFront || []).length
- if(lengths > this.shownumber) {
- this.startNum = lengths - this.shownumber
- this.endNum = lengths
- } else {
- this.startNum = 0
- this.endNum = lengths
- }
- this.sizeNum = typeof this.sizeNum == 'number' ? this.sizeNum+'' : +this.sizeNum
- },
- getTaskDetail(id) {
- this.http.post('/task/getTask',{id: id},
- res => {
- if (res.code == "ok") {
- this.meetingId = res.data.meetingId
- console.log(this.meetingId, '看看打印纸')
- if(this.user.userNameNeedTranslate == 1) {
- for(var i in res.data.subTaskList) {
- if(res.data.subTaskList[i].executorName) {
- res.data.subTaskList[i].executorName = res.data.subTaskList[i].executorName.split(',')
- }
- }
- }
- this.addForm = res.data;
- if (this.addForm.aheadTid) {
- this.addForm.aheadTidList = JSON.parse(this.addForm.aheadTid);
- } else {
- this.addForm.aheadTidList = [];
- }
-
- this.addForm.createDate = null;
- this.addForm.indate = null;
- this.addLoading = false;
- this.canAddTask = res.data.canAddTask
- this.recentProgressInfo = res.data.progress;
-
- if(res.data.executorList.length > 0) {
- for(var i in res.data.executorList){
- if(res.data.executorList[i].serviceId) {
- res.data.executorList[i].serviceId = JSON.parse(res.data.executorList[i].serviceId)
- }
- }
- console.log("==================",res.data.executorList)
- this.addForm.executorListFront = res.data.executorList;
- } else {
- this.addForm.executorListFront = [{executorId: null, planHours: 8}];
- }
- this.gstimday = []
- this.gstimhour = []
- for(let i=0;i<this.addForm.executorListFront.length;i++){
- this.gstimhour.push(this.addForm.executorListFront[i].planHours)
- this.gstimday.push(Math.ceil(this.addForm.executorListFront[i].planHours / this.user.timeType.allday))
- }
- console.log(this.gstimday, this.gstimhour)
- // //删除中间传值的变量数组
- delete this.addForm.executorList;
-
- //人员处理
- this.users = res.data.userList;
- // 触发类型切换事件
- this.selchg()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //获取任务进展列表
- getTaskProgressList(taskId) {
- this.taskIid = taskId
- this.http.post('/task-progress/list', {taskId: taskId},
- res => {
- if (res.code == "ok") {
- this.ProgressList = res.data;
- this.recentProgressInfo = res.data[0]
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- }
- );
- },
- getUsers() {
- this.http.post('/user/getSimpleActiveUserList', {},
- res => {
- if (res.code == "ok") {
- this.users = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取评论列表
- gain(task,e) {
- this.commentList = [];
- 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") {
- if(this.user.userNameNeedTranslate == 1) {
- for (let i = 0; i < res.data.length; i++) {
- const originalString = res.data[i].content;
- const regex = /\$userName=[^$]*\$|[^$]+/g;
- const parts = originalString.match(regex);
- let newArrList = [];
- for (let j = 0; j < parts.length; j++) {
- const newStr = parts[j];
- if (newStr.startsWith('$userName=')) {
- const userName = newStr.slice(10, -1);
- newArrList.push({ type: 'user', value: userName });
- } else {
- newArrList.push({ type: 'text', value: newStr });
- }
- }
- res.data[i].newContent = newArrList;
- }
- }
- this.commentList = res.data
- this.sppk(this.commentList) // 获取参与人的方法
- this.contRoll()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取评论参与人
- sppk(comit) {
- var sk = []
- comit.forEach(function(e){
- sk.push(e.userName)
- })
- this.critic = new Set(sk)
- },
- 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'
- })
- })
- },
- // 获取来自日报
- getDailyList(id) {
- this.http.post('/report/getTaskReportList',{
- // taskId: '22131'
- taskId: id
- },
- res => {
- if (res.code == "ok") {
- this.dailyList = res.data
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- objectSpanMethod({ row, column, rowIndex, columnIndex }) {
- const { timeType } = this.user
- if (columnIndex === 6 && timeType.taskFileCharge == 1) {
- return [this.taskFileList.length, 1];
- }
- return [1, 1];
- },
- // 获取任务下的文档列表
- 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.map(item => {
- let str = item.fileChargeStatusText || ''
- let arr = str.split(/\$|=/).filter(item => item && item !== 'userName');
- return {
- ...item,
- fileChargeStatusTextList: arr || []
- }
- })
- console.log(this.taskFileList, '<+======this.taskFileList')
- }else {
- this.fileListLoading = false
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },error => {
- this.fileListLoading = false
- this.$message({
- message: error,
- type: 'error'
- })
- })
- },
- DateChange(){
- if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
- let stdate = Date.parse(this.addForm.startDate)
- let eddate = Date.parse(this.addForm.endDate)
- if(stdate <= eddate){
- let days = (eddate - stdate) / (1*24*60*60*1000) + 1
- for (let i=0;i<this.gstimday.length;i++) {
- this.gstimday[i] = days
- this.gstimhour[i] = days * this.user.timeType.allday
- }
- this.$forceUpdate()
- }
- }
-
- },
- // 自定义组件事件
- selectCal(obj) {
- if(obj.distinction == '1') {
- this.addForm.executorListFront[obj.index].executorId = obj.id
- } else if(obj.distinction == '2') {
- this.groupForm.inchargerId = obj.id
- }
- },
- getDetail(id) {
- this.http.post('/project/detail',{
- id: id
- },
- res => {
- if (res.code == "ok") {
- console.log('触发更新试一下')
- this.currentProject = res.data;
- this.getjurisdictionIds(this.currentProject)
- this.joinMembList = this.currentProject.participationList;
- } else {
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- getjurisdictionIds(pro){
- console.log('pro',pro.creatorId);
- this.projectCreatorId = pro.creatorId
- this.projectInchargerId = pro.inchargerId
- },
- //加载项目内的任务列表
- getStageList(obj) {
- this.http.post('/stages/list', {
- groupId: obj.groupId,
- projectId: obj.projectId,
- order: obj.order,
- isDesc: obj.isDesc
- },
- res => {
- if (res.code == "ok") {
- this.stageList = res.data.list;
- this.canAddTask = res.data.canAddTask
- this.canEditStageList = res.data.canEditStageList
- this.timess() // 处理时间的方法
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- 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)
- let D = date.getDate() < 10 ? ('0' + date.getDate()) : date.getDate()
- this.times = `${Y}-${M}-${D}`
- console.log(this.times, '时间')
- },
- // 提交按钮
- submitInsert() {
- if (this.textContent !== true) return this.$message({
- showClose: true,
- message: this.$t('pictureistoolargepleaseuploaditagain'),
- type: 'warning'
- });
- //检查是有重名的执行人
- var exeList = this.addForm.executorListFront;
- // for(let i=0;i<this.gstimhour.length;i++){
- // exeList[i].planHours = this.gstimhour[i]
- // }
-
- for (var i=0;i<exeList.length;i++) {
- if(this.user.companyId==3092){
- var findSameUser = false;
- exeList[i].planHours = this.gstimhour[i]
- for (var j=i+1;j<exeList.length; j++) {
- if ((exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId)
- &&(exeList[i].serviceId && exeList[j].serviceId && exeList[i].serviceId == exeList[j].serviceId)) {
- findSameUser = true;
- break;
- }
- }
- if (findSameUser) {
- return this.$message({
- showClose: true,
- message: this.$t('tongYiGeZhiHangRenFuWuBuNengXiangTong'),
- type: 'error'
- });
- }
- }else{
- var findSameUser = false;
- exeList[i].planHours = this.gstimhour[i]
- for (var j=i+1;j<exeList.length; j++) {
- if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
- findSameUser = true;
- break;
- }
- }
- if (findSameUser) {
- return this.$message({
- showClose: true,
- message: this.$t('executorhasduplication'),
- type: 'error'
- });
- }
- }
- }
- if(this.addForm.startDate && this.addForm.endDate) {
- if(this.addForm.endDate < this.addForm.startDate) {
- return this.$message({
- showClose: true,
- message: this.$t('ren-wu-jie-zhi-shi-jian-bu-neng-xiao-yu-kai-shi-shi-jian'),
- type: 'error'
- });
- }
- }
-
- this.$refs.form1.validate(valid => {
- if (valid) {
- delete this.addForm.subTaskList;
- delete this.addForm.refTaskList;
- delete this.addForm.progress;
- delete this.addForm.userList;
- //去掉没有执行人的.(因为要有计划工时,执行人可以暂不设置)
- // this.addForm.executorListFront = this.addForm.executorListFront.filter(exe=>exe.executorId);
- if(this.addForm.executorListFront.serviceId){
- this.addForm.executorListFront.serviceId= this.addForm.executorListFront.serviceId;
- }
- this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
- this.addForm.aheadTid = JSON.stringify(this.addForm.aheadTidList);
- this.addLoading = true;
- this.http.post('/task/save',this.addForm,
- res => {
- this.addLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.submittedSuccessfully'),
- type: "success"
- });
-
- if (this.addForm.parentTid == null) {
- console.log('我是对的')
- let obj = {
- submitInsert: true,
- showOrNot: this.showOrNot
- }
- this.$emit('closeBounced', obj)
- } else {
- console.log('我也是对的')
- // this.backToParentTask();
- this.$emit('closeBounced', {backToParentTaskSub: true})
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- });
- },
- backToParentTask() {
- this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
- this.isEditFile = true;
- if(this.timelabel){
- this.isRelationItem = false
- this.getRelationTaskList(1, this.relationPar.id)
- this.gain(this.relationPar)
- }
- },
- onEditorFocus() {
- this.onEditorBlur()
- },
- // 获得焦点时触发
- onEditorBlur(){
- let theEle = this.$refs.text; // 获取元素
- if(!theEle.value) {
- return
- }
- var img = theEle.value.match(/<img[^>]+>/g); // 赛选 img 标签
- var arrImg = ''
- for (var j = 0; j < img.length; j++) {
- // 正则匹配,摘出img标签下的src里的内容,即capture
- img[j].replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/gi, function(match, capture) {
- arrImg += capture
- });
- }
- // 原来的字符流大小,单位为字节
- var strLen = arrImg.length;
- // 计算后得到的文件流大小,单位为字节
- var fileSize=parseInt(strLen-(strLen/8)*2);
- var size = "";
- size = (fileSize/1024/1024).toFixed(2);
- if (size > 2){
- this.textContent = false
- this.$message({
- showClose: true,
- message: this.$t('imageexceeds2MBpleaseuploaditagain'),
- type: 'warning'
- });
- }
- this.textContent = true
- },
- //删除当前编辑的任务
- deleteTask() {
- var warning='';
- if (this.addForm.subTaskList.length > 0) {
- warning=this.$t('currenttaskanditssubtasks');
- } else {
- warning=this.$t('wanttodeletethecurrent task');
- }
- this.$confirm(warning, this.$t('other.prompts'), {
- //type: 'warning'
- }).then(() => {
- this.http.post('/task/delete',{id: this.addForm.id},
- res => {
- if (res.code == "ok") {
- this.$emit('closeBounced', {deleteTask: true})
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- });
- },
- addprogress(){ // 添加子任务进展事件
- this.$refs.proBox.style.display="block"
- this.$refs.addPro.style.display="none"
- },
- shutPro() { // 关闭任务进展
- this.$refs.addPro.style.display="block"
- this.$refs.addRem.style.display="none"
- this.$refs.proBox.style.display="none"
- },
- //创建任务进展
- addTaskProgress() {
- var param = {
- taskId: this.taskIid,
- status: this.radio,
- content: this.text2,
- participatorIds: this.checkLists.toString()
- };
- this.http.post('/task-progress/addProgress', param,
- res => {
- if (res.code == "ok") {
- this.shutPro()
- this.getTaskProgressList(this.taskIid)
- this.$message({
- message: this.$t('releasesuccess'),
- type: "success"
- });
- this.checkboxGrounp = [],
- this.checkLists = [],
- this.text2 = '',
- this.radio = 0
- let obj = {
- id: this.taskIid
- }
- this.gain(obj)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- }
- );
- },
- addI() { // 打开选择查看
- this.$refs.addRem.style.display="block"
- },
- selchg(){ //类型切换
- if(this.addForm.taskType == 1){
- this.timelabel = true
- if(!this.addForm.executorListFront[0].executorId) {
- console.log(this.currentProject)
- this.addForm.executorListFront[0].executorId = this.currentProject.inchargerId
- }
- }else{
- this.timelabel = false
- }
- },
- DateChange(){
- if(this.addForm.startDate != undefined && this.addForm.endDate != undefined){
- let stdate = Date.parse(this.addForm.startDate)
- let eddate = Date.parse(this.addForm.endDate)
- if(stdate <= eddate){
- let days = (eddate - stdate) / (1*24*60*60*1000) + 1
- for (let i=0;i<this.gstimday.length;i++) {
- this.gstimday[i] = days
- this.gstimhour[i] = days * this.user.timeType.allday
- }
- this.$forceUpdate()
- }
- // console.log("gstimday",this.gstimday);
-
- }
-
- },
- kkk(el){
- var k = this.checkLists.indexOf(el.id)
- if (k == -1) {
- this.checkLists.push(el.id)
- } else {
- this.checkLists.splice(k, 1)
- }
- },
- //删除任务进展
- deleteTaskProgress(id) {
- this.http.post('/task-progress/deleteProgress', {id: id},
- res => {
- if (res.code == "ok") {
- this.getTaskProgressList(this.taskIid)
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- }
- );
- },
- addRelation(){ //关联任务卡片
- this.relationvalue = []
- this.isRelationTab = true
- this.getrelation()
- },
- getrelation(){
- //获取选择关联列表
- this.http.post('/task/getTaskOnlyList',{
- projectId: this.curProjectId?this.curProjectId:this.addForm.projectId
- },
- res => {
- if (res.code == "ok") {
- this.relationdata = []
- res.data.forEach( (item) =>{
- if(item.taskType != 1){
- if (item.id != this.addForm.id) {
- this.relationdata.push(item)
- }
- }
- })
-
- // console.log('map',this.relationdata);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //显示子任务创建卡片
- 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}];
- this.addForm.executorListFront = [{executorId:null, planHours:8, serviceId: null}];
- this.addLoading = false;
- //创建子任务,非编辑状态
- this.isEditFile = false;
- // 触发外界子任务事件
- this.$emit('closeBounced', {addSubTask: true, addForms: this.addForm})
- },
- // 关联任务点击事件
- 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.$t('editingtasks');
- this.getTaskDetail(row.taskId);
- // this.getUsers();
- this.gain(row,1);
- this.getRelationTaskList(1, row.taskId)
- this.getTaskFileList(1,row.taskId)
- },
- // 解除关联
- 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: this.$t('jie-chu-cheng-gong'),
- 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();
- let obj = {
- submitInsert: true
- }
- this.$emit('closeBounced', obj)
- // }
- }else{
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },error => {
- this.$message({
- message: error,
- type: 'error'
- })
- })
- },
- finishTask(task) {
- this.http.post('/task/finish',{id: task.id, taskStatus: task.taskStatus},
- res => {
- if (res.code == "ok") {
- // if (this.groupType == 0) {
- // this.getStageList();
- // } else {
- // this.getViewTaskList();
- // }
- let obj = {
- submitInsert: true
- }
- this.$emit('closeBounced', obj)
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 关联文件按钮
- relationFileClick(){
- this.relationFileDialog = true
- this.addFileId = null
- this.getProjectFileList()
- },
- // 获取项目下的文档列表
- 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'
- })
- })
- },
- // 列表的删除按钮
- taskFileDelete(eid){
- this.$confirm(this.$t('shiFouYiChuCiWenJian'), this.$t('other.prompts'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- 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()
- this.gain({ taskId: this.taskId }, 1)
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },error => {
- this.$message({
- message: error,
- type: 'error'
- })
- })
- }).catch(()=>{
- this.$message({
- message: this.$t('thedeletionhasbeencancelled'),
- type: 'info'
- })
- })
- },
- showReasonForRejection(item) {
- const taskId = this.taskId
- this.http.post('/task/getFileRejectReason',{
- taskId
- },res => {
- if(res.code == 'ok'){
- this.$alert(res.data, '驳回原因');
- }else {
- this.$message.error(res.msg)
- }
- },error => { this.$message.error(error) })
- },
- // 确认关联文件
- addTaskFile(){
- if(this.addFileId == null){
- this.$message({message: this.$t('xuanzguanlianwenjian') , 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: this.$t('guan-lian-cheng-gong'),
- type: 'success'
- })
- this.relationFileDialog = false
- this.getTaskFileList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },error => {
- this.$message({
- message: error,
- type: 'error'
- })
- })
- },
- 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: this.$t('addsuccessful'),
- type: 'success'
- })
- this.getRelationTaskList()
- this.$forceUpdate()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },
- error => {
- this.$message({
- message: error,
- type: 'error'
- })
- })
- },
- backToParentTask() {
- // this.getTaskDetail(this.addForm.parentTid);
- this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
- this.isEditFile = true;
- if(this.timelabel){
- this.isRelationItem = false
- // this.relationPar = {name: ''}
- this.getRelationTaskList(1, this.relationPar.id)
- this.gain(this.relationPar)
- }
- },
- // 点击评论发布
- release() {
- if(this.textarea2.length <= 0) return this.$message({message: this.$t('pleaseentercontent'), type: "error"})
- this.http.post('/task-comment/add', {taskId: this.taskId, userId: this.user.id, content: this.textarea2},
- res => {
- if(res.code == "ok"){
- if(res.data.content.indexOf('$userName=') != '-1') {
- let obj = {
- msg1: res.data.content.split('$')[0],
- msg2: res.data.content.split('$')[1].split('=')[1],
- msg3: res.data.content.split('$')[2]
- }
- res.data.content = obj
- } else {
- if(this.user.userNameNeedTranslate == 1) {
- let obj = {
- msg1: res.data.content,
- msg2: '',
- msg3: ''
- }
- res.data.content = obj
- }
- }
- this.commentList.push(res.data)
- console.log(this.commentList, '值☞')
- this.sppk(this.commentList)
- let obj = {
- id: this.taskIid
- }
- this.gain(obj)
- this.textarea2 = ""
- // this.contRoll() // 滚动到底部
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- // 滚动到底部
- contRoll(){
- // this.$nextTick(() => {
- // this.$refs.main.scrollTop = this.$refs.contRoll.scrollHeight;
- // })
- this.$nextTick(() => {
- let scrollElem = this.$refs.main;
- scrollElem.scrollTo({ top: scrollElem.scrollHeight});
- });
- console.log('最后执行')
- },
- sss(){
- this.$refs.addRem.style.display="none"
- },
- taskLineClick(row, column, event) {
- if(this.isRelationItem){return}
- this.mileageCup = true
- if(row.taskType == 1){
- this.timelabel = true
- this.isRelationItem = false
- }else{
- this.timelabel = false
- }
- this.addFormVisible = true;
- this.isEditFile = true;
- this.addLoading = false;
- this.getTaskDetail(row.id);
- this.getTaskProgressList(row.id); // 获取任务进展列表
- // this.getUsers(); // 获取名单数据
- this.gain(row); // 获取评论列表
- this.getDailyList(row.id) // 获取来自日报
- this.getRelationTaskList(1, row.id)
- this.getTaskFileList(1,row.id)
- this.$emit('closeBounced', {taskLineClickAbs: true, items: row})
- },
- //获取SAP项目服务数据列表
- getSapServiceList(){
- this.http.post('/sap-project-service/sapServiceList', {},
- res => {
- if(res.code == "ok"){
- this.sapServiceList=res.data
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- // 列表的上传按钮
- uploadFileClick(item){
- console.log("upload",item.file);
- let files = new FormData()
- files.append("projectId",this.curProjectId);
- files.append("taskId", this.addForm.id);
- files.append("file", item.file);
- this.http.uploadFile('/task-files/uploadFile',files,
- res => {
- if(res.code == 'ok'){
- console.log(res);
- this.$message({
- message: this.$t('yi-shang-chuan'),
- type: 'success'
- })
- this.gain({ taskId: this.taskId }, 1)
- this.getTaskFileList()
- }else {
- this.$message({
- message: res.msg,
- type: 'error'
- })
- }
- },error => {
- this.$message({
- message: error,
- type: 'error'
- })
- })
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .editingTask {
- display: flex;
- flex-wrap: wrap;
- }
- .carts .commentSpan {
- float: none;
- display: block;
- margin-top: 0;
- font-size: 14px;
- span {
- float: none;
- display: inline-block;
- margin-top: 0;
- font-size: 14px;
- }
- }
- .foooot {
- padding: 10px 20px 20px;
- text-align: right;
- -webkit-box-sizing: border-box;
- box-sizing: border-box;
- }
- .Daily p {
- margin: 0 !important;
- padding: 0 0 10px 0 !important;
- }
- .sub-all {
- div {
- display: inline-block;
- padding: 0 20px;
- font-size: 20px;
- cursor: pointer;
- }
- .subOn {
- color: #66b1ff;
- }
- }
- .DailyBody {
- margin: 0 20px;
- }
- .Daily{
- height: 120%;
- overflow: auto;
- }
- .inputDeep {
- position: absolute;
- bottom: 85px;
- width: 95%;
- margin: 0 12px;
- }
- .inputDeep .el-textarea .el-textarea__inner{
- border: 0 !important;
- resize: none !important;
- }
- .inputDeeps .el-textarea__inner {
- border: 0 !important;
- resize: none !important;
- }
- .scop_span {
- display: inline-block;
- padding: 2px 5px;
- }
- .counli {
- em {
- font-style: normal;
- display: inline-block;
- margin-left: 9%;
- }
- span {
- float: right;
- }
- }
- .carts {
- position: relative;
- .el-image{
- border-radius: 50%;
- float: left;
- width: 20%;
- }
- i {
- width: 30px;
- height: 30px;
- // background: #778899;
- display: inline-block;
- float: left;
- border-radius:50%;
- font-style:normal;
- font-size: 12px;
- line-height: 30px;
- text-align: center;
- color: #fff;
- background: #778899;
- overflow: hidden;
- direction: rtl;
- }
- div {
- text-align: left;
- p {
- text-align: left;
- margin-left: 10px;
- margin-left: 13%;
- }
- em {
- display: block;
- font-style: normal;
- margin-left: 13%;
- }
- }
- span {
- font-size: 10px;
- float: right;
- margin-top: -40px;
- }
- }
- .issue {
- // height: 20%;
- // position: relative;
- // z-index: 4;
- .zh{
- position: relative;
- width: 100%;
- height: 100%;
- }
- .textareays {
- background: #000;
- height: 140px;
- border: 0;
- .el-textarea__inner {
- height: 85%;
- }
- }
- .issue-button {
- position: absolute;
- bottom: 20px;
- right: 20px;
- }
- }
- .inputDeep {
- position: absolute;
- bottom: 85px;
- width: 95%;
- margin: 0 12px;
- }
- .inputDeep .el-textarea .el-textarea__inner{
- border: 0 !important;
- resize: none !important;
- }
- .inputDeeps .el-textarea__inner {
- border: 0 !important;
- resize: none !important;
- }
- .scop_span {
- display: inline-block;
- padding: 2px 5px;
- }
- .container {
- position: relative;
- overflow-y: scroll;
- }
- .list {
- position: absolute;
- top: 0;
- width: 100%;
- }
- </style>
|