qinzhipeng_v 5 rokov pred
rodič
commit
f0fbc46966

+ 8 - 0
src/api/requirement.js

@@ -274,3 +274,11 @@ export function filterGetFilter(id) {
     method: 'get'
   })
 }
+
+// 获取新的排期变更记录
+export function scheduleGetHistoryRequireScheduleById(id) {
+  return request({
+    url: requestIp + `/schedule/getHistoryRequireScheduleById?id=${id}`,
+    method: 'get'
+  })
+}

+ 293 - 280
src/views/projectManage/components/demand.vue

@@ -1,314 +1,332 @@
 <template>
-  <div class="schedule-list" :class="className">
-    <el-table
-      :data="tableData"
-      :header-cell-style="{ background: 'rgba(247,247,247,1)', color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}"
-      border
-      style="width: 100%"
-    >
-      <el-table-column
-        type="selection"
-        width="50"
-        align="center"
-      />
-      <el-table-column
-        prop="date"
-        label="任务"
-        width="180"
-      />
-      <el-table-column>
+  <!-- 表头 -->
+  <div class="schedule-list">
+    <el-table v-if="tableHeader === false" :data="[]" class="tableHeader" border size="mini" :header-cell-style="{ background: 'rgba(247,247,247,1)', color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}" @selection-change="changeCheckout(checkAlls)">
+      <el-table-column v-if="locking" type="selection" width="50" align="center">
         <template>
-          <div>
-            <el-table
-              :id="'schedule-'+id"
-              :data="scheduleList"
-              show-overflow-tooltip="true"
-              :show-header="false"
-              row-key="id"
-              border
-              stripe
-              size="mini"
-            >
-              <el-table-column v-if="noMove" width="80">
-                <template>
-                  <el-tooltip class="item" effect="dark" content="代表移动,鼠标选中区域可以向上移动" placement="bottom">
-                    <div class="sortable-tip">
-                      <img :src="move">
-                    </div>
-                  </el-tooltip>
-                </template>
-              </el-table-column>
-              <el-table-column prop="type" label="类型" min-width="100">
-                <template slot-scope="scope">
-                  {{ scope.row.name }}
-                  <div v-show="showunlock" :class="scope.row.isScheduleLocked === 1 ? 'el-icon-lock' : 'el-icon-unlock'" />
-                </template>
-              </el-table-column>
-              <el-table-column prop="desc" label="描述" min-width="150" align="left" show-overflow-tooltip />
-              <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="200" show-overflow-tooltip />
-              <el-table-column prop="dayLength" label="时长" min-width="50" />
-              <el-table-column prop="peopleList" label="参与人员" min-width="150" />
-              <el-table-column label="操作" width="200">
-                <template slot-scope="scope">
-                  <div v-if="showunlock">
-                    <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="editSchedule(scope.row)">编辑</el-button>
-                    <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="deleteSchedule(scope.row)">删除</el-button>
-                  </div>
-                </template>
-              </el-table-column>
-            </el-table>
-          </div>
+          <el-checkbox v-model="checkAlls" style="padding: 17.5px; line-height: 20px; border-right: 1px solid #EBEEF5" @change="changeCheckout(checkAlls)" />
         </template>
       </el-table-column>
+      <el-table-column prop="date" label="任务" width="300" />
+      <el-table-column prop="type" label="类型" min-width="100" />
+      <el-table-column prop="desc" label="描述" min-width="150" />
+      <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="200" />
+      <el-table-column prop="dayLength" label="时长" min-width="50" />
+      <el-table-column prop="peopleList" label="参与人员" min-width="150" />
+      <el-table-column label="操作" width="200" />
     </el-table>
