瀏覽代碼

Merge branch 'insist' into http_test

qinzhipeng_v@didiglobal.com 4 年之前
父節點
當前提交
edd2c9799c

+ 0 - 179
src/excel/Blob.js.js

@@ -1,179 +0,0 @@
-/* eslint-disable */
-/* Blob.js
- * A Blob implementation.
- * 2014-05-27
- *
- * By Eli Grey, http://eligrey.com
- * By Devin Samarin, https://github.com/eboyjr
- * License: X11/MIT
- *   See LICENSE.md
- */
-
-/*global self, unescape */
-/*jslint bitwise: true, regexp: true, confusion: true, es5: true, vars: true, white: true,
- plusplus: true */
-
-/*! @source http://purl.eligrey.com/github/Blob.js/blob/master/Blob.js */
-
-(function (view) {
-  "use strict";
-
-  view.URL = view.URL || view.webkitURL;
-
-  if (view.Blob && view.URL) {
-      try {
-          new Blob;
-          return;
-      } catch (e) {}
-  }
-
-  // Internally we use a BlobBuilder implementation to base Blob off of
-  // in order to support older browsers that only have BlobBuilder
-  var BlobBuilder = view.BlobBuilder || view.WebKitBlobBuilder || view.MozBlobBuilder || (function(view) {
-          var
-              get_class = function(object) {
-                  return Object.prototype.toString.call(object).match(/^\[object\s(.*)\]$/)[1];
-              }
-              , FakeBlobBuilder = function BlobBuilder() {
-                  this.data = [];
-              }
-              , FakeBlob = function Blob(data, type, encoding) {
-                  this.data = data;
-                  this.size = data.length;
-                  this.type = type;
-                  this.encoding = encoding;
-              }
-              , FBB_proto = FakeBlobBuilder.prototype
-              , FB_proto = FakeBlob.prototype
-              , FileReaderSync = view.FileReaderSync
-              , FileException = function(type) {
-                  this.code = this[this.name = type];
-              }
-              , file_ex_codes = (
-                  "NOT_FOUND_ERR SECURITY_ERR ABORT_ERR NOT_READABLE_ERR ENCODING_ERR "
-                  + "NO_MODIFICATION_ALLOWED_ERR INVALID_STATE_ERR SYNTAX_ERR"
-              ).split(" ")
-              , file_ex_code = file_ex_codes.length
-              , real_URL = view.URL || view.webkitURL || view
-              , real_create_object_URL = real_URL.createObjectURL
-              , real_revoke_object_URL = real_URL.revokeObjectURL
-              , URL = real_URL
-              , btoa = view.btoa
-              , atob = view.atob
-
-              , ArrayBuffer = view.ArrayBuffer
-              , Uint8Array = view.Uint8Array
-              ;
-          FakeBlob.fake = FB_proto.fake = true;
-          while (file_ex_code--) {
-              FileException.prototype[file_ex_codes[file_ex_code]] = file_ex_code + 1;
-          }
-          if (!real_URL.createObjectURL) {
-              URL = view.URL = {};
-          }
-          URL.createObjectURL = function(blob) {
-              var
-                  type = blob.type
-                  , data_URI_header
-                  ;
-              if (type === null) {
-                  type = "application/octet-stream";
-              }
-              if (blob instanceof FakeBlob) {
-                  data_URI_header = "data:" + type;
-                  if (blob.encoding === "base64") {
-                      return data_URI_header + ";base64," + blob.data;
-                  } else if (blob.encoding === "URI") {
-                      return data_URI_header + "," + decodeURIComponent(blob.data);
-                  } if (btoa) {
-                      return data_URI_header + ";base64," + btoa(blob.data);
-                  } else {
-                      return data_URI_header + "," + encodeURIComponent(blob.data);
-                  }
-              } else if (real_create_object_URL) {
-                  return real_create_object_URL.call(real_URL, blob);
-              }
-          };
-          URL.revokeObjectURL = function(object_URL) {
-              if (object_URL.substring(0, 5) !== "data:" && real_revoke_object_URL) {
-                  real_revoke_object_URL.call(real_URL, object_URL);
-              }
-          };
-          FBB_proto.append = function(data/*, endings*/) {
-              var bb = this.data;
-              // decode data to a binary string
-              if (Uint8Array && (data instanceof ArrayBuffer || data instanceof Uint8Array)) {
-                  var
-                      str = ""
-                      , buf = new Uint8Array(data)
-                      , i = 0
-                      , buf_len = buf.length
-                      ;
-                  for (; i < buf_len; i++) {
-                      str += String.fromCharCode(buf[i]);
-                  }
-                  bb.push(str);
-              } else if (get_class(data) === "Blob" || get_class(data) === "File") {
-                  if (FileReaderSync) {
-                      var fr = new FileReaderSync;
-                      bb.push(fr.readAsBinaryString(data));
-                  } else {
-                      // async FileReader won't work as BlobBuilder is sync
-                      throw new FileException("NOT_READABLE_ERR");
-                  }
-              } else if (data instanceof FakeBlob) {
-                  if (data.encoding === "base64" && atob) {
-                      bb.push(atob(data.data));
-                  } else if (data.encoding === "URI") {
-                      bb.push(decodeURIComponent(data.data));
-                  } else if (data.encoding === "raw") {
-                      bb.push(data.data);
-                  }
-              } else {
-                  if (typeof data !== "string") {
-                      data += ""; // convert unsupported types to strings
-                  }
-                  // decode UTF-16 to binary string
-                  bb.push(unescape(encodeURIComponent(data)));
-              }
-          };
-          FBB_proto.getBlob = function(type) {
-              if (!arguments.length) {
-                  type = null;
-              }
-              return new FakeBlob(this.data.join(""), type, "raw");
-          };
-          FBB_proto.toString = function() {
-              return "[object BlobBuilder]";
-          };
-          FB_proto.slice = function(start, end, type) {
-              var args = arguments.length;
-              if (args < 3) {
-                  type = null;
-              }
-              return new FakeBlob(
-                  this.data.slice(start, args > 1 ? end : this.data.length)
-                  , type
-                  , this.encoding
-              );
-          };
-          FB_proto.toString = function() {
-              return "[object Blob]";
-          };
-          FB_proto.close = function() {
-              this.size = this.data.length = 0;
-          };
-          return FakeBlobBuilder;
-      }(view));
-
-  view.Blob = function Blob(blobParts, options) {
-      var type = options ? (options.type || "") : "";
-      var builder = new BlobBuilder();
-      if (blobParts) {
-          for (var i = 0, len = blobParts.length; i < len; i++) {
-              builder.append(blobParts[i]);
-          }
-      }
-      return builder.getBlob(type);
-  };
-}(typeof self !== "undefined" && self || typeof window !== "undefined" && window || this.content || this));

