|
@@ -4,11 +4,11 @@
|
|
<view>
|
|
<view>
|
|
<view class="item-info uni-row">
|
|
<view class="item-info uni-row">
|
|
<view style="flex: 3;">
|
|
<view style="flex: 3;">
|
|
- <button :class="[checkAll ? 'active' : 'select' ]" @click="handleAll"
|
|
|
|
- style="margin-left: 0px;;">全选</button>
|
|
|
|
|
|
+ <button :class="[ checkAll ? 'active' : 'select' ]" @click="handleAll"
|
|
|
|
+ style="margin-left: 0px;">全选</button>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <uni-data-select v-model=" workshopId" :localdata="workshopList" @change="handleChangeWorkshop"
|
|
|
|
|
|
+ <uni-data-select v-model="workshopId" :localdata="workshopList" @change="handleChangeWorkshop"
|
|
:clear="false" class="label right"
|
|
:clear="false" class="label right"
|
|
style="width: 50rpx; outline: 2rpx solid #999999;border-radius: 10rpx;flex: 1;"></uni-data-select>
|
|
style="width: 50rpx; outline: 2rpx solid #999999;border-radius: 10rpx;flex: 1;"></uni-data-select>
|
|
</view>
|
|
</view>
|
|
@@ -20,7 +20,9 @@
|
|
|
|
|
|
<view class="title-container uni-row">
|
|
<view class="title-container uni-row">
|
|
<view class="title uni-row"><text class="label">{{item.lotCode}}</text></view>
|
|
<view class="title uni-row"><text class="label">{{item.lotCode}}</text></view>
|
|
- <view><button class="start-batch-btn uni-row" type=primary @click='handleAdd'>换箱</button></view>
|
|
|
|
|
|
+ <view><button class="start-batch-btn uni-row" type=primary
|
|
|
|
+ @click.stop='handleChangeCarrier(item)'>换箱</button>
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
<view class="item-info uni-row">
|
|
<view class="item-info uni-row">
|
|
<text class="label">产品描述</text>
|
|
<text class="label">产品描述</text>
|
|
@@ -30,13 +32,21 @@
|
|
<text class="label">关联箱号</text>
|
|
<text class="label">关联箱号</text>
|
|
<text class="label right">{{item['carrierName']}}</text>
|
|
<text class="label right">{{item['carrierName']}}</text>
|
|
</view>
|
|
</view>
|
|
- <view class="item-info uni-row">
|
|
|
|
|
|
+ <!-- <view class="item-info uni-row">
|
|
<text class="label">下序</text>
|
|
<text class="label">下序</text>
|
|
<text class="label right">{{item['process']}}</text>
|
|
<text class="label right">{{item['process']}}</text>
|
|
|
|
+ </view> -->
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <text class="label">当前序</text>
|
|
|
|
+ <text class="label right">{{item['process'].processAlias}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <text class="label">下序</text>
|
|
|
|
+ <text class="label right">{{item['nextProcess'].processAlias}}</text>
|
|
</view>
|
|
</view>
|
|
<view class="item-info uni-row">
|
|
<view class="item-info uni-row">
|
|
<text class="label">下序工段</text>
|
|
<text class="label">下序工段</text>
|
|
- <text class="label right">{{item['dept']}}</text>
|
|
|
|
|
|
+ <text class="label right">{{item.quickInfo.deptName}}</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -52,7 +62,7 @@
|
|
<button class='bottom-btn left-btn' type="warn" @click="handleEnd">结束报工</button>
|
|
<button class='bottom-btn left-btn' type="warn" @click="handleEnd">结束报工</button>
|
|
<button class='bottom-btn right-btn' type="primary" @click="handleContinue">继续扫码</button>
|
|
<button class='bottom-btn right-btn' type="primary" @click="handleContinue">继续扫码</button>
|
|
</view>
|
|
</view>
|
|
- <dialog-lotReporting ref="lotReporting"></dialog-lotReporting>
|
|
|
|
|
|
+ <dialog-lotReporting ref="lotReporting" :getList="init" @scan="handleAdd"></dialog-lotReporting>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
@@ -60,7 +70,12 @@
|
|
import {
|
|
import {
|
|
getPlanDetailsList
|
|
getPlanDetailsList
|
|
} from '@/api/business/planDetails.js'
|
|
} from '@/api/business/planDetails.js'
|
|
- import { store } from '@/store/index.js'
|
|
|
|
|
|
+ import {
|
|
|
|
+ store
|
|
|
|
+ } from '@/store/index.js'
|
|
|
|
+ import {
|
|
|
|
+ onShow
|
|
|
|
+ } from '@dcloudio/uni-app'
|
|
import {
|
|
import {
|
|
getDayWorkList,
|
|
getDayWorkList,
|
|
showDaywork,
|
|
showDaywork,
|
|
@@ -78,17 +93,22 @@
|
|
} from 'vue'
|
|
} from 'vue'
|
|
import path from '@/api/base/path.js'
|
|
import path from '@/api/base/path.js'
|
|
|
|
|
|
|
|
+
|
|
const lotReporting = ref(null)
|
|
const lotReporting = ref(null)
|
|
- const workshopId = ref();
|
|
|
|
|
|
+ const workshopId = ref(null);
|
|
|
|
|
|
const form = ref([]); //表单数据true
|
|
const form = ref([]); //表单数据true
|
|
const checkAll = ref(false); //是否全选
|
|
const checkAll = ref(false); //是否全选
|
|
const listData = ref([]);
|
|
const listData = ref([]);
|
|
|
|
+ const allData = ref([])
|
|
const selection = ref([]); //选中数据
|
|
const selection = ref([]); //选中数据
|
|
const workshopList = ref([]); //车间数据
|
|
const workshopList = ref([]); //车间数据
|
|
-
|
|
|
|
|
|
+ onShow(() => {
|
|
|
|
+ init()
|
|
|
|
+ })
|
|
//初始化
|
|
//初始化
|
|
function init() {
|
|
function init() {
|
|
|
|
+ // console.log(store.curDeptDetails)
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '加载中'
|
|
title: '加载中'
|
|
});
|
|
});
|
|
@@ -97,9 +117,27 @@
|
|
}).then(res => {
|
|
}).then(res => {
|
|
console.log(res)
|
|
console.log(res)
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
- listData.value = res.data
|
|
|
|
|
|
+ allData.value = res.rows
|
|
|
|
+ if (allData.value.length == 0) {
|
|
|
|
+ listData.value = []
|
|
|
|
+ }
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
}
|
|
}
|
|
|
|
+ if (res.other.workShops != null) {
|
|
|
|
+ workshopList.value = res.other.workShops.map(v => ({
|
|
|
|
+ value: v.id,
|
|
|
|
+ text: v.name,
|
|
|
|
+ depts: v.depts
|
|
|
|
+ }))
|
|
|
|
+ if (workshopId.value == null && workshopList.value.length > 0) {
|
|
|
|
+ workshopId.value = workshopList.value[0].value
|
|
|
|
+ handleChangeWorkshop(workshopId.value)
|
|
|
|
+ } else {
|
|
|
|
+ handleChangeWorkshop(workshopId.value)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ workshopList.value = []
|
|
|
|
+ }
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -127,10 +165,13 @@
|
|
}
|
|
}
|
|
getDayworkByCarrierId({
|
|
getDayworkByCarrierId({
|
|
carrierId: vehicleObj.carrierId,
|
|
carrierId: vehicleObj.carrierId,
|
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
status: 7
|
|
status: 7
|
|
}).then(response => {
|
|
}).then(response => {
|
|
if (response.code == 200) {
|
|
if (response.code == 200) {
|
|
- if (response.data.length > 0) {
|
|
|
|
|
|
+ // console.log(response.data.items.length)
|
|
|
|
+ // console.log(response.data)
|
|
|
|
+ if (response.data.items.length > 0) {
|
|
lotReporting.value.open(response.data);
|
|
lotReporting.value.open(response.data);
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -152,13 +193,14 @@
|
|
} else {
|
|
} else {
|
|
// 测试时用
|
|
// 测试时用
|
|
getDayworkByCarrierId({
|
|
getDayworkByCarrierId({
|
|
- carrierId: '1770342949115183106',
|
|
|
|
- status: 7
|
|
|
|
|
|
+ carrierId: '1747500987688890381',
|
|
|
|
+ status: 7,
|
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
}).then(response => {
|
|
}).then(response => {
|
|
- console.log(response)
|
|
|
|
|
|
+ // console.log(response)
|
|
if (response.code == 200) {
|
|
if (response.code == 200) {
|
|
//
|
|
//
|
|
- if (response.data.length > 0) {
|
|
|
|
|
|
+ if (response.data.items.length > 0) {
|
|
// console.log(response.data)
|
|
// console.log(response.data)
|
|
lotReporting.value.open(response.data);
|
|
lotReporting.value.open(response.data);
|
|
} else {
|
|
} else {
|
|
@@ -180,6 +222,9 @@
|
|
// lotReporting.value.open(data);
|
|
// lotReporting.value.open(data);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function handleContinue() {
|
|
|
|
+ handleAdd()
|
|
|
|
+ }
|
|
// 全选按钮操作
|
|
// 全选按钮操作
|
|
function handleAll() {
|
|
function handleAll() {
|
|
//清空选中数据
|
|
//清空选中数据
|
|
@@ -189,11 +234,17 @@
|
|
checkAll.value = false;
|
|
checkAll.value = false;
|
|
} else {
|
|
} else {
|
|
checkAll.value = true;
|
|
checkAll.value = true;
|
|
- form.value.findIndex(item => handleSelection(item))
|
|
|
|
|
|
+ listData.value.findIndex(item => handleSelection(item))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- function handleChangeWorkshop() {}
|
|
|
|
|
|
+ function handleChangeWorkshop(arg) {
|
|
|
|
+ const workshop = workshopList.value.find(v => v.value === arg)
|
|
|
|
+ console.log(allData.value)
|
|
|
|
+ console.log(workshop)
|
|
|
|
+ // console.log()
|
|
|
|
+ listData.value = allData.value.filter(v => workshop.depts.some(e => e.deptId === v.quickInfo.deptId))
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
function isSelected(item) {
|
|
function isSelected(item) {
|
|
@@ -208,14 +259,36 @@
|
|
} else {
|
|
} else {
|
|
selection.value.push(item); // 选中
|
|
selection.value.push(item); // 选中
|
|
}
|
|
}
|
|
- if (selection.value.length == form.value.length) {
|
|
|
|
|
|
+ if (selection.value.length == listData.value.length) {
|
|
checkAll.value = true;
|
|
checkAll.value = true;
|
|
} else {
|
|
} else {
|
|
checkAll.value = false;
|
|
checkAll.value = false;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- init();
|
|
|
|
|
|
+ function handleChangeCarrier(item) {
|
|
|
|
+ store.dayworkInfo = null
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: "/pages/changeBox/index",
|
|
|
|
+ success: function(res) {
|
|
|
|
+ // 通过eventChannel向被打开页面传送数据
|
|
|
|
+ res.eventChannel.emit('acceptDataFromOpenerPage', {
|
|
|
|
+ data: item
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleEnd() {
|
|
|
|
+ finishQuick(selection.value).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ init()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // init();
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|