-    <!-- <el-col align="right" class="add-schedule"><span @click="addSchedule()"><i class="el-icon-circle-plus-outline" />添加排期</span></el-col> -->
-    <el-table
-      :id="'schedule-'+id"
-      :data="scheduleList"
-      :header-cell-style="{ backgroundColor: 'rgba(232,232,232,0.4)', color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}"
-      show-overflow-tooltip="true"
-      row-key="id"
-      border
-      stripe
-      size="mini"
-    >
-      <el-table-column v-if="noMove" width="80">
-        <template>
-          <el-tooltip class="item" effect="dark" content="代表移动,鼠标选中区域可以向上移动" placement="bottom">
-            <div class="sortable-tip">
-              <img :src="move">
-            </div>
-          </el-tooltip>
-        </template>
-      </el-table-column>
-      <el-table-column prop="type" label="类型" min-width="100">
+    <div v-if="tableHeader === true" class="Layout_space_between" style="height: 40px;;border: 1px solid #EBEEF5;">
+      <div class="Layout_flex_start" style="width: 90%">
+        <el-checkbox v-model="checkAlls" style="padding: 17.5px; line-height: 20px; border-right: 1px solid #EBEEF5" @change="changeCheckout(checkAlls)" />
+        <div style="margin: 0 30px 0 10px" class="endCheck"> 已选择 {{ taskList.length }} 个</div>
+        <div class="endCheck cursorPo" @click="clickAddScheduling(1)"><i class="el-icon-document" /> 添加排期</div>
+      </div>
+      <div class="endCheck cursorPo" @click="Deselect">取消选择</div>
+    </div>
+    <!-- 表头 -->
+
+    <!-- 任务表格 -->
+    <el-table ref="taskList" :data="tableData" :cell-class-name="addClass" :header-cell-style="{ background: 'rgba(247,247,247,1)', color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}" border :show-header="false" @selection-change="handleSelectionChange">
+      <el-table-column v-if="locking" type="selection" width="50" align="center" />
+      <el-table-column label="任务" width="300" align="left">
         <template slot-scope="scope">
-          {{ scope.row.name }}
-          <div v-show="showunlock" :class="scope.row.isScheduleLocked === 1 ? 'el-icon-lock' : 'el-icon-unlock'" />
+          <div v-if="!scope.row.vsInput">
+            <div class="templatName">
+              {{ scope.row.moduleInfoName === null ? "" : scope.row.moduleInfoName.substring(0,9) }}
+              <span v-if="scope.row.involveAppString !== null" class="el-involveApp">{{ scope.row.involveAppString }}</span>
+            </div>
+
+            <div class="Layout_space_between" @mouseover="scope.row.vVisible = true" @mouseout="scope.row.vVisible = false">
+              <div class="Layout_flex_start">
+                <div class="templatTaskName cursorPo" @click="clickTemplatTaskName(scope.row.id)">{{ scope.row.name }}</div>
+                <el-tooltip v-if="locking" class="item" effect="dark" :content="scope.row.isScheduleLocked === 1? '点击解锁排期' : '点击锁定排期'" placement="top">
+                  <div :class="scope.row.isScheduleLocked === 1 ? 'el-icon-lock' : 'el-icon-unlock'" @click="changeSchedule(scope.row)" />
+                </el-tooltip>
+              </div>
+              <div v-if="locking" v-show="scope.row.vVisible" class="iconEdit"><i class="el-icon-edit-outline iconPadding cursorPo" @click="editTask(scope.row)" /> <i v-show="scope.row.isScheduleLocked === 0" class="el-icon-circle-plus-outline cursorPo" @click="clickAddScheduling(2,scope.row)" /></div>
+            </div>
+
+            <div class="templatCreator">
+              开发负责人:{{ scope.row.rdObject.name !== null? scope.row.rdObject.name: '无' }} 测试负责人: {{ scope.row.qaObject.name !== null?scope.row.qaObject.name: '无' }}
+            </div>
+          </div>
+          <el-input v-if="scope.row.vsInput" ref="taskName" v-model="taskName" type="textarea" rows="4" placeholder="请输入内容" maxlength="150" show-word-limit @blur="changeTaskName(scope.row)" />
         </template>
       </el-table-column>
-      <el-table-column prop="desc" label="描述" min-width="150" align="left" show-overflow-tooltip />
-      <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="200" show-overflow-tooltip />
-      <el-table-column prop="dayLength" label="时长" min-width="50" />
-      <el-table-column prop="peopleList" label="参与人员" min-width="150" />
-      <el-table-column label="操作" width="200">
+      <el-table-column label="任" style="padding: 20px;">
         <template slot-scope="scope">
-          <div v-if="showunlock">
-            <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="editSchedule(scope.row)">编辑</el-button>
-            <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="deleteSchedule(scope.row)">删除</el-button>
-          </div>
+          <!-- <schedule-list :id="requirementId" ref="ScheduleEvent" :showunlock="showunlock" :type-list="taskScheduleEvent" :required-list="taskScheduleLists(scope.row.id)" class-name="white" :all="true" :no-move="false" /> -->
+          <schedule-list :id="requirementId" ref="taskSchedule" :select-task-list="taskList" :required-list="taskScheduleLists(scope.row.id)" @listByTask="listByTask(requirementId)" />
         </template>
       </el-table-column>
     </el-table>