+ 0 - 141
src/excel/Export2Excel.js

@@ -1,141 +0,0 @@
-/* eslint-disable */
-require('script-loader!file-saver');
-require('./Blob.js');
-require('script-loader!xlsx/dist/xlsx.core.min');
-function generateArray(table) {
-    var out = [];
-    var rows = table.querySelectorAll('tr');
-    var ranges = [];
-    for (var R = 0; R < rows.length; ++R) {
-        var outRow = [];
-        var row = rows[R];
-        var columns = row.querySelectorAll('td');
-        for (var C = 0; C < columns.length; ++C) {
-            var cell = columns[C];
-            var colspan = cell.getAttribute('colspan');
-            var rowspan = cell.getAttribute('rowspan');
-            var cellValue = cell.innerText;
-            if (cellValue !== "" && cellValue == +cellValue) cellValue = +cellValue;
-
-            //Skip ranges
-            ranges.forEach(function (range) {
-                if (R >= range.s.r && R <= range.e.r && outRow.length >= range.s.c && outRow.length <= range.e.c) {
-                    for (var i = 0; i <= range.e.c - range.s.c; ++i) outRow.push(null);
-                }
-            });
-
-            //Handle Row Span
-            if (rowspan || colspan) {
-                rowspan = rowspan || 1;
-                colspan = colspan || 1;
-                ranges.push({s: {r: R, c: outRow.length}, e: {r: R + rowspan - 1, c: outRow.length + colspan - 1}});
-            }
-            ;
-
-            //Handle Value
-            outRow.push(cellValue !== "" ? cellValue : null);
-
-            //Handle Colspan
-            if (colspan) for (var k = 0; k < colspan - 1; ++k) outRow.push(null);
-        }
-        out.push(outRow);
-    }
-    return [out, ranges];
-};
-
-function datenum(v, date1904) {
-    if (date1904) v += 1462;
-    var epoch = Date.parse(v);
-    return (epoch - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1000);
-}
-
-function sheet_from_array_of_arrays(data, opts) {
-    var ws = {};
-    var range = {s: {c: 10000000, r: 10000000}, e: {c: 0, r: 0}};
-    for (var R = 0; R != data.length; ++R) {
-        for (var C = 0; C != data[R].length; ++C) {
-            if (range.s.r > R) range.s.r = R;
-            if (range.s.c > C) range.s.c = C;
-            if (range.e.r < R) range.e.r = R;
-            if (range.e.c < C) range.e.c = C;
-            var cell = {v: data[R][C]};
-            if (cell.v == null) continue;
-            var cell_ref = XLSX.utils.encode_cell({c: C, r: R});
-
-            if (typeof cell.v === 'number') cell.t = 'n';
-            else if (typeof cell.v === 'boolean') cell.t = 'b';
-            else if (cell.v instanceof Date) {
-                cell.t = 'n';
-                cell.z = XLSX.SSF._table[14];
-                cell.v = datenum(cell.v);
-            }
-            else cell.t = 's';
-
-            ws[cell_ref] = cell;
-        }
-    }
-    if (range.s.c < 10000000) ws['!ref'] = XLSX.utils.encode_range(range);
-    return ws;
-}
-
-function Workbook() {
-    if (!(this instanceof Workbook)) return new Workbook();
-    this.SheetNames = [];
-    this.Sheets = {};
-}
-
-function s2ab(s) {
-    var buf = new ArrayBuffer(s.length);
-    var view = new Uint8Array(buf);
-    for (var i = 0; i != s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
-    return buf;
-}
-
-export function export_table_to_excel(id) {
-    var theTable = document.getElementById(id);
-    console.log('a')
-    var oo = generateArray(theTable);
-    var ranges = oo[1];
-
-    /* original data */
-    var data = oo[0];
-    var ws_name = "SheetJS";
-    console.log(data);
-
-    var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
-
-    /* add ranges to worksheet */
-    // ws['!cols'] = ['apple', 'banan'];
-    ws['!merges'] = ranges;
-
-    /* add worksheet to workbook */
-    wb.SheetNames.push(ws_name);
-    wb.Sheets[ws_name] = ws;
-
-    var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
-
-    saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), "test.xlsx")
-}
-
-function formatJson(jsonData) {
-    console.log(jsonData)
-}
-export function export_json_to_excel(th, jsonData, defaultTitle) {
-
-    /* original data */
-
-    var data = jsonData;
-    data.unshift(th);
-    var ws_name = "SheetJS";
-
-    var wb = new Workbook(), ws = sheet_from_array_of_arrays(data);
-
-
-    /* add worksheet to workbook */
-    wb.SheetNames.push(ws_name);
-    wb.Sheets[ws_name] = ws;
-
-    var wbout = XLSX.write(wb, {bookType: 'xlsx', bookSST: false, type: 'binary'});
-    var title = defaultTitle || '列表'
-    saveAs(new Blob([s2ab(wbout)], {type: "application/octet-stream"}), title + ".xlsx")
-}

