projectApproval.vue 65 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329
  1. <template>
  2. <section>
  3. <!--工具条 top-->
  4. <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
  5. <el-form :inline="true">
  6. <el-form-item >
  7. <!-- <div style="display: flex;align-items: center;height: 40px;"> -->
  8. <div v-if="true" style="display: flex;align-items: center;height: 40px;">
  9. <el-input v-model="keyword" class="input-with-select" :placeholder="searchField == '1' ? $t('peaseenterthe') : $t('peaseenterthe')" clearable="true" size="small">
  10. <el-select v-model="searchField" style="width:120px;" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')">
  11. <el-option :label="$t('headerTop.projectName')" value=1 ></el-option>
  12. <el-option :label="$t('Itemno')" value=2 ></el-option>
  13. </el-select>
  14. <el-button slot="append" @click="searchList" icon="el-icon-search"></el-button>
  15. </el-input>
  16. </div>
  17. </el-form-item>
  18. <!-- 分类筛选 -->
  19. <el-form-item >
  20. <span style="margin-left:5px;margin-right:5px;color:#606266;">{{ $t('fen-lei') }}</span>
  21. <el-select v-model="statusClf" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="searchClfList" size="small">
  22. <el-option v-for="item in baseClfList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
  23. </el-select>
  24. </el-form-item>
  25. <el-form-item style="float:right;">
  26. <el-link type="primary" :underline="false" @click="handleAdd(-1,null)">{{'新增'}}</el-link>
  27. <el-link type="primary" v-if="permissions.projectApprovalEdit||permissions.projectApprocalImport" style="margin-right:10px;" :underline="false" @click="importDialog=true">{{'导入'}}</el-link>
  28. <el-link type="primary" v-if="permissions.projectApprovalEdit||permissions.projectApprocalExport" style="margin-right:10px;" :underline="false" @click="exportData()">{{'导出'}}</el-link>
  29. </el-form-item>
  30. </el-form>
  31. </el-col>
  32. <div style="display: flex;width: 100%;">
  33. <div class="classification">
  34. <div>
  35. <p :class="idx == 0 ? 'on' : ''" @click="switchs(0)" v-if="permissions.projectApprovalEdit">{{'全部项目'}}</p>
  36. <p :class="idx == 1 ? 'on' : ''" @click="switchs(1)">{{'我发起的'}}</p>
  37. <p :class="idx == 2 ? 'on' : ''" @click="switchs(2)">{{'我审核的'}}</p>
  38. </div>
  39. </div>
  40. <div style="max-width: 94%;min-width: 90%">
  41. <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">
  42. <el-table-column type="selection" width="60" :selectable="isSelectable">
  43. </el-table-column>
  44. <el-table-column prop="projectCode" :label="$t('Itemno')" width="150"></el-table-column>
  45. <el-table-column prop="projectName" :label="$t('headerTop.projectName')" min-width="250" sortable="custom">
  46. <template slot-scope="scope">
  47. <div>
  48. <el-button type="text" v-if="scope.row.isPublic==0" @click="showProjectApprovalDeatil(scope.row)">{{scope.row.projectName}}</el-button>
  49. <span v-else>{{scope.row.projectName}}</span>
  50. </div>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="categoryName" :label="$t('projectclassification')" width="140"></el-table-column>
  54. <el-table-column prop="isPublic" :label="'项目类型'" width="140">
  55. <template slot-scope="scope">{{scope.row.isPublic==0?"正式项目":"非项目"}}</template>
  56. </el-table-column>
  57. <el-table-column prop="inchargerName" :label="$t('projectmanager')" min-width="150">
  58. <template slot-scope="scope">
  59. <el-link type="primary" :underline="false" @click="showUser(scope.row.inchargerId)">
  60. <span v-if="user.userNameNeedTranslate != 1">
  61. {{scope.row.inchargerName}}
  62. </span>
  63. <span v-if="user.userNameNeedTranslate == 1">
  64. <ww-open-data type='userName' :openid='scope.row.inchargerName'></ww-open-data>
  65. </span>
  66. </el-link>
  67. </template>
  68. </el-table-column>
  69. <!-- 级别 -->
  70. <el-table-column :prop="user.timeType.projectLevelState == 1 ? 'levelName' : 'level'" :label="$t('ji-bie')" min-width="190" v-if="user.company.packageProject == 1">
  71. <template slot-scope="scope">
  72. <span v-if="user.timeType.projectLevelState == 1">{{scope.row.levelName}}</span>
  73. <span v-else>{{importanceListLable[scope.row.level - 1]}}</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="status" :label="'审核状态'" min-width="100" >
  77. <template slot-scope="scope">
  78. {{scope.row.status == null?"-":approvalStatusStr[scope.row.status]}}
  79. </template>
  80. </el-table-column>
  81. <el-table-column :label="$t('operation')" :width="300" align="left" fixed="right">
  82. <template slot-scope="scope">
  83. <el-button size="mini" type="primary" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck)&&scope.row.status!=1" @click="handleAdd(scope.$index, scope.row)">{{'编辑'}}</el-button>
  84. <el-button size="mini" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck) && scope.row.status==0" @click="check(scope.row,1)">{{'通过'}}</el-button>
  85. <el-button size="mini" v-if="(permissions.projectApprovalEdit||permissions.projectApprovalCheck) && scope.row.status==0" @click="check(scope.row,2)">{{'驳回'}}</el-button>
  86. <el-button size="mini" v-if="(permissions.projectApprovalEdit ||permissions.projectApprovalCheck) && scope.row.status==1" @click="check(scope.row)">{{'撤销'}}</el-button>
  87. </template>
  88. </el-table-column>
  89. </el-table>
  90. <!--工具条 footer-->
  91. <el-col :span="24" class="toolbar">
  92. <el-pagination :key="projectListPageComponentKey"
  93. @size-change="handleSizeChange"
  94. @current-change="handleCurrentChange"
  95. :page-sizes="[20 , 50 , 80 , 100]"
  96. :page-size="size"
  97. :current-page.sync="page"
  98. layout="total, sizes, prev, pager, next"
  99. :total="total"
  100. style="float:right;"
  101. ></el-pagination>
  102. </el-col>
  103. <!--新增界面-->
  104. <el-dialog :title="title" v-if="addFormVisible" :visible.sync="addFormVisible" :close-on-click-modal="false" customClass="customWidth" width="960px" :top="'6vh'">
  105. <div style="height: 72vh;overflow-y: auto;overflow-x: hidden;">
  106. <el-form ref="form1" :model="addForm" :rules="rules" label-width="120px">
  107. <el-form-item :label="$t('Itemno')" :class="title == $t('newproject')" v-if="user.companyId!=936">
  108. <!-- <el-input v-model="addForm.code" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目编号" clearable></el-input> -->
  109. <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>
  110. </el-form-item>
  111. <el-form-item :label="$t('headerTop.projectName')" prop="name">
  112. <!-- <el-input v-model="addForm.name" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目名称" clearable></el-input> -->
  113. <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>
  114. </el-form-item>
  115. <el-form-item :label="$t('projectclassification')" v-if="user.timeType.mainProjectState != '1'">
  116. <!-- <el-select v-model="addForm.category" style="width:32%;" clearable :disabled="!permissions.projectManagement && addForm.creatorId != user.id"> -->
  117. <el-select v-model="addForm.category" style="width:32%;" clearable filterable :disabled="canOnlyModParticipator">
  118. <el-option v-for="(item) in baseClfList" :key="item.id" :value="item.id" :label="item.name"></el-option>
  119. </el-select>
  120. </el-form-item>
  121. <el-form-item :label="$t('projecttype')" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''" prop="isPublic">
  122. <el-select v-model="addForm.isPublic" style="width:32%;" @change="selectPublic" :disabled="canOnlyModParticipator">
  123. <el-option :value="0" :label="$t('zheng-shi-xiang-mu')"></el-option>
  124. <el-option :value="1" :label="$t('fei-xiang-mu')"></el-option>
  125. </el-select>
  126. </el-form-item>
  127. <el-form-item :label="$t('other.projectDescription')" prop="projectDesc">
  128. <!-- <el-input v-model="addForm.projectDesc" :disabled="!permissions.projectManagement && addForm.creatorId != user.id" placeholder="请输入项目描述" clearable maxlength="4000"></el-input> -->
  129. <el-input v-model="addForm.projectDesc" :placeholder="$t('peaseenterthe')" clearable maxlength="4000" :disabled="canOnlyModParticipator" show-word-limit></el-input>
  130. </el-form-item>
  131. <el-form-item :label="$t('Allparticipants')" v-show="addForm.isPublic == 0" :class="title == $t('newproject') && user.companyId == 936 ? 'wpgCssClass' : ''">
  132. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate != 1">
  133. <div slot="content" style="width:780px">{{addForm.userNames}}</div>
  134. <el-input @focus="showChooseMembTree" v-model="addForm.userNames"></el-input>
  135. </el-tooltip>
  136. <el-tooltip placement="top" effect="light" v-if="user.userNameNeedTranslate == 1">
  137. <div slot="content" style="width:780px">
  138. <span v-for="(item, index) in addFormUserNames" :key="index">
  139. <!-- {{item}} -->
  140. <ww-open-data type='userName' :openid='item'></ww-open-data>
  141. <span v-if="index < addFormUserNames.length - 1">,</span>
  142. </span>
  143. </div>
  144. <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">
  145. <span v-for="(item, index) in addFormUserNames" :key="index">
  146. <!-- {{item}} -->
  147. <ww-open-data type='userName' :openid='item'></ww-open-data>
  148. <span v-if="index < addFormUserNames.length - 1">,</span>
  149. </span>
  150. </div>
  151. </el-tooltip>
  152. </el-form-item>
  153. <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)">
  154. <el-select v-if="user.userNameNeedTranslate != 1" v-model="addForm.inchargerId" filterable :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator || projectManagerEdit">
  155. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id">
  156. <span style="float: left">{{ item.name }}</span>
  157. </el-option>
  158. </el-select>
  159. <selectCat v-if="user.userNameNeedTranslate == 1" :size="'medium'" :subject="participator" :subjectId="addForm.inchargerId" :distinction="'3'" @selectCal="selectCal" :disabled="canOnlyModParticipator || projectManagerEdit || isShowProjectName"></selectCat>
  160. </el-form-item>
  161. <el-form-item :label="$t('newspaperauditor')">
  162. <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" >
  163. <el-option v-for="item in participator" :key="item.id" :label="item.name" :value="item.id"></el-option>
  164. </el-select>
  165. <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>
  166. </el-form-item>
  167. <!--专业项目协作版本功能 -->
  168. <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))">
  169. <el-select v-model="addForm.level" :placeholder="$t('defaultText.pleaseChoose')" style="width:32%;" v-if="user.timeType.projectLevelState == 1" :disabled="canOnlyModParticipator || isShowProjectName">
  170. <el-option v-for="item in levelList" :key="item.id" :label="item.projectLevelName" :value="item.id"></el-option>
  171. </el-select>
  172. <el-select v-model="addForm.level" :placeholder="this.$t('defaultText.pleaseChoose')" style="width:32%;" :disabled="canOnlyModParticipator" v-else>
  173. <el-option v-for="item in importanceList" :key="item.id" :label="item.label" :value="item.id"></el-option>
  174. </el-select>
  175. </el-form-item>
  176. <!-- 增加合同金额字段 -->
  177. <el-form-item :label="$t('contractamount')" v-if="user.company.packageProject==1 && (user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  178. <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>
  179. <template v-if="title == $t('modifytheproject') && contractAmountReasonShow">
  180. <span style="margin-left:63px;margin-right:10px;">{{ $t('modifythereason') }}</span>
  181. <el-input v-model="addForm.changeContractReason" style="width:33%" clearable :placeholder="$t('contractamountasd')"></el-input>
  182. </template>
  183. </el-form-item>
  184. <el-form-item :label="$t('ommencementDate')" prop="planStartDate" v-if="(user.company.nonProjectSimple == 0 || (user.company.nonProjectSimple == 1 && addForm.isPublic == 0))">
  185. <el-date-picker v-model="addForm.planStartDate" :disabled="canOnlyModParticipator"
  186. :editable="false" style="width:32%;"
  187. format="yyyy-MM-dd"
  188. value-format="yyyy-MM-dd"
  189. :clearable="false" type="date"
  190. :placeholder="$t('optiondate')"></el-date-picker>
  191. <span style="margin-left:63px;margin-right:10px;" >{{ $t('ji-hua-jie-shu-ri-qi') }}</span>
  192. <el-date-picker v-model="addForm.planEndDate" style="width:33%;"
  193. :editable="false" :disabled="canOnlyModParticipator"
  194. format="yyyy-MM-dd"
  195. value-format="yyyy-MM-dd"
  196. :clearable="false" type="date"
  197. :placeholder="$t('optiondate')"></el-date-picker>
  198. </el-form-item>
  199. <!-- 项目基线 -->
  200. <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))">
  201. <el-tabs v-model="activeName" @tab-click="handleClick">
  202. <el-tab-pane :label="$t('costbaseline')" name="baseCostPanel" >
  203. <div style="padding-top:10px;">
  204. <!--新版 -->
  205. <span class="rg_span" v-for="(item, index) in projectBaseCostData" :key="item.id">
  206. <span style="width:120px;display: inline-block;" v-if="user.company.packageProject==1">{{item.baseName}}</span>
  207. <el-input :id="'baseCost'+index" @input="addUpfun()" v-model="item.baseAmount" style="width:200px; margin-bottom: 20px"
  208. :placeholder="$t('zheng-shu')" clearable @keyup.native="restrictNumber('baseCost'+index)"></el-input><span style="margin-left:10px;">{{ $t('yuan') }}</span>
  209. </span>
  210. <!-- 合计 -->
  211. <div style="margin-top: 10px;float:right;">
  212. <span style="margin-right:50px;margin-right:10px;" v-if="user.company.packageProject==1">{{ $t('other.totals') }}</span>
  213. <span v-if="addForm.budget <= 0 || addForm.budget == undefined">0</span>
  214. <span v-else>{{addForm.budget | numberToCurrency}}</span>
  215. <span style="margin-right:50px;margin-left:10px;">{{ $t('yuan') }}</span>
  216. </div>
  217. </div>
  218. </el-tab-pane>
  219. </el-tabs>
  220. </div>
  221. <el-divider></el-divider>
  222. <template>
  223. <div><span>{{'审核人'}}</span></div>
  224. <div>
  225. <div v-for="(item, index) in pointList" :key="index" >
  226. 第{{index+1}}审核人:
  227. <el-select :disabled="item.status!=0" v-if="user.userNameNeedTranslate != 1" v-model="item.userId" style="width:140px;" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="manageSelect" size="small" filterable popper-class="managePopperClass">
  228. <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id">
  229. <span style="float: left">{{ item.name }}</span>
  230. </el-option>
  231. </el-select>
  232. <i class="el-icon-circle-plus-outline" @click="addInput(index)" v-if="index==pointList.length-1"></i>
  233. <i class="el-icon-remove-outline" v-if="pointList.length>1 && item.status==0" @click="deleteInput(index)"></i>
  234. <span>{{item.status==0?'待审核':item.status==1?"已审核":"已驳回"}}</span>
  235. </div>
  236. </div>
  237. </template>
  238. </el-form>
  239. </div>
  240. <div slot="footer" class="dialog-footer;">
  241. <el-button @click.native="deletePro(1, addForm)" v-if="(permissions.projectApprovalEdit) && addForm.id" style="float:left">{{ $t('btn.delete') }}</el-button>
  242. <el-button @click.native="addFormVisible = false">{{ $t('btn.cancel') }}</el-button>
  243. <el-button type="primary" @click="submitInsert" :loading="addLoading">{{ $t('btn.submit') }}</el-button>
  244. </div>
  245. </el-dialog>
  246. <!-- 按部门选择人员 -->
  247. <el-dialog :title="$t('selectingParticipants')" :visible.sync="chooseParticipVisible" :close-on-click-modal="false" customClass="customWidth" width="500px">
  248. <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
  249. <div v-if="user.userNameNeedTranslate == '1'">
  250. <el-input placeholder="请输入内容" v-model.trim="filterText" class="input-with-select">
  251. <el-button slot="append" icon="el-icon-search" @click="echartDepartment()"></el-button>
  252. </el-input>
  253. </div>
  254. <div class="tree" style="height:400px">
  255. <el-scrollbar style="height:100%">
  256. <el-input
  257. :placeholder="$t('keywordfiltering')"
  258. v-model="filterText" v-if="user.userNameNeedTranslate != '1'">
  259. </el-input>
  260. <el-tree :data="deptMembData" :key="searchPersonnelFlgnum" show-checkbox :default-expand-all="searchPersonnelFlg" :props="defaultProps" node-key="id"
  261. ref="chooseMembTree" @check-change="onTreeItemChange" :default-checked-keys="addForm.userId"
  262. highlight-current :filter-node-method="filterNode">
  263. <span class="custom-tree-node" slot-scope="{ node, data }">
  264. <span v-if="user.userNameNeedTranslate == '1'">
  265. <span v-if="node.data.children">
  266. <ww-open-data type='departmentName' :openid='node.label'></ww-open-data>
  267. </span>
  268. <span v-else>
  269. <ww-open-data type='userName' :openid='node.label'></ww-open-data>
  270. </span>
  271. </span>
  272. <span v-if="user.userNameNeedTranslate != '1'">
  273. {{ node.label }}
  274. </span>
  275. <!-- {{ node.label }} -->
  276. </span>
  277. </el-tree>
  278. </el-scrollbar>
  279. </div>
  280. <div>{{ $t('btn.choose') }}&nbsp;{{chosenMembCount}}&nbsp;{{ $t('other.people') }}</div>
  281. <div slot="footer" class="dialog-footer">
  282. <el-button @click="chooseParticipVisible = false" >{{ $t('btn.cancel') }}</el-button>
  283. <el-button type="primary" @click="chooseParticip()" >{{ $t('btn.determine') }}</el-button>
  284. </div>
  285. </el-dialog>
  286. <!--用户详细信息弹出框-->
  287. <el-dialog :title="$t('Checkthedetails')" v-if="userDetailVisible" :visible.sync="userDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  288. <div class="line"><span>{{ $t('lable.name') +":"}}</span>
  289. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.name}}</span>
  290. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='userDetail.name'></ww-open-data></span>
  291. </div>
  292. <div class="line"><span>{{ $t('Worknumber') +":"}}</span><span>{{userDetail.jobNumber}}</span></div>
  293. <div class="line"><span>{{ $t('lable.phone') +":"}}</span><span>{{userDetail.phone}}</span></div>
  294. <div class="line"><span>{{ $t('jiao-se') +":"}}</span><span>{{userDetail.roleName}}</span></div>
  295. <div class="line"><span>{{ $t('lable.department') +":"}}</span>
  296. <span v-if="user.userNameNeedTranslate != 1">{{userDetail.departmentName}}</span>
  297. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='departmentName' :openid='userDetail.departmentName'></ww-open-data></span>
  298. </div>
  299. <div slot="footer" class="dialog-footer">
  300. <el-button type="primary" @click="userDetailVisible = false" >{{ $t('btn.determine') }}</el-button>
  301. </div>
  302. </el-dialog>
  303. <!--查看立项-->
  304. <el-dialog :title="$t('Checkthedetails')" v-if="projectApprovalDetailVisible" :visible.sync="projectApprovalDetailVisible" :close-on-click-modal="false" customClass="customWidth" width="400px">
  305. <div class="line"><span>{{'项目编号:'}}</span><span>{{projectApprocalDetail.projectCode}}</span></div>
  306. <div class="line"><span>{{'项目名称:'}}</span><span>{{projectApprocalDetail.projectName}}</span></div>
  307. <div class="line"><span>{{'项目分类:'}}</span><span>{{projectApprocalDetail.categoryName}}</span></div>
  308. <div class="line"><span>{{'项目类型:'}}</span><span>{{projectApprocalDetail.isPublic==0?"正式项目":"非项目"}}</span></div>
  309. <div class="line"><span>{{'项目描述:'}}</span><span>{{projectApprocalDetail.projectDesc}}</span></div>
  310. <div class="line"><span>{{'全部参与人:'}}</span>
  311. <span v-if="user.userNameNeedTranslate != 1">{{projectApprocalDetail.participationApprovalList.map(v=>v.userName).join(",")}}</span>
  312. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='projectApprocalDetail.participationApprovalList.map(v=>v.userName).join(",")'></ww-open-data></span>
  313. </div>
  314. <div class="line"><span>{{'项目经理:'}}</span>
  315. <span v-if="user.userNameNeedTranslate != 1">{{projectApprocalDetail.inchargerName}}</span>
  316. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='projectApprocalDetail.inchargerName'></ww-open-data></span>
  317. </div>
  318. <div class="line"><span>{{'日报审核人:'}}</span>
  319. <span v-if="user.userNameNeedTranslate != 1">{{projectApprocalDetail.projectApprovalAuditorList.map(v=>v.auditorName).join(",")}}</span>
  320. <span v-if="user.userNameNeedTranslate == 1"><ww-open-data type='userName' :openid='projectApprocalDetail.projectApprovalAuditorList.map(v=>v.auditorName).join(",")'></ww-open-data></span>
  321. </div>
  322. <div class="line"><span>{{'级别:'}}</span><span>{{importanceListLable[projectApprocalDetail.level-1]}}</span></div>
  323. <div class="line"><span>{{'合同金额:'}}</span><span>{{projectApprocalDetail.contractAmount}}</span></div>
  324. <el-divider></el-divider>
  325. <div class="line">
  326. <span>成本基线</span>
  327. </div>
  328. <div class="line">
  329. <span>{{'计划开始日期:'}}</span><span>{{projectApprocalDetail.planStartDate}}</span>
  330. <span>{{'计划结束日期:'}}</span><span>{{projectApprocalDetail.planEndDate}}</span>
  331. </div>
  332. <div class="line" v-for="(item,index) in projectApprocalDetail.projectApprovalBasecostList">
  333. <span>{{item.baseName+":"}}</span><span>{{item.baseAmount}}</span>
  334. </div>
  335. <div slot="footer" class="dialog-footer">
  336. <el-button type="primary" @click="projectApprovalDetailVisible = false" >{{'关闭'}}</el-button>
  337. </div>
  338. </el-dialog>
  339. <el-dialog :title="$t('other.Batchimportofworkinghours')" v-if="importDialog" :visible.sync="importDialog" customClass="customWidth" width="500px">
  340. <p>1. {{$t('other.download')}}
  341. <el-link type="primary" style="margin-left:5px;" :underline="false" :href="'./upload/立项导入模板.xlsx'" :download="'立项导入模板.xlsx'">{{'立项导入模板.xlsx'}}</el-link>
  342. </p>
  343. <p>2. {{$t('other.projectsAndPeopleInThetemplate')}}。</p>
  344. <p style="display: flex;justify-content: center;">
  345. <el-upload ref="upload" action="#" :limit="1" :http-request="batchImportData" :show-file-list="false">
  346. <el-button type="primary" :underline="false" :loading="importingData">{{$t("other.startImporting")}}</el-button>
  347. </el-upload>
  348. </p>
  349. </el-dialog>
  350. </div>
  351. </div>
  352. </section>
  353. </template>
  354. <script>
  355. export default {
  356. name: '',
  357. components: {},
  358. props: { },
  359. data() {
  360. return {
  361. keyword:"",
  362. searchField:"1",
  363. user: JSON.parse(sessionStorage.getItem("user")),
  364. total: 0,
  365. page: 1,
  366. size: localStorage.getItem("projectPageSize")==null?20:parseInt(localStorage.getItem("projectPageSize")),
  367. listLoading:false,
  368. approvalStatusStr:["待审核","已通过","已驳回"],
  369. 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')}],
  370. 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')],
  371. addFormVisible:false,
  372. baseCostItemList:[],
  373. permissions: JSON.parse(sessionStorage.getItem("permissions")),
  374. addForm: {
  375. name: '',
  376. userId: [],
  377. level:1,
  378. bu:'',
  379. id: '',
  380. code: '',
  381. projectDesc: '',
  382. alarmType: 0
  383. },
  384. projectBaseCostData:[],
  385. activeName:"baseCostPanel",
  386. baseClfList:[],
  387. addFormUserNames: [],
  388. deptMembData: [
  389. {
  390. id: 0,
  391. label: this.$t('lable.unassigned'),
  392. }
  393. ],
  394. allMembData:[],
  395. participator:[],
  396. chosenListBackup: [],
  397. chooseParticipVisible:false,
  398. rules: {
  399. name: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  400. code: [{ required: true, message: this.$t('qing-shu-ru-bian-hao'), trigger: "blur" }],
  401. projectStageName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  402. projectLevelName: [{ required: true, message: this.$t('pleaseentername'), trigger: "blur" }],
  403. deptId: [{ required: true, message: '请选择所属部门', trigger: "blur" }]
  404. },
  405. chosenMembCount:0,
  406. dataDetail:{},
  407. userDetailVisible:false,
  408. userDetail:{},
  409. pointList:[{
  410. userId:"",
  411. seq:1,
  412. status:0
  413. }],
  414. idx: 1,
  415. tableHeight: 0,
  416. projectApprovalDetailVisible:false,
  417. projectApprocalDetail:{},
  418. importDialog:false,
  419. }
  420. },
  421. computed: {},
  422. watch: {},
  423. created () {
  424. let height = window.innerHeight;
  425. this.tableHeight = height - 195;
  426. const that = this;
  427. window.onresize = function temp() {
  428. that.tableHeight = window.innerHeight - 195;
  429. };
  430. },
  431. mounted () {
  432. this.getList();
  433. this.getProjectBaseConfigList();
  434. this.getClfConfigList();
  435. this.getDepartment();
  436. this.getUsers();
  437. },
  438. methods: {
  439. isSelectable(row,index){
  440. if(row.creatorId == this.user.id || row.inchargerId == this.user.id || this.permissions.projectApprovalEdit){
  441. return true
  442. }else{
  443. return false
  444. }
  445. },
  446. submitInsert() {
  447. this.$refs.form1.validate(valid => {
  448. if (valid) {
  449. this.addLoading = true;
  450. let targetData = {};
  451. targetData.projectName= this.addForm.name
  452. if(this.addForm.projectDesc != null) {
  453. targetData.projectDesc=this.addForm.projectDesc
  454. }
  455. if(this.addForm.id != null) {
  456. targetData.id=this.addForm.id
  457. }
  458. if(this.addForm.isPublic != null) {
  459. targetData.isPublic=this.addForm.isPublic
  460. }
  461. if(this.addForm.userId.length != 0 && this.addForm.isPublic == 0) {
  462. let userArray=[]
  463. for(let i in this.addForm.userId){
  464. userArray.push({
  465. "userId":this.addForm.userId[i]
  466. })
  467. }
  468. targetData.participationApprovalList=userArray
  469. }
  470. if(this.addForm.inchargerId != null) {
  471. targetData.inchargerId=this.addForm.inchargerId
  472. }
  473. if(this.addForm.code != null) {
  474. targetData.projectCode=this.addForm.code
  475. }
  476. if(this.addForm.planStartDate != null) {
  477. targetData.planStartDate=this.addForm.planStartDate
  478. }
  479. if(this.addForm.planEndDate != null) {
  480. targetData.planEndDate=this.addForm.planEndDate
  481. }
  482. if(this.addForm.level != null) {
  483. targetData.level=this.addForm.level
  484. }
  485. if(this.addForm.contractAmount != null) {
  486. targetData.contractAmount=this.addForm.contractAmount
  487. }
  488. if (this.projectBaseCostData != null) {
  489. targetData.projectApprovalBasecostList=this.projectBaseCostData
  490. //计算总预算成本
  491. if (this.addForm.budget == null) {
  492. this.addForm.budget = 0;
  493. }
  494. targetData.budget=this.addForm.budget
  495. }
  496. if (this.addForm.contractAmount) {
  497. targetData.contractAmount=this.addForm.contractAmount
  498. } else {
  499. targetData.contractAmount=0
  500. }
  501. if (this.user.timeType.outputValueStatus == 1){
  502. targetData.outputValue=this.addForm.outputValue ? this.addForm.outputValue : 0
  503. }
  504. //日报审核人
  505. if (this.addForm.auditUserIds) {
  506. targetData.auditUserIds=this.addForm.auditUserIds
  507. }
  508. if(this.addForm.auditUserIds.length != 0) {
  509. let userArray=[]
  510. for(let i in this.addForm.auditUserIds){
  511. userArray.push({
  512. "auditorId":this.addForm.auditUserIds[i]
  513. })
  514. }
  515. targetData.projectApprovalAuditorList=userArray
  516. }
  517. if(this.addForm.category != null) {
  518. targetData.category=this.addForm.category
  519. }
  520. //审核人
  521. if (this.pointList) {
  522. targetData.projectApprovalCheckList=this.pointList
  523. }
  524. this.http.JSONPost("/project-approval/editProjectApproval",targetData,
  525. res => {
  526. this.addLoading = false;
  527. if (res.code == "ok") {
  528. this.$message({
  529. message: (this.addForm.id!=null?this.$t('xiu-gai'):this.$t('create'))+this.$t('other.successful'),
  530. type: "success"
  531. });
  532. this.addFormVisible = false;
  533. this.getList();
  534. if (this.user.company.packageEngineering == 1) {
  535. this.saveProjectProfessions(res.data);
  536. }
  537. } else {
  538. this.$message({
  539. message: res.msg,
  540. type: "error"
  541. });
  542. }
  543. },
  544. error => {
  545. this.addLoading = false;
  546. this.$message({
  547. message: error,
  548. type: "error"
  549. });
  550. });
  551. }
  552. });
  553. },
  554. // 获取分类条目
  555. getClfConfigList() {
  556. this.http.get('/project-category/list',
  557. res => {
  558. if (res.code == "ok") {
  559. this.baseClfList = res.data;
  560. // console.log("获取分类条目",res.data);
  561. this.$forceUpdate();
  562. } else {
  563. this.$message({
  564. message: res.msg,
  565. type: "error"
  566. });
  567. }
  568. },
  569. error => {
  570. this.$message({
  571. message: error,
  572. type: "error"
  573. });
  574. }
  575. );
  576. },
  577. //分页
  578. handleCurrentChange(val) {
  579. this.page = val;
  580. this.getList();
  581. },
  582. handleSizeChange(val) {
  583. this.size = val;
  584. localStorage.projectPageSize = this.size;
  585. this.page = 1
  586. this.getList();
  587. },
  588. getProjectBaseConfigList() {
  589. this.http.post('/project-basecost-setting/list',{},
  590. res => {
  591. if (res.code == "ok") {
  592. this.baseCostItemList = res.data;
  593. this.$forceUpdate();
  594. } else {
  595. this.$message({
  596. message: res.msg,
  597. type: "error"
  598. });
  599. }
  600. },
  601. error => {
  602. this.$message({
  603. message: error,
  604. type: "error"
  605. });
  606. }
  607. );
  608. },
  609. //显示新增界面
  610. handleAdd(i, item) {
  611. if(i == -1) {
  612. this.title = this.$t('newproject');
  613. this.addForm = {
  614. name: '',
  615. isPublic:0,
  616. userId: [],
  617. userNames:'',
  618. code:'',
  619. inchargerId:null,
  620. level: this.user.timeType.projectLevelState == 1 ? (this.levelList.length > 0 ? this.levelList[0].id : null) : 1,
  621. customerId:null,
  622. notifyUserNames:'',
  623. chosenLeaders:[],
  624. category:null,
  625. creatorId: this.user.id,
  626. projectMainId: '',
  627. outputValue: '',
  628. bu: [],
  629. manDay:0,
  630. fromOutside: 0,
  631. }
  632. this.projectBaseCostData = [];
  633. this.auseList = [];
  634. for (var m=0;m<this.baseCostItemList.length; m++) {
  635. this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
  636. }
  637. } else {
  638. this.http.post('/project-approval/getDetail', {id: item.id},
  639. res => {
  640. let theData=[];
  641. if (res.code == "ok") {
  642. theData=res.data
  643. }
  644. var arr=[]
  645. var names=""
  646. var auditorArr=[]
  647. if(theData.participationApprovalList){
  648. for(let i in theData.participationApprovalList){
  649. arr.push(theData.participationApprovalList[i].userId);
  650. names+=theData.participationApprovalList[i].userName+",";
  651. }
  652. }
  653. if(theData.projectApprovalAuditorList){
  654. for(let i in theData.projectApprovalAuditorList){
  655. auditorArr.push(theData.projectApprovalAuditorList[i].auditorId)
  656. }
  657. }
  658. if (names.length > 0) {
  659. names = names.substring(0, names.length -1);
  660. }
  661. this.addForm = {
  662. id: item.id,
  663. name: item.projectName,
  664. userId: arr,
  665. auditUserIds:auditorArr,
  666. userNames:names,
  667. isPublic: item.isPublic,
  668. code:item.projectCode,
  669. inchargerId: item.inchargerId,
  670. level: item.level,
  671. planStartDate: item.planStartDate,
  672. planEndDate: item.planEndDate,
  673. budget: item.budget,
  674. baseMan: item.baseMan,
  675. contractAmount: item.contractAmount,
  676. baseFee: item.baseFee,
  677. baseRisk1: item.baseRisk1,
  678. baseRisk2: item.baseRisk2,
  679. baseOutsourcing: item.baseOutsourcing,
  680. customerId:item.customerId==0?null:item.customerId,
  681. category:item.category,
  682. projectDesc: item.projectDesc,
  683. creatorId: item.creatorId,
  684. outputValue: item.outputValue,
  685. }
  686. this.participator=theData.participationApprovalList
  687. this.changeParticipator();
  688. this.getProjectBaseData(item.id);
  689. console.log("===========",this.projectBaseCostData)
  690. this.getProjectCheckerData(item.id);
  691. });
  692. }
  693. this.addFormVisible = true;
  694. },
  695. //获取项目列表
  696. getList() {
  697. localStorage.projectPageIndex = this.page;
  698. this.listLoading = true;
  699. let parameter = {
  700. pageIndex: this.page,
  701. pageSize: this.size,
  702. keyword:this.keyword,
  703. searchField: this.searchField,
  704. category:this.statusClf,
  705. status: this.status,
  706. viewId:this.idx
  707. }
  708. this.http.post("/project-approval/listByPage", parameter,
  709. res => {
  710. this.listLoading = false;
  711. if (res.code == "ok") {
  712. var list = res.data.records;
  713. this.list = list;
  714. this.total = res.data.total;
  715. } else {
  716. this.$message({
  717. message: res.msg,
  718. type: "error"
  719. });
  720. }
  721. },
  722. error => {
  723. this.listLoading = false;
  724. this.$message({
  725. message: error,
  726. type: "error"
  727. });
  728. });
  729. },
  730. // 项目基线合计
  731. addUpfun() {
  732. var total = 0;
  733. for (var i=0;i<this.projectBaseCostData.length; i++) {
  734. if (this.projectBaseCostData[i].baseAmount) {
  735. total += parseFloat(this.projectBaseCostData[i].baseAmount);
  736. }
  737. }
  738. this.addForm.budget = total;
  739. },
  740. restrictNumber(targetId) {
  741. let inpu = document.getElementById(targetId);
  742. inpu.value = inpu.value.replace(/[^\d.]/g, ""); //仅保留数字和"."
  743. inpu.value = inpu.value.replace(/\.{2,}/g, "."); //两个连续的"."仅保留第一个"."
  744. inpu.value = inpu.value.replace(".", "$#*").replace(/\./g,'').replace('$#*','.');//去除其他"."
  745. inpu.value = inpu.value.replace(/^(\d+)\.(\d\d).*$/, '$1.$2');;//限制只能输入两个小数
  746. if (inpu.value.indexOf(".") < 0 && inpu.value != "") { //首位是0的话去掉
  747. inpu.value = parseFloat(inpu.value);
  748. }
  749. },
  750. showChooseLeaderTree() {
  751. this.chosenMembCount = this.chosenLeaders.length;
  752. this.chooseLeaderVisible = true;
  753. },
  754. onLeaderTreeItemChange() {
  755. var chosenList = this.$refs.chooseLeaderTree.getCheckedNodes();
  756. var list = chosenList.filter(item=>item.isUser == 1);
  757. this.chosenMembCount = list.length;
  758. },
  759. showChooseMembTree() {
  760. this.deptMembData = JSON.parse(JSON.stringify(this.allMembData))
  761. this.chosenMembCount = this.participator.length;
  762. this.chooseParticipVisible = true;
  763. this.filterText = ''
  764. this.wxFilterText = ''
  765. if(this.user.userNameNeedTranslate == 1) {
  766. this.getDepartment()
  767. }
  768. let that = this
  769. setTimeout(()=>{
  770. that.chosenListBackup = that.$refs.chooseMembTree.getCheckedNodes();
  771. }, 500)
  772. },
  773. onTreeItemChange() {
  774. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  775. var list = chosenList.filter(item=>item.isUser == 1);
  776. this.chosenMembCount = list.length;
  777. },
  778. findUserInTree() {
  779. if (this.filterName == '') {
  780. this.deptMembData = this.allMembData;
  781. } else {
  782. var list = this.findRecursively(this.filterName, this.allMembData);
  783. this.deptMembData = list;
  784. }
  785. },
  786. findRecursively(username, list) {
  787. var filterList = [];
  788. for (var i=0;i<list.length; i++) {
  789. if (list[i].isUser == 1) {
  790. if (list[i].label.indexOf(username) >= 0) {
  791. //匹配上了
  792. filterList.push(list[i]);
  793. }
  794. } else if (list[i].children != null && list[i].children.length > 0) {
  795. var subList = this.findRecursively(username, list[i].children);
  796. if (subList.length > 0) {
  797. subList.forEach(s=>filterList.push(s));
  798. }
  799. }
  800. }
  801. return filterList;
  802. },
  803. //确定选择参与人
  804. chooseParticip() {
  805. this.chooseParticipVisible = false;
  806. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  807. if(this.searchPersonnelFlg) {
  808. chosenList = [...chosenList, ...this.chosenListBackup]
  809. }
  810. this.chosenMembList = chosenList.filter(item=>item.isUser == 1);
  811. this.addForm.userNames = '';
  812. this.addFormUserNames = []
  813. this.addForm.userId = [];
  814. this.participator = [];
  815. for (var i=0;i<this.chosenMembList.length; i++) {
  816. this.addForm.userId.push(this.chosenMembList[i].id);
  817. this.addForm.userNames += this.chosenMembList[i].label+',';
  818. this.addFormUserNames.push(this.chosenMembList[i].label)
  819. var item = {id:this.chosenMembList[i].id, name:this.chosenMembList[i].label};
  820. this.participator.push(item);
  821. }
  822. if (this.addForm.userNames.length > 0) {
  823. this.addForm.userNames = this.addForm.userNames.substring(0, this.addForm.userNames.length-1);
  824. }
  825. },
  826. // 获取部门列表
  827. getDepartment() {
  828. this.http.post("/department/listAllMemb", {},
  829. res => {
  830. if (res.code == "ok") {
  831. var list = res.data;
  832. //设置员工到部门下面
  833. this.setUserToDept(list);
  834. this.deptMembData = list;
  835. console.log(this.deptMembData, '看看数据')
  836. //用于筛选过滤
  837. this.allMembData = JSON.parse(JSON.stringify(this.deptMembData));
  838. } else {
  839. this.$message({
  840. message: res.msg,
  841. type: "error"
  842. });
  843. }
  844. },
  845. error => {
  846. this.$message({
  847. message: error,
  848. type: "error"
  849. });
  850. });
  851. },
  852. onTreeItemChange() {
  853. var chosenList = this.$refs.chooseMembTree.getCheckedNodes();
  854. var list = chosenList.filter(item=>item.isUser == 1);
  855. this.chosenMembCount = list.length;
  856. },
  857. findUserInTree() {
  858. if (this.filterName == '') {
  859. this.deptMembData = this.allMembData;
  860. } else {
  861. var list = this.findRecursively(this.filterName, this.allMembData);
  862. this.deptMembData = list;
  863. }
  864. },
  865. addPersonCheck(){
  866. var chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  867. var list = chosenList.filter(item=>item.isUser == 1);
  868. this.chosenMembCount = list.length;
  869. // console.log(list);
  870. },
  871. addPersonSure(){
  872. this.addGroupPersonPdialog = false
  873. let chosenList = this.$refs.chooseMembTree2.getCheckedNodes();
  874. let list = chosenList.filter(item=>item.isUser == 1);
  875. let listIDs = []
  876. let listNames = ''
  877. let listNamesList = []
  878. for(let i=0;i<list.length;i++){
  879. listIDs.push(list[i].id)
  880. listNames += list[i].label + ','
  881. listNamesList.push(list[i].label)
  882. }
  883. this.addGroupPersonData.person = listIDs
  884. this.addGroupPersonData.personNames = listNames
  885. this.addGroupPersonDataPersonNames = listNamesList
  886. console.log('触发', this.addGroupPersonDataPersonNames)
  887. },
  888. // 企业微信搜索
  889. echartDepartment() {
  890. console.log('我点击了搜索')
  891. if(this.filterText != '') {
  892. this.http.post("/user/getEmployeeList", {
  893. keyword: this.filterText,
  894. cursor: '',
  895. departmentId: -1,
  896. pageIndex: 1,
  897. pageSize: 1000
  898. },
  899. res => {
  900. if (res.code == "ok") {
  901. this.filterNodePersonnel = res.data.records.map(item => item.name)
  902. this.$refs.chooseMembTree.filter(this.filterText);
  903. } else {
  904. this.$message({
  905. message: res.msg,
  906. type: "error"
  907. });
  908. }
  909. },
  910. error => {
  911. this.$message({
  912. message: error,
  913. type: "error"
  914. });
  915. });
  916. } else {
  917. this.searchPersonnelFlgnum = +this.searchPersonnelFlgnum +1
  918. this.searchPersonnelFlg = false
  919. this.getDepartment()
  920. }
  921. },
  922. setUserToDept(list) {
  923. for (var i in list) {
  924. if (list[i].children != null) {
  925. this.setUserToDept(list[i].children);
  926. }
  927. if (list[i].userList != null) {
  928. if (list[i].children == null) {
  929. list[i].children = [];
  930. }
  931. list[i].userList.forEach(element => {
  932. var obj = {id: element.id, label:element.name, parentId:element.departmentId, isUser:1};
  933. list[i].children.push(obj);
  934. });
  935. }
  936. }
  937. },
  938. formDataToObject(formData) {
  939. const object = {};
  940. for (const [key, value] of formData.entries()) {
  941. if (key in object) {
  942. object[key] = [].concat(object[key], value);
  943. } else {
  944. object[key] = value;
  945. }
  946. }
  947. return object;
  948. },
  949. searchList() {
  950. this.page = 1;
  951. this.getList();
  952. },
  953. // 分类筛选
  954. searchClfList(){
  955. this.page = 1;
  956. this.getList();
  957. },
  958. getUsers() {
  959. // this.http.post(this.port.manage.list, {
  960. // departmentId: -1,
  961. // pageIndex: 1,
  962. // // pageSize: 99999
  963. // pageSize: -1
  964. // },
  965. this.http.post('/user/getSimpleActiveUserList', {},
  966. res => {
  967. if (res.code == "ok") {
  968. this.users = res.data;
  969. } else {
  970. this.$message({
  971. message: res.msg,
  972. type: "error"
  973. });
  974. }
  975. },
  976. error => {
  977. this.$message({
  978. message: error,
  979. type: "error"
  980. });
  981. });
  982. },
  983. // 自定义组件事件
  984. selectCal(obj) {
  985. if(obj.distinction == '1') {
  986. this.inchagerId = obj.id
  987. this.manageSelect()
  988. } else if(obj.distinction == '2') {
  989. this.participationId = obj.id
  990. this.participationSelect()
  991. } else if(obj.distinction == '3') {
  992. this.addForm.inchargerId = obj.id
  993. // console.log(this.participator)
  994. this.participator = JSON.parse(JSON.stringify(this.participator))
  995. } else if(obj.distinction =='4') {
  996. this.projectProfessionList[obj.other].inchargerId = obj.id
  997. } else if(obj.distinction =='5') {
  998. this.paramInchargerId = obj.id
  999. }else if(obj.distinction =='6') {
  1000. this.hasSetGroupInchargerId = obj.id
  1001. } else if(obj.distinction == '10') {
  1002. let userList = obj.arrUserList
  1003. let arr = []
  1004. for(var i in userList) {
  1005. arr.push(userList[i].id)
  1006. }
  1007. this.participator = JSON.parse(JSON.stringify(this.participator))
  1008. this.addForm.auditUserIds = arr
  1009. } else if(obj.distinction == '11') {
  1010. let userList = obj.id
  1011. console.log(obj)
  1012. this.curProfessionRow.membList[obj.other].membId = userList
  1013. }
  1014. },
  1015. getProjectBaseData(projectId) {
  1016. this.http.post('/project-approval-basecost/get',{projectId: projectId},
  1017. res => {
  1018. if (res.code == "ok") {
  1019. if(res.data.length>0){
  1020. this.projectBaseCostData = res.data;
  1021. }else{
  1022. this.projectBaseCostData = [];
  1023. for (var m=0;m<this.baseCostItemList.length; m++) {
  1024. this.projectBaseCostData.push({baseId: this.baseCostItemList[m].id, baseName:this.baseCostItemList[m].name, baseAmount:0});
  1025. }
  1026. }
  1027. } else {
  1028. this.$message({
  1029. message: res.msg,
  1030. type: "error"
  1031. });
  1032. }
  1033. },
  1034. error => {
  1035. this.listLoading = false;
  1036. this.$message({
  1037. message: error,
  1038. type: "error"
  1039. });
  1040. }
  1041. );
  1042. },
  1043. getProjectCheckerData(projectId) {
  1044. this.http.post('//project-approval-check/get',{projectId: projectId},
  1045. res => {
  1046. if (res.code == "ok") {
  1047. if(res.data.length>0){
  1048. this.pointList = res.data;
  1049. }
  1050. } else {
  1051. this.$message({
  1052. message: res.msg,
  1053. type: "error"
  1054. });
  1055. }
  1056. },
  1057. error => {
  1058. this.listLoading = false;
  1059. this.$message({
  1060. message: error,
  1061. type: "error"
  1062. });
  1063. }
  1064. );
  1065. },
  1066. selectPublic() {
  1067. if (this.addForm.isPublic == 1) {
  1068. this.participator = this.users;
  1069. } else {
  1070. this.participator = [];
  1071. }
  1072. },
  1073. //选择参与人
  1074. changeParticipator() {
  1075. //检查是否在参与人中,如果没有需要加入到参与人中
  1076. // console.log('addform',this.addForm.userId,this.users);
  1077. this.participator = [];
  1078. this.addForm.userId.forEach(u=>{
  1079. var list = this.users.filter(au=>au.id == u);
  1080. if (list.length > 0) {
  1081. var findUser = list[0];
  1082. this.participator.push(findUser);
  1083. } else {
  1084. console.log('未找到用户: '+u);
  1085. }
  1086. })
  1087. },
  1088. //显示用户详情
  1089. showUser(userId) {
  1090. this.userDetailVisible = true;
  1091. this.http.post(this.port.manage.userDetail, {
  1092. userId: userId
  1093. },
  1094. res => {
  1095. if (res.code == "ok") {
  1096. this.userDetail = res.data;
  1097. } else {
  1098. this.$message({
  1099. message: res.msg,
  1100. type: "error"
  1101. });
  1102. }
  1103. },
  1104. error => {
  1105. this.$message({
  1106. message: error,
  1107. type: "error"
  1108. });
  1109. });
  1110. },
  1111. addInput(index){
  1112. this.pointList.push({
  1113. userId:"",
  1114. seq:index+2,
  1115. status:0
  1116. })
  1117. },
  1118. deleteInput(index){
  1119. this.pointList.splice(index,1)
  1120. // if(this.pointList.length<=0){
  1121. // this.pointList.push({
  1122. // checkerId:""
  1123. // })
  1124. // }
  1125. },
  1126. // 切换当前选项的索引
  1127. switchs(e) {
  1128. this.idx = e
  1129. this.page = 1
  1130. // console.log(this.searchField)
  1131. this.getList()
  1132. },
  1133. deletePro(i, item) {
  1134. this.$confirm('确定要删除立项[' + item.name +'吗]','删除立项', {
  1135. confirmButtonText: this.$t('btn.determine'),
  1136. cancelButtonText: this.$t('btn.cancel'),
  1137. type: "warning"
  1138. })
  1139. .then(() => {
  1140. this.listLoading = true;
  1141. this.http.post('/project-approval/delete',{
  1142. id: item.id
  1143. },
  1144. res => {
  1145. this.listLoading = false;
  1146. if (res.code == "ok") {
  1147. this.$message({
  1148. message: this.$t('message.successfullyDeleted'),
  1149. type: "success"
  1150. });
  1151. this.addFormVisible=false
  1152. this.getList();
  1153. } else {
  1154. this.$message({
  1155. message: res.msg,
  1156. type: "error"
  1157. });
  1158. }
  1159. },
  1160. error => {
  1161. this.listLoading = false;
  1162. this.$message({
  1163. message: error,
  1164. type: "error"
  1165. });
  1166. }
  1167. );
  1168. })
  1169. .catch(() => {});
  1170. },
  1171. check(item,checkType,revokeType){
  1172. this.listLoading = true;
  1173. this.http.post('/project-approval/check',{
  1174. id:item.id ,
  1175. checkType:checkType,
  1176. revokeType:revokeType
  1177. },
  1178. res => {
  1179. this.listLoading = false;
  1180. if (res.code == "ok") {
  1181. this.$message({
  1182. message: "操作成功",
  1183. type: "success"
  1184. });
  1185. this.addFormVisible=false
  1186. this.getList();
  1187. } else {
  1188. this.$message({
  1189. message: res.msg,
  1190. type: "error"
  1191. });
  1192. }
  1193. },
  1194. error => {
  1195. this.listLoading = false;
  1196. this.$message({
  1197. message: error,
  1198. type: "error"
  1199. });
  1200. }
  1201. );
  1202. },
  1203. showProjectApprovalDeatil(item){
  1204. this.projectApprovalDetailVisible=true
  1205. this.http.post('/project-approval/getDetail', {id: item.id},
  1206. res => {
  1207. if (res.code == "ok") {
  1208. this.projectApprocalDetail=res.data
  1209. }
  1210. });
  1211. },
  1212. batchImportData(item) {
  1213. //首先判断文件类型
  1214. let str = item.file.name.split(".");
  1215. let format = str[str.length - 1];
  1216. if (format != "xls" && format != "xlsx") {
  1217. this.$message({
  1218. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  1219. type: "error"
  1220. });
  1221. } else {
  1222. this.importingData = true;
  1223. let formData = new FormData();
  1224. formData.append("multipartFile", item.file);
  1225. formData.append("companyId", this.user.companyId)
  1226. this.http.uploadFile('/project-approval/importData', formData,
  1227. res => {
  1228. this.$refs.upload.clearFiles();
  1229. this.importingData = false;
  1230. if (res.code == "ok") {
  1231. //换成弹出框,以免有人等了半天回来啥也没看到
  1232. this.importResultMsg = "成功导入"+res.data+'立项数据'+(res.msg?res.msg:"");;
  1233. this.getList();
  1234. this.importDialog = false;
  1235. } else {
  1236. this.importResultMsg = this.$t('export.Importfailure')+":"+res.msg;
  1237. }
  1238. },
  1239. error => {
  1240. this.$refs.upload.clearFiles();
  1241. this.importingData = false;
  1242. this.$message({
  1243. message: error,
  1244. type: "error"
  1245. });
  1246. });
  1247. }
  1248. },
  1249. exportData(){
  1250. let parameter = {
  1251. keyword:this.keyword,
  1252. searchField: this.searchField,
  1253. category:this.statusClf,
  1254. status: this.status,
  1255. viewId:this.idx
  1256. }
  1257. this.http.post("/project-approval/exportData", parameter,
  1258. res => {
  1259. if (res.code == "ok") {
  1260. const a = document.createElement("a"); // 创建a标签
  1261. a.setAttribute("download", "立项导出.xlsx"); // download属性
  1262. a.setAttribute("href", res.data); // href链接
  1263. a.click(); // 自执行点击事件
  1264. a.remove();
  1265. } else {
  1266. this.$message({
  1267. message: res.msg,
  1268. type: "error"
  1269. });
  1270. }
  1271. },
  1272. error => {
  1273. this.$message({
  1274. message: error,
  1275. type: "error"
  1276. });
  1277. });
  1278. },
  1279. },
  1280. }
  1281. </script>
  1282. <style scoped>
  1283. .toolbar_formitem_n1{
  1284. margin-right: 0 !important;
  1285. }
  1286. .rg_span{
  1287. display: inline-block;
  1288. }
  1289. .classification {
  1290. width: 120px;
  1291. border-right: 1px solid #f2f2f2;
  1292. display: flex;
  1293. flex-wrap: wrap;
  1294. padding-top: 20px;
  1295. }
  1296. .classification p{
  1297. width: 120px;
  1298. text-align: center;
  1299. line-height: 50px;
  1300. margin: 0;
  1301. cursor: pointer;
  1302. }
  1303. .classification p:hover {
  1304. background: #dddddd;
  1305. }
  1306. .on {
  1307. color: #409EFF;
  1308. }
  1309. </style>