|
@@ -7,9 +7,14 @@
|
|
|
:class="{ 'middle-btn': true, 'active': item.dictValue == curDayworkItem.turnoverType }"
|
|
|
@click="selectTurnoverType(item)"><text class="label">{{item.dictLabel}}</text></view>
|
|
|
</view>
|
|
|
- <view class="" style="margin: 0 20rpx 20rpx 0;width: 88%;">
|
|
|
- <uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;">
|
|
|
- <uni-data-select v-model="curDayworkItem.deptId" :localdata="deptList" @change="handleChange"
|
|
|
+ <view class="" style="margin: 0 20rpx 20rpx 0;width: 88%;" >
|
|
|
+ <uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;" v-if="curDayworkItem.turnoverType == '1'">
|
|
|
+ <uni-data-select v-model="curDayworkItem.deptId" :localdata="insideDepts" @change="handleChangeInside"
|
|
|
+ :clear="false"
|
|
|
+ style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
|
|
|
+ </uni-section>
|
|
|
+ <uni-section title="请选择下序工段" title-font-size="32rpx" style="margin: 0 0 0 -16rpx;" v-if="curDayworkItem.turnoverType == '2'">
|
|
|
+ <uni-data-select v-model="curDayworkItem.deptId" :localdata="outsideDepts" @change="handleChangeOutside"
|
|
|
:clear="false"
|
|
|
style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
|
|
|
</uni-section>
|
|
@@ -74,6 +79,8 @@
|
|
|
})
|
|
|
const dayworkInfo = ref(null)
|
|
|
const deptList = ref([]) // 工段列表
|
|
|
+ const insideDepts = ref([]) // 车间内工段
|
|
|
+ const outsideDepts = ref([]) // 车间外工段
|
|
|
const turnAreaList = ref([]) // 周转区列表
|
|
|
// const emit = defineEmits('confirm') // 自定义调用父组件方法
|
|
|
|
|
@@ -107,6 +114,8 @@
|
|
|
turnoverType: 1
|
|
|
}
|
|
|
deptList.value = []
|
|
|
+ insideDepts.value = []
|
|
|
+ outsideDepts.value = []
|
|
|
turnAreaList.value = []
|
|
|
}
|
|
|
|
|
@@ -129,17 +138,28 @@
|
|
|
console.log(curDayworkItem.value)
|
|
|
})
|
|
|
getDeptList({
|
|
|
- isWorkSection: 1,
|
|
|
- tenantId: store.tenantId
|
|
|
+ tenantId: store.tenantId,
|
|
|
+ productionPlanDetailId: store.planDetails.id
|
|
|
}).then(res => {
|
|
|
+ console.log(store.curDeptDetails)
|
|
|
console.log(res.data)
|
|
|
for (let i = 0; i < res.data.length; i++) {
|
|
|
- deptList.value[i] = {
|
|
|
- text: res.data[i].deptName,
|
|
|
- value: res.data[i].deptId,
|
|
|
- data: res.data[i]
|
|
|
+ if (store.curDeptDetails.workshopId == res.data[i].workshopId) {
|
|
|
+ insideDepts.value.push({
|
|
|
+ text: res.data[i].deptName,
|
|
|
+ value: res.data[i].deptId,
|
|
|
+ data: res.data[i]
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ outsideDepts.value.push({
|
|
|
+ text: res.data[i].deptName,
|
|
|
+ value: res.data[i].deptId,
|
|
|
+ data: res.data[i]
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
+ console.log(insideDepts.value)
|
|
|
+ console.log(outsideDepts.value)
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -156,10 +176,10 @@
|
|
|
selection.value.splice(index, 1);
|
|
|
} else {
|
|
|
selection.value.push(item);
|
|
|
- }
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- function selectTurnoverDoorOutside(item){
|
|
|
+
|
|
|
+ function selectTurnoverDoorOutside(item) {
|
|
|
selection.value[0] = item;
|
|
|
}
|
|
|
|
|
@@ -181,7 +201,7 @@
|
|
|
curDayworkItem.value.status = curDayworkItem.value.turnoverType == '1' ? '7' : '4';
|
|
|
curDayworkItem.value.startTime = timestampToTime(new Date());
|
|
|
curDayworkItem.value.endTime = timestampToTime(new Date());
|
|
|
- curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
|
|
|
+ curDayworkItem.value.technologicalProcessId = dayworkInfo.value.technologicalProcessId;
|
|
|
curDayworkItem.value.dayworkId = dayworkInfo.value.id;
|
|
|
curDayworkItem.value.productionPlanDetailId = dayworkInfo.value.productionPlanDetailId;
|
|
|
if (!store.tenantId) {
|
|
@@ -199,10 +219,10 @@
|
|
|
return null;
|
|
|
}
|
|
|
})
|
|
|
- if(curDayworkItem.value.turnoverType == '1'){
|
|
|
+ if (curDayworkItem.value.turnoverType == '1') {
|
|
|
curDayworkItem.value.place = newArray.join('、');
|
|
|
curDayworkItem.value.turnoverArea = "车间内周转看place字段";
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
curDayworkItem.value.turnoverArea = newArray.join('、');
|
|
|
}
|
|
|
// curDayworkItem.value.dayworkId = store.dayworkInfo.id;
|
|
@@ -239,7 +259,7 @@
|
|
|
// emit('confirm');
|
|
|
}
|
|
|
|
|
|
- function handleChange() {
|
|
|
+ function handleChangeInside() {
|
|
|
turnAreaList.value = [];
|
|
|
selection.value = []
|
|
|
getTurnoverListByDeptId({
|
|
@@ -252,6 +272,11 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ function handleChangeOutside(){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|