+ 41 - 0
src/mixins/websocket.js

@@ -0,0 +1,41 @@
+export default {
+  name: 'test',
+  data() {
+    return {
+      websocketUrl: '',
+      websocket: null,
+      requestData: null,
+      responseData: null
+    }
+  },
+  created() {
+    this.initWebSocket()
+  },
+  destroyed() {
+    this.websocketClose() // 离开路由之后断开websocket连接
+  },
+  methods: {
+    initWebSocket() { // websocket
+      this.websocket = new WebSocket(this.websocketUrl)
+      this.websocket.onmessage = this.websocketOnmessage
+      this.websocket.onopen = this.websocketOnopen
+      this.websocket.onerror = this.websocketOnerror
+      this.websocket.onclose = this.websocketClose
+    },
+    websocketOnopen() { // 连接建立之后执行send方法发送数据
+      this.websocketSend(this.requestData)
+    },
+    websocketOnerror() { // 连接失败重连
+      this.initWebSocket()
+    },
+    websocketOnmessage(e) { // 数据接收
+      this.responseData = e.data
+    },
+    websocketSend(Data) { // 数据发送
+      this.websocket.send(this.requestData)
+    },
+    websocketClose(e) { // 关闭
+      this.websocket.close()
+    }
+  }
+}

+ 153 - 0
src/views/projectManage/requirement/components/ganntViews.vue