-    <div class="bottom-detail">
-      <el-row>排期总汇:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }}</el-row>
-      <el-row v-if="scheduleDetail.preOnlineVersion && scheduleDetail.preOnlineVersion.length>0">
-        <el-col :span="2" style="width: 100px">预计上线版本:</el-col>
-        <el-col :span="6">
-          <span v-for="item in scheduleDetail.preOnlineVersion" :key="item">{{ item }}<br></span>
-        </el-col>
-      </el-row>
-      <el-row v-else>预计上线版本:</el-row>
-    </div>
-    <modify-schedule
-      v-if="visibleSchedule"
-      :visible.sync="visibleSchedule"
-      :is-delete.sync="isDelete"
-      :detail-data="detailData"
-      :title="DialogTitle"
-      @update="listByTask(id)"
-    />
+    <!-- 任务表格 -->
+
+    <!-- 日期详情 -->
+    <el-row><span class="demandLayout">交付日期:</span><span class="demandeta">{{ dataList.endTime }}</span></el-row>
+    <el-row><span class="demandLayout">排期:</span><span class="demandeta">{{ dataList.startTime || '' }} ~ {{ dataList.endTime }}</span></el-row>
+    <el-row :gutter="20">
+      <el-col v-for="(item, index) in scheduleDetail" :key="index" :span="6"><span class="demandLayout">{{ index }}:</span><span class="demandeta">{{ item.startTime }} ~ {{ item.endTime }}</span></el-col>
+    </el-row>
+    <el-row><span class="demandLayout">预计上线版本:</span> <span v-for="item in preOnlineVersion" :key="item" class="demandeta">{{ item }}</span></el-row>
+    <!-- 日期详情 -->
+
+    <!-- 排期锁定弹窗 -->
+    <schedule ref="ScheduleEvent" :visible.sync="scheduleVisble" :name="'任务'" :is-schedule-locked="isScheduleLocked" :require-id="Number(taskId)" @updataData="listByTask(requirementId)" />
+  <!-- 排期锁定弹窗 -->
   </div>
 </template>
 <script>
-import Sortable from 'sortablejs'
-import moment from 'moment'
-import 'moment/locale/zh-cn'
 import { listByRequire } from '@/api/requirement.js'
-import { listByTask, sortForTask } from '@/api/projectViewDetails'
-import modifySchedule from '@/views/projectManage/requirement/components/modifySchedule.vue'
-import move from '@/assets/麻将@2x.png'
+import scheduleList from '@/views/projectManage/requirement/components/scheduleList.vue'
 import '@/styles/PublicStyle/index.scss' // 通用css
