|
@@ -0,0 +1,402 @@
|
|
|
|
+<template>
|
|
|
|
+ <view class="uni-column" style="padding: 24rpx">
|
|
|
|
+ <view v-if="listData.length>0" style="margin-bottom: 20rpx;">
|
|
|
|
+ <view>
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <view style="flex: 3;">
|
|
|
|
+ <button :class="[checkAll ? 'active' : 'select' ]" @click="handleAll"
|
|
|
|
+ style="margin-left: 0px;;">全选</button>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+ <uni-data-select v-model=" workshopId" :localdata="workshopList" @change="handleChangeWorkshop"
|
|
|
|
+ :clear="false" class="label right"
|
|
|
|
+ style="width: 50rpx; outline: 2rpx solid #999999;border-radius: 10rpx;flex: 1;"></uni-data-select>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="listData.length>0" style="height: calc(100% - 200rpx); overflow: auto;">
|
|
|
|
+ <view v-for="(item, index) in listData" :key="index" :class="{'list-item':true,'selected':isSelected(item)}"
|
|
|
|
+ @click="handleSelection(item)">
|
|
|
|
+
|
|
|
|
+ <view class="title-container uni-row">
|
|
|
|
+ <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>
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <text class="label">产品描述</text>
|
|
|
|
+ <text class="label right">{{item['productDescription']}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <text class="label">关联箱号</text>
|
|
|
|
+ <text class="label right">{{item['carrierName']}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <text class="label">下序</text>
|
|
|
|
+ <text class="label right">{{item['process']}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view class="item-info uni-row">
|
|
|
|
+ <text class="label">下序工段</text>
|
|
|
|
+ <text class="label right">{{item['dept']}}</text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <view v-if="listData.length==0" style="color: #999;margin: 50% auto;">
|
|
|
|
+ <text>扫码开始快速报工</text>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="listData.length==0" class='bottom-btn-container'>
|
|
|
|
+ <button class="start-batch-btn uni-row" type=primary @click='handleAdd'>扫码开始报工</button>
|
|
|
|
+ </view>
|
|
|
|
+ <view v-if="listData.length>0" class='btn uni-row'>
|
|
|
|
+ <button class='bottom-btn left-btn' type="warn" @click="handleEnd">结束报工</button>
|
|
|
|
+ <button class='bottom-btn right-btn' type="primary" @click="handleContinue">继续扫码</button>
|
|
|
|
+ </view>
|
|
|
|
+ <dialog-lotReporting ref="lotReporting"></dialog-lotReporting>
|
|
|
|
+ </view>
|
|
|
|
+</template>
|
|
|
|
+
|
|
|
|
+<script setup>
|
|
|
|
+ import {
|
|
|
|
+ getPlanDetailsList
|
|
|
|
+ } from '@/api/business/planDetails.js'
|
|
|
|
+ import { store } from '@/store/index.js'
|
|
|
|
+ import {
|
|
|
|
+ getDayWorkList,
|
|
|
|
+ showDaywork,
|
|
|
|
+ showDayworkSave,
|
|
|
|
+ turnoverDelete
|
|
|
|
+ } from '@/api/business/dayWork.js'
|
|
|
|
+ import {
|
|
|
|
+ getQuickDayworkList,
|
|
|
|
+ finishQuick,
|
|
|
|
+ getDayworkByCarrierId,
|
|
|
|
+ reportDaywork
|
|
|
|
+ } from '@/api/business/quickDaywork'
|
|
|
|
+ import {
|
|
|
|
+ ref
|
|
|
|
+ } from 'vue'
|
|
|
|
+ import path from '@/api/base/path.js'
|
|
|
|
+
|
|
|
|
+ const lotReporting = ref(null)
|
|
|
|
+ const workshopId = ref();
|
|
|
|
+
|
|
|
|
+ const form = ref([]); //表单数据true
|
|
|
|
+ const checkAll = ref(false); //是否全选
|
|
|
|
+ const listData = ref([]);
|
|
|
|
+ const selection = ref([]); //选中数据
|
|
|
|
+ const workshopList = ref([]); //车间数据
|
|
|
|
+
|
|
|
|
+ //初始化
|
|
|
|
+ function init() {
|
|
|
|
+ uni.showLoading({
|
|
|
|
+ title: '加载中'
|
|
|
|
+ });
|
|
|
|
+ getQuickDayworkList({
|
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
|
|
+ }).then(res => {
|
|
|
|
+ console.log(res)
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
+ listData.value = res.data
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ }
|
|
|
|
+ uni.hideLoading();
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleAdd() {
|
|
|
|
+ const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
|
+ if (mpaasScanModule) {
|
|
|
|
+ // 调用插件的 mpaasScan 方法
|
|
|
|
+ mpaasScanModule.mpaasScan({
|
|
|
|
+ // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
|
+ // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
|
+ scanType: ["qrCode", "barCode"],
|
|
|
|
+ // 是否隐藏相册,默认false不隐藏
|
|
|
|
+ hideAlbum: false,
|
|
|
|
+ },
|
|
|
|
+ (ret) => {
|
|
|
|
+ let vehicleObj = JSON.parse(ret.resp_result);
|
|
|
|
+ if (!vehicleObj.carrierId || vehicleObj.carrierId == "") {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: "none",
|
|
|
|
+ title: "请扫载具码",
|
|
|
|
+ duration: 1000
|
|
|
|
+ })
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ getDayworkByCarrierId({
|
|
|
|
+ carrierId: vehicleObj.carrierId,
|
|
|
|
+ status: 7
|
|
|
|
+ }).then(response => {
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ if (response.data.length > 0) {
|
|
|
|
+ lotReporting.value.open(response.data);
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '该批次不在此计划单内',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: response.msg,
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ // 测试时用
|
|
|
|
+ getDayworkByCarrierId({
|
|
|
|
+ carrierId: '1770342949115183106',
|
|
|
|
+ status: 7
|
|
|
|
+ }).then(response => {
|
|
|
|
+ console.log(response)
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ //
|
|
|
|
+ if (response.data.length > 0) {
|
|
|
|
+ // console.log(response.data)
|
|
|
|
+ lotReporting.value.open(response.data);
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: '该批次不在此计划单内',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: response.msg,
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ // lotReporting.value.open(data);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 全选按钮操作
|
|
|
|
+ function handleAll() {
|
|
|
|
+ //清空选中数据
|
|
|
|
+ selection.value.length = 0;
|
|
|
|
+ if (checkAll.value) {
|
|
|
|
+ //变更选中状态
|
|
|
|
+ checkAll.value = false;
|
|
|
|
+ } else {
|
|
|
|
+ checkAll.value = true;
|
|
|
|
+ form.value.findIndex(item => handleSelection(item))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function handleChangeWorkshop() {}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ function isSelected(item) {
|
|
|
|
+ return selection.value.includes(item);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //
|
|
|
|
+ function handleSelection(item) {
|
|
|
|
+ const buttonIndex = selection.value.findIndex(selectedItem => selectedItem === item);
|
|
|
|
+ if (buttonIndex > -1) {
|
|
|
|
+ selection.value.splice(buttonIndex, 1); // 取消选中
|
|
|
|
+ } else {
|
|
|
|
+ selection.value.push(item); // 选中
|
|
|
|
+ }
|
|
|
|
+ if (selection.value.length == form.value.length) {
|
|
|
|
+ checkAll.value = true;
|
|
|
|
+ } else {
|
|
|
|
+ checkAll.value = false;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ init();
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss">
|
|
|
|
+ $nav-height: 60rpx;
|
|
|
|
+
|
|
|
|
+ .bottom-btn-container {
|
|
|
|
+ position: fixed;
|
|
|
|
+ top: 80%;
|
|
|
|
+ right: 20rpx;
|
|
|
|
+ left: 20rpx;
|
|
|
|
+
|
|
|
|
+ .start-batch-btn {
|
|
|
|
+ margin-bottom: 24rpx;
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
+ background-color: #00e2a6;
|
|
|
|
+ width: 80%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .active {
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: 40rpx;
|
|
|
|
+ font-size: 20rpx;
|
|
|
|
+ background-color: #5e6eff;
|
|
|
|
+ border: 1px solid #5e6eff;
|
|
|
|
+ color: #000000;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .select {
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: 40rpx;
|
|
|
|
+ font-size: 20rpx;
|
|
|
|
+ background-color: #5e6eff;
|
|
|
|
+ border: 1px solid #5e6eff;
|
|
|
|
+ color: #ffffff;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ .btn {
|
|
|
|
+ position: fixed;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ padding: 16rpx 24rpx;
|
|
|
|
+ align-items: center;
|
|
|
|
+ background-color: #FFFFFF;
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+
|
|
|
|
+ .bottom-btn {
|
|
|
|
+ flex: 1;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+
|
|
|
|
+ &.left-btn {
|
|
|
|
+ // background-color: #a4adb3;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.right-btn {
|
|
|
|
+ background-color: #1684fc;
|
|
|
|
+ margin-left: 24rpx;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .box-bg {
|
|
|
|
+ width: 100%;
|
|
|
|
+ background-color: #F5F5F5;
|
|
|
|
+ padding: 5rpx 0;
|
|
|
|
+ justify-content: space-around;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ .input-view {
|
|
|
|
+ width: 100%;
|
|
|
|
+ flex: 4;
|
|
|
|
+ background-color: #f8f8f8;
|
|
|
|
+ height: $nav-height;
|
|
|
|
+ border: 1rpx solid #999;
|
|
|
|
+ border-radius: 15rpx;
|
|
|
|
+ padding: 0 15rpx;
|
|
|
|
+ flex-wrap: nowrap;
|
|
|
|
+ margin: 0 10rpx 20rpx;
|
|
|
|
+ line-height: $nav-height;
|
|
|
|
+
|
|
|
|
+ .input-uni-icon {
|
|
|
|
+ line-height: $nav-height;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .nav-bar-input {
|
|
|
|
+ width: 80%;
|
|
|
|
+ height: $nav-height;
|
|
|
|
+ line-height: $nav-height;
|
|
|
|
+ padding: 0 5rpx;
|
|
|
|
+ background-color: #f8f8f8;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .search {
|
|
|
|
+ width: 20%;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #808080;
|
|
|
|
+ margin-top: -20rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .uni-column {
|
|
|
|
+ background-color: rgba(245, 245, 245, 1);
|
|
|
|
+ height: calc(100% - 40rpx);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .list-item {
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ position: relative;
|
|
|
|
+ padding: 16rpx;
|
|
|
|
+ padding-bottom: 24rpx;
|
|
|
|
+ border-radius: 24rpx;
|
|
|
|
+ margin-bottom: 24rpx;
|
|
|
|
+
|
|
|
|
+ .title-container {
|
|
|
|
+ justify-content: space-between;
|
|
|
|
+ margin-top: 8rpx;
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
+
|
|
|
|
+ .title {
|
|
|
|
+ height: 48rpx;
|
|
|
|
+ align-items: center;
|
|
|
|
+
|
|
|
|
+ .label {
|
|
|
|
+ font-size: 32rpx;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+
|
|
|
|
+ &.code {
|
|
|
|
+ margin-left: 8rpx;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .tag {
|
|
|
|
+ border: 1px solid #1ce5b0;
|
|
|
|
+ background-color: #f6fffd;
|
|
|
|
+ padding: 8rpx;
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
+
|
|
|
|
+ .label {
|
|
|
|
+ color: #1ce5b0;
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ &.not-start {
|
|
|
|
+ border: 1px solid #bbbbbb;
|
|
|
|
+ background-color: #f5f5f5;
|
|
|
|
+
|
|
|
|
+ .label {
|
|
|
|
+ color: #bbbbbb;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ .item-info {
|
|
|
|
+ margin-bottom: 8rpx;
|
|
|
|
+
|
|
|
|
+ .label {
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ width: 150rpx;
|
|
|
|
+ color: #808080;
|
|
|
|
+
|
|
|
|
+ &.right {
|
|
|
|
+ flex: 1;
|
|
|
|
+ color: #000000;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .selected {
|
|
|
|
+ border: 1rpx solid #c0c4fc;
|
|
|
|
+ background-color: #c0c4fc;
|
|
|
|
+ /* 选中之后样式 */
|
|
|
|
+ }
|
|
|
|
+</style>
|