@@ -0,0 +1,153 @@
+<template>
+  <div class="ganntt-parent">
+    <gantt-elastic
+      v-if="ganttElastic"
+      :options="options"
+      :tasks="tasks"
+    >
+      <gantt-header slot="header" />
+    </gantt-elastic>
+  </div>
+</template>
+
+<script>
+import GanttElastic from 'gantt-elastic'
+import GanttHeader from 'gantt-elastic-header'
+import teamGanttOptions from './../gannttOptions/requireGannt'
+import { listByRequire } from '@/api/requirement.js'
+import moment from 'moment'
+
+export default {
+  components: {
+    GanttElastic,
+    GanttHeader
+  },
+  data() {
+    return {
+      ganttElastic: false,
+      tasks: [],
+      scheduleDetail: [],
+      options: teamGanttOptions, // 甘特图配置
+      dynamicStyle: {},
+      mun: {}
+    }
+  },
+  mounted() {
+    this.listByRequire()
+  },
+  methods: {
+    async listByRequire() { // 获取排期列表
+      const res = await listByRequire(Number(this.$route.query.id))
+      if (res.code === 200) {
+        this.mun = res.data.scheduleDetailRespons
+        this.handleData(res.data.taskDetailList)
+        this.scheduleDetailRespons(res.data.scheduleDetailRespons)
+      }
+    },
+    handleData(data) {
+      this.ganttElastic = false
+      this.tasks = []
+      this.tasks = data.map((value, key) => {
+        return this.handleItem(value, key)
+      })
+      this.ganttElastic = true
+      this.$nextTick(() => {
+        this.setOption()
+      })
+    },
+
+    handleItem(item, key) {
+      let data = ''
+      for (const key in this.mun) {
+        if (Number(key) === item.id) {
+          data = this.mun[key].length
+        }
+      }
+      const colorlist = ['#A1DEFF', '#FAB5B5', '#BCED86', '#FFA87F', '#8E44AD', '#1EBC61', '#0287D0']
+      return {
+        id: item.id,
+        taskName: item.name,
+        label: item.name,
+        belongModules: item.moduleInfoName || '',
+        devPerson: item.rdObject.name || '',
+        testPerson: item.qaObject.name || '',
+        description: data + '个排期',
+        startDate: item.optionsObject.startTime ? moment(item.optionsObject.startTime).format('YYYY-MM-DD') : '',
+        endDate: item.optionsObject.endTime ? moment(item.optionsObject.endTime).format('YYYY-MM-DD') : '',
+        needLegalAllDays: item.optionsObject.workDays + '/' + item.optionsObject.days,
+        type: 'task',
+        percent: 0,
+        html: true,
+        start: moment(item.optionsObject.startTime).toDate().getTime(),
+        duration: moment(item.optionsObject.endTime).toDate().getTime() - moment(item.optionsObject.startTime).toDate().getTime(),
+        style: {
+          base: {
+            fill: colorlist[key % colorlist.length]
+          }
+        }
+      }
+    },
+
+    scheduleDetailRespons(data) { // 处理排期
+      const colorlist = ['#A1DEFF', '#FAB5B5', '#BCED86', '#FFA87F', '#8E44AD', '#1EBC61', '#0287D0']
+      for (const key in data) {
+        const arr = data[key]
+        for (const vel in arr) {
+          const ds = {
+            id: arr[vel].id,
+            taskName: '',
+            label: arr[vel].desc ? arr[vel].name + '-' + arr[vel].desc : arr[vel].name,
+            description: arr[vel].desc ? arr[vel].name + '-' + arr[vel].desc : arr[vel].name,
+            startDate: arr[vel].dayList[0],
+            endDate: arr[vel].dayList[arr[vel].dayList.length - 1],
+            needLegalAllDays: arr[vel].dayLength + '/' + arr[vel].days,
+            type: 'task',
+            percent: 0,
+            html: true,
+            parentId: Number(key),
+            start: moment(arr[vel].dayList[0]).toDate().getTime(),
+            duration: moment(arr[vel].dayList[arr[vel].dayList.length - 1]).toDate().getTime() - moment(arr[vel].dayList[0]).toDate().getTime(),
+            style: {
+              base: {
+                fill: colorlist[key % colorlist.length]
+              }
+            }
+          }
+          this.scheduleDetail.push(ds)
+        }
+      }
+      this.tasks = this.tasks.concat(this.scheduleDetail)
+    },
+
+    setOption() {
+      const node = document.querySelectorAll('.gantt-elastic__header-label')
+      node[0].style = 'display: none'
+      node[1].style = 'display: none'
+      node[2].style = 'display: none'
+      node[3].removeChild(node[3].childNodes[0])
+      const span = document.createElement('span')
+      span.innerText = '列表区域 :'
+      node[3].insertBefore(span, node[3].childNodes[0])
+    }
+  }
+}
+</script>
+
+<style lang="scss" scoped>
+.ganntt-parent {
+  margin: 0 20px 20px;
+  >>>.gantt-elastic__header {
+    display: block !important;
+    background: #FFF !important;
+  }
+  >>>.gantt-elastic__header-title {
+    display: none;
+  }
+ >>>.gantt-elastic__header-btn-recenter {
+    display: none;
+ }
+ >>>.gantt-elastic__header-task-list-switch--wrapper {
+    display: none;
+ }
+}
+</style>