+import { taskUpdate } from '@/api/taskIndex'
+import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
 export default {
   components: {
-    modifySchedule
-  },
-  filters: {
-    handlerDate(val) {
-      return val ? moment(val).format('YYYY-MM-DD') : ''
-    }
+    scheduleList,
+    schedule
   },
   props: {
-    id: {
-      type: Number,
-      default: NaN,
-      required: true
-    },
-    all: {
-      type: Boolean,
-      default: false,
-      required: false
-    },
     requiredList: {
-      type: Array,
-      default: () => [],
-      required: false
-    },
-    typeList: {
-      type: Array,
-      default: () => [],
-      required: false
-    },
-    className: {
-      type: String,
-      default: '',
-      required: false
-    },
-    noMove: {
-      type: Boolean,
-      default: true,
-      required: false
-    },
-    showunlock: {
-      type: Boolean,
-      default: false,
+      type: [Object, Array],
+      default: () => null,
       required: false
     }
   },
   data() {
     return {
-      tableData: [{
-        date: '2016-05-02',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1518 弄'
-      }, {
-        date: '2016-05-04',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1517 弄'
-      }, {
-        date: '2016-05-01',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1519 弄'
-      }, {
-        date: '2016-05-03',
-        name: '王小虎',
-        address: '上海市普陀区金沙江路 1516 弄'
-      }],
-      move: move,
+      requirementId: Number(this.$route.query.id),
+      tableData: [],
+      checkAlls: false,
+      taskScheduleList: [],
       scheduleList: [],
-      scheduleDetail: {},
-      visibleSchedule: false,
-      detailData: null,
+      isScheduleLocked: '', //  当前排期的状态
+      taskId: '', // taskID
+      scheduleVisble: false, // 排期锁定
+      userInformation: localStorage.getItem('username'),
+      userNames: localStorage.getItem('realname'),
+      taskList: [], // 全选list
+      tableHeader: false, // 表头切换
+      taskName: '', // taskname
+      scheduleDetail: {}, // 用例/开发/提测/测试/准出/上线
+      preOnlineVersion: [], // 预计上线版本
+      dataList: {}, // 排期
       taskScheduleEvent: [], // 排期类型
-      DialogTitle: '新建排期',
+      locking: true, // 查看历史记录锁定能
       isDelete: false // 删除排期操作
     }
   },
   watch: {
-    id: {
-      handler(newV, oldV) {
-        this.listByTask(newV)
-      },
-      immediate: true
-    },
     requiredList: {
-      handler(newV, oldV) {
-        this.scheduleList = newV
-      },
-      immediate: true
-    },
-    typeList: {
-      handler(newV, oldV) {
-        this.taskScheduleEvent = newV
+      handler(newV, old) {
+        if (newV.length === 0) {
+          console.log('没有数据')
+        } else {
+          this.tableData = newV.taskDetailList // 任务list
+          this.dataList = newV // 排期
+          this.scheduleList = newV.scheduleDetailRespons || []
+          this.scheduleDetail = newV.timeInfos // 用例/开发/提测/测试/准出/上线
+          this.preOnlineVersion = newV.preOnlineVersion // 预计上线版本
+          this.taskScheduleEvent = newV.scheduleDetailRespons // 排期详情
+          this.locking = false
+          this.tableHeader = false
+          if (this.tableData !== null) {
+            this.tableData = this.tableData.map(item => ({
+              ...item,
+              vVisible: false,
+              vsInput: false
+            }))
+          }
+        }
       },
       immediate: true
     }
   },
-
-  mounted() {
-    this.rowDrop()
-  },
   methods: {
-    rowDrop() {
-      const tbody = document.querySelector(`#schedule-${this.id} tbody`)
-      const _this = this
-      Sortable.create(tbody, {
-        onEnd({ newIndex, oldIndex }) {
-          const currRow = _this.scheduleList.splice(oldIndex, 1)[0]
-          _this.scheduleList.splice(newIndex, 0, currRow)
-          _this.sortForTask(_this.scheduleList.map(item => item.id))
-        }
-      })
-    },
-    async sortForTask(arr) {
-      const res = await sortForTask(this.id, arr)
+    async listByTask(id) { // 获取排期列表
+      this.taskList = []
+      this.scheduleVisble = false
+      const res = await listByRequire(id)
       if (res.code === 200) {
-        this.$message({ message: '移动成功', type: 'success', duration: 1000, offset: 150 })
+        this.$nextTick(() => {
+          this.tableData = res.data.taskDetailList // 任务list
+          this.dataList = res.data // 排期
+          this.$emit('isScheduleLockeds', this.dataList.isScheduleLocked)
+          this.scheduleList = res.data.scheduleDetailRespons || []
+          this.scheduleDetail = res.data.timeInfos // 用例/开发/提测/测试/准出/上线
+          this.preOnlineVersion = res.data.preOnlineVersion // 预计上线版本
+          this.taskScheduleEvent = res.data.scheduleDetailRespons // 排期详情
+          this.tableData = this.tableData.map(item => ({
+            ...item,
+            vVisible: false,
+            vsInput: false
+          }))
+        })
+      }
+    },
+
+    addClass({ row, column, rowIndex, columnIndex }) {
+      // console.log(row, column, rowIndex, columnIndex, 'cdjscnsdjknj')
+      if (columnIndex === 2) {
+        return 'cell-grey'
       }
     },
-    getType(value) {
-      const res = this.taskScheduleEvent.find(item => item.code === value) || {}
-      return res.msg
+    lockingchange() {
+      this.locking = true
     },
-    async listByTask(id) { // 获取排期列表
-      const res = this.all ? await listByRequire(id) : await listByTask(id)
+    changeSchedule(ele) { // 修改锁定状态
+      if (this.dataList.isScheduleLocked === 1 && ele.isScheduleLocked === 1) {
+        this.$message({ message: '无法解锁,请先变更归属需求的排期状态为未锁定状态!', type: 'error', duration: 3000, offset: 150 })
+      } else {
+        this.isScheduleLocked = ele.isScheduleLocked
+        this.taskId = ele.id
+        this.scheduleVisble = true
+      }
+    },
+    async changeTaskName(val) { // 修改taskname
+      val.vsInput = false
+      val.vVisible = false
+      val.name = this.taskName.split(' ').join('').length === 0 ? val.name : this.taskName
+      const taskInfoDO = val
+      const user = { name: this.userNames, ename: this.userInformation, id: '' }
+      const res = await taskUpdate({ taskInfoDO, user })
       if (res.code === 200) {
-        this.scheduleList = res.data.scheduleDetailRespons || []
-        this.scheduleDetail = res.data || {}
-        this.scheduleList = this.scheduleList.map(item => ({
-          ...item,
-          peopleList: item.peopleObjectList.map(item => item.name).join(',')
-        }))
+        this.$message({ message: '已修改任务名称', type: 'success', duration: 1000, offset: 150 })
       }
     },
-    addSchedule() {
-      this.detailData = null
-      this.DialogTitle = '新建排期'
-      this.visibleSchedule = true
+    clickAddScheduling(index, ele) { // 模拟调用自组件方法
+      if (index === 2) {
+        this.taskList = []
+        this.taskList.push(ele)
+      }
+      const taskA = []
+      this.taskList.map(item => {
+        if (item.isScheduleLocked === 1) {
+          taskA.push(item.taskIdSting)
+        }
+      })
+      if (taskA.length !== 0) {
+        this.$message({ message: '任务 ' + taskA + ' 的排期已锁定,请先解锁排期后再添加排期', type: 'warning', offset: 150 })
+        return
+      }
+      this.$refs.taskSchedule.addSchedule()
     },
-    deleteSchedule(row) { // 删除排期
-      this.DialogTitle = '删除排期'
-      this.isDelete = true
-      this.visibleSchedule = true
-      this.detailData = row
+    clickTemplatTaskName(e) { // 任务名称店家跳转
+      const { href } = this.$router.resolve({ name: '任务详情', query: { id: e }})
+      window.open(href, '_blank')
     },
-    editSchedule(row) { // 编辑排期
-      this.DialogTitle = '编辑排期'
-      this.visibleSchedule = true
-      this.detailData = row
+    editTask(val) { // 点击修改taskName
+      val.vsInput = true
+      this.taskName = val.name
+      this.$nextTick(() => {
+        this.$refs.taskName.focus()
+      })
+    },
+    changeCheckout(rows) {
+      console.log(rows, 'cdjscnsdjknj')
+      if (rows) {
+        this.tableData.forEach(row => {
+          this.$refs.taskList.toggleRowSelection(row, true)
+        })
+      } else {
+        this.$refs.taskList.clearSelection()
+      }
+    },
+    Deselect() { // 取消选择
+      this.taskList.forEach(row => {
+        this.$refs.taskList.clearSelection()// 调用这个方法
+      })
+      this.tableHeader = false
+      this.taskList = []
+    },
+    handleSelectionChange(val) {
+      this.taskList = val
+      this.taskList.length === this.tableData.length ? this.checkAlls = true : this.checkAlls = false
+      if (this.taskList.length > 0) {
+        this.tableHeader = true
+      } else {
+        this.tableHeader = false
+      }
+    },
+    taskScheduleLists(id) {
+      for (var key in this.taskScheduleEvent) {
+        if (id === Number(key)) {
+          return this.taskScheduleEvent[key]
+        }
+      }
     }
   }
 }
 </script>
 <style lang="scss" scoped>
-.schedule-list {
- /deep/ .el-table td {
-    padding: 0;
-    min-width: 0;
-    -webkit-box-sizing: border-box;
-    box-sizing: border-box;
-    text-overflow: ellipsis;
-    vertical-align: middle;
-    position: relative;
-    text-align: left;
-}
->>> .cell {
-   padding: 0 !important;
+.templatName {
+  font-size:12px;
+  font-family:MicrosoftYaHei;
+  line-height:14px;
+  color:rgba(102,102,102,1);
+  opacity:1;
+  margin: 5px 0;
 }
+.templatTaskName {
+  font-size:14px;
+  font-family:MicrosoftYaHei;
+  line-height:23px;
+  color:rgba(51,51,51,1);
+  margin-right: 5px;
+  opacity:1;
 }
-.add-schedule {
+.cursorPo:hover {
+  color:#409EFF;
   cursor: pointer;
-  color: #409EFF;
-  font-size: 14px;
-  margin: 0 20px;
-  padding: 20px 0;
-  i {
-    margin-right: 4px;
-  }
-  span {
-    margin-right: 20px;
+}
+.templatCreator {
+  font-size:12px;
+  font-family:MicrosoftYaHei;
+  line-height:14px;
+  color:rgba(102,102,102,1);
+  opacity:1;
+  margin: 5px 0;
+}
+.demandLayout {
+  display: inline-block;
+  width: 100px;
+  margin: 10px 0;
+  font-size:12px;
+  line-height:14px;
+  color:rgba(102,102,102,1);
+  opacity:1;
+}
+.demandeta {
+  font-size:12px;
+  font-family:MicrosoftYaHei;
+  line-height:14px;
+  color:rgba(51,51,51,1);
+  opacity:1;
+}
+.iconEdit {
+  width:67px;
+  background:rgba(245,245,245,1);
+  opacity:1;
+  padding: 0 10px;
+  border-radius:20px;
+}
+.tableHeader {
+  >>> .el-table__empty-block{
+    display: none;
   }
 }
+.iconPadding {
+  margin-right: 5px;
+}
+.schedule-list {
+ /deep/ .el-table td {
+    padding: 0;
+ }
+}
+// >>> .cell {
+//    padding: 0 !important;
+// }
 .schedule-list {
   margin: 0 20px;
   padding: 0;
@@ -316,37 +334,32 @@ export default {
 >>>.el-table, .el-table__expanded-cell{
   background:rgba(248,248,248,0.6);
 }
-.white {
-  background: #ffffff;
-  .add-schedule {
-    padding: 0 0 20px 0;
-  }
-  /deep/.el-table{
-    background: #ffffff !important;
-  }
+.el-involveApp {
+  border:1px solid rgba(64,158,255,1);
+  border-radius:20px;
+  font-size:10px;
+  font-family:MicrosoftYaHei;
+  line-height:12px;
+  padding: 0 5px;
+  margin-left: 5px;
+  color:rgba(64,158,255,1);
+  opacity:1;
 }
-.bottom-detail {
-  font-size: 14px;
-  // width: calc(100% - 40px);
-  margin: 0 20px;
-  padding: 20px 0;
-  :first-child {
-    margin-bottom: 10px;
-  }
-}
-.sortable-tip {
-  height: 26px;
-  width: 15px;
-  border-radius:2px;
-  margin: auto;
-  justify-content: center;
-  align-items: center;
-  img {
-    width: 8px;
-  }
+.endCheck {
+  font-size:14px;
+  font-family:Microsoft Sans Serif;
+  font-weight:400;
+  line-height:16px;
+  margin-right: 10px;
+  color:rgba(102,102,102,1);
+  opacity:1;
 }
+
 </style>
 <style>
+ .cell-grey .cell {
+   padding: 0 !important;
+ }
 .el-tooltip__popper.is-dark {
   background:rgba(121,132,150,0.8);
   color: #FFF;

+ 36 - 77
src/views/projectManage/requirement/components/scheduleList.vue

@@ -1,38 +1,29 @@
 <template>
-  <div class="schedule-list" :class="className">
-    <!-- <el-col align="right" class="add-schedule"><span @click="addSchedule()"><i class="el-icon-circle-plus-outline" />添加排期</span></el-col> -->
+  <div class="white">
     <el-table
       :id="'schedule-'+id"
       :data="scheduleList"
-      :header-cell-style="{ backgroundColor: 'rgba(232,232,232,0.4)', color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}"
       show-overflow-tooltip="true"
+      :show-header="false"
+      :cell-class-name="addClass"
       row-key="id"
       border
-      stripe
+      style="min-height: 90px;"
       size="mini"
     >
-      <el-table-column v-if="noMove" width="80">
-        <template>
-          <el-tooltip class="item" effect="dark" content="代表移动,鼠标选中区域可以向上移动" placement="bottom">
-            <div class="sortable-tip">
-              <img :src="move">
-            </div>
-          </el-tooltip>
-        </template>
-      </el-table-column>
       <el-table-column prop="type" label="类型" min-width="100">
         <template slot-scope="scope">
           {{ scope.row.name }}
-          <div v-show="showunlock" :class="scope.row.isScheduleLocked === 1 ? 'el-icon-lock' : 'el-icon-unlock'" />
+          <div :class="scope.row.isScheduleLocked === 1 ? 'el-icon-lock' : 'el-icon-unlock'" />
         </template>
       </el-table-column>
       <el-table-column prop="desc" label="描述" min-width="150" align="left" show-overflow-tooltip />
       <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="200" show-overflow-tooltip />
       <el-table-column prop="dayLength" label="时长" min-width="50" />
-      <el-table-column prop="peopleList" label="参与人员" min-width="150" />
+      <el-table-column prop="peopleList" label="参与人员" min-width="150" show-overflow-tooltip />
       <el-table-column label="操作" width="200">
         <template slot-scope="scope">
-          <div v-if="showunlock">
+          <div class="btn-style">
             <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="editSchedule(scope.row)">编辑</el-button>
             <el-button v-if="scope.row.isScheduleLocked === 0" type="text" size="small" @click="deleteSchedule(scope.row)">删除</el-button>
           </div>
@@ -40,19 +31,10 @@
       </el-table-column>
 
     </el-table>
-    <div class="bottom-detail">
-      <el-row>排期总汇:{{ scheduleDetail.startTime | handlerDate }} ~ {{ scheduleDetail.endTime | handlerDate }}</el-row>
-      <el-row v-if="scheduleDetail.preOnlineVersion && scheduleDetail.preOnlineVersion.length>0">
-        <el-col :span="2" style="width: 100px">预计上线版本:</el-col>
-        <el-col :span="6">
-          <span v-for="item in scheduleDetail.preOnlineVersion" :key="item">{{ item }}<br></span>
-        </el-col>
-      </el-row>
-      <el-row v-else>预计上线版本:</el-row>
-    </div>
     <modify-schedule
       v-if="visibleSchedule"
       :visible.sync="visibleSchedule"
+      :select-task-list="selectTaskList"
       :is-delete.sync="isDelete"
       :detail-data="detailData"
       :title="DialogTitle"
@@ -62,31 +44,22 @@
 </template>
 <script>
 import Sortable from 'sortablejs'
-import moment from 'moment'
-import 'moment/locale/zh-cn'
-import { listByRequire } from '@/api/requirement.js'
-import { listByTask, sortForTask } from '@/api/projectViewDetails'
+import { sortForTask } from '@/api/projectViewDetails'
 import modifySchedule from './modifySchedule'
-import move from '@/assets/麻将@2x.png'
 import '@/styles/PublicStyle/index.scss' // 通用css
 export default {
   components: {
     modifySchedule
   },
-  filters: {
-    handlerDate(val) {
-      return val ? moment(val).format('YYYY-MM-DD') : ''
-    }
-  },
   props: {
     id: {
       type: Number,
       default: NaN,
       required: true
     },
-    all: {
-      type: Boolean,
-      default: false,
+    selectTaskList: { // 已选任务列表
+      type: Array,
+      default: () => [],
       required: false
     },
     requiredList: {
@@ -98,26 +71,10 @@ export default {
       type: Array,
       default: () => [],
       required: false
-    },
-    className: {
-      type: String,
-      default: '',
-      required: false
-    },
-    noMove: {
-      type: Boolean,
-      default: true,
-      required: false
-    },
-    showunlock: {
-      type: Boolean,
-      default: false,
-      required: false
     }
   },
   data() {
     return {
-      move: move,
       scheduleList: [],
       scheduleDetail: {},
       visibleSchedule: false,
@@ -174,15 +131,7 @@ export default {
       return res.msg
     },
     async listByTask(id) { // 获取排期列表
-      const res = this.all ? await listByRequire(id) : await listByTask(id)
-      if (res.code === 200) {
-        this.scheduleList = res.data.scheduleDetailRespons || []
-        this.scheduleDetail = res.data || {}
-        this.scheduleList = this.scheduleList.map(item => ({
-          ...item,
-          peopleList: item.peopleObjectList.map(item => item.name).join(',')
-        }))
-      }
+      this.$emit('listByTask')
     },
     addSchedule() {
       this.detailData = null
@@ -199,11 +148,30 @@ export default {
       this.DialogTitle = '编辑排期'
       this.visibleSchedule = true
       this.detailData = row
+    },
+    addClass({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex <= 5) {
+        return 'cell-greys'
+      }
     }
   }
 }
 </script>
 <style lang="scss" scoped>
+.white {
+  background: #ffffff;
+  .add-schedule {
+    padding: 0 0 20px 0;
+  }
+  /deep/.el-table{
+    background: #ffffff !important;
+  }
+}
+.btn-style {
+ >>> .el-button {
+    padding: 0;
+  }
+}
 .add-schedule {
   cursor: pointer;
   color: #409EFF;
@@ -217,10 +185,6 @@ export default {
     margin-right: 20px;
   }
 }
-.schedule-list {
-  margin: 0 20px;
-  padding: 0;
-}
 >>>.el-table, .el-table__expanded-cell{
   background:rgba(248,248,248,0.6);
 }
@@ -233,15 +197,6 @@ export default {
     background: #ffffff !important;
   }
 }
-.bottom-detail {
-  font-size: 14px;
-  // width: calc(100% - 40px);
-  margin: 0 20px;
-  padding: 20px 0;
-  :first-child {
-    margin-bottom: 10px;
-  }
-}
 .sortable-tip {
   height: 26px;
   width: 15px;
@@ -255,8 +210,12 @@ export default {
 }
 </style>
 <style>
+ .cell-greys .cell {
+   margin-left: 10px !important;
+ }
 .el-tooltip__popper.is-dark {
   background:rgba(121,132,150,0.8);
   color: #FFF;
 }
 </style>
+

+ 1 - 1
src/views/projectManage/requirement/list/create.vue

@@ -366,7 +366,7 @@ export default {
             console.log(this.form, 'from')
             data = this.form
             data.rqmtProposer = data.rqmtProposer ? this.form.rqmtProposer.join() : null
-            data.referredClientType = data.referredClientType.join()
+            data.referredClientType = data.referredClientType === null ? null : this.form.referredClientType.join()
             createRequirement(data)
               .then(res => {
                 if (res.code === 200) {

+ 13 - 15
src/views/projectManage/requirement/requirementDetail.vue

@@ -180,8 +180,8 @@
 
           <el-container>
             <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" class-name="white" :all="true" :no-move="false" />
+              <!-- <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" />
             </el-main>
             <el-aside v-if="lockHide" class="SchedulingAside">
               <div v-for="(item, index) in SchedulingContent" :key="index" class="SchedulingDiv" @click="clickScheduling(item)">
@@ -206,7 +206,7 @@
             <div class="title-left-icon" />
             <div class="title-left-name">动态</div>
           </div>
-          <el-tabs v-model="optionName" class="sign-tabs" @tab-click="handleClick">
+          <el-tabs v-model="optionName" class="sign-tabs">
             <el-tab-pane label="评论" name="first">
               <div class="detail-info">
                 <ul class="comment-main">
@@ -314,12 +314,12 @@ import {
   iterationList,
   getCommentList,
   addComment,
-  listByRequire,
   requirementHold,
   requirementUnhold,
   configShowRequireStatusEnum,
   scheduleGetRequireScheduleHistory,
-  scheduleGetHistoryScheduleById,
+  scheduleGetHistoryRequireScheduleById,
+  // scheduleGetHistoryScheduleById,
   settingQueryBizRqmtOrntList
 } from '@/api/requirement.js'
 import { configShowTaskEnum } from '@/api/taskIndex'
@@ -332,7 +332,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 scheduleList from './components/scheduleList'
+// import scheduleList from './components/scheduleList'
 import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog' // 缺陷表格
 import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
 import urgent from '@/assets/urgent.png'
@@ -351,7 +351,7 @@ export default {
     createdBug,
     tasksList,
     dataStatistics,
-    scheduleList,
+    // scheduleList,
     bugTableDialog,
     schedule,
     download,
@@ -438,28 +438,26 @@ export default {
     this.$store.state.data.bizId = false
   },
   methods: {
-    handleClick(tab, event) {
-      console.log(tab, event)
-    },
     async GetRequireScheduleHistory() {
       this.scheduleVisble = false
       const res = await scheduleGetRequireScheduleHistory(this.requirementId)
       this.SchedulingContent = res.data
-      const res1 = await listByRequire(this.requirementId)
       this.BackToTheLatest = false // 回到最新
       this.lockHide = false // 隐藏排期变更记录
       this.showunlock = true
       this.ScheduId = 0
-      this.taskScheduleList = res1.data.scheduleDetailRespons
-      this.isScheduleLocked = res1.data.isScheduleLocked // 锁定状态1锁定0未锁定
       this.$refs.ScheduleEvent.listByTask(this.requirementId)
+      this.$refs.ScheduleEvent.lockingchange()
       this.getRequirementById()
     },
+    isScheduleLockeds(data) {
+      this.isScheduleLocked = data // 锁定状态1锁定0未锁定
+    },
     async clickScheduling(ele) {
       this.showunlock = false
       this.ScheduId = ele.id
-      const res = await scheduleGetHistoryScheduleById(ele.id)
-      this.taskScheduleList = res.data.scheduleDetailRespons
+      const res = await scheduleGetHistoryRequireScheduleById(ele.id)
+      this.taskScheduleList = res.data
       this.BackToTheLatest = true
     },
     changeSchedule() { // 修改锁定状态