qinzhipeng_v 5 years ago
parent
commit
55872c0a34

+ 1 - 2
src/views/projectManage/components/demand.vue

@@ -51,8 +51,7 @@
       </el-table-column>
       <el-table-column label="任" style="padding: 20px;">
         <template slot-scope="scope">
-          <!-- <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="scope.row.id" ref="taskSchedule" :select-task-list="taskList" :required-list="taskScheduleLists(scope.row.id)" @listByTask="listByTask(requirementId)" />
+          <schedule-list :id="scope.row.id" ref="taskSchedule" :locking="locking" :select-task-list="taskList" :required-list="taskScheduleLists(scope.row.id)" @listByTask="listByTask(requirementId)" />
         </template>
       </el-table-column>
     </el-table>

+ 18 - 7
src/views/projectManage/components/scheduleList.vue

@@ -10,6 +10,7 @@
       border
       style="min-height: 90px;"
       size="mini"
+      :class="{'ignore-elements': dondrop }"
     >
       <el-table-column prop="type" label="类型" min-width="70">
         <template slot-scope="scope">
@@ -20,7 +21,11 @@
       <el-table-column prop="desc" label="描述" min-width="150" align="left" show-overflow-tooltip />
       <el-table-column prop="seperateDaysNoHoliday" label="排期" min-width="160" show-overflow-tooltip />
       <el-table-column prop="dayLength" label="时长" min-width="50" />
-      <el-table-column prop="peopleList" label="参与人员" min-width="150" show-overflow-tooltip />
+      <el-table-column prop="peopleList" label="参与人员" min-width="150" show-overflow-tooltip>
+        <template slot-scope="scope">
+          <div v-for="(item, index) in scope.row.peopleObjectList" :key="index">{{ item.name }}</div>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" width="120">
         <template slot-scope="scope">
           <div class="btn-style">
@@ -57,6 +62,10 @@ export default {
       default: NaN,
       required: true
     },
+    locking: {
+      type: Boolean,
+      required: true
+    },
     selectTaskList: { // 已选任务列表
       type: Array,
       default: () => [],
@@ -79,18 +88,19 @@ export default {
       scheduleDetail: {},
       visibleSchedule: false,
       detailData: null,
+      dondrop: true,
       taskScheduleEvent: [], // 排期类型
       DialogTitle: '新建排期',
       isDelete: false // 删除排期操作
     }
   },
   watch: {
-    // id: {
-    //   handler(newV, oldV) {
-    //     this.listByTask(newV)
-    //   },
-    //   immediate: true
-    // },
+    locking: {
+      handler(newV, oldV) {
+        this.dondrop = !newV
+      },
+      immediate: true
+    },
     requiredList: {
       handler(newV, oldV) {
         this.scheduleList = newV
@@ -113,6 +123,7 @@ export default {
       const tbody = document.querySelector(`#schedule-${this.id} tbody`)
       const _this = this
       Sortable.create(tbody, {
+        disabled: _this.dondrop,
         onEnd({ newIndex, oldIndex }) {
           const currRow = _this.scheduleList.splice(oldIndex, 1)[0]
           _this.scheduleList.splice(newIndex, 0, currRow)