+ 175 - 0
src/views/projectManage/requirement/gannttOptions/requireGannt.js

@@ -0,0 +1,175 @@
+const options = {
+  taskMapping: {
+    progress: 'percent'
+  },
+  maxRows: 100,
+  maxHeight: 460,
+  title: {
+    label: 'Your project title as html (link or whatever...)',
+    html: false
+  },
+  row: {
+    height: 24
+  },
+  calendar: {
+    hour: {
+      display: true
+    }
+  },
+  chart: {
+    progress: {
+      bar: false
+    },
+    expander: {
+      display: true
+    }
+  },
+  taskList: {
+    expander: {
+      straight: false
+    },
+    columns: [
+      {
+        id: 1,
+        label: '任务名称',
+        value: 'taskName',
+        width: 150,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 2,
+        label: '所属模块',
+        value: 'belongModules',
+        width: 100,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 3,
+        label: '开发负责人',
+        value: 'devPerson',
+        width: 80,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 4,
+        label: '测试负责人',
+        value: 'testPerson',
+        width: 80,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 5,
+        label: '排期类型及描述',
+        value: 'description',
+        width: 180,
+        expander: true,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 6,
+        label: '开始时间',
+        value: 'startDate',
+        width: 90,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 7,
+        label: '结束时间',
+        value: 'endDate',
+        width: 90,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      },
+      {
+        id: 8,
+        label: '时长/周期',
+        value: 'needLegalAllDays',
+        width: 130,
+        style: {
+          'task-list-header-label': {
+            'text-align': 'center',
+            width: '100%'
+          },
+          'task-list-item-value-container': {
+            'text-align': 'center',
+            width: '100%'
+          }
+        }
+      }
+    ]
+  },
+  locale: {
+    Now: 'Now',
+    'X-Scale': 'Zoom-X',
+    'Y-Scale': 'Zoom-Y',
+    'Task list width': 'Task1 list',
+    'Before/After': 'Expand',
+    'Display task list': 'Task list',
+    name: 'zh_cn',
+    weekdays: ['周天', '周一', '周二', '周三', '周四', '周五', '周六'],
+    months: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
+  }
+} // 甘特图配置
+export default options

