123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496 |
- <template>
- <section>
- <!--工具条-->
- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
- <el-form :inline="true">
- <el-form-item :label="$t('tasklist')">
- <div style="margin-left: 8px">
- <!-- <el-input style="float:left;" v-model="keyword" class="input-with-select" placeholder="请输入项目名称关键字" clearable="true"> -->
- <el-select v-model="searchField" style="width:120px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" v-if="idx != 3">
- <el-option :label="$t('ongoing')" value="0" @click.native="hiddens()"></el-option>
- <el-option :label="$t('state.completed')" value="1" @click.native="hiddens()"></el-option>
- </el-select>
- <!-- <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button> -->
- <!-- </el-input> -->
- </div>
- </el-form-item>
- <el-form-item v-if="idx == 3">
- <el-input placeholder="请输入任务名称" v-model="auditFileTaskName" size="small" style="margin-top: 6px">
- <el-button slot="append" icon="el-icon-search" @click="getFilesAwaitingReview()"></el-button>
- </el-input>
- </el-form-item>
- <el-form-item :label="$t('subordinatedepartments')" v-if="user.timeType.projectWithDept && idx != 3">
- <el-cascader v-model="deptId" :options="departmentList" size="small" :placeholder="$t('qing-xuan-ze-bu-men')"
- :props="{ checkStrictly: true, expandTrigger: 'hover' }" :show-all-levels="false" clearable filterable @change="hiddens"
- ></el-cascader>
- </el-form-item>
- <el-form-item :label="$t('lable.department')" v-if="!user.timeType.projectWithDept">
- <div style="margin-left: 8px">
- <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="screenDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 125px"
- :options="departmentList" :props="{ checkStrictly: true,expandTrigger: 'hover' }" :show-all-levels="false" clearable
- @change="getList()" size="mini"></el-cascader>
- <vueCascader :size="'mini'" :widthStr="'125'" :clearable="true" :subject="departmentList" :radios="true" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
- </div>
- </el-form-item>
- <el-form-item :label="$t('types')" v-if="idx != 3">
- <div style="margin-left: 8px">
- <el-select v-model="typeField" style="width:120px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="hiddens()">
- <el-option :label="$t('other.task')" value="0"></el-option>
- <el-option :label="$t('other.milestone')" value="1"></el-option>
- <el-option :label="$t('risk')" value="2"></el-option>
- </el-select>
- </div>
- </el-form-item>
- <el-form-item :label="$t('other.project')">
- <div style="margin-left: 8px">
- <el-select v-model="screenProjectId" filterable style="width:150px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="screenProjectChange">
- <el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
- </el-select>
- </div>
- </el-form-item>
- <el-form-item :label="$t('lable.taskGrouping')" v-if="idx != 3">
- <div style="margin-left: 8px">
- <el-select v-model="screenTaskGroupingId" style="width:150px;" size="small" :disabled="!screenProjectId" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="hiddens()">
- <el-option v-for="item in taskGroupList" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- </div>
- </el-form-item>
- <el-form-item :label="$t('ren-yuan')" v-if="idx != 3">
- <div style="margin-left: 8px">
- <el-select v-model="screenPersonnelId" filterable style="width:120px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="hiddens()" v-if="user.userNameNeedTranslate != '1'">
- <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat :subject="users" :subjectId="screenPersonnelId" :filterable="true" :clearable="true" @selectCal="selectCal" :size="'small'" :distinction="'10'" v-if="user.userNameNeedTranslate == '1'"></selectCat>
- </div>
- </el-form-item>
- <el-form-item v-if="idx == 3 && permissions.viewFilesReviewedByOthers">
- <el-radio-group v-model="documentRadios" size="small" @input="documentRadioInput">
- <el-radio-button label="待我审核"></el-radio-button>
- <el-radio-button label="待他人审核"></el-radio-button>
- </el-radio-group>
- </el-form-item>
- <el-form-item v-if="idx != 3">
- <div style="display: flex;">
- <div style="margin-left: 20px">
- <el-select v-model="dateType" style="width:120px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
- <el-option :label="$t('starttimes')" :value="0" @click.native="hiddens(1)"></el-option>
- <el-option :label="$t('deadline')" :value="1" @click.native="hiddens(1)"></el-option>
- </el-select>
- </div>
- <div style="margin-left: 8px">
- <el-date-picker
- v-model="dateSelect"
- type="daterange"
- size="small"
- range-separator="-"
- :start-placeholder="$t('interval')"
- :end-placeholder="$t('interval')"
- value-format="yyyy-MM-dd"
- clearable
- @change="hiddens()">
- </el-date-picker>
- </div>
- </div>
- </el-form-item>
- <el-form-item style="float: right;" v-if="user.companyId != '3092'">
- <el-link type="primary" icon="el-icon-circle-plus-outline" :underline="false" @click="addTask()" v-if="idx != 3">{{ $t('xinJianRenWu') }}</el-link>
- <el-link type="primary" :underline="false" @click="exportTaskList()" style="margin-left: 20px;" v-loading="exportTaskLoading" v-if="idx != 3">{{ $t('export.export') }}</el-link>
- </el-form-item>
- </el-form>
- </el-col>
- <div style="display: flex;width: 100%;">
- <div class="classification">
- <div>
- <p :class="idx == 0 ? 'on' : ''" @click="switchs(0)" v-if="permissions.projectView || permissions.projectManagement || permissions.projectViewAllTasks">{{ $t('alltaskss') }}</p>
- <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">{{ $t('perform') }}</p>
- <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">{{ $t('created') }}</p>
- <p :class="idx == 3 ? 'on' : ''" @click="switchs(3)" v-if="(user.timeType.taskFileCharge == 1 || user.timeType.taskFileCharge == 2) && permissions.tasksReviewTaskFile">待审核文件</p>
- </div>
- </div>
- <div style="max-width: 94%;min-width: 90%">
- <!--列表-->
- <el-table :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" v-if="[0, 1, 2].includes(idx)" :key="tablesKey">
- <el-table-column type="index" width="60">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
- </template>
- </el-table-column>
- <el-table-column prop="stagesName" :label="$t('taskstage')" sortable width="180" @mouseover="mouseOver">
- <template slot-scope="scope">
- {{ scope.row.stagesName }}
- </template>
- </el-table-column>
- <el-table-column prop="taskLevel" :label="$t('priority')" sortable width="100">
- <template slot-scope="scope">
- <div>
- <span v-if="scope.row.taskLevel == 0">{{ $t('yi-ban') }}</span>
- <span v-if="scope.row.taskLevel == 1" style="color: #E6A23C">{{ $t('zhong-yao') }}</span>
- <span v-if="scope.row.taskLevel == 2" style="color: #F56C6C">{{ $t('jin-ji') }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="name" :label="$t('nameofthetask')" sortable width="330">
- <template slot-scope="scope">
- <div v-if="scope.row.name.length > 20">
- <el-popover trigger="hover" placement="top" width="330" v-if="scope.row.name">
- <p id="caseContent">{{scope.row.name}}</p>
- <div slot="reference" class="name-wrapper">
- <div class="cal" >
- <el-link type="primary" @click="editTask(scope.row)">{{scope.row.name}}</el-link>
- </div>
- </div>
- </el-popover>
- </div>
- <div v-else>
- <div class="cal">
- <el-link type="primary" @click="editTask(scope.row)">{{scope.row.name}}</el-link>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="finalChargeStatusText" label="文件审核状态" width="210" sortable v-if="(user.timeType.taskFileCharge == 1 || user.timeType.taskFileCharge == 2) && [0, 1, 2].includes(idx)">
- <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.finalChargeStatusTextList[0] || '' }}
- <template v-if="(scope.row.finalChargeStatusTextList || []).length > 1">
- <TranslationOpenDataText :openid='scope.row.finalChargeStatusTextList[1]'></TranslationOpenDataText>
- {{ scope.row.finalChargeStatusTextList[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.finalChargeStatusTextList[0] || '' }}
- <template v-if="(scope.row.finalChargeStatusTextList || []).length > 1">
- <TranslationOpenDataText :openid='scope.row.finalChargeStatusTextList[1]'></TranslationOpenDataText>
- {{ scope.row.finalChargeStatusTextList[2] || '' }}
- </template>
- </el-link>
- </el-tooltip>
- </template>
- </template>
- </el-table-column>
- <!-- <el-table-column prop="projectCategorySub" label="项目分组" sortable width="300" v-if="user.companyId == '428'"></el-table-column> -->
- <el-table-column prop="departmentName" :label="$t('subordinatedepartments')" sortable width="300" v-if="user.timeType.projectWithDept">
- <template slot-scope="scope">
- <div>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='scope.row.departmentName'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{departmentName}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" sortable width="130">
- <template slot-scope="scope">
- <!-- <el-link type="primary" @click="showUser(scope.row.executorId)">{{scope.row.executorName}}</el-link> -->
- <span v-if="user.userNameNeedTranslate == '1'">
- <span v-for="(item, index) in scope.row.executorNameList" :key="index">
- <TranslationOpenDataText type='userName' :openid='item'></TranslationOpenDataText>
- <span v-if="index < scope.row.executorNameList.length - 1">,</span>
- </span>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">{{scope.row.executorName}}</span>
- </template>
- </el-table-column>
-
- <el-table-column prop="startDate" :label="$t('starttimes')" sortable width="180"></el-table-column>
- <el-table-column prop="endDate" :label="$t('deadline')" width="310" fixed="right" sortable>
- <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) && searchField == '0' && scope.row.taskStatus == 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, scope.row)">{{ $t('wan-cheng') }}</el-button>
- <el-button v-if="searchField == 1" size="small" type="warning" @click="completes(scope.row.id, 1, scope.row)">{{ $t('zhong-qi') }}</el-button>
- </div>
- </template>
- </el-table-column>
- </el-table>
- <el-table v-if="[3].includes(idx)" :data="documentReview" highlight-current-row v-loading="documentReviewLoading" :height="tableHeight" style="width: 100%;" :key="tablesTwoKey" @selection-change="agentSelectChange">
- <el-table-column type="selection" width="55" v-if="documentRadios == '待他人审核'"></el-table-column>
- <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
- </template>
- </el-table-column>
- <el-table-column prop="name" :label="$t('nameofthetask')" sortable>
- <template slot-scope="scope">
- <div v-if="scope.row.taskName.length > 20">
- <el-popover trigger="hover" placement="top" width="330" v-if="scope.row.taskName">
- <p id="caseContent">{{scope.row.taskName}}</p>
- <div slot="reference" class="name-wrapper">
- <div class="cal" >
- <el-link type="primary" @click="editTask(scope.row)">{{scope.row.taskName}}</el-link>
- </div>
- </div>
- </el-popover>
- </div>
- <div v-else>
- <div class="cal">
- <el-link type="primary" @click="editTask(scope.row)">{{scope.row.taskName}}</el-link>
- </div>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="文件名称" v-if="documentRadios == '待他人审核'">
- <template slot-scope="scope">
- {{ scope.row.documentName }}
- </template>
- </el-table-column>
- <el-table-column prop="executorName" :label="$t('zhi-hang-ren')" sortable>
- <template slot-scope="scope">
- <span v-for="(item, index) in scope.row.executorList" :key="index">
- <template v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='item.executorName'></TranslationOpenDataText>
- </template>
- <template v-if="user.userNameNeedTranslate != 1">
- {{ item.executorName }}
- </template>
- <span v-if="index < scope.row.executorList.length - 1">,</span>
- </span>
- </template>
- </el-table-column>
- <el-table-column label="文件审核" width="140" v-if="documentRadios == '待我审核'">
- <template slot-scope="scope">
- <el-button type="primary" size="mini" @click="viewFilesAndReviewThem(scope.row)">查看文件并审核</el-button>
- </template>
- </el-table-column>
- <el-table-column label="审核人" width="140" v-if="documentRadios == '待他人审核'">
- <template slot-scope="scope">
- <template v-if="user.userNameNeedTranslate == 1">
- <TranslationOpenDataText type='userName' :openid='scope.row.finalChargeName'></TranslationOpenDataText>
- </template>
- <template v-if="user.userNameNeedTranslate != 1">
- {{ scope.row.finalChargeName }}
- </template>
- </template>
- </el-table-column>
- </el-table>
- <!-- 重启时输入原因 -->
- <el-dialog :title="$t('zhongQiRenWu')" :visible.sync="causeRejectionDialog" width="600px" :before-close="handleClose">
- <div>
- <el-form ref="causeRejectionForm" :model="causeRejectionForm" label-width="80px">
- <el-form-item :label="$t('zhongQiYuanYin')">
- <el-input type="textarea" v-model.trim="causeRejectionForm.cause"></el-input>
- </el-form-item>
- <el-form-item :label="$t('zeRenRen')">
- <el-select v-if="user.userNameNeedTranslate != '1'" multiple collapse-tags v-model="causeRejectionForm.responsible" size="small" filterable clearable :placeholder="$t('qingXuanZeZeRenRen')" @change="$forceUpdate()">
- <el-option v-for="item in causeRejectionForm.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;margin-right: 20px" v-if="item.jobNumber">{{ item.jobNumber }}</span>
- </el-option>
- </el-select>
- <selectCat :subject="causeRejectionForm.users" :subjectId="causeRejectionForm.responsible" :multiSelect="true" :filterable="true" @selectCal="selectCal" :size="'small'" :distinction="'5'" v-if="user.userNameNeedTranslate == '1'"></selectCat>
- <!-- <selectCat :subject="causeRejectionForm.users" :subjectId="causeRejectionForm.responsible" :multiSelect="true" :filterable="true" @selectCal="selectCal" :size="'small'" :distinction="'5'"></selectCat> -->
- </el-form-item>
- </el-form>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="causeRejectionDialog = false">{{ $t('quXiao') }}</el-button>
- <el-button type="primary" @click="causeRejectionClick()">{{ $t('queDing') }}</el-button>
- </span>
- </el-dialog>
- <!--工具条-->
- <el-col :span="24" class="toolbar bottomToolbar">
- <div>
- <el-button type="primary" size="small" :disabled="!selectFilesed.length" :loading="urgingLoading" v-if="documentRadios == '待他人审核'" @click="urgingCli()">催办</el-button>
- </div>
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20, 50 , 80 , 100]"
- :page-size="20"
- :current-page="page"
- layout="total, sizes, prev, pager, next"
- :total="total"
- style="float:right;"
- ></el-pagination>
- </el-col>
- </div>
- </div>
- <!--用户详细信息弹出框-->
- <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
- <div class="line"><span>{{ $t('lable.name') }}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='userName' :openid='userDetail.name'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{userDetail.name}}</span>
- </div>
- <div class="line"><span>{{ $t('Worknumber') }}</span><span>{{userDetail.jobNumber}}</span></div>
- <div class="line"><span>{{ $t('lable.phone') }}</span><span>{{userDetail.phone}}</span></div>
- <div class="line"><span>{{ $t('lable.department') }}</span>
- <span v-if="user.userNameNeedTranslate == '1'"><TranslationOpenDataText type='departmentName' :openid='userDetail.name'></TranslationOpenDataText></span>
- <span v-if="user.userNameNeedTranslate != '1'">{{userDetail.departmentName}}</span>
- </div>
- <div class="line"><span>{{ $t('costof') }}</span><span>{{userDetail.cost}}{{ $t('Yuananhour') }}</span></div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
- </div>
- </el-dialog>
- <!-- 子项目列表 -->
- <el-dialog :title="$t('listofsubitems')" show-header="false" v-if="subProjectVisible" :visible.sync="subProjectVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <el-table :data="subProjectList" highlight-current-row height="400" style="width: 100%;">
- <el-table-column type="index" width="60" :label="$t('headerTop.serialNumber')">
- <template slot-scope="scope" >
- {{scope.$index+1+(page-1)*size}}
- </template>
- </el-table-column>
- <el-table-column prop="name" :label="$t('names')" ></el-table-column>
- <el-table-column :label="$t('operation')" width="150">
- <template slot-scope="scope" >
- <el-button size="small" type="primary" @click="addNewSubProject(scope.row)">{{ $t('bian-ji') }}</el-button>
- <el-button size="small" type="danger" @click="deleteSubPro(scope.row)">{{ $t('btn.delete') }}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="subProjectVisible = false" >{{ $t('Shutdown') }}</el-button>
- <el-button type="primary" @click="addNewSubProject()" >{{ $t('addsubitems') }}</el-button>
- </div>
- </el-dialog>
- <!-- 任务详情信息弹出框 -->
- <el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
- :close-on-click-modal="false" customClass="customWidth" width="840px" :top="'6vh'">
- <!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
- <!-- 整合 -->
- <taskComponent ref="thskComponents" :integrationTask="integrationTask" :showOrNot="showOrNot" @closeBounced="closeBounced"></taskComponent>
- <div slot="title" v-if="addForm.parentTid != null">
- <el-page-header @back="backToParentTask" :title="$t('parenttask')" :content="addForm.parentTname"></el-page-header>
- </div>
- </el-dialog>
- <!-- 发起会议 -->
- <el-dialog :title="$t('faQiHuiYi')" :visible.sync="meeting" width="500px" :before-close="handleClose" style="z-index: 2020 !important ">
- <div class="block">
- <div>
- <span class="demonstration">{{ $t('huiYiKaiShiShiJian') }}</span>
- <el-date-picker
- v-model="meetingStartValue"
- type="datetime"
- :placeholder="$t('xuanZeRiQiShiJian')"
- value-format="yyyy-MM-dd HH:mm:ss"
- clearable
- default-time="10:00:00">
- </el-date-picker>
- </div>
- <div style="margin-top: 20px">
- <span class="demonstration">{{ $t('huiYiJieShuShiJian') }}</span>
- <el-date-picker
- v-model="meetingEndValue"
- type="datetime"
- :placeholder="$t('xuanZeRiQiShiJian')"
- value-format="yyyy-MM-dd HH:mm:ss"
- clearable.
- default-time="11:00:00">
- </el-date-picker>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="meeting = false">{{ $t('quXiao') }}</el-button>
- <el-button type="primary" @click="confirmMeeting()">{{ $t('queDing') }}</el-button>
- </span>
- </el-dialog>
- <!-- 文件审核 -->
- <el-dialog title="文件审核" :visible.sync="viewFilesAndReviewThemVisable" width="1000px">
- <el-table :data="viewFilesAndReviewThemRejectList" style="width: 100%" height="500px" @selection-change="handleSelectionChange" :key="viewFilesAndReviewThemkey">
- <el-table-column type="selection" width="55"></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}}</span>
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" min-width="40" 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>
- </template>
- </el-table-column>
- </el-table>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" size="small" :disabled="tableMultipleSelection.length == 0" :loading="viewFilesAndReviewThemAdoptLoading" @click="viewFilesAndReviewThemRejectCli(1)">通过</el-button>
- <el-button type="danger" size="small" :disabled="tableMultipleSelection.length == 0" @click="viewFilesAndReviewThemReject()">驳回</el-button>
- </div>
- </el-dialog>
- <el-dialog title="文件驳回" :visible.sync="viewFilesAndReviewThemRejectVisable" width="800px">
- <el-input type="textarea" :rows="5" placeholder="请输入驳回原因" v-model.trim="viewFilesAndReviewThemRejectVal" :maxlength="50">
- </el-input>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" size="small" @click="viewFilesAndReviewThemRejectCli(2)" :loading="viewFilesAndReviewThemRejectValLoading">确定</el-button>
- </div>
- </el-dialog>
- </section>
- </template>
- <style scoped lang="scss">
- @import "../../assets/scss/handle";
- .input-with-select .el-input-group__prepend {
- background-color: #fff;
- }
- .line {
- padding:10px;
- }
- .line span{
- font-size:18px;
- }
- .line span:nth-child(even){
- float:right;
- }
- .classification {
- width: 120px;
- border-right: 1px solid #f2f2f2;
- display: flex;
- flex-wrap: wrap;
- padding-top: 20px;
- }
- .classification p{
- width: 120px;
- text-align: center;
- line-height: 50px;
- margin: 0;
- cursor: pointer;
- }
- .classification p:hover {
- background: #dddddd;
- }
- .on {
- @include font_color("color");
- }
- .acl{
- display: inline-block;
- width: 300px;
- height: 22px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- display: flex;
- align-items: center;
- margin: 0;
- padding: 0;
- line-height: 0;
- }
- .cal {
- @include font_color("color");
- width: 300px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .autodatespan{
- padding: 1.5px 2.5px;
- width: 90px;
- height: 16px;
- line-height: 16px;
- text-align: center;
- display: block;
- }
- .redwarningspan{
- background: #e62412;
- color: #fff;
- border-radius: 3px;
- }
- /* p {
- margin: 0 !important;
- } */
- </style>
- <style lang="scss" scoped>
- .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;
- }
- 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;
- }
- </style>
- <script>
- import { error } from 'dingtalk-jsapi';
- import util from "../../common/js/util";
- // 引入自定义组件
- import selectCat from "@/components/select.vue"
- // 引入自定义级联组件
- import vueCascader from "@/components/cascader.vue"
- import cascaderOption from "@/components/cascaderOption.vue"
- import taskComponent from "@/components/taskComponent.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'
- import { getThemeColor } from '@/utils/commonMethod.js'
- export default {
- name: "two-list-headerslots",
- display: "Two list header slot",
- order: 14,
- components: {
- // draggable,
- // // editor,
- // FileCenter,
- // ProjectInfo,
- // Summary,
- // Earning,
- quillEditor, // 富文本
- selectCat,
- taskComponent,
- vueCascader,
- cascaderOption
- },
- data() {
- return {
- meeting: false,
- causeRejectionDialog: false,
- causeRejectionForm: {
- cause: '',
- responsible: []
- },
- isDeleting: true,
- showOrNot: false,
- typeField: null,
- searchField: '0',
- keyword:null,
- user: JSON.parse(sessionStorage.getItem("user")),
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- userDetailVisible: false,
- userDetail:{},
- date: new Date(),
- users: [],
- participator:[],
- tableHeight: 0,
- listLoading: false,
- total: 0,
- page: 1,
- size: 20,
- list: [],
- subProjectVisible: false,
- subProjectList: [],//子项目列表
- currentProject:{},
- addSubProject: false,
- addFormVisible: false,
- addLoading: false,
- title: "",
- addForm: {
- name: '',
- userId: [],
- },
- rules: {
- name: [{ required: true, message: this.$t('Pleaseenteraprojectname'), trigger: "blur" }],
- },
- idx: 1,
- taskDetails: false,
- addForm: {
- name: '',
- },
- 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" }],
- },
- sleectId: null,
- sleectProjectId: null,
- sidebarIndex: null, // 侧边栏索引
- 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,
- 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:[getThemeColor(),'#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'],
- stageList: '',
- selectedGroup:{},
- dateClass: true,
- dateType: 0,
- dateSelect: [],
- groupName: '',
- groupNameList: [],
- departmentList: [],
- deptId: [],
- dynamicTab: true,
- dailyList: [],
- askComponentFlg: false,
- integrationTask: {},
- integrationTaskNingwai: {},
- // 会议时间
- meetingStartValue: '',
- meetingEndValue: '',
- toMeetTaskId:'',
- // 筛选条件
- screenProjectId: '',
- screenTaskGroupingId: '',
- screenPersonnelId: '',
- allProjectList: [],
- exportTaskLoading: false,
- screenDeptId: [],
- // 待审核文件
- documentRadios: '待我审核',
- documentReview: [],
- documentReviewLoading: false,
- auditFileTaskName: '',
- viewFilesAndReviewThemVisable: false,
- viewFilesAndReviewThemList: [],
- viewFilesAndReviewThemTableLoading: false,
- viewFilesAndReviewThemRejectVisable: false,
- viewFilesAndReviewThemRejectList: [],
- viewFilesAndReviewThemRejectVal: '',
- viewFilesAndReviewThemRejectValLoading: false,
- viewFilesAndReviewThemRejectRow: {},
- viewFilesAndReviewThemAdoptLoading: false,
- viewFilesAndReviewThemkey: 902,
- selectFilesed: [], // 列表选择
- urgingLoading: false,
- tablesKey: 1,
- tablesTwoKey: 300,
- tableMultipleSelection: []
- };
- },
- methods: {
- urgingCli() {
- const ids = this.selectFilesed.map(item => item.finalChargeId).join(',')
- this.urgingLoading = true
- this.http.post('/task/sendMsgToChargers',{
- ids
- },res => {
- this.urgingLoading = false
- if(res.code == 'ok'){
- this.$message.success('催办成功')
- this.selectFilesed = []
- }else {
- this.$message.error(res.msg)
- }
- },error => { this.$message.error(error), this.urgingLoading = false })
- },
- documentRadioInput(val) {
- this.tablesTwoKey++
- this.page = 1
- if(val == '待我审核') {
- this.getFilesAwaitingReview()
- return
- }
- this.getFilesAwaitingReviewTwo()
- },
- agentSelectChange(rows) {
- this.selectFilesed = rows
- },
- handleSelectionChange(val) {
- this.tableMultipleSelection = val;
- },
- showReasonForRejection(item) {
- const taskId = item.id
- this.http.post('/task/getFileRejectReason',{
- taskId
- },res => {
- if(res.code == 'ok'){
- // this.$alert(res.data, '驳回原因');
- const text = (res.data || []).map(item => {
- return `文件【${item.documentName}】的驳回原因为:${item.fileRejectReason}<br/>`
- })
- this.$alert(text.join(''), '驳回原因', { dangerouslyUseHTMLString: true });
- }else {
- this.$message.error(res.msg)
- }
- },error => { this.$message.error(error) })
- },
- viewFilesAndReviewThemRejectCli(auditStatus = 1) {
- if(!this.viewFilesAndReviewThemRejectVal && auditStatus == 2) {
- this.$message.error('请输入驳回原因')
- return
- }
- const taskFileIds = this.tableMultipleSelection.map(item => item.id).join(',')
- this.viewFilesAndReviewThemRejectValLoading = true
- const { id, projectId } = this.viewFilesAndReviewThemRejectRow
- this.http.post(auditStatus == 1 ? '/task-files/approveFile' : '/task-files/rejectFile',{
- taskFileIds,
- reason: auditStatus == 1 ? '' : this.viewFilesAndReviewThemRejectVal
- },
- res => {
- if (res.code == "ok") {
- this.viewFilesAndReviewThemRejectList = res.data || []
- this.viewFilesAndReviewThemRejectVisable = false
- this.viewFilesAndReviewThemVisable = false
- this.$message.success('操作成功')
- this.getFilesAwaitingReview()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- this.viewFilesAndReviewThemRejectValLoading=false
- },
- error => {
- this.viewFilesAndReviewThemRejectValLoading=false
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- viewFilesAndReviewThemReject() {
- this.viewFilesAndReviewThemRejectVal = ''
- this.viewFilesAndReviewThemRejectVisable = true
- },
- parentMeetingCli(id) {
- this.meeting = true
- if(id) {
- this.toMeetTaskId = id
- }
- console.log(id)
- },
- getViewFilesAndReviewThemList() {
- this.viewFilesAndReviewThemTableLoading = false
- // this.http.post('/task-files/getTaskFiles',{taskId:this.viewFilesAndReviewThemRejectRow.id},
- this.http.post('/task-files/getUnChargedFilesByTaskId',{taskId:this.viewFilesAndReviewThemRejectRow.id},
- res => {
- if (res.code == "ok") {
- this.viewFilesAndReviewThemkey++
- this.viewFilesAndReviewThemRejectList = res.data || []
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- this.viewFilesAndReviewThemTableLoading=false
- },
- error => {
- this.viewFilesAndReviewThemTableLoading=false
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- confirmMeeting() {
- var date = new Date();
- let startTime = this.meetingStartValue
- let endTime = this.meetingEndValue
- this.http.post('/task//operateMeeting',{taskId:this.toMeetTaskId,startTime:startTime,endTime:endTime},
- res => {
- if (res.code == "ok") {
- this.meeting=false,
- this.$message({
- message: this.$t('chengGongFaQiHuiYi'),
- type: "success"
- });
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- closeBounced(obj) {
- if(!obj.backToParentTaskSub) {
- this.addFormVisible = false
- this.taskComponentFlg = false
- if(obj.addSubTask) {
- this.addSubTask()
- }
- if(obj.taskLineClickAbs) {
- this.taskLineClick(obj.items)
- }
- if(obj.deleteTask) {
- this.getList()
- }
- if(obj.showOrNot) {
- this.getList()
- }
- if(obj.submitInsert) {
- this.getList()
- }
- } else {
- this.backToParentTask()
- }
- },
- // 获取来自日报
- 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"
- });
- });
- },
- judgedate(itemD){
- let nowdate = new Date()
- let idate = new Date(itemD + " 23:59:59")
- return nowdate > idate ? true : false
- },
- deleteSubPro(subProject) {
- this.$confirm(this.$t('makesuretodeletethesubproject') + subProject.name + this.$t('ma'),this.$t('deletesubproject'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/sub-project/deleteProject',{
- id: subProject.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.subProject(this.currentProject);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- searchList() {
- this.page = 1;
- this.getList();
- },
- addNewSubProject(subProject) {
- if (subProject == null) {
- this.addForm = {projectId: this.currentProject.id}
- } else {
- this.addForm = subProject;
- }
- this.addSubProject = true;
- },
- exportTaskList(){
- let parameter = {
- status: this.searchField,
- viewId: this.idx,
- pageIndex: this.page,
- pageSize: this.size,
- // type: this.typeField
- projectId: this.screenProjectId,
- groupId: this.screenTaskGroupingId,
- targetUserId: this.screenPersonnelId
- }
- if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
- parameter.type = this.typeField
- }
- if(this.dateSelect != null && this.dateSelect.length != 0){
- parameter.dateType = this.dateType
- parameter.startDate = this.dateSelect[0]
- parameter.endDate = this.dateSelect[1]
- }
- if(this.deptId.length > 0) {
- parameter.deptId = this.deptId[this.deptId.length - 1]
- } else {
- parameter.deptId = ''
- }
- this.http.post('/task/exportTaskList', parameter,
- res => {
- if (res.code == "ok") {
- var filePath = res.data;
- var fName = this.$t('daiBanRenWuDaoChuXlsx')
- const a = document.createElement('a'); // 创建a标签
- a.setAttribute('download', fName);// download属性
- a.setAttribute('href', filePath);// href链接
- a.click(); //自执行点击事件
- a.remove();
- this.exportLoading = false
- this.byQuarterDialog = false
-
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //显示子项目
- subProject(item) {
- this.subProjectVisible = true;
- this.currentProject = item;
- this.http.post('/sub-project/list', {
- projectId: item.id
- },
- res => {
- if (res.code == "ok") {
- this.subProjectList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //显示用户详情
- showUser(userId) {
- this.userDetailVisible = true;
- this.http.post(this.port.manage.userDetail, {
- userId: userId
- },
- res => {
- if (res.code == "ok") {
- this.userDetail = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //选择参与人
- changeParticipator() {
- //检查是否在参与人中,如果没有需要加入到参与人中
- // console.log(this.addForm.userId);
- var find = false;
- this.participator = [];
- this.addForm.userId.forEach(u=>{
- var findUser = this.users.filter(au=>au.id == u)[0];
- this.participator.push(findUser);
- })
-
- },
- getUsers() {
- // this.http.post(this.port.manage.list, {
- // departmentId: -1,
- // pageIndex: 1,
- // // pageSize: 99999
- // pageSize: -1
- // },
- 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"
- });
- });
- },
- addStagePost() {
- let param = JSON.parse(JSON.stringify(this.stageForm));
- param.taskList = [];
- this.http.post('/stages/save',param,
- res => {
- if (res.code == "ok") {
- this.stageList = res.data;
- this.addStageDialog = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //分页
- handleCurrentChange(val) {
- this.page = val;
- this.getList();
- },
- handleSizeChange(val) {
- this.size = val;
- this.getList();
- },
- //获取项目列表
- getList() {
- console.log('执行函数', this.screenDeptId)
- this.listLoading = true;
- let parameter = {
- status: this.searchField,
- viewId: this.idx,
- pageIndex: this.page,
- pageSize: this.size,
- // type: this.typeField
- projectId: this.screenProjectId,
- groupId: this.screenTaskGroupingId,
- targetUserId: this.screenPersonnelId
- }
- console.log(parameter)
- if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
- parameter.type = this.typeField
- }
- if(this.dateSelect != null && this.dateSelect.length != 0){
- parameter.dateType = this.dateType
- parameter.startDate = this.dateSelect[0]
- parameter.endDate = this.dateSelect[1]
- }
- // if(this.user.companyId == '428') {
- // parameter.groupName = this.groupName
- // }
- if(this.deptId.length > 0) {
- parameter.deptId = this.deptId[this.deptId.length - 1]
- } else {
- parameter.deptId = ''
- }
- if(this.screenDeptId.length > 0) {
- parameter.deptId = this.screenDeptId[this.screenDeptId.length - 1]
- }
- this.http.post('/task/listByPage', parameter,
- res => {
- this.listLoading = false;
- if(res.code == 'ok') {
- if(this.user.userNameNeedTranslate == 1) {
- for(var i in res.data.records) {
- let arr = []
- if(res.data.records[i].executorName) {
- arr = res.data.records[i].executorName.split(',')
- }
- res.data.records[i].executorNameList = arr
- }
- }
- // this.tablesKey++
- this.list = (res.data.records || []).map(item => {
- let str = item.finalChargeStatusText || ''
- let arr = str.split(/\$|=/).filter(item => item && item !== 'userName');
- return {
- ...item,
- finalChargeStatusTextList: arr || []
- }
- })
- this.total = res.data.total
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- getFilesAwaitingReview() {
- this.documentReviewLoading = true;
- let parameter = {
- pageIndex: this.page,
- pageSize: this.size,
- projectId: this.screenProjectId,
- taskName: this.auditFileTaskName
- }
- if(this.deptId.length > 0) {
- parameter.deptId = this.deptId[this.deptId.length - 1]
- } else {
- parameter.deptId = ''
- }
- this.http.post('/task/getTaskChargePage', parameter,
- res => {
- this.documentReviewLoading = false;
- if(res.code == 'ok') {
- this.documentReview = (res.data.records || []).map((item) => {
- return {
- ...item,
- id: item.taskId
- }
- })
- // this.tablesTwoKey++
- this.total = res.data.total
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.documentReviewLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- getFilesAwaitingReviewTwo() {
- this.documentReviewLoading = true;
- let parameter = {
- pageIndex: this.page,
- pageSize: this.size,
- projectId: this.screenProjectId,
- taskName: this.auditFileTaskName
- }
- if(this.deptId.length > 0) {
- parameter.deptId = this.deptId[this.deptId.length - 1]
- } else {
- parameter.deptId = ''
- }
- this.http.post('/task/getOtherTaskChargePage', parameter,
- res => {
- this.documentReviewLoading = false;
- if(res.code == 'ok') {
- this.documentReview = (res.data.records || []).map((item) => {
- return {
- ...item,
- executorList: [{ executorName: item.creatorName }],
- }
- })
- // this.tablesTwoKey++
- this.total = res.data.total
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.documentReviewLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- // 导出任务
- exportTask() {
- // console.log('执行代码')
- this.exportTaskLoading = true
- let url = '' // 导出连接
- let parameter = {
- status: this.searchField,
- viewId: this.idx,
- pageIndex: this.page,
- pageSize: this.size,
- // type: this.typeField
- projectId: this.screenProjectId,
- groupId: this.screenTaskGroupingId,
- targetUserId: this.screenPersonnelId
- }
- if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
- parameter.type = this.typeField
- }
- if(this.dateSelect != null && this.dateSelect.length != 0){
- parameter.dateType = this.dateType
- parameter.startDate = this.dateSelect[0]
- parameter.endDate = this.dateSelect[1]
- }
- if(this.deptId.length > 0) {
- parameter.deptId = this.deptId[this.deptId.length - 1]
- } else {
- parameter.deptId = ''
- }
- this.http.post(url, parameter,
- res => {
- if (res.code == "ok") {
- this.exportTaskLoading = false;
- var aTag = document.createElement('a');
- aTag.download = this.$t('navigation.upcomingTasks');
- aTag.href = res.data;
- aTag.click();
- } else {
- this.exportTaskLoading = false;
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- this.exportTaskLoading = false;
- });
- },
- //显示新增界面
- handleAdd(i, item) {
- if(i == -1) {
- this.title = this.$t('addWork');
- this.addForm = {
- name: '',
- userId: [],
- code:'',
- inchargerId:null,
- }
- } else {
- this.title = this.$t('modifytheproject');
- var list = item.participator , arr = [];
- for(var j in list) {
- arr.push(list[j].id)
- }
-
- this.addForm = {
- id: item.id,
- name: item.projectName,
- userId: arr,
- code:item.projectCode,
- inchargerId: item.inchargerId
- }
- this.changeParticipator();
- }
- this.addFormVisible = true;
- },
- //提交子项目创建修改请求
- submitInsertSubProject () {
- this.$refs.form2.validate(valid => {
- if (valid) {
- this.http.post('/sub-project/saveOrUpdate',this.addForm,
- res => {
- if (res.code == "ok") {
- this.$message({
- message: this.$t('operationissuccessful'),
- type: "success"
- });
- this.subProject(this.currentProject);
- this.addSubProject = false;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- });
- },
- // submitInsert() {
- // console.log("111");
- // this.$refs.form1.validate(valid => {
- // if (valid) {
- // this.addLoading = true;
- // let formData = new FormData();
- // formData.append("name", this.addForm.name);
- // if(this.addForm.id != null) {
- // formData.append("id", this.addForm.id);
- // }
- // if(this.addForm.userId.length != 0) {
- // for(var j in this.addForm.userId) {
- // formData.append("userId", this.addForm.userId[j]);
- // }
- // }
- // if(this.addForm.inchargerId != null) {
- // formData.append("inchargerId", this.addForm.inchargerId);
- // }
- // if(this.addForm.code != null) {
- // formData.append("code", this.addForm.code);
- // }
- // formData.delete("refTaskList")
- // console.log('走了')
- // this.http.uploadFile(this.port.project.add,formData,
- // res => {
- // this.addLoading = false;
- // if (res.code == "ok") {
- // this.$message({
- // message: this.addForm.id!=null?'修改':'创建'+"成功",
- // type: "success"
- // });
- // this.addFormVisible = false;
- // this.getList();
- // } else {
- // this.$message({
- // message: res.msg,
- // type: "error"
- // });
- // }
- // },
- // error => {
- // this.addLoading = false;
- // this.$message({
- // message: error,
- // type: "error"
- // });
- // });
- // }
- // });
- // },
- // 删除
- deletePro(i, item) {
- this.$confirm(this.$t('identifytheproject') + item.projectName + this.$t('ma'),this.$t('deletetheproject'), {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post(this.port.project.delete,{
- id: item.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- detail(i) {
- this.$router.push("/list/" + this.list[i].id + "/" + this.list[i].projectName);
- },
- // 切换当前选项的索引
- switchs(e) {
- this.idx = e
- this.page = 1
- // console.log(this.searchField)
- if([3].includes(e)) {
- this.documentRadios = '待我审核'
- this.getFilesAwaitingReview()
- } else {
- this.getList()
- }
- },
- viewFilesAndReviewThem(item) {
- this.viewFilesAndReviewThemRejectRow = item
- this.viewFilesAndReviewThemVisable = true
- this.tableMultipleSelection = []
- this.getViewFilesAndReviewThemList()
- },
- // 下拉框选择
- hiddens(e) {
- if(e == 1 && (this.dateSelect == null || this.dateSelect.length == 0)){
- return
- }
- // console.log(this.searchField)
- this.page = 1
- if([3].includes(this.idx)) {
- this.getFilesAwaitingReview()
- } else {
- this.getList()
- }
- },
- // 完成
- completes(e, el, obj) {
- console.log(obj)
- let arr = []
- let userArr = []
- if(obj.executorList) {
- for(let i in obj.executorList) {
- if(i == 0) {
- userArr.push(obj.executorList[0].executorId)
- }
- let oobj = {
- name: obj.executorList[i].executorName,
- id: obj.executorList[i].executorId
- }
- arr.push(oobj)
- }
- }
- this.causeRejectionForm = {
- id: e,
- taskStatus: el,
- cause: '',
- responsible: userArr.length > 0 ? userArr : '',
- users: arr
- }
- if(el == 1 && this.user.timeType.restartTaskNeedReason == 1) {
- this.causeRejectionDialog = true
- } else {
- this.restart(this.causeRejectionForm)
- }
- },
- // 重启 和 完成
- restart(obj) {
- let from = {
- id: obj.id,
- taskStatus: obj.taskStatus,
- personLiableIds: obj.userList,
- reason: obj.cause
- }
- this.http.post('/task/finish', from,
- res => {
- this.causeRejectionDialog = false
- if (res.code == "ok") {
- this.$message({
- message: this.$t('operationissuccessful'),
- type: "success"
- });
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.causeRejectionDialog = false
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- })
- },
- // 重启任务点击事件
- causeRejectionClick() {
- this.causeRejectionForm.userList = this.causeRejectionForm.responsible.toString()
- console.log(this.causeRejectionForm)
- // return
- this.restart(this.causeRejectionForm)
- },
- // 点击任务事件
- editTask(task) {
- this.addFormVisible = true;
- // this.addLoading = false;
- this.title = this.$t('editingtasks');
- this.dynamicTab = true
- this.showOrNot = false
- console.log(task, '<=== 点击的数据', this.integrationTaskNingwai.length)
- const { projectId } = task
- // 自定义组件
- this.integrationTask = {
- id: task.id,
- task: task,
- num: 1,
- curProjectId: projectId || '',
- create: false,
- integrationTaskNingwai: {
- groupId: task.groupId,
- isDesc: false,
- order: "seq",
- projectId: projectId || '',
- },
- taskVue: projectId ? false : true,
- meetingId: this.addForm.meetingId
- }
- this.taskComponentFlg = true
- this.getTaskDetail(task.id);
- // this.getTaskProgressList(task.id); // 获取任务进展列表
- // this.getUsers(); // 获取名单数据
- // this.gain(task); // 获取评论列表
- // this.getDailyList(task.id) // 获取来自日报
- // this.getStageList()
- },
- addExecutorLine() {
- this.addForm.executorListFront.push({executorId:null, planHours:8});
- this.$forceUpdate();
- },
- removeExecutorLine(index) {
- this.addForm.executorListFront.splice(index,1);
- this.$forceUpdate();
- },
- getTaskDetail(id) {
- this.http.post('/task/getTask',{id: id},
- res => {
- if (res.code == "ok") {
- this.addForm = res.data;
- this.addForm.createDate = null;
- this.addForm.indate = null;
- this.addLoading = false;
- this.recentProgressInfo = this.addForm.progress;
- this.addForm.executorListFront = this.addForm.executorList;
- //删除中间传值的变量数组
- delete this.addForm.executorList;
- } 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() {
- // console.log(this.port.manage.list)
- // this.http.post(this.port.manage.list, {
- // departmentId: -1,
- // pageIndex: 1,
- // pageSize: 99999
- // },
- 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) {
- this.commentList = [];
- this.taskId = task.id;
- this.http.post('/task-comment/getList', {taskId: task.id},
- res => {
- if (res.code == "ok") {
- for(var i in res.data) {
- if(res.data[i].content.indexOf('$userName=') != '-1') {
- let obj = {
- msg1: res.data[i].content.split('$')[0],
- msg2: res.data[i].content.split('$')[1].split('=')[1],
- msg3: res.data[i].content.split('$')[2]
- }
- res.data[i].content = obj
- } else {
- if(this.user.userNameNeedTranslate == 1) {
- let obj = {
- msg1: res.data[i].content,
- msg2: '',
- msg3: ''
- }
- res.data[i].content = obj
- }
- }
- }
- this.commentList = res.data
- console.log(res.data, '数据')
- this.sppk(this.commentList) // 获取参与人的方法
- } 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)
- },
- sss(){
- this.$refs.addRem.style.display="none"
- },
- 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"
- },
- addI() { // 打开选择查看
- this.$refs.addRem.style.display="block"
- },
- load() {
- if(this.count >= 0) return
- this.count += 2
- },
- onEditorFocus() {
- this.onEditorBlur()
- },
- kkk(el){
- var k = this.checkLists.indexOf(el.id)
- if (k == -1) {
- this.checkLists.push(el.id)
- } else {
- this.checkLists.splice(k, 1)
- }
- },
- 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"
- });
- }
- }
- );
- },
- //删除任务进展
- 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"
- });
- }
- }
- );
- },
- //显示子任务创建卡片
- addSubTask() {
- 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.addLoading = false;
- },
- taskLineClick(row, column, event) {
- this.editTask(row);
- },
- 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();
- }
-
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //认领任务
- addAsMyTask(task) {
- this.http.post('/task/addAsMyTask',{id: task.id},
- res => {
- if (res.code == "ok") {
- this.getStageList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- 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}`
- },
- showSubTaskList(task) {
- this.subTaskVisible = true;
- this.addForm = task;
- },
- addTask(stage) {
- this.addFormVisible = true;
- // this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
- this.addForm = {projectId: '', groupId: '', stagesId: '', taskLevel:0, planHours: 8, taskType: 0};
- this.addLoading = false;
- this.title=this.$t('createtask ');
- this.commentList = [];
- this.showOrNot = true
- let obj = {
- create: true,
- addForm: this.addForm,
- executorListFront: [{executorId:null, planHours:8}],
- stage: this.addForm,
- integrationTaskNingwai: this.integrationTaskNingwai,
- taskVue: true,
- meetingId: this.addForm.meetingId
- }
- this.integrationTask = obj
- this.taskComponentFlg = true
- },
- addStage() {
- this.addStageDialog = true;
- this.stageForm = {groupId: this.selectedGroup.id, projectId: this.curProjectId};
- },
- // 获得焦点时触发
- onEditorBlur(){
- let theEle = this.$refs.text; // 获取元素
- 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
- },
- backToParentTask() {
- console.log('我是不是出发了')
- this.getTaskDetail(this.addForm.parentTid);
- this.$refs.thskComponents.backToParentTask()
- },
- // 点击发布
- 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)
- this.sppk(this.commentList)
- 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;
- })
- },
- submitInsert() {
- if (this.textContent !== true) return this.$message({
- showClose: true,
- message: this.$t('pictureistoolargepleaseuploaditagain'),
- type: 'warning'
- });
- //检查是有重名的执行人
- var exeList = this.addForm.executorListFront;
- for (var i=0;i<exeList.length;i++) {
- var findSameUser = false;
- 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'
- });
- }
- }
-
- this.$refs.form1.validate(valid => {
- if (valid) {
- delete this.addForm.subTaskList;
- delete this.addForm.progress;
- delete this.addForm.refTaskList;
- this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
- 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) {
- this.addFormVisible = false;
- if (this.groupType == 0) {
- this.getStageList();
- } else {
- // this.getViewTaskList();
- }
- } else {
- this.backToParentTask();
- }
- this.getList()
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.addLoading = false
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- }
- });
- },
- //加载项目内的任务列表
- getStageList() {
- // console.log('进来了')
- this.http.post('/stages/list',{groupId: this.selectedGroup.id, projectId: this.selectedGroup.projectId, order: this.order, isDesc: this.isDesc},
- res => {
- if (res.code == "ok") {
- this.stageList = res.data.list;
- // console.log('触发获取任务列表函数')
- this.timess() // 处理时间的方法
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- //删除当前编辑的任务
- 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.isDeleting = true;
- this.http.post('/task/delete',{id: this.addForm.id},
- res => {
- this.isDeleting = false;
- if (res.code == "ok") {
- this.addFormVisible = false;
- // this.getStageList();
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.isDeleting = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- });
- },
- chan() {
- // console.log(this.critic)
- },
- getSthForSb() {
- this.http.post('/task/getGroupNameList ',{},
- res => {
- if (res.code == "ok") {
- console.log('看看是', res.data)
- this.groupNameList = res.data
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取部门
- getDepartmentList() {
- this.http.post( this.port.manage.depList, {},
- res => {
- if (res.code == "ok") {
- let dptlist = JSON.parse(JSON.stringify(res.data));
- this.departmentList = this.changeArr(dptlist);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- changeArr(arr) {
- for (var i = 0; i < arr.length; i++) {
- if(arr[i].id != -1 && arr[i].id != 0) {
- if (arr[i].children != null && arr[i].children.length>0) {
- arr[i].children = this.changeArr(arr[i].children);
- }
- arr[i].id && (arr[i].value = arr[i].id);
- delete arr[i].id;
- }
- }
- for(var i in arr) {
- if(arr[i].id == -1 || arr[i].id == 0) {
- arr.splice(i,1)
- }
- }
- return arr;
- },
- selectCal(obj) {
- if(obj.distinction == '1') {
- this.addForm.executorListFront[obj.index].executorId = obj.id
- } else if(obj.distinction == '5') {
- let arr = []
- for(var i in obj.arrUserList) {
- arr.push(obj.arrUserList[i].id)
- }
- this.causeRejectionForm.responsible = arr
- } else if(obj.distinction == '10') {
- this.screenPersonnelId = obj.id
- this.hiddens()
- }
- },
- screenProjectChange() {
- if(!this.screenProjectId) {
- this.screenTaskGroupingId = ''
- } else {
- this.getTaskGroupList()
- }
- this.hiddens()
- },
- // 获取项目列表
- getAllProjectlist() {
- this.http.post('/project/getProjectList',{},
- res => {
- if (res.code == "ok") {
- this.allProjectList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 获取任务分组列表
- getTaskGroupList() {
- this.http.post('/task-group/list',{
- projectId: this.screenProjectId
- },
- res => {
- if (res.code == "ok") {
- this.taskGroupList = res.data;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- vueCasader(obj) {
- if(obj.distinction == '1') {
- if(obj.id != '') {
- let arr = []
- arr.push(obj.id)
- this.screenDeptId = arr
- } else {
- this.screenDeptId = []
- }
- this.getList()
- }
- }
- },
- created() {
- let height = window.innerHeight;
- this.tableHeight = height - 195;
- const that = this;
- window.onresize = function temp() {
- that.tableHeight = window.innerHeight - 195;
- };
- },
- mounted() {
- this.getList();
- this.getUsers();
- // this.getDailyList()
- if(this.user.timeType.projectWithDept) {
- this.getDepartmentList()
- }
- this.getDepartmentList()
- this.getAllProjectlist()
- // if(this.user.companyId == '428') {
- // this.getSthForSb()
- // }
- },
- };
- </script>
- <style lang="scss" scoped>
- .bottomToolbar {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .Daily p {
- margin: 0 !important;
- padding: 0 0 10px 0 !important;
- }
- .sub-all {
- // display: flex;
- div {
- display: inline-block;
- padding: 0 20px;
- font-size: 20px;
- cursor: pointer;
- }
- .subOn {
- color: #66b1ff;
- }
- }
- .DailyBody {
- margin: 0 20px;
- }
- .Daily{
- height: 120%;
- overflow: auto;
- }
- // .classification {
- // width: 120px;
- // // height: 100%;
- // border-right: 1px solid #f2f2f2;
- // display: flex;
- // flex-wrap: wrap;
- // // align-items: center;
- // // justify-content: center;
- // padding-top: 20px;
- // }
- // .classification p{
- // width: 120px;
- // text-align: center;
- // line-height: 50px;
- // margin: 0;
- // cursor: pointer;
- // }
- // .classification p:hover {
- // background: #dddddd;
- // }
- // .on {
- // // background: #dddddd;
- // color: #409EFF;
- // }
- // .acl{
- // display: inline-block;
- // width: 300px;
- // height: 22px;
- // // line-height: 22px;
- // overflow: hidden;
- // white-space: nowrap;
- // text-overflow: ellipsis;
- // margin: 0;
- // padding: 0;
- // line-height: 0;
- // }
- // .cal {
- // width: 300px;
- // overflow: hidden;
- // white-space: nowrap;
- // text-overflow: ellipsis;
- // cursor: pointer;
- // }
- </style>
|