12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367 |
- <template>
- <section>
- <!--工具条 top-->
- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
- <el-form :inline="true">
- <el-form-item >
- <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
- <div v-if="true" style="display: flex;align-items: center;height: 40px;">
- <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? $t('peaseenterthe') : $t('peaseenterthe')" clearable="true" size="small">
- <el-select v-model="searchField" style="width:120px;" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
- <el-option :label="$t('headerTop.projectName')" value=1 ></el-option>
- <el-option :label="$t('Itemno')" value=2 ></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 >
- <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
- <el-select v-model="statusClf" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
- <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- </el-form-item>
- <el-form-item style="float:right;">
- <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{'新增'}}</el-link>
- <el-link type="primary" v-if="permissions.projectApprovalEdit||permissions.projectApprocalImport" style="margin-right:10px;" :underline="false" @click="importDialog=true">{{'导入'}}</el-link>
- <el-link type="primary" v-if="permissions.projectApprovalEdit||permissions.projectApprocalExport" style="margin-right:10px;" :underline="false" @click="exportData()">{{'导出'}}</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.projectApprovalEdit">{{'全部项目'}}</p>
- <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">{{'我发起的'}}</p>
- <!-- <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">{{'我审核的'}}</p> -->
- </div>
- </div>
- <div style="max-width: 94%;min-width: 90%">
- <el-table ref="projectlistOfWudulist" border @cell-mouse-enter="hoverCall" @cell-mouse-leave="handCall" :cell-class-name="tableCellClassName" :data="list" highlight-current-row v-loading="listLoading" :height="tableHeight" style="width: 100%;" @selection-change="checkedWudulist">
- <el-table-column type="selection" width="60" :selectable="isSelectable">
- </el-table-column>
- <el-table-column prop="projectCode" :label="$t('Itemno')" width="150"></el-table-column>
- <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250" sortable="custom">
- <template slot-scope="scope">
- <div>
- <el-button type="text" v-if="scope.row.isPublic==0" @click="showProjectApprovalDeatil(scope.row)">{{scope.row.projectName}}</el-button>
- <span v-else>{{scope.row.projectName}}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column prop="categoryName" :label="$t('projectclassification')" width="140"></el-table-column>
- <el-table-column prop="isPublic" :label="'项目类型'" width="140">
- <template slot-scope="scope">{{scope.row.isPublic==0?"正式项目":"非项目"}}</template>
- </el-table-column>
- <el-table-column prop="inchargerName" :label="$t('projectmanager')" min-width="150">
- <template slot-scope="scope">
- <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
- <span v-if="user.userNameNeedTranslate != 1">
- {{scope.row.inchargerName}}
- </span>
- <span v-if="user.userNameNeedTranslate == 1">
- <ww-open-data type='userName' :openid='scope.row.inchargerName'></ww-open-data>
- </span>
- </el-link>
- </template>
- </el-table-column>
- <!-- 级别 -->
- <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" :label="$t('ji-bie')" min-width="190" v-if="user.company.packageProject == 1">
- <template slot-scope="scope">
- <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
- <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
- </template>
- </el-table-column>
- <el-table-column prop="status" :label="'审核状态'" min-width="100" >
- <template slot-scope="scope">
- {{scope.row.status == null?"-":approvalStatusStr[scope.row.status-1]}}
- </template>
- </el-table-column>
- <el-table-column :label="$t('operation')" :width="300" align="left" fixed="right">
- <template slot-scope="scope">
- <el-button size="mini" type="primary" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck)&&scope.row.status!=1" @click="handleAdd(scope.$index, scope.row)">{{'编辑'}}</el-button>
- <!-- <el-button size="mini" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck) && scope.row.status==0" @click="check(scope.row,1)">{{'通过'}}</el-button>
- <el-button size="mini" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck) && scope.row.status==0" @click="check(scope.row,2)">{{'驳回'}}</el-button> -->
- <el-button size="mini" v-if="(permissions.projectApprovalEdit ||permissions.projectApprovalCheck) && scope.row.status==1" @click="check(scope.row,3)">{{'撤销'}}</el-button>
- </template>
- </el-table-column>
- </el-table>
- <!--工具条 footer-->
- <el-col :span="24" class="toolbar">
- <el-pagination :key="projectListPageComponentKey"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :page-sizes="[20 , 50 , 80 , 100]"
- :page-size="size"
- :current-page.sync="page"
- layout="total, sizes, prev, pager, next"
- :total="total"
- style="float:right;"
- ></el-pagination>
- </el-col>
- <!--新增界面-->
- <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px" :top="'6vh'">
- <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
- <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
- <el-form-item :label="$t('Itemno')" :class="title == $t('newproject')" v-if="user.companyId!=936">
- <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
- <el-input v-model="addForm.code" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName)" maxlength="50" show-word-limit="true"></el-input>
- </el-form-item>
- <el-form-item :label="$t('headerTop.projectName')" prop="name">
- <!-- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input> -->
- <el-input v-model="addForm.name" :placeholder="$t('peaseenterthe')" clearable :disabled="canOnlyModParticipator || (!permissions.projectManagement && addForm.creatorId != user.id && !permissions.projectCodeAndName) || isShowProjectName" maxlength="255" show-word-limit="true"></el-input>
- </el-form-item>
- <el-form-item :label="$t('projectclassification')" v-if="user.timeType.mainProjectState != '1'">
- <!-- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
- <el-select v-model="addForm.category" style="width:32%;" clearable filterable :disabled="canOnlyModParticipator">
- <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('projecttype')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" prop="isPublic">
- <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="canOnlyModParticipator">
- <el-option :value="0" :label="$t('zheng-shi-xiang-mu')"></el-option>
- <el-option :value="1" :label="$t('fei-xiang-mu')"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item :label="$t('other.projectDescription')" prop="projectDesc">
- <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
- <el-input v-model="addForm.projectDesc" :placeholder="$t('peaseenterthe')" clearable maxlength="4000" :disabled="canOnlyModParticipator" show-word-limit></el-input>
- </el-form-item>
- <el-form-item :label="$t('Allparticipants')" v-show="addForm.isPublic == 0" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
- <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != 1">
- <div slot="content" style="width:780px">{{addForm.userNames}}</div>
- <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
- </el-tooltip>
- <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
- <div slot="content" style="width:780px">
- <span v-for="(item, index) in addFormUserNames" :key="index">
- <!-- {{item}} -->
- <ww-open-data type='userName' :openid='item'></ww-open-data>
- <span v-if="index < addFormUserNames.length - 1">,</span>
- </span>
- </div>
- <div @click="showChooseMembTree" style="width: 800px;overflow:hidden;white-space:nowrap;height:40px;border: 1px solid #DCDFE6;border-radius: 4px;box-sizing: border-box;padding: 0 10px">
- <span v-for="(item, index) in addFormUserNames" :key="index">
- <!-- {{item}} -->
- <ww-open-data type='userName' :openid='item'></ww-open-data>
- <span v-if="index < addFormUserNames.length - 1">,</span>
- </span>
- </div>
- </el-tooltip>
- </el-form-item>
- <el-form-item :label="$t('projectmanager')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0)">
- <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator || projectManagerEdit">
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
- <span style="float: left">{{ item.name }}</span>
- </el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit || isShowProjectName"></selectCat>
- </el-form-item>
- <el-form-item :label="$t('newspaperauditor')">
- <el-select v-if="user.userNameNeedTranslate != '1'" @change="$forceUpdate()" v-model="addForm.auditUserIds" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" filterable :placeholder="$t('defaultistheprojectleader')" style="width:100%;" :multiple="user.timeType.reportAuditType != 6" >
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == '1'" :size="'medium'" :tile="true" :widthStr="'800'" :disabled="!(permissions.projectManagement|| user.id == addForm.inchargerId || user.id == addForm.creatorId)" :subjectId="addForm.auditUserIds" :subject="participator" :clearable="false" :distinction="'10'" :multiSelect="user.timeType.reportAuditType != 6" @selectCal="selectCal"></selectCat>
- </el-form-item>
- <!--专业项目协作版本功能 -->
- <el-form-item :label="$t('ji-bie')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" v-if="user.company.packageProject==1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
- <el-select v-model="addForm.level" :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" v-if="user.timeType.projectLevelState == 1" :disabled="canOnlyModParticipator || isShowProjectName">
- <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
- </el-select>
- <el-select v-model="addForm.level" :placeholder="this.$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator" v-else>
- <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
- </el-select>
- </el-form-item>
- <!-- 增加合同金额字段 -->
- <el-form-item :label="$t('contractamount')" v-if="user.company.packageProject==1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
- <el-input id="contractAmount" v-model="addForm.contractAmount" :disabled="canOnlyModParticipator" style="width:32%;" @input="contractAmountChange(addForm.contractAmount)" :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('contractAmount')"></el-input><span style="margin-left:10px;position:absolute;">{{ $t('yuan') }}</span>
- <template v-if="title == $t('modifytheproject') && contractAmountReasonShow">
- <span style="margin-left:63px;margin-right:10px;">{{ $t('modifythereason') }}</span>
- <el-input v-model="addForm.changeContractReason" style="width:33%" clearable :placeholder="$t('contractamountasd')"></el-input>
- </template>
- </el-form-item>
- <el-form-item :label="$t('ommencementDate')" prop="planStartDate" v-if="(user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
- <el-date-picker v-model="addForm.planStartDate" :disabled="canOnlyModParticipator"
- :editable="false" style="width:32%;"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :clearable="false" type="date"
- :placeholder="$t('optiondate')"></el-date-picker>
- <span style="margin-left:63px;margin-right:10px;" >{{ $t('ji-hua-jie-shu-ri-qi') }}</span>
- <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
- :editable="false" :disabled="canOnlyModParticipator"
- format="yyyy-MM-dd"
- value-format="yyyy-MM-dd"
- :clearable="false" type="date"
- :placeholder="$t('optiondate')"></el-date-picker>
- </el-form-item>
- <!-- 项目基线 -->
- <div style="margin: 10px 0 30px 0;min-height:200px;" v-if="user.company.packageProject == 1 && !canOnlyModParticipator && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
- <el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane :label="$t('costbaseline')" name="baseCostPanel" >
- <div style="padding-top:10px;">
- <!--新版 -->
- <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
- <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
- <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
- :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
- </span>
- <!-- 合计 -->
- <div style="margin-top: 10px;float:right;">
- <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">{{ $t('other.totals') }}</span>
- <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
- <span v-else>{{addForm.budget | numberToCurrency}}</span>
- <span style="margin-right:50px;margin-left:10px;">{{ $t('yuan') }}</span>
- </div>
- </div>
- </el-tab-pane>
- </el-tabs>
- </div>
- <el-divider></el-divider>
- <!-- <template>
- <div><span>{{'审核人'}}</span></div>
- <div>
- <div v-for="(item, index) in pointList" :key="index" >
- 第{{index+1}}审核人:
- <el-select v-if="user.userNameNeedTranslate != 1" :disabled="item.status!=0" v-model="item.userId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="manageSelect" size="small" filterable popper-class="managePopperClass">
- <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
- <span style="float: left">{{ item.name }}</span>
- </el-option>
- </el-select>
- <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="item.userId" :distinction="'12'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit || isShowProjectName"></selectCat>
- <i class="el-icon-circle-plus-outline" @click="addInput(index)" v-if="index==pointList.length-1"></i>
- <i class="el-icon-remove-outline" v-if="pointList.length>1 && item.status==0" @click="deleteInput(index)"></i>
- <span>{{item.status==0?'待审核':item.status==1?"已审核":"已驳回"}}</span>
- </div>
- </div>
- </template> -->
- </el-form>
- </div>
- <div slot="footer" class="dialog-footer;">
- <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectApprovalEdit) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
- <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
- </div>
- </el-dialog>
- <!-- 按部门选择人员 -->
- <el-dialog :title="$t('selectingParticipants')" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
- <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
- <div v-if="user.userNameNeedTranslate == '1'">
- <el-input placeholder="请输入内容" v-model.trim="filterText" class="input-with-select">
- <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
- </el-input>
- </div>
-
- <div class="tree" style="height:400px">
- <el-scrollbar style="height:100%">
- <el-input
- :placeholder="$t('keywordfiltering')"
- v-model="filterText" v-if="user.userNameNeedTranslate != '1'">
- </el-input>
- <el-tree :data="deptMembData" :key="searchPersonnelFlgnum" show-checkbox :default-expand-all="searchPersonnelFlg" :props="defaultProps" node-key="id"
- ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
- highlight-current :filter-node-method="filterNode">
- <span class="custom-tree-node" slot-scope="{ node, data }">
- <span v-if="user.userNameNeedTranslate == '1'">
- <span v-if="node.data.children">
- <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
- </span>
- <span v-else>
- <ww-open-data type='userName' :openid='node.label'></ww-open-data>
- </span>
- </span>
- <span v-if="user.userNameNeedTranslate != '1'">
- {{ node.label }}
- </span>
- <!-- {{ node.label }} -->
- </span>
- </el-tree>
- </el-scrollbar>
- </div>
- <div>{{ $t('btn.choose') }} {{chosenMembCount}} {{ $t('other.people') }}</div>
- <div slot="footer" class="dialog-footer">
- <el-button @click="chooseParticipVisible = false" >{{ $t('btn.cancel') }}</el-button>
- <el-button type="primary" @click="chooseParticip()" >{{ $t('btn.determine') }}</el-button>
- </div>
- </el-dialog>
- <!--用户详细信息弹出框-->
- <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">{{userDetail.name}}</span>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></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('jiao-se') +":"}}</span><span>{{userDetail.roleName}}</span></div>
- <div class="line"><span>{{ $t('lable.department') +":"}}</span>
- <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></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('Checkthedetails')" v-if="projectApprovalDetailVisible" :visible.sync="projectApprovalDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
- <div class="line"><span>{{'项目编号:'}}</span><span>{{projectApprocalDetail.projectCode}}</span></div>
- <div class="line"><span>{{'项目名称:'}}</span><span>{{projectApprocalDetail.projectName}}</span></div>
- <div class="line"><span>{{'项目分类:'}}</span><span>{{projectApprocalDetail.categoryName}}</span></div>
- <div class="line"><span>{{'项目类型:'}}</span><span>{{projectApprocalDetail.isPublic==0?"正式项目":"非项目"}}</span></div>
- <div class="line"><span>{{'项目描述:'}}</span><span>{{projectApprocalDetail.projectDesc}}</span></div>
- <div class="line"><span>{{'全部参与人:'}}</span>
- <span v-if="user.userNameNeedTranslate != 1">{{projectApprocalDetail.participationApprovalList.map(v=>v.userName).join(",")}}</span>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='projectApprocalDetail.participationApprovalList?projectApprocalDetail.participationApprovalList.map(v=>v.userName).join(","):""'></ww-open-data></span>
- </div>
- <div class="line"><span>{{'项目经理:'}}</span>
- <span v-if="user.userNameNeedTranslate != 1">{{projectApprocalDetail.inchargerName}}</span>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='projectApprocalDetail.inchargerName'></ww-open-data></span>
- </div>
- <div class="line"><span>{{'日报审核人:'}}</span>
- <span v-if="user.userNameNeedTranslate != 1">{{projectApprocalDetail.projectApprovalAuditorList.map(v=>v.auditorName).join(",")}}</span>
- <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='projectApprocalDetail.projectApprovalAuditorList?projectApprocalDetail.projectApprovalAuditorList.map(v=>v.auditorName).join(","):""'></ww-open-data></span>
- </div>
- <div class="line"><span>{{'级别:'}}</span><span>{{importanceListLable[projectApprocalDetail.level-1]}}</span></div>
- <div class="line"><span>{{'合同金额:'}}</span><span>{{projectApprocalDetail.contractAmount}}</span></div>
- <el-divider></el-divider>
- <div class="line">
- <span>成本基线</span>
- </div>
- <div class="line">
- <span>{{'计划开始日期:'}}</span><span>{{projectApprocalDetail.planStartDate}}</span>
- <span>{{'计划结束日期:'}}</span><span>{{projectApprocalDetail.planEndDate}}</span>
- </div>
- <div class="line" v-for="(item,index) in projectApprocalDetail.projectApprovalBasecostList">
- <span>{{item.baseName+":"}}</span><span>{{item.baseAmount}}</span>
- </div>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="projectApprovalDetailVisible = false" >{{'关闭'}}</el-button>
- </div>
- </el-dialog>
- <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
- <p>1. {{$t('other.download')}}
- <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/立项导入模板.xlsx'" :download="'立项导入模板.xlsx'">{{'立项导入模板.xlsx'}}</el-link>
- </p>
- <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
- <p style="display: flex;justify-content: center;">
- <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
- <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
- </el-upload>
- </p>
- </el-dialog>
- </div>
- </div>
- </section>
- </template>
- <script>
- import selectCat from "@/components/select.vue"
- export default {
- name: '',
- components: {
- selectCat
- },
- props: { },
- data() {
- return {
- keyword:"",
- searchField:"1",
- user: JSON.parse(sessionStorage.getItem("user")),
- total: 0,
- page: 1,
- size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
- listLoading:false,
- approvalStatusStr:["待审核","已通过","已驳回"],
- importanceList:[{id:1,label:this.$t('zheng-chang')},{id:2,label:this.$t('jin-ji')},{id:3,label:this.$t('zhong-yao')},{id:4,label:this.$t('zhong-yao-qie-jin-ji')}],
- importanceListLable:[this.$t('zheng-chang'), this.$t('jin-ji'), this.$t('zhong-yao'), this.$t('zhong-yao-qie-jin-ji'), this.$t('di-feng-xian'), this.$t('zhong-feng-xian'), this.$t('gao-feng-xian')],
- addFormVisible:false,
- baseCostItemList:[],
- permissions: JSON.parse(sessionStorage.getItem("permissions")),
- addForm: {
- name: '',
- userId: [],
- level:1,
- bu:'',
- id: '',
- code: '',
- projectDesc: '',
- alarmType: 0
- },
- projectBaseCostData:[],
- activeName:"baseCostPanel",
- baseClfList:[],
- addFormUserNames: [],
- deptMembData: [
- {
- id: 0,
- label: this.$t('lable.unassigned'),
- }
- ],
- allMembData:[],
- participator:[],
- chosenListBackup: [],
- chooseParticipVisible:false,
- rules: {
- name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
- code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
- projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
- projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
- deptId: [{ required: true, message: '请选择所属部门', trigger: "blur" }]
- },
- chosenMembCount:0,
- dataDetail:{},
- userDetailVisible:false,
- userDetail:{},
- pointList:[{
- userId:"",
- seq:1,
- status:0
- }],
- idx: 1,
- tableHeight: 0,
- projectApprovalDetailVisible:false,
- projectApprocalDetail:{},
- importDialog:false,
- }
- },
- computed: {},
- watch: {},
- 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.getProjectBaseConfigList();
- this.getClfConfigList();
- this.getDepartment();
- this.getUsers();
- },
- methods: {
- isSelectable(row,index){
- if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectApprovalEdit){
- return true
- }else{
- return false
- }
- },
- submitInsert() {
- this.$refs.form1.validate(valid => {
- if (valid) {
- this.addLoading = true;
- let targetData = {};
- targetData.projectName= this.addForm.name
- if(this.addForm.projectDesc != null) {
- targetData.projectDesc=this.addForm.projectDesc
- }
- if(this.addForm.id != null) {
- targetData.id=this.addForm.id
- }
- if(this.addForm.isPublic != null) {
- targetData.isPublic=this.addForm.isPublic
- }
- if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
- let userArray=[]
- for(let i in this.addForm.userId){
- userArray.push({
- "userId":this.addForm.userId[i]
- })
- }
- targetData.participationApprovalList=userArray
- }
- if(this.addForm.inchargerId != null) {
- targetData.inchargerId=this.addForm.inchargerId
- }
- if(this.addForm.code != null) {
- targetData.projectCode=this.addForm.code
- }
- if(this.addForm.planStartDate != null) {
- targetData.planStartDate=this.addForm.planStartDate
- }
- if(this.addForm.planEndDate != null) {
- targetData.planEndDate=this.addForm.planEndDate
- }
- if(this.addForm.level != null) {
- targetData.level=this.addForm.level
- }
- if(this.addForm.contractAmount != null) {
- targetData.contractAmount=this.addForm.contractAmount
- }
- if (this.projectBaseCostData != null) {
- targetData.projectApprovalBasecostList=this.projectBaseCostData
- //计算总预算成本
- if (this.addForm.budget == null) {
- this.addForm.budget = 0;
- }
- targetData.budget=this.addForm.budget
- }
- if (this.addForm.contractAmount) {
- targetData.contractAmount=this.addForm.contractAmount
- } else {
- targetData.contractAmount=0
- }
- if (this.user.timeType.outputValueStatus == 1){
- targetData.outputValue=this.addForm.outputValue ? this.addForm.outputValue : 0
- }
- //日报审核人
- if (this.addForm.auditUserIds) {
- targetData.auditUserIds=this.addForm.auditUserIds
- }
- if(this.addForm.auditUserIds&&this.addForm.auditUserIds.length != 0) {
- let userArray=[]
- for(let i in this.addForm.auditUserIds){
- userArray.push({
- "auditorId":this.addForm.auditUserIds[i]
- })
- }
- targetData.projectApprovalAuditorList=userArray
- }
- if(this.addForm.category != null) {
- targetData.category=this.addForm.category
- }
- if(this.addForm.status != null) {
- targetData.status=this.addForm.status
- }
- //审核人
- if (this.pointList) {
- targetData.projectApprovalCheckList=this.pointList
- }
- this.http.JSONPost("/project-approval/editProjectApproval",targetData,
- res => {
- this.addLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
- type: "success"
- });
- this.addFormVisible = false;
- this.getList();
- if (this.user.company.packageEngineering == 1) {
- this.saveProjectProfessions(res.data);
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.addLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- });
- },
- // 获取分类条目
- getClfConfigList() {
- this.http.get('/project-category/list',
- res => {
- if (res.code == "ok") {
- this.baseClfList = res.data;
- // console.log("获取分类条目",res.data);
- this.$forceUpdate();
- } 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;
- localStorage.projectPageSize = this.size;
- this.page = 1
- this.getList();
- },
- getProjectBaseConfigList() {
- this.http.post('/project-basecost-setting/list',{},
- res => {
- if (res.code == "ok") {
- this.baseCostItemList = res.data;
- this.$forceUpdate();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- //显示新增界面
- handleAdd(i, item) {
- if(i == -1) {
- this.title = this.$t('newproject');
- this.addForm = {
- name: '',
- isPublic:0,
- userId: [],
- userNames:'',
- code:'',
- inchargerId:null,
- level: this.user.timeType.projectLevelState == 1 ? (this.levelList.length > 0 ? this.levelList[0].id : null) : 1,
- customerId:null,
- notifyUserNames:'',
- chosenLeaders:[],
- category:null,
- creatorId: this.user.id,
- projectMainId: '',
- outputValue: '',
- bu: [],
- manDay:0,
- fromOutside: 0,
- status:0
- }
- this.projectBaseCostData = [];
- this.auseList = [];
- for (var m=0;m<this.baseCostItemList.length; m++) {
- this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
- }
- this.pointList=[{
- "userId":"",
- "status":0
- }]
- } else {
- this.http.post('/project-approval/getDetail', {id: item.id},
- res => {
- let theData=[];
- if (res.code == "ok") {
- theData=res.data
- }
- var list = theData.participationApprovalList;
- if (item.isPublic == 1) {
- list = this.users;
- }
- var arr=[]
- var names=""
- let namesLiss = [] // 企业微信用到的参与者
- for(var j in list) {
- arr.push(list[j].userId)
- names += list[j].userName+',';
- namesLiss.push(list[j].userName)
- }
- if (names.length > 0) {
- names = names.substring(0, names.length -1);
- }
- this.addFormUserNames = namesLiss
- var auditorArr=[]
- if(theData.participationApprovalList){
- for(let i in theData.participationApprovalList){
- arr.push(theData.participationApprovalList[i].userId);
- names+=theData.participationApprovalList[i].userName+",";
- }
- }
- if(theData.projectApprovalAuditorList){
- for(let i in theData.projectApprovalAuditorList){
- auditorArr.push(theData.projectApprovalAuditorList[i].auditorId)
- }
- }
- if (names.length > 0) {
- names = names.substring(0, names.length -1);
- }
- this.addForm = {
- id: item.id,
- name: item.projectName,
- userId: arr,
- auditUserIds:auditorArr,
- userNames:names,
- isPublic: item.isPublic,
- code:item.projectCode,
- inchargerId: item.inchargerId,
- level: item.level,
- planStartDate: item.planStartDate,
- planEndDate: item.planEndDate,
- budget: item.budget,
- baseMan: item.baseMan,
- contractAmount: item.contractAmount,
- baseFee: item.baseFee,
- baseRisk1: item.baseRisk1,
- baseRisk2: item.baseRisk2,
- baseOutsourcing: item.baseOutsourcing,
- customerId:item.customerId==0?null:item.customerId,
- category:item.category,
- projectDesc: item.projectDesc,
- creatorId: item.creatorId,
- outputValue: item.outputValue,
- status: item.status,
- }
- this.participator=theData.participationApprovalList
- this.changeParticipator();
- this.getProjectBaseData(item.id);
- console.log("===========",this.projectBaseCostData)
- this.getProjectCheckerData(item.id);
- });
- }
- this.addFormVisible = true;
- },
- //获取项目列表
- getList() {
- localStorage.projectPageIndex = this.page;
- this.listLoading = true;
- let parameter = {
- pageIndex: this.page,
- pageSize: this.size,
- keyword:this.keyword,
- searchField: this.searchField,
- category:this.statusClf,
- status: this.status,
- viewId:this.idx
- }
- this.http.post("/project-approval/listByPage", parameter,
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- var list = res.data.records;
- this.list = list;
- this.total = res.data.total;
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- // 项目基线合计
- addUpfun() {
- var total = 0;
- for (var i=0;i<this.projectBaseCostData.length; i++) {
- if (this.projectBaseCostData[i].baseAmount) {
- total += parseFloat(this.projectBaseCostData[i].baseAmount);
- }
- }
- this.addForm.budget = total;
- },
- restrictNumber(targetId) {
- let inpu = document.getElementById(targetId);
- inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
- inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
- inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
- inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
- if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
- inpu.value = parseFloat(inpu.value);
- }
- },
- showChooseLeaderTree() {
- this.chosenMembCount = this.chosenLeaders.length;
- this.chooseLeaderVisible = true;
- },
- onLeaderTreeItemChange() {
- var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- showChooseMembTree() {
- this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
- this.chosenMembCount = this.participator.length;
- this.chooseParticipVisible = true;
- this.filterText = ''
- this.wxFilterText = ''
- if(this.user.userNameNeedTranslate == 1) {
- this.getDepartment()
- }
- let that = this
- setTimeout(()=>{
- that.chosenListBackup = that.$refs.chooseMembTree.getCheckedNodes();
- }, 500)
- },
- onTreeItemChange() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- findUserInTree() {
- if (this.filterName == '') {
- this.deptMembData = this.allMembData;
- } else {
- var list = this.findRecursively(this.filterName, this.allMembData);
- this.deptMembData = list;
- }
- },
- findRecursively(username, list) {
- var filterList = [];
- for (var i=0;i<list.length; i++) {
- if (list[i].isUser == 1) {
- if (list[i].label.indexOf(username) >= 0) {
- //匹配上了
- filterList.push(list[i]);
- }
- } else if (list[i].children != null && list[i].children.length > 0) {
- var subList = this.findRecursively(username, list[i].children);
- if (subList.length > 0) {
- subList.forEach(s=>filterList.push(s));
- }
- }
- }
- return filterList;
- },
- //确定选择参与人
- chooseParticip() {
- this.chooseParticipVisible = false;
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- if(this.searchPersonnelFlg) {
- chosenList = [...chosenList, ...this.chosenListBackup]
- }
- this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
- this.addForm.userNames = '';
- this.addFormUserNames = []
- this.addForm.userId = [];
- this.participator = [];
- for (var i=0;i<this.chosenMembList.length; i++) {
- this.addForm.userId.push(this.chosenMembList[i].id);
- this.addForm.userNames += this.chosenMembList[i].label+',';
- this.addFormUserNames.push(this.chosenMembList[i].label)
- var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
- this.participator.push(item);
- }
- if (this.addForm.userNames.length > 0) {
- this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
- }
- },
- // 获取部门列表
- getDepartment() {
- this.http.post("/department/listAllMemb", {},
- res => {
- if (res.code == "ok") {
- var list = res.data;
- //设置员工到部门下面
- this.setUserToDept(list);
- this.deptMembData = list;
- console.log(this.deptMembData, '看看数据')
-
- //用于筛选过滤
- this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- onTreeItemChange() {
- var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- },
- findUserInTree() {
- if (this.filterName == '') {
- this.deptMembData = this.allMembData;
- } else {
- var list = this.findRecursively(this.filterName, this.allMembData);
- this.deptMembData = list;
- }
- },
- addPersonCheck(){
- var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
- var list = chosenList.filter(item=>item.isUser == 1);
- this.chosenMembCount = list.length;
- // console.log(list);
- },
- addPersonSure(){
- this.addGroupPersonPdialog = false
- let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
- let list = chosenList.filter(item=>item.isUser == 1);
- let listIDs = []
- let listNames = ''
- let listNamesList = []
- for(let i=0;i<list.length;i++){
- listIDs.push(list[i].id)
- listNames += list[i].label + ','
- listNamesList.push(list[i].label)
- }
- this.addGroupPersonData.person = listIDs
- this.addGroupPersonData.personNames = listNames
- this.addGroupPersonDataPersonNames = listNamesList
- console.log('触发', this.addGroupPersonDataPersonNames)
- },
- // 企业微信搜索
- echartDepartment() {
- console.log('我点击了搜索')
- if(this.filterText != '') {
- this.http.post("/user/getEmployeeList", {
- keyword: this.filterText,
- cursor: '',
- departmentId: -1,
- pageIndex: 1,
- pageSize: 1000
- },
- res => {
- if (res.code == "ok") {
- this.filterNodePersonnel = res.data.records.map(item => item.name)
- this.$refs.chooseMembTree.filter(this.filterText);
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- } else {
- this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
- this.searchPersonnelFlg = false
- this.getDepartment()
- }
- },
- setUserToDept(list) {
- for (var i in list) {
- if (list[i].children != null) {
- this.setUserToDept(list[i].children);
- }
-
- if (list[i].userList != null) {
- if (list[i].children == null) {
- list[i].children = [];
- }
- list[i].userList.forEach(element => {
- var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
- list[i].children.push(obj);
- });
- }
- }
- },
- formDataToObject(formData) {
- const object = {};
- for (const [key, value] of formData.entries()) {
- if (key in object) {
- object[key] = [].concat(object[key], value);
- } else {
- object[key] = value;
- }
- }
- return object;
- },
- searchList() {
- this.page = 1;
- this.getList();
- },
- // 分类筛选
- searchClfList(){
- this.page = 1;
- this.getList();
- },
- 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"
- });
- });
- },
- // 自定义组件事件
- selectCal(obj) {
- if(obj.distinction == '1') {
- this.inchagerId = obj.id
- this.manageSelect()
- } else if(obj.distinction == '2') {
- this.participationId = obj.id
- this.participationSelect()
- } else if(obj.distinction == '3') {
- this.addForm.inchargerId = obj.id
- // console.log(this.participator)
- this.participator = JSON.parse(JSON.stringify(this.participator))
- } else if(obj.distinction =='4') {
- this.projectProfessionList[obj.other].inchargerId = obj.id
- } else if(obj.distinction =='5') {
- this.paramInchargerId = obj.id
- }else if(obj.distinction =='6') {
- this.hasSetGroupInchargerId = obj.id
- } else if(obj.distinction == '10') {
- let userList = obj.arrUserList
- let arr = []
- for(var i in userList) {
- arr.push(userList[i].id)
- }
- this.participator = JSON.parse(JSON.stringify(this.participator))
- this.addForm.auditUserIds = arr
- } else if(obj.distinction == '11') {
- let userList = obj.id
- console.log(obj)
- this.curProfessionRow.membList[obj.other].membId = userList
- } else if(obj.distinction == '12') {
- this.pointList.push({
- "userId":obj.id,
- "status":0
- })
- this.pointList=this.pointList.filter(i=>i.userId!="")
- }
- },
- getProjectBaseData(projectId) {
- this.http.post('/project-approval-basecost/get',{projectId: projectId},
- res => {
- if (res.code == "ok") {
- if(res.data.length>0){
- this.projectBaseCostData = res.data;
- }else{
- this.projectBaseCostData = [];
- for (var m=0;m<this.baseCostItemList.length; m++) {
- this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
- }
- }
-
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- getProjectCheckerData(projectId) {
- this.http.post('//project-approval-check/get',{projectId: projectId},
- res => {
- if (res.code == "ok") {
- if(res.data.length>0){
- this.pointList = res.data;
- }else{
- this.pointList=[{
- "userId":"",
- "status":0
- }]
- }
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- selectPublic() {
- if (this.addForm.isPublic == 1) {
- this.participator = this.users;
- } else {
- this.participator = [];
- }
- },
- //选择参与人
- changeParticipator() {
- //检查是否在参与人中,如果没有需要加入到参与人中
- // console.log('addform',this.addForm.userId,this.users);
- this.participator = [];
- this.addForm.userId.forEach(u=>{
- var list = this.users.filter(au=>au.id == u);
- if (list.length > 0) {
- var findUser = list[0];
- this.participator.push(findUser);
- } else {
- console.log('未找到用户: '+u);
- }
-
- })
- },
- //显示用户详情
- 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"
- });
- });
- },
- addInput(index){
- this.pointList.push({
- userId:"",
- seq:index+2,
- status:0
- })
- },
- deleteInput(index){
- this.pointList.splice(index,1)
- // if(this.pointList.length<=0){
- // this.pointList.push({
- // checkerId:""
- // })
- // }
- },
- // 切换当前选项的索引
- switchs(e) {
- this.idx = e
- this.page = 1
- // console.log(this.searchField)
- this.getList()
- },
- deletePro(i, item) {
- this.$confirm('确定要删除立项[' + item.name +'吗]','删除立项', {
- confirmButtonText: this.$t('btn.determine'),
- cancelButtonText: this.$t('btn.cancel'),
- type: "warning"
- })
- .then(() => {
- this.listLoading = true;
- this.http.post('/project-approval/delete',{
- id: item.id
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: this.$t('message.successfullyDeleted'),
- type: "success"
- });
- this.addFormVisible=false
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- })
- .catch(() => {});
- },
- check(item,checkType,revokeType){
- this.listLoading = true;
- this.http.post('/project-approval/check',{
- id:item.id ,
- checkType:checkType,
- revokeType:revokeType
- },
- res => {
- this.listLoading = false;
- if (res.code == "ok") {
- this.$message({
- message: "操作成功",
- type: "success"
- });
- this.addFormVisible=false
- this.getList();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.listLoading = false;
- this.$message({
- message: error,
- type: "error"
- });
- }
- );
- },
- showProjectApprovalDeatil(item){
- this.projectApprovalDetailVisible=true
- this.http.post('/project-approval/getDetail', {id: item.id},
- res => {
- if (res.code == "ok") {
- this.projectApprocalDetail=res.data
- }
- });
- },
- batchImportData(item) {
- //首先判断文件类型
- let str = item.file.name.split(".");
- let format = str[str.length - 1];
- if (format != "xls" && format != "xlsx") {
- this.$message({
- message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
- type: "error"
- });
- } else {
- this.importingData = true;
- let formData = new FormData();
- formData.append("multipartFile", item.file);
- formData.append("companyId", this.user.companyId)
- this.http.uploadFile('/project-approval/importData', formData,
- res => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- if (res.code == "ok") {
- //换成弹出框,以免有人等了半天回来啥也没看到
- this.importResultMsg = "成功导入"+res.data+'立项数据'+(res.msg?res.msg:"");;
- this.getList();
- this.importDialog = false;
- } else {
- this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
- }
- },
- error => {
- this.$refs.upload.clearFiles();
- this.importingData = false;
- this.$message({
- message: error,
- type: "error"
- });
- });
- }
- },
- exportData(){
- let parameter = {
- keyword:this.keyword,
- searchField: this.searchField,
- category:this.statusClf,
- status: this.status,
- viewId:this.idx
- }
- this.http.post("/project-approval/exportData", parameter,
- res => {
- if (res.code == "ok") {
- const a = document.createElement("a"); // 创建a标签
- a.setAttribute("download", "立项导出.xlsx"); // download属性
- a.setAttribute("href", res.data); // href链接
- a.click(); // 自执行点击事件
- a.remove();
- } else {
- this.$message({
- message: res.msg,
- type: "error"
- });
- }
- },
- error => {
- this.$message({
- message: error,
- type: "error"
- });
- });
- },
- },
- }
- </script>
- <style scoped>
- .toolbar_formitem_n1{
- margin-right: 0 !important;
- }
- .rg_span{
- display: inline-block;
- }
- .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 {
- color: #409EFF;
- }
- </style>
|