+ 136 - 6
src/views/projectManage/requirement/requirementDetail.vue

@@ -176,8 +176,11 @@
           </div>
           <section class="main-section">
             <div class="allTips">
-              <div class="tips"><i class="el-icon-warning-outline" /> 每个任务仅支持一次提测和一次准出,请合理拆解后任务再排期</div><br>
-              <div class="allTips">
+              <el-radio-group v-model="listOrGannt" size="small" style="margin-left: 10px">
+                <el-radio-button label="列表" />
+                <el-radio-button label="甘特图" />
+              </el-radio-group>
+              <div v-show="listOrGannt === '列表'" class="allTips">
                 <div v-if="BackToTheLatest" class="Scheduling" @click="GetRequireScheduleHistory"><i class="el-icon-refresh" /> 回到最新</div>
                 <div v-if="Latest" align="left" class="Scheduling" @click="scheduleHiHide"><div class="el-icon-document" /> 排期变更记录</div>
                 <download :id="requirementId" :name="'需求'" />
@@ -185,7 +188,7 @@
             </div>
           </section>
 
-          <el-container>
+          <el-container v-show="listOrGannt === '列表'" class="allTips">
             <el-main style="padding: 0;">
               <!-- <schedule-list :id="requirementId" ref="ScheduleEvent" :showunlock="showunlock" :type-list="taskScheduleEvent" :required-list="taskScheduleList" class-name="white" :all="true" :no-move="false" /> -->
               <demand :id="requirementId" ref="ScheduleEvent" :showunlock="showunlock" :type-list="taskScheduleEvent" :required-list="taskScheduleList" />
@@ -207,6 +210,36 @@
               <div v-if="SchedulingContent.length === 0" style="width: 270px; margin: 50% 20px; text-align: center;"> 暂无排期变更记录!</div>
             </el-aside>
           </el-container>
+          <gannt-views v-if="listOrGannt === '甘特图'" />
+          <div class="detail-info border-top">
+            <el-divider />
+            <el-form ref="form_query" :inline="true" :model="form_query" class="Layout_space_start" label-position="left" label-width="140px">
+              <el-form-item
+                v-if="brdPassRealTime"
+                label="BRD评审通过时间:"
+              >
+                <el-date-picker v-model="form_query.brdPassRealTime" type="date" :clearable="false" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" size="small" @change="setChangeArea" />
+              </el-form-item>
+              <el-form-item
+                v-if="prdPassRealTime"
+                label="PRD评审通过时间:"
+              >
+                <el-date-picker v-model="form_query.prdPassRealTime" type="date" :clearable="false" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" size="small" @change="setChangeArea" />
+              </el-form-item>
+              <el-form-item
+                v-if="techInRealTime"
+                label="技术准入时间:"
+              >
+                <el-date-picker v-model="form_query.techInRealTime" type="date" :clearable="false" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" size="small" @change="setChangeArea" />
+              </el-form-item>
+              <el-form-item
+                v-if="onlineRealTime"
+                label="实际上线时间:"
+              >
+                <el-date-picker v-model="form_query.onlineRealTime" type="date" :clearable="false" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" size="small" @change="setChangeArea" />
+              </el-form-item>
+            </el-form>
+          </div>
         </section>
         <section class="main-section">
           <div class="el-main-title">
@@ -303,6 +336,34 @@
         @childValInput="childVal"
         @click.stop
       />
