|
@@ -8,8 +8,8 @@
|
|
|
<div class="item"><p>计划人数:</p><span>{{ planList.planManNum }}人</span></div>
|
|
|
<div class="item"><div>{{ planList.taskTypeName }}</div></div>
|
|
|
<div class="item"><p>数量:</p><span>{{ planList.num }}</span></div>
|
|
|
- <div class="item"><p>工时:</p><span>{{ planList.planWorkHour }} h</span></div>
|
|
|
- <div class="item" style="width: 100%;">
|
|
|
+ <div class="item"><p>工时:</p><span>{{ planList.planWorkHour }} 分钟</span></div>
|
|
|
+ <!-- <div class="item" style="width: 100%;">
|
|
|
<p>组员:</p>
|
|
|
<span :style="`color: #333`" @click.stop="distributionProp()" v-if="planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames">
|
|
|
{{ planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames }}
|
|
@@ -19,18 +19,47 @@
|
|
|
</div>
|
|
|
<div class="planItem_conter_icon">
|
|
|
<van-icon name="arrow" size="20" color="#999" />
|
|
|
+ </div> -->
|
|
|
+
|
|
|
+ <!-- 以下新加的 -->
|
|
|
+ <div class="PlanItem" style="width:100%">
|
|
|
+ <div>组员:</div>
|
|
|
+ <span class="" v-if="planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames">{{ planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames }}</span>
|
|
|
+ <span style="color: #1989fa;" v-if="!(planList.planProcedureTotals[0] && planList.planProcedureTotals[0].teamNames) && beDeptList" @click.stop="distributionProp(planList.planProcedureTotals[0],'add')">分配</span>
|
|
|
+ <div>
|
|
|
+ <!-- <span style="color: #1989fa;" @click="workShowHide(index)">{{ item.flg ? paiArr[0] : paiArr[1] }}</span> -->
|
|
|
+ <span style="color: #1989fa;" @click.stop="planList.flg = !planList.flg">{{ planList.flg ? '收起' : '展开' }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="width: 100%">
|
|
|
+ <collapse style="width: 100%">
|
|
|
+ <div v-if="planList.flg" style="width: 100%">
|
|
|
+ <div style="width: 100%;border-top: 0.02667rem solid #E6E6E6;margin-top: 10px">
|
|
|
+ <div class="disZhuyuan" v-for="second_item,index in planList.planProcedureTotals[0].prodProcedureTeamList " :key="index">
|
|
|
+ <span>{{ second_item.user.name }}</span>
|
|
|
+ <span>{{ second_item.status==0?"待接收":second_item.status==1?"进行中":second_item.status==2?"已完工":second_item.status==3?"已中止":"已换人"}}</span>
|
|
|
+ <span class="" v-if="second_item.status==3" @click.stop="distributionProp(planList.planProcedureTotals[0],'change', second_item)" style="color: #1989fa;">换人</span>
|
|
|
+ <span class="" v-if="second_item.status==0&&second_item.isChange==1" @click.stop="deletePeople(second_item.id)" style="color: #1989fa;">删除</span>
|
|
|
+ </div>
|
|
|
+ <p style="margin-top:20px;">
|
|
|
+ <span class="" v-if="beDeptList" @click.stop="distributionProp(planList.planProcedureTotals[0],'add')" style="color: #1989fa;">新增</span>
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </collapse>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
<!-- 弹出层选人 -->
|
|
|
<van-popup v-model="popupShow" round position="bottom" :style="{ height: '80%',background: '#F4F4F4' }" >
|
|
|
- <ChooseSomeone ref="ChooseSomeoneOne" :groupView="2" :groupViewBack="true" :peopleList="peopleList" @ChooseSomeoneChanhe="chooseSomeoneChanhe" :peopleListId="peopleListId"></ChooseSomeone>
|
|
|
+ <ChooseSomeone ref="ChooseSomeoneOne" :groupView="this.groupViewNum" :groupViewBack="true" :peopleList="peopleList" @ChooseSomeoneChanhe="chooseSomeoneChanhe" :peopleListId="peopleListId"></ChooseSomeone>
|
|
|
</van-popup>
|
|
|
</div>
|
|
|
+
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import ChooseSomeone from '../../../components/chooseSomeone.vue'
|
|
|
+import collapse from '../../../assets/collapse.js'
|
|
|
export default {
|
|
|
name: 'InsertionPlanItem',
|
|
|
props: {
|
|
@@ -40,7 +69,8 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
components: {
|
|
|
- ChooseSomeone
|
|
|
+ ChooseSomeone,
|
|
|
+ collapse
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -50,6 +80,8 @@ export default {
|
|
|
planProcedureTotals: [{teamNames: ''}]
|
|
|
},
|
|
|
peopleListId: [],
|
|
|
+ groupViewNum:2,
|
|
|
+ peopleType:0,
|
|
|
};
|
|
|
},
|
|
|
computed: {},
|
|
@@ -68,13 +100,34 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- distributionProp() {
|
|
|
+ // distributionProp() {
|
|
|
+ // if(this.beDeptList) {
|
|
|
+ // console.log(this.planList, '看看你')
|
|
|
+ // this.peopleListId = this.planList.planProcedureTotals[0] ? this.planList.planProcedureTotals[0].teamIds ? this.planList.planProcedureTotals[0].teamIds.split(',') : [] : []
|
|
|
+ // this.popupShow = true
|
|
|
+ // }
|
|
|
+
|
|
|
+ // },
|
|
|
+ distributionProp(item, str, itemObj) {
|
|
|
+ this.ChooseSomeoneKey++
|
|
|
+ if(str=='add'){
|
|
|
+ this.peopleType=0;
|
|
|
+ this.groupViewNum=2;
|
|
|
+ if(item.teamIds) {
|
|
|
+ this.peopleListId = item.teamIds.split(',')
|
|
|
+ } else {
|
|
|
+ this.peopleListId = []
|
|
|
+ }
|
|
|
+ }else if(str=='change'){
|
|
|
+ this.peopleType=1;
|
|
|
+ this.groupViewNum=1;
|
|
|
+ // 针对换人存之前人的所有信息
|
|
|
+ this.peopleListId = [itemObj.userId]
|
|
|
+ this.peopleListIdObj = itemObj
|
|
|
+ }
|
|
|
if(this.beDeptList) {
|
|
|
- console.log(this.planList, '看看你')
|
|
|
- this.peopleListId = this.planList.planProcedureTotals[0] ? this.planList.planProcedureTotals[0].teamIds ? this.planList.planProcedureTotals[0].teamIds.split(',') : [] : []
|
|
|
this.popupShow = true
|
|
|
}
|
|
|
-
|
|
|
},
|
|
|
// 获取人员
|
|
|
getPeople() {
|
|
@@ -112,6 +165,7 @@ export default {
|
|
|
this.$refs.ChooseSomeoneOne['loadingBtn'] = false
|
|
|
this.popupShow = false
|
|
|
if (res.code == "ok") {
|
|
|
+ this.$emit('flashList')
|
|
|
this.planList.planProcedureTotals[0].teamNames = nameArr.join(',')
|
|
|
this.planList.planProcedureTotals[0].teamIds = teamIds.join(',')
|
|
|
} else {
|
|
@@ -129,9 +183,29 @@ export default {
|
|
|
let nameArr = item.map(item => {
|
|
|
return item.name
|
|
|
})
|
|
|
- console.log(arr, nameArr)
|
|
|
- this.teamAllocation(arr, nameArr)
|
|
|
- }
|
|
|
+ if(this.peopleType == 1) {
|
|
|
+ this.changePeople(this.peopleListIdObj,arr[0])
|
|
|
+ } else {
|
|
|
+ this.teamAllocation(arr, nameArr)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //换人
|
|
|
+ changePeople(item,newPeopleId){
|
|
|
+ delete item.user
|
|
|
+ this.$axios.post('/plan/changePeople', {
|
|
|
+ ...item,
|
|
|
+ newPeopleId:newPeopleId
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ this.popupShow = false
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.$emit('flashList')
|
|
|
+ } else {
|
|
|
+ this.$toast.clear();
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(err => { this.$toast.clear(); });
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -147,6 +221,15 @@ export default {
|
|
|
justify-content: space-between;
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
+ .disZhuyuan {
|
|
|
+ padding-left: 30px;
|
|
|
+ font-size: 14px;
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ padding-right: 100px;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-top: 10px;
|
|
|
+ }
|
|
|
.planItem_conter {
|
|
|
width: 100%;
|
|
|
padding: 8px;
|
|
@@ -156,6 +239,37 @@ export default {
|
|
|
flex-wrap: wrap;
|
|
|
position: relative;
|
|
|
|
|
|
+ .PlanItem {
|
|
|
+ width: 50%;
|
|
|
+ display: flex;
|
|
|
+ padding-top: 12px;
|
|
|
+ &:first-child {
|
|
|
+ width: 100%;
|
|
|
+ padding-top: 10px;
|
|
|
+ span {
|
|
|
+ font-size: 18px;
|
|
|
+ color: #333;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ &:nth-child(2) {
|
|
|
+ width: 100%;
|
|
|
+ span {
|
|
|
+ width: 230px;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ div {
|
|
|
+ width: 80px;
|
|
|
+ text-align: right;
|
|
|
+ color: #666;
|
|
|
+ }
|
|
|
+ span {
|
|
|
+ display: inline-block;
|
|
|
+ color: #333;
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.planItem_conter_icon {
|
|
|
position: absolute;
|
|
|
top: 50%;
|