project_gantt.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <template>
  2. <div class="container">
  3. <div class="gantt_head">
  4. <div class="head_RorX">
  5. <el-radio-group v-model="radio1" @change="selChange()" size="small" style="margin-right:9px;width:280px">
  6. <el-radio-button :label="$t('an-ren-yuan-cha-kan')" value="renyuan"></el-radio-button>
  7. <el-radio-button :label="$t('an-xiang-mu-cha-kan')" value="xiangmu"></el-radio-button>
  8. <el-radio-button :label="$t('zi-yuan-xu-qiu')" value="demand"></el-radio-button>
  9. </el-radio-group>
  10. </div>
  11. <!-- 时间段筛选 -->
  12. <div class="head_date" v-if="isDataLoaded">
  13. <span>{{ $t('message.period') }}</span>
  14. <el-date-picker
  15. style="margin-left:9px;width:17vw"
  16. size="small"
  17. v-model="valueDate"
  18. type="daterange"
  19. :range-separator="$t('other.to')"
  20. :start-placeholder="$t('time.startDate')"
  21. :end-placeholder="$t('time.endDate')"
  22. value-format="yyyy-MM-dd"
  23. @change="dateupdata()">
  24. </el-date-picker>
  25. </div>
  26. <!-- 任务类型筛选 -->
  27. <div v-if="radio1 == $t('an-xiang-mu-cha-kan')" class="head_taskType">
  28. <span>{{ $t('ren-wu-lei-xing') }}</span>
  29. <el-select clearable filterable v-model="taskType" :placeholder="$t('defaultText.pleaseChoose')" size="small" style="margin-left:9px;width:10vw" @change="taskTypeSel()">
  30. <el-option :label="$t('other.task')" :value="0"></el-option>
  31. <el-option :label="$t('other.milestone')" :value="1"></el-option>
  32. </el-select>
  33. </div>
  34. <!-- 任务分组筛选 -->
  35. <div v-if="reqpar1" class="head_taskgroup">
  36. <span>{{ $t('other.taskGroup') }}</span>
  37. <el-select clearable filterable v-model="valuex2" :placeholder="$t('defaultText.pleaseChoose')" size="small" style="margin-left:9px;width:10vw" @change="taskgroupSel()">
  38. <el-option
  39. v-for="item in taskgroupList"
  40. :key="item.name"
  41. :label="item.name"
  42. :value="item.name"
  43. >
  44. </el-option>
  45. </el-select>
  46. </div>
  47. <!-- 人员/项目筛选 -->
  48. <div class="head_select">
  49. <span>{{(this.radio1 == $t('an-ren-yuan-cha-kan') ? $t('ren-yuan') : $t('other.project'))}}</span>
  50. <el-select v-if="reqpar1" clearable filterable v-model="valuex" :placeholder="$t('defaultText.pleaseChoose')" size="small" style="margin-left:9px;width:10vw" @change="optupdata()">
  51. <el-option v-for="item in screenList" :key="item.id" :label="item.projectName" :value="item.id">
  52. <span v-if="reqpar1" style="float: left;color: #8492a6;">{{ item.projectCode }}</span>
  53. <span v-if="reqpar1" style="float: right;font-size: 13px;margin-left: 20px">{{ item.projectName }}</span>
  54. </el-option>
  55. </el-select>
  56. <el-select v-if="!reqpar1 && user.userNameNeedTranslate != '1'" clearable filterable v-model="valuex" :placeholder="$t('defaultText.pleaseChoose')" size="small" style="margin-left:9px;width:10vw" @change="optupdata()">
  57. <el-option v-for="item in screenList" :key="item.id" :label="item.name" :value="item.id">
  58. </el-option>
  59. </el-select>
  60. <selectCat v-if="!reqpar1 && user.userNameNeedTranslate == '1'" style="margin-left:9px;" :size="'small'" :widthStr="'153'" :subject="screenList" :subjectId="valuex" :distinction="'1'" @selectCal="selectCal"></selectCat>
  61. </div>
  62. <!-- 资源需求导入/导出 -->
  63. <div class="head_files" v-if="!isDataLoaded">
  64. <div style="margin-left:10px;float:left;">
  65. <el-link type="primary" :underline="false" :href="'./upload/'+$t('zi-yuan-xu-qiu-dao-ru-mo-ban')+'.xlsx'" download="资源需求导入模板.xlsx">{{ $t('Downloadthetemplate') }}</el-link>
  66. </div>
  67. <el-upload ref="upload" style="margin-left:10px;float:left;" action="#" :limit="1" :http-request="importProject" :show-file-list="false">
  68. <el-link type="primary" :underline="false" >{{ $t('dao-ru-xu-qiu') }}</el-link>
  69. </el-upload>
  70. <div style="margin-left:10px;float:left;">
  71. <el-link type="primary" :underline="false" @click="exportProjectData" download="资源需求导出.xlsx">{{ $t('dao-chu-xu-qiu') }}</el-link>
  72. </div>
  73. </div>
  74. </div>
  75. <gantt v-if="isDataLoaded && user.userNameNeedTranslate != 1" ref="ganttTable1" class="left-container" :tasks="tasks"
  76. :stafforpro="radio1"
  77. :valueDate="valueDate"
  78. :key="updatakey1"></gantt>
  79. <vueGantt v-if="isDataLoaded && user.userNameNeedTranslate == 1" ref="ganttTable1" :stafforpro="radio1"
  80. :valueDate="valueDate"
  81. :key="updatakey1" :tasks="tasks"></vueGantt>
  82. <div class="demand-container" v-if="!isDataLoaded">
  83. <el-table height="90%" :loading="demandListLoading" :data="demandList">
  84. <el-table-column :label="$t('Itemno')" prop="projectCode" width="160"></el-table-column>
  85. <el-table-column :label="$t('headerTop.projectName')" prop="projectName" min-width="240"></el-table-column>
  86. <el-table-column :label="$t('jin-qi-ri-huo-yue-ren-yuan')" prop="activeUsers" min-width="240">
  87. <template slot-scope="scope">
  88. <div>
  89. <span v-if="user.userNameNeedTranslate == 1">
  90. <span v-for="(item, index) in scope.row.activeUsers" :key="index">
  91. <ww-open-data type='userName' :openid='item'></ww-open-data>
  92. <span v-if="index < scope.row.activeUsers.length - 1">,</span>
  93. </span>
  94. </span>
  95. <span v-if="user.userNameNeedTranslate != 1">
  96. {{scope.row.activeUsers}}
  97. </span>
  98. </div>
  99. </template>
  100. </el-table-column>
  101. <el-table-column :label="$t('starttimes') +' - '+ $t('time.endTime')" min-width="240">
  102. <template slot-scope="scope">
  103. <span>{{scope.row.startDate ? scope.row.startDate + ' ~ ' + scope.row.endDate : ''}}</span>
  104. </template>
  105. </el-table-column>
  106. <el-table-column :label="$t('he-tong-yao-qiu')" prop="contractReq" min-width="240" show-overflow-tooltip></el-table-column>
  107. <el-table-column :label="$t('li-cheng-bei-jin-du')" prop="milepost" min-width="280">
  108. <template slot-scope="scope">
  109. <span>{{scope.row.milepost ? scope.row.milepost.name + '\u3000'+$t('wan-cheng-shi-jian')+':' + scope.row.milepost.finishDate : ''}}</span>
  110. </template>
  111. </el-table-column>
  112. <el-table-column :label="$t('ren-yuan-xu-qiu')" prop="membReq" min-width="280"></el-table-column>
  113. <el-table-column :label="$t('ren-wu-xu-qiu')" prop="taskReq" min-width="280"></el-table-column>
  114. <el-table-column :label="$t('can-yu-bu-men-jin-du')" prop="departmentSpeed" min-width="280"></el-table-column>
  115. <el-table-column :label="$t('operation')" width="120" align="center" fixed="right">
  116. <template slot-scope="scope">
  117. <el-button @click="demandEdit(scope.row)" size="small">{{ $t('xiu-gai') }}</el-button>
  118. </template>
  119. </el-table-column>
  120. </el-table>
  121. <div class="poss">
  122. <el-pagination
  123. @size-change="handleSizeChange"
  124. @current-change="handleCurrentChange"
  125. :current-page="pageIndex"
  126. :page-sizes="[20, 50, 100, 200]"
  127. :page-size="20"
  128. layout="total, sizes, prev, pager, next"
  129. :total="total">
  130. </el-pagination>
  131. </div>
  132. <!-- 资源需求修改 -->
  133. <el-dialog v-if="demandEditDialog" width="500px" append-to-body :visible.sync="demandEditDialog" :title="$t('xiu-gai') +' - ' + editParameter.projectName">
  134. <el-form label-width="150">
  135. <el-form-item :label="$t('starttimes')">
  136. <el-date-picker
  137. style="width:350px"
  138. v-model="editDate1"
  139. type="date"
  140. :placeholder="$t('defaultText.pleaseChoose')"
  141. value-format="yyyy-MM-dd"></el-date-picker>
  142. </el-form-item>
  143. <el-form-item :label="$t('time.endTime')">
  144. <el-date-picker
  145. style="width:350px"
  146. v-model="editDate2"
  147. type="date"
  148. :placeholder="$t('defaultText.pleaseChoose')"
  149. value-format="yyyy-MM-dd"></el-date-picker>
  150. </el-form-item>
  151. <el-form-item :label="$t('ren-yuan-xu-qiu')">
  152. <el-input style="width:350px" v-model="editParameter.membReq" clearable></el-input>
  153. </el-form-item>
  154. <el-form-item :label="$t('ren-wu-xu-qiu')">
  155. <el-input style="width:350px" v-model="editParameter.taskReq" clearable></el-input>
  156. </el-form-item>
  157. <el-form-item :label="$t('he-tong-yao-qiu')">
  158. <el-input style="width:350px" v-model="editParameter.contractReq" clearable></el-input>
  159. </el-form-item>
  160. <el-form-item :label="$t('bu-men-jin-du')">
  161. <el-input style="width:350px" v-model="editParameter.departmentSpeed" clearable></el-input>
  162. </el-form-item>
  163. </el-form>
  164. <div slot="footer" class="dialog-footer">
  165. <el-button type="default" @click="demandEditDialog = false">{{ $t('btn.cancel') }}</el-button>
  166. <el-button type="primary" @click="demandEditSure" >{{ $t('btn.determine') }}</el-button>
  167. </div>
  168. </el-dialog>
  169. </div>
  170. </div>
  171. </template>
  172. <script>
  173. import { error } from 'dingtalk-jsapi';
  174. import Gantt from './gantt.vue';
  175. import vueGantt from './vueGantt.vue'
  176. // 自定义select组件
  177. import SelectCat from "@/components/select.vue"
  178. export default {
  179. name: 'project_gantt',
  180. props: {},
  181. components: {Gantt, vueGantt, SelectCat},
  182. data() {
  183. return {
  184. taskType: '',
  185. isDataLoaded:false,
  186. tasks: {
  187. data : [],
  188. links: []
  189. },
  190. tasks1: {links:[]},
  191. updatakey1: 1,
  192. updatakey2: -1,
  193. radio1:this.$t('an-ren-yuan-cha-kan'),
  194. valueDate:[],
  195. options:[{value:this.$t('xuan-xiang-1'),label:this.$t('all')},{value:this.$t('xuan-xiang-2'),label:this.$t('ren-yuan')+"1"}],
  196. valuex:'',
  197. screenList:[],
  198. // 请求参数
  199. reqpar1:0,
  200. reqpar2:[],
  201. demandListLoading: false,
  202. demandList: [],
  203. pageIndex: 1,
  204. pageSize: 20,
  205. demandEditDialog: false,
  206. editParameter: {},
  207. editDate1: '',
  208. editDate2: '',
  209. taskgroupList: [],
  210. valuex2: '',
  211. user: JSON.parse(sessionStorage.getItem("user")),
  212. };
  213. },
  214. computed: {},
  215. watch: {},
  216. created() {},
  217. mounted() {
  218. let nowdate = new Date()
  219. let nowmonth = nowdate.getMonth() + 1
  220. let startdate = nowdate.getFullYear() + "-" + (nowmonth < 10 ? "0" + nowmonth : nowmonth) + "-" + (nowdate.getDate() < 10 ? "0" + nowdate.getDate() : nowdate.getDate())
  221. let udate = new Date(nowdate.getFullYear(),nowdate.getMonth(),nowdate.getDate() + 31)
  222. let endmonth = udate.getMonth() + 1
  223. let enddate = udate.getFullYear() + "-" + (endmonth < 10 ? "0" + endmonth : endmonth) + "-" + (udate.getDate() < 10 ? "0" + udate.getDate() : udate.getDate())
  224. this.valueDate = [startdate,enddate]
  225. this.valueDate2 = this.valueDate
  226. this.reqpar2 = this.valueDate
  227. // console.log("date",this.valueDate);
  228. this.getList();
  229. this.getScreen()
  230. // this.tasks1 = this.tasks
  231. this.isDataLoaded = true
  232. },
  233. methods: {
  234. selectCal(obj) {
  235. if(obj.distinction == '1') {
  236. this.valuex = obj.id
  237. this.optupdata()
  238. }
  239. },
  240. setGroup() {
  241. this.$refs.ganttTable1.setGroup();
  242. // this.$refs.ganttTable2.setGroup();
  243. },
  244. taskTypeSel(){
  245. console.log(this.taskType);
  246. this.getList()
  247. },
  248. // 资源需求导出
  249. exportProjectData() {
  250. let parameter = {}
  251. if(this.valuex){
  252. parameter.projectId = this.valuex
  253. }
  254. if(this.valuex2){
  255. parameter.groupName = this.valuex2
  256. }
  257. this.http.post('/project-requirement/exportData',parameter,
  258. res => {
  259. if (res.code == "ok") {
  260. let filePath = res.data;
  261. const a = document.createElement('a'); // 创建a标签
  262. a.setAttribute('download', this.$t('zi-yuan-xu-qiu-dao-chu')+'.xls');// download属性
  263. a.setAttribute('href', filePath);// href链接
  264. a.click(); //自执行点击事件
  265. a.remove();
  266. }
  267. },
  268. error => {
  269. this.$message({
  270. message: error,
  271. type: "error"
  272. });
  273. }
  274. );
  275. },
  276. // 资源需求导入
  277. importProject(item) {
  278. //首先判断文件类型
  279. let str = item.file.name.split(".");
  280. let format = str[str.length - 1];
  281. if (format != "xls" && format != "xlsx") {
  282. this.$message({
  283. message: this.$t('other.PleaseselecttheXLSorXLSXfile'),
  284. type: "error"
  285. });
  286. } else {
  287. let formData = new FormData();
  288. formData.append("multipartFile", item.file);
  289. this.http.uploadFile('/project-requirement/importData', formData,
  290. res => {
  291. this.$refs.upload.clearFiles();
  292. if (res.code == "ok") {
  293. this.$message({
  294. message: this.$t('other.importSuccess'),
  295. type: "success"
  296. });
  297. this.getDemandList();
  298. } else {
  299. this.$message({
  300. message: res.msg,
  301. type: "error"
  302. });
  303. }
  304. },
  305. error => {
  306. this.$refs.upload.clearFiles();
  307. this.$message({
  308. message: error,
  309. type: "error"
  310. });
  311. });
  312. }
  313. },
  314. // 人员/项目切换
  315. selChange(){
  316. this.valuex = null
  317. // console.log("切换按钮",this.radio1);
  318. if (this.radio1 == this.$t('an-ren-yuan-cha-kan')) {
  319. this.isDataLoaded = true
  320. this.reqpar1 = 0
  321. this.getList()
  322. this.getScreen()
  323. }else if(this.radio1 == this.$t('an-xiang-mu-cha-kan')){
  324. this.isDataLoaded = true
  325. this.reqpar1 = 1
  326. this.getList()
  327. this.getXmScreen()
  328. this.getTaskgroupList()
  329. }else {
  330. this.reqpar1 = 1
  331. this.isDataLoaded = false
  332. this.pageIndex = 1
  333. this.pageSize = 20
  334. this.valuex = ''
  335. this.valuex2 = ''
  336. this.getDemandList()
  337. this.getXmScreen()
  338. this.getTaskgroupList()
  339. }
  340. },
  341. // 时间段改变
  342. dateupdata(){
  343. this.reqpar2 = this.valueDate
  344. if(this.isDataLoaded){
  345. this.getList()
  346. }else {
  347. this.getDemandList()
  348. }
  349. },
  350. // 人员/项目筛选改变
  351. optupdata(){
  352. // console.log(this.valuex);
  353. if(this.isDataLoaded){
  354. this.getList()
  355. }else{
  356. this.getDemandList()
  357. }
  358. },
  359. // 任务分组筛选改变
  360. taskgroupSel(){
  361. // console.log(this.valuex2);
  362. if(this.isDataLoaded){
  363. this.getList()
  364. }else{
  365. this.getDemandList()
  366. }
  367. },
  368. handleSizeChange(val){
  369. this.pageSize = val
  370. this.pageIndex = 1
  371. this.getDemandList()
  372. },
  373. handleCurrentChange(val){
  374. this.pageIndex = val
  375. this.getDemandList()
  376. },
  377. // 资源需求修改
  378. demandEdit(row){
  379. console.log(row);
  380. this.demandEditDialog = true
  381. this.editParameter = JSON.parse(JSON.stringify(row))
  382. this.editDate1 = this.editParameter.startDate
  383. this.editDate2 = this.editParameter.endDate
  384. // console.log('edit',this.demandEditDialog);
  385. },
  386. demandEditSure(){
  387. this.editParameter.startDate = this.editDate1
  388. this.editParameter.endDate = this.editDate2
  389. delete this.editParameter.reStartDate
  390. delete this.editParameter.reEndDate
  391. delete this.editParameter.milepost
  392. this.http.post('/project-requirement/addOrMod',this.editParameter,
  393. res => {
  394. if(res.code == 'ok'){
  395. this.$message({
  396. message: this.$t('message.modifyTheSuccess'),
  397. type: 'success'
  398. })
  399. this.demandEditDialog = false
  400. this.getDemandList()
  401. }else {
  402. this.$message({
  403. message: res.msg,
  404. type: 'error'
  405. })
  406. }
  407. },err => {
  408. this.$message({
  409. message: err,
  410. type: 'error'
  411. })
  412. })
  413. },
  414. // 获取人员项目筛选列表
  415. getScreen(){
  416. this.http.get('/project/getMyUsers',
  417. res => {
  418. if (res.code == "ok") {
  419. this.screenList = res.data
  420. }else{
  421. this.$message({
  422. message: res.msg,
  423. type: "error"
  424. });
  425. }
  426. },
  427. error => {
  428. this.$message({
  429. message : error,
  430. type : "error"
  431. })
  432. }
  433. )
  434. },
  435. getXmScreen(){
  436. this.http.get('/project/getProjectList',
  437. res => {
  438. if (res.code == "ok") {
  439. this.screenList = res.data
  440. // console.log("screen",this.screenList);
  441. }else{
  442. this.$message({
  443. message: res.msg,
  444. type: "error"
  445. });
  446. }
  447. },
  448. error => {
  449. this.$message({
  450. message : error,
  451. type : "error"
  452. })
  453. }
  454. )
  455. },
  456. // 获取任务分组筛选列表
  457. getTaskgroupList(){
  458. this.http.post('/task-group/getGroupNames',{},
  459. res => {
  460. if(res.code == 'ok'){
  461. this.taskgroupList = res.data
  462. }else {
  463. this.$message({
  464. message: res.msg,
  465. type: 'error'
  466. })
  467. }
  468. },err => {
  469. this.$message({
  470. message: err,
  471. type: 'error'
  472. })
  473. })
  474. },
  475. // 获取甘特图数据
  476. getList() {
  477. let getlistcs = {type : this.reqpar1 , startDate : this.reqpar2[0] , endDate : this.reqpar2[1]}
  478. if(this.reqpar1) {
  479. if(this.valuex != ''){
  480. getlistcs.projectId = this.valuex
  481. }
  482. if(this.valuex2 != ''){
  483. getlistcs.groupName = this.valuex2
  484. }
  485. getlistcs.taskType = this.taskType
  486. }else {
  487. if(this.valuex != ''){
  488. getlistcs.userId = this.valuex
  489. }
  490. }
  491. var urls = ''
  492. if(this.user.userNameNeedTranslate == '1') {
  493. urls = '/project/getGanttDataNew'
  494. } else {
  495. urls = '/project/getGanttData'
  496. }
  497. this.http.post(urls, getlistcs ,
  498. // this.http.post('/project/getGanttDataNew', getlistcs,
  499. res => {
  500. if (res.code == "ok") {
  501. for(var i in res.data) {
  502. if(res.data[i].id.indexOf(this.$t('chu-cha')) != '-1') {
  503. res.data[i].color = '#E6A23C'
  504. }
  505. if(res.data[i].id.indexOf(this.$t('other.AskForLeave')) != '-1') {
  506. res.data[i].color = '#F56C6C'
  507. }
  508. }
  509. this.tasks = {data:res.data};
  510. if(this.user.userNameNeedTranslate != '1') {
  511. let taskson = []
  512. for(let m in this.tasks.data){
  513. this.tasks.data[m].render = null
  514. if(this.tasks.data[m].time != 0){
  515. if(this.tasks.data[m].id != this.tasks.data[m].userId){
  516. this.tasks.data[m].render = 'split'
  517. let item = JSON.parse(JSON.stringify(this.tasks.data[m]))
  518. item.parent = this.tasks.data[m].id
  519. item.id = this.tasks.data[m].id + 'son'
  520. taskson.push(item)
  521. this.tasks.data[m].time = 0
  522. }
  523. }
  524. }
  525. this.tasks.data.push.apply(this.tasks.data,taskson)
  526. for(let i in this.tasks.data){
  527. if(this.tasks.data[i].time == 0){
  528. delete this.tasks.data[i].start_date
  529. delete this.tasks.data[i].end_date
  530. this.tasks.data[i].type = 'milestone'
  531. }
  532. if(this.tasks.data[i].end_date){
  533. let date = new Date(this.tasks.data[i].end_date)
  534. let date2 = new Date(date.getFullYear(),date.getMonth(),date.getDate() + 1)
  535. let dmonth = date2.getMonth() + 1
  536. let dday = date2.getDate()
  537. this.tasks.data[i].end_date = date2.getFullYear() + '-' + (dmonth < 10 ? '0' + dmonth : dmonth) + '-' + (dday < 10 ? '0' + dday : dday)
  538. }
  539. }
  540. }
  541. console.log('ganttData',this.tasks.data);
  542. this.$nextTick(()=>{
  543. this.updatakey1 += 1
  544. })
  545. } else {
  546. this.$message({
  547. message: res.msg,
  548. type: "error"
  549. });
  550. }
  551. },
  552. error => {
  553. this.$message({
  554. message: error,
  555. type: "error"
  556. });
  557. }
  558. );
  559. },
  560. // 获取资源需求列表
  561. getDemandList(){
  562. let parameter = {
  563. pageIndex: this.pageIndex,
  564. pageSize: this.pageSize,
  565. }
  566. if(this.valuex != ''){
  567. parameter.projectId = this.valuex
  568. }
  569. if(this.valuex2 != ''){
  570. parameter.groupName = this.valuex2
  571. }
  572. this.demandListLoading = true
  573. this.http.post('/project-requirement/listByPage',parameter,
  574. res => {
  575. if(res.code == 'ok'){
  576. this.demandListLoading = false
  577. this.total = res.data.total
  578. if(this.user.userNameNeedTranslate == 1) {
  579. for(let i in res.data.records) {
  580. if(res.data.records[i].activeUsers){
  581. res.data.records[i].activeUsers = res.data.records[i].activeUsers.split(',')
  582. }
  583. }
  584. }
  585. this.demandList = res.data.records
  586. }else {
  587. this.demandListLoading = false
  588. this.$message({
  589. message: res.msg,
  590. type: 'error'
  591. })
  592. }
  593. },err => {
  594. this.demandListLoading = false
  595. this.$message({
  596. message: err,
  597. type: 'error'
  598. })
  599. })
  600. },
  601. },
  602. };
  603. </script>
  604. <style scoped lang="scss">
  605. .container {
  606. height: 100%;
  607. width: 100%;
  608. }
  609. .left-container {
  610. overflow: hidden;
  611. position: relative;
  612. height: 90%;
  613. }
  614. .demand-container{
  615. overflow: hidden;
  616. position: relative;
  617. height: 92%;
  618. }
  619. .gantt_head{
  620. width: 100%;
  621. height: 80px;
  622. display: flex;
  623. justify-content: space-between;
  624. align-items: center;
  625. }
  626. .gantt_head .head_RorX{
  627. width: 280px;
  628. }
  629. .gantt_head .head_date{
  630. width: 22vw;
  631. }
  632. .gantt_head .head_taskgroup{
  633. width: 15vw;
  634. }
  635. .gantt_head .head_taskType{
  636. width: 15vw;
  637. }
  638. .gantt_head .head_select{
  639. width: 15vw;
  640. }
  641. .gantt_head .head_files{
  642. width: 17vw;
  643. }
  644. .poss {
  645. height: 8%;
  646. float: right;
  647. padding-top: 5px;
  648. }
  649. </style>