|
@@ -22,7 +22,7 @@
|
|
style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
|
|
style="margin: 0 0 0 16rpx;outline: 2rpx solid #999999;border-radius: 10rpx;"></uni-data-select>
|
|
</uni-section>
|
|
</uni-section>
|
|
</view>
|
|
</view>
|
|
- <view v-if="curDayworkItem.turnoverType != '3'">
|
|
|
|
|
|
+ <view >
|
|
<text style=" margin: 0 0 0 5rpx;">请选择您摆放位置</text>
|
|
<text style=" margin: 0 0 0 5rpx;">请选择您摆放位置</text>
|
|
</view>
|
|
</view>
|
|
<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '1'">
|
|
<view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '1'">
|
|
@@ -39,6 +39,13 @@
|
|
style="font-size: 30rpx;">{{item.code}}</text></view>
|
|
style="font-size: 30rpx;">{{item.code}}</text></view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="turnArea uni-row" v-if="curDayworkItem.turnoverType == '3'">
|
|
|
|
+ <view v-for="(item,index) in outTurnArea" class="btn">
|
|
|
|
+ <view :class="{ 'middle-btn': true, 'active': handleTurnoverDoor(item) }"
|
|
|
|
+ @click="selectTurnoverOutsource(item)"><text class="label"
|
|
|
|
+ style="font-size: 30rpx;">{{item.code}}</text></view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="add-btn-container uni-row">
|
|
<view class="add-btn-container uni-row">
|
|
<button type="default" class="btn" @click="handleConfirm">确认</button>
|
|
<button type="default" class="btn" @click="handleConfirm">确认</button>
|
|
@@ -58,7 +65,8 @@
|
|
getDictInfoByType
|
|
getDictInfoByType
|
|
} from '@/api/dict/dict.js'
|
|
} from '@/api/dict/dict.js'
|
|
import {
|
|
import {
|
|
- getTurnoverByWorkshop
|
|
|
|
|
|
+ getTurnoverByWorkshop,
|
|
|
|
+ getOutsourceTurnoverByWorkshop
|
|
} from '@/api/business/workshop.js'
|
|
} from '@/api/business/workshop.js'
|
|
import {
|
|
import {
|
|
getDayWorkItemList,
|
|
getDayWorkItemList,
|
|
@@ -70,7 +78,7 @@
|
|
getDeptList
|
|
getDeptList
|
|
} from '@/api/dept/dept.js'
|
|
} from '@/api/dept/dept.js'
|
|
import {
|
|
import {
|
|
- getTurnoverListByDeptId
|
|
|
|
|
|
+ getTurnoverListByDeptId,
|
|
} from '@/api/business/turnover.js'
|
|
} from '@/api/business/turnover.js'
|
|
import {
|
|
import {
|
|
store
|
|
store
|
|
@@ -82,6 +90,7 @@
|
|
const baseDialog = ref(null)
|
|
const baseDialog = ref(null)
|
|
const turnoverDoorChecked = ref([])
|
|
const turnoverDoorChecked = ref([])
|
|
const turnoverType = ref([])
|
|
const turnoverType = ref([])
|
|
|
|
+ const outTurnArea = ref([])
|
|
const turnoverArea = ref([])
|
|
const turnoverArea = ref([])
|
|
const selection = ref([])
|
|
const selection = ref([])
|
|
const curDayworkItem = ref({
|
|
const curDayworkItem = ref({
|
|
@@ -137,6 +146,11 @@
|
|
turnoverArea.value = res.data;
|
|
turnoverArea.value = res.data;
|
|
})
|
|
})
|
|
})
|
|
})
|
|
|
|
+ getOutsourceTurnoverByWorkshop({
|
|
|
|
+ deptCode:'170000'
|
|
|
|
+ }).then(response =>{
|
|
|
|
+ outTurnArea.value = response.data
|
|
|
|
+ })
|
|
getDayWorkItemList({
|
|
getDayWorkItemList({
|
|
dayworkId: dayworkInfo.value.id,
|
|
dayworkId: dayworkInfo.value.id,
|
|
userId: store.userInfo.userId,
|
|
userId: store.userInfo.userId,
|
|
@@ -199,11 +213,14 @@
|
|
function selectTurnoverDoorOutside(item) {
|
|
function selectTurnoverDoorOutside(item) {
|
|
selection.value[0] = item;
|
|
selection.value[0] = item;
|
|
}
|
|
}
|
|
|
|
+ function selectTurnoverOutsource(item) {
|
|
|
|
+ selection.value[0] = item
|
|
|
|
+ }
|
|
|
|
|
|
function handleTurnoverDoor(item) {
|
|
function handleTurnoverDoor(item) {
|
|
return selection.value.includes(item);
|
|
return selection.value.includes(item);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ //校验车间内车间外
|
|
function handleValidate(data) {
|
|
function handleValidate(data) {
|
|
console.log(data)
|
|
console.log(data)
|
|
if (data.turnoverArea == "" || data.deptId == null || selection.value.length == 0) {
|
|
if (data.turnoverArea == "" || data.deptId == null || selection.value.length == 0) {
|
|
@@ -212,8 +229,23 @@
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //校验外协
|
|
|
|
+ function handleValidateOutsource(data) {
|
|
|
|
+ console.log(data)
|
|
|
|
+ if (selection.value.length == 0) {
|
|
|
|
+ return false;
|
|
|
|
+ } else {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
function handleConfirmOutsource() {
|
|
function handleConfirmOutsource() {
|
|
|
|
+ if (!handleValidateOutsource(curDayworkItem.value)) {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: '请选择完整信息'
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
curDayworkItem.value.id = null;
|
|
curDayworkItem.value.id = null;
|
|
curDayworkItem.value.startTime = timestampToTime(new Date());
|
|
curDayworkItem.value.startTime = timestampToTime(new Date());
|
|
curDayworkItem.value.endTime = timestampToTime(new Date());
|
|
curDayworkItem.value.endTime = timestampToTime(new Date());
|
|
@@ -226,11 +258,11 @@
|
|
} else {
|
|
} else {
|
|
curDayworkItem.value.tenantId = store.tenantId;
|
|
curDayworkItem.value.tenantId = store.tenantId;
|
|
}
|
|
}
|
|
- curDayworkItem.value.turnoverArea = "外协周转";
|
|
|
|
|
|
+ //curDayworkItem.value.turnoverArea = "外协周转";
|
|
|
|
+ curDayworkItem.value.turnoverArea = selection.value.map((item) => {return item.code;}).join('、')
|
|
|
|
|
|
/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
|
|
/**** 此处暂时为硬编码,170000为外协部门编码,根据编码查询信息 ***/
|
|
curDayworkItem.value.deptCode = 170000;
|
|
curDayworkItem.value.deptCode = 170000;
|
|
-
|
|
|
|
close();
|
|
close();
|
|
turnoverOutsource(curDayworkItem.value).then(res => {
|
|
turnoverOutsource(curDayworkItem.value).then(res => {
|
|
if (res.code === 200) {
|
|
if (res.code === 200) {
|
|
@@ -246,6 +278,7 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function handleConfirm() {
|
|
function handleConfirm() {
|