+      <el-dialog
+        title="状态变更"
+        :visible.sync="dialogStatusVisible"
+        width="30%"
+        class="public_task"
+      >
+        <div class="blueStripe" />
+        <div align="center">
+          <el-form ref="form_query" :inline="true" :model="form_query" :rules="rules" label-position="left" label-width="158px">
+            <el-form-item v-if="statusName === 'BRD评审通过'" :label="statusName + '时间:'" prop="brdPassRealTime">
+              <el-date-picker v-model="form_query.brdPassRealTime" type="date" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" />
+            </el-form-item>
+            <el-form-item v-if="statusName === 'PRD评审通过'" :label="statusName + '时间:'" prop="prdPassRealTime">
+              <el-date-picker v-model="form_query.prdPassRealTime" type="date" :clearable="false" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" />
+            </el-form-item>
+            <el-form-item v-if="statusName === '技术准入'" :label="statusName + '时间:'" prop="techInRealTime">
+              <el-date-picker v-model="form_query.techInRealTime" type="date" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" />
+            </el-form-item>
+            <el-form-item v-if="statusName === '已上线'" :label="statusName + '时间:'" prop="onlineRealTime">
+              <el-date-picker v-model="form_query.onlineRealTime" type="date" placeholder="请选择" format="yyyy.MM.dd" value-format="yyyy.MM.dd" style="width: 100%;" />
+            </el-form-item>
+          </el-form>
+        </div>
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogStatusVisible = false">取 消</el-button>
+          <el-button type="primary" @click="setChangeArea">确 定</el-button>
+        </span>
+      </el-dialog>
     </el-container>
   </div>
 </template>
@@ -341,6 +402,7 @@ import image_url from '@/assets/home_images/home_u.png'
 import createdBug from '@/views/projectManage/bugList/file/createdBug'
 import tasksList from './components/taskList'
 import dataStatistics from './components/dataStatistics'
+import moment from 'moment'
 // import scheduleList from './components/scheduleList'
 import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog' // 缺陷表格
 import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
@@ -350,6 +412,7 @@ import demand from '@/views/projectManage/components/demand.vue'
 import '@/styles/PublicStyle/index.scss'
 import record from '@/views/projectManage/components/record.vue'
 import timeLine from '@/views/projectManage/components/timeLine.vue'
+import ganntViews from './components/ganntViews'
 export default {
   components: {
     searchPeople,
@@ -366,7 +429,8 @@ export default {
     download,
     record,
     timeLine,
-    demand
+    demand,
+    ganntViews
   },
   filters: {
     ellipsis(value, num) {
@@ -389,8 +453,21 @@ export default {
         children: 'childRqmtOrnts',
         multiple: true
       },
+      rules: {
+        brdPassRealTime: [{ required: true, message: '请输入BRD评审通过时间', trigger: 'change' }],
+        prdPassRealTime: [{ required: true, message: '请输入PRD评审通过时间', trigger: 'change' }],
+        techInRealTime: [{ required: true, message: '请输入技术准入时间', trigger: 'change' }],
+        onlineRealTime: [{ required: true, message: '请输入实际上线时间', trigger: 'change' }]
+      },
       Latest: true,
+      statusName: '',
+      statusValue: '',
+      dialogStatusVisible: false,
       demandDirection: [], // 需求方向option
+      brdPassRealTime: false, // BRD评审通过时间
+      prdPassRealTime: false, // PRD评审通过时间
+      techInRealTime: false, // 技术准入
+      onlineRealTime: false, // 实际上线
       optionName: 'first',
       visible: false, // Hold任务
       ScheduId: '', // 排期ID
@@ -424,7 +501,8 @@ export default {
       taskScheduleList: [], // 排期数据
       lockHide: false, // 隐藏排期变更记录
       isScheduleLocked: '', // 锁定状态1锁定0未锁定
-      SchedulingContent: [] // 排期历史变更记录
+      SchedulingContent: [], // 排期历史变更记录
+      listOrGannt: '列表'
     }
   },
   computed: {
@@ -492,6 +570,15 @@ export default {
     // clickBackToTheLatest() {
     //   this.$refs.ScheduleEvent.rowDrop()
     // },
+    setChangeArea() {
+      this.$refs.form_query.validate((valid) => {
+        if (valid) {
+          this.changeArea()
+        } else {
+          this.$message({ message: '还有必填项未填写', type: 'error', duration: 1000, offset: 150 })
+        }
+      })
+    },
     async changeArea(e) { // area修改
       const requirementInfo = _.cloneDeep(this.form_query)
       requirementInfo.rqmtProposer = requirementInfo.rqmtProposer ? requirementInfo.rqmtProposer.join() : null
@@ -504,8 +591,10 @@ export default {
       if (requirementInfo.referredClientType !== null) {
         requirementInfo.referredClientType = requirementInfo.referredClientType.join()
       }
+      requirementInfo.status = this.statusValue
       const res = await updateRequirement(requirementInfo)
       if (res.code === 200) {
+        this.dialogStatusVisible = false
         this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
       }
       this.getRequirementById()
@@ -606,6 +695,28 @@ export default {
           this.form_query.rqmtProposer = this.form_query.rqmtProposer.split(',')
         }
       }
+      this.availableStatusList.map(item => {
+        if (item.name === 'BRD评审通过') {
+          if (this.form_query.status >= item.code) {
+            this.brdPassRealTime = true
+          }
+        }
+        if (item.name === 'PRD评审通过') {
+          if (this.form_query.status >= item.code) {
+            this.prdPassRealTime = true
+          }
+        }
+        if (item.name === '技术准入') {
+          if (this.form_query.status >= item.code) {
+            this.techInRealTime = true
+          }
+        }
+        if (item.name === '已上线') {
+          if (this.form_query.status >= item.code) {
+            this.onlineRealTime = true
+          }
+        }
+      })
     },
     async getCommentList() { // 获取需求评论
       const res = await getCommentList({ type: 4, joinId: this.$route.query.id })
@@ -631,6 +742,16 @@ export default {
       }
     },
     async updateStatus(status) { // 修改状态
+      if (status.label === 'PRD评审通过' || status.label === 'BRD评审通过' || status.label === '技术准入' || status.label === '已上线') {
+        this.statusName = status.label
+        this.statusValue = status.value
+        this.dialogStatusVisible = true
+        status.label === 'BRD评审通过' ? this.form_query.brdPassRealTime = moment().locale('zh-cn').format('YYYY.MM.DD') : '' // BRD评审通过时间
+        status.label === 'PRD评审通过' ? this.form_query.prdPassRealTime = moment().locale('zh-cn').format('YYYY.MM.DD') : '' // PRD评审通过时间
+        status.label === '技术准入' ? this.form_query.techInRealTime = moment().locale('zh-cn').format('YYYY.MM.DD') : '' // 技术准入
+        status.label === '已上线' ? this.form_query.onlineRealTime = moment().locale('zh-cn').format('YYYY.MM.DD') : '' // 实际上线
+        return false
+      }
       const res = await updateRequirementStatus({
         id: this.$route.query.id,
         status: status.value,
@@ -753,7 +874,7 @@ export default {
     }
     .demo-form-inline {
       .el-form-item {
-        width: 33%;
+        width: 20%;
         margin-right: 0;
       }
     }
@@ -822,5 +943,14 @@ export default {
 .el-btn-size {
    margin: 10px 30px;
 }
+.border-top {
+ padding: 0 20px 10px !important;
+ >>>.el-divider--horizontal {
+    display: block;
+    height: 1px;
+    width: 100%;
+    margin: 10px 0;
+}
+}
 </style>
 

+ 1 - 0
vue.config.js

@@ -33,6 +33,7 @@ module.exports = {
       warnings: false,
       errors: true
     },
+    disableHostCheck: true, // webpack4.0 开启热更新
     proxy: {
       // change xxx-api/login => mock/login
       // detail: https://cli.vuejs.org/config/#devserver-proxy