|
@@ -0,0 +1,819 @@
|
|
|
+<template>
|
|
|
+ <view v-if="isMaskShow" class="mask">
|
|
|
+ </view>
|
|
|
+ <view class="uni-column" style=" background-color: #f5f5f5;padding: 24rpx;">
|
|
|
+ <view
|
|
|
+ style="height: 20%;position: fixed;top:38px;left: 12px;right: 12px;z-index: 10;background-color: #f5f5f5;">
|
|
|
+ <view class="box-bg uni-row">
|
|
|
+ <view class="input-view uni-row">
|
|
|
+ <uni-icons class="input-uni-icon" type="search" size="18" color="#999" />
|
|
|
+ <input class="nav-bar-input" type="text" v-model="keywords" placeholder="请输入批次号/箱号" />
|
|
|
+ </view>
|
|
|
+ <view class="search" @click="handleSearch">
|
|
|
+ 搜索
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="scan uni-row" style="padding: 24rpx 24rpx 0 24rpx;">
|
|
|
+ <view class="scan-btn " @click.stop="handleScan">扫码
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="list-title uni-row">
|
|
|
+ <text class="label">是否正常批次</text>
|
|
|
+ <text>{{ normalStatus ? '是' : '否' }}</text>
|
|
|
+ <switch class="switch" :checked="normalStatus" @change="switchChange" color="rgba(103, 195, 55, 1.0)" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view v-if="listData.length == 0" style="color: #999;margin: 100% auto;
|
|
|
+ height: 100%;
|
|
|
+ position: relative;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;">
|
|
|
+ <text>暂无批次</text>
|
|
|
+ </view>
|
|
|
+ <view v-else class="uni-column" style="margin-top: 138px;overflow: auto;height: 100%;">
|
|
|
+
|
|
|
+ <!-- 批次列表 -->
|
|
|
+ <view v-for="(item, index) in listData" :key="index" class="list-item"
|
|
|
+ @click="handleToreportingForWork(item)">
|
|
|
+ <view class="title-container uni-row" style="justify-content: flex-start;">
|
|
|
+ <view class="title uni-row">
|
|
|
+ <text class="label">批次号:</text>
|
|
|
+ <text class="label code">{{ item['lotCode'] }}</text>
|
|
|
+ </view>
|
|
|
+ <view class=" uni-row" style="margin-left: 16rpx;">
|
|
|
+ <view v-if="item['status'] == 1" class="tag"><text class="label">进行中</text></view>
|
|
|
+ <view v-else-if="item['status'] == 3" class="tag turnover "><text class="label">待领取</text>
|
|
|
+ </view>
|
|
|
+ <view v-else-if="item['status'] == 2" class="tag turnover "><text class="label">待周转</text>
|
|
|
+ </view>
|
|
|
+ <view v-else-if="item['status'] == 0" class="tag finished "><text class="label">未开始</text>
|
|
|
+ </view>
|
|
|
+ <view v-else-if="item['status'] == 4" type="default finished" class="tag finished"><text
|
|
|
+ class="label">已完成</text></view>
|
|
|
+ </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['furnaceNoInfo'] && item['furnaceNoInfo'].firstTechnicalRequirement != '' ? item['furnaceNoInfo'].firstTechnicalRequirement + ";" + item['furnaceNoInfo'].secondTechnicalRequirement : '-' }}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-info uni-row">
|
|
|
+ <text class="label">箱号</text>
|
|
|
+ <text class="label right">{{ item['carrierName'] ? item['carrierName'] : '-' }}</text>
|
|
|
+ </view>
|
|
|
+ <!-- <view class="item-info uni-row">
|
|
|
+ <text class="label">总工时</text>
|
|
|
+ <text class="label right">{{ item['totalWorkingHours']}}</text>
|
|
|
+ </view> -->
|
|
|
+ <view class="item-info uni-row">
|
|
|
+ <text class="label">投入数</text>
|
|
|
+ <text
|
|
|
+ class="label right">{{ item.prevProcess == null ? item['productionQuantity'] : item['processQualifiedNum']}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-info uni-row">
|
|
|
+ <text class="label">上道工序</text>
|
|
|
+ <text class="label right">{{ item.prevProcess ? item['prevProcess'].processAlias : '-'}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-info uni-row">
|
|
|
+ <text class="label">当前工序</text>
|
|
|
+ <!-- <text
|
|
|
+ class="label right">{{ item.currentProcess ? item.prevProcess && item['currentProcess'].processAlias == item['prevProcess'].processAlias ? '-' : item['currentProcess'].processAlias : '-'}}</text> -->
|
|
|
+ <text
|
|
|
+ class="label right">{{ item.currentProcess ? item['currentProcess'].processAlias : '-'}}</text>
|
|
|
+ </view>
|
|
|
+ <view class="item-info uni-row">
|
|
|
+ <text class="label">下道工序</text>
|
|
|
+ <view class="label right uni-row">
|
|
|
+ {{ item.nextProcess ? item['nextProcess'].processAlias : '-' }}
|
|
|
+ (<view style="color: #1684fc;" @click.stop="handleClickProcessList(item)"> 工艺列表
|
|
|
+ </view>)
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <view class="item-info uni-row">
|
|
|
+ <text class="label">操作者</text>
|
|
|
+ <text class="label right">{{ item['allNickName'] }}</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="notPreProcess" class="item-info uni-row">
|
|
|
+ <text class="label">所在区域</text>
|
|
|
+ <text class="label right">{{ item['place'] ? item['place'] : '-' }}</text>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
|
|
|
+ class="item-info uni-row">
|
|
|
+ <text class="label">目标工段</text>
|
|
|
+ <text
|
|
|
+ class="label right">{{ item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3 ? item['dayworkItemList'][0].deptName : '-' }}</text>
|
|
|
+ </view>
|
|
|
+ <view
|
|
|
+ v-if="item['dayworkItemList'] && item['dayworkItemList'].length >0 && item['dayworkItemList'][0].status >3"
|
|
|
+ class="item-info uni-row">
|
|
|
+ <text class="label">目标车间</text>
|
|
|
+ <text class="label right">{{ item['workshopName']}}</text>
|
|
|
+ </view>
|
|
|
+
|
|
|
+ <!-- <view v-if="item.protemResourceGroupDetailList && item.protemResourceGroupDetailList.length>0"
|
|
|
+ class="item-info uni-row">
|
|
|
+ <text class="label">邀请者</text>
|
|
|
+ <text
|
|
|
+ class="label right">{{ item['protemResourceGroupDetailList'] && item['protemResourceGroupDetailList'].length>0 ? item['protemResourceGroupDetailList'][0].protemCreatorName : '-' }}</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="item.protemResourceGroupDetailList&& item.protemResourceGroupDetailList.length>0"
|
|
|
+ class="item-info uni-row">
|
|
|
+ <text class="label">已完成数量</text>
|
|
|
+ <text class="label right">{{ item['totalQuantity'] ? item['totalQuantity'] : 0 }}</text>
|
|
|
+ </view> -->
|
|
|
+ <view class="status-btn uni-row">
|
|
|
+ <view v-if="item['status'] == 2" class=" uni-row">
|
|
|
+ <button class="turnover-tag" size="mini"
|
|
|
+ @click.stop="handleShowTurnoverApplication(item)">周转申请</button>
|
|
|
+ <!-- <button class="reporting-tag" size="mini" @click="handleToreportingForWork">去报工</button> -->
|
|
|
+ </view>
|
|
|
+ <view v-else-if="item['status'] == 3" class=" uni-row">
|
|
|
+ <button class="turnover-tag" size="mini" @click.stop="handleCancelTurnover(item)"
|
|
|
+ style="background-color: rgba(255, 85, 85, 1);">取消周转</button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <!-- 抽屉 -->
|
|
|
+ <uni-drawer ref="showRight" mode="right" :mask-click="true">
|
|
|
+ <view style="text-align: center; font-size: 48rpx; padding: 48rpx 0 24rpx 0;">工艺列表</view>
|
|
|
+ <view style="font-size: 24rpx;text-align: center;color: red; margin-bottom: 16rpx;">
|
|
|
+ 仅显示当前工序后面工艺
|
|
|
+ </view>
|
|
|
+ <scroll-view scroll-y="true" style="height: 82%;" @touchmove.stop>
|
|
|
+ <view v-for="(item,index) in curProcessAfte" :key="index"
|
|
|
+ style="padding: 8rpx 5% 8rpx 14%; border-top: 1px solid #cccccc">
|
|
|
+ <text>{{ index + 1 }}.{{item.processAlias}}</text>
|
|
|
+ </view>
|
|
|
+ </scroll-view>
|
|
|
+ <view><button v-if="!editStatus" class="view-end-btn" type="primary"
|
|
|
+ @click="handleOpenDrawing">查看本工序图纸</button></view>
|
|
|
+
|
|
|
+ </uni-drawer>
|
|
|
+ <dialog-turnoverApplicationAssist ref="turnoverApplicationDialog" @reflushDaywork="handleDoTurnoverAfter" />
|
|
|
+ <dialog-selectProduction ref="selectProduction"></dialog-selectProduction>
|
|
|
+ <QrScanner v-if="showQrCodeReader" @decode="onDecodeHandler" @close="qrReaderClose" />
|
|
|
+ </view>
|
|
|
+
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+ import {
|
|
|
+ normalizeProps,
|
|
|
+ reactive,
|
|
|
+ onMounted,
|
|
|
+ ref
|
|
|
+ } from 'vue'
|
|
|
+ import {
|
|
|
+ onLoad,
|
|
|
+ onReady,
|
|
|
+ onUnload,
|
|
|
+ onShow,
|
|
|
+ onReachBottom
|
|
|
+ } from '@dcloudio/uni-app'
|
|
|
+ import {
|
|
|
+ getAssistDayWorkList,
|
|
|
+ showDaywork,
|
|
|
+ showDayworkSave,
|
|
|
+ turnoverDelete
|
|
|
+ } from '@/api/business/dayWork.js'
|
|
|
+ import {
|
|
|
+ isTakeStock
|
|
|
+ } from '@/api/business/taksStackLot.js'
|
|
|
+ import {
|
|
|
+ getAbnormalityLot
|
|
|
+ } from '@/api/business/lot.js'
|
|
|
+ import {
|
|
|
+ carrierFinishedCheck
|
|
|
+ } from '@/api/business/carrier.js'
|
|
|
+ import {
|
|
|
+ store
|
|
|
+ } from '@/store/index.js'
|
|
|
+ import {
|
|
|
+ toHHmmss
|
|
|
+ } from '@/utils/common.js'
|
|
|
+ import {
|
|
|
+ onPullDownRefresh
|
|
|
+ } from "@dcloudio/uni-app"
|
|
|
+ import QrScanner from '../vueQrCode/index.vue'
|
|
|
+
|
|
|
+ const turnoverApplicationDialog = ref(null)
|
|
|
+ const selectProduction = ref(null)
|
|
|
+ const showQrCodeReader = ref(false);
|
|
|
+ const listData = ref([])
|
|
|
+ const curPlan = ref(null)
|
|
|
+ const bottomStatus = ref(false) // 底部按钮显示
|
|
|
+ const paging = ref();
|
|
|
+ const reqParam = ref(null);
|
|
|
+ const normalStatus = ref(true)
|
|
|
+ const isLoding = ref(false);
|
|
|
+ const curDayworkItem = ref({}) // 当前报工记录,回显是否显示取消周转的状态
|
|
|
+ const keywords = ref(null)
|
|
|
+ const tempList = ref([])
|
|
|
+ const wasteRecyclingList = ref([]) //废品回用批次
|
|
|
+ // 在数据中定义一个变量来控制遮罩层的显示
|
|
|
+ const isMaskShow = ref(false);
|
|
|
+ //打开图纸
|
|
|
+ //选中的daywork
|
|
|
+ const currentDaywork = ref({})
|
|
|
+ const editStatus = ref(false)
|
|
|
+ const notPreProcess = ref(true)
|
|
|
+ const curProcessAfte = ref([])
|
|
|
+ const showRight = ref(null) // 抽屉
|
|
|
+ const pageSize = ref(10)
|
|
|
+ const pageNum = ref(1)
|
|
|
+ const status = ref(true)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ onLoad(() => {
|
|
|
+ curPlan.value = store.planDetails;
|
|
|
+ normalStatus.value = true;
|
|
|
+ //废品回用的领料部门如果是当前工段,也要可以开始新批次
|
|
|
+ //查找当前计划单下的批次废品回用是当前工段
|
|
|
+ // getAbnormalityLot({
|
|
|
+ // productionPlanDetailId: store.planDetails.id,
|
|
|
+ // requisitionDepartmentId: store.curDeptDetails.deptId
|
|
|
+ // }).then(res => {
|
|
|
+ // wasteRecyclingList.value = res.rows
|
|
|
+ // if (store.planDetails.requisitionDepartmentId == store.curDeptDetails.deptId ||
|
|
|
+ // wasteRecyclingList.value.length > 0) {
|
|
|
+ // bottomStatus.value = true;
|
|
|
+ // store.isPreProcess = true;
|
|
|
+ // } else {
|
|
|
+ // bottomStatus.value = false;
|
|
|
+ // store.isPreProcess = false;
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ // 页面下拉刷新操作
|
|
|
+ onPullDownRefresh(() => {
|
|
|
+ uni.stopPullDownRefresh();
|
|
|
+ reflush();
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+ onShow(() => {
|
|
|
+ reflush();
|
|
|
+
|
|
|
+
|
|
|
+ })
|
|
|
+
|
|
|
+ ;
|
|
|
+
|
|
|
+ function reflush() {
|
|
|
+ init();
|
|
|
+ }
|
|
|
+
|
|
|
+ function qrReaderClose() {
|
|
|
+ showQrCodeReader.value = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ function onDecodeHandler(ret) {
|
|
|
+ showQrCodeReader.value = false;
|
|
|
+ console.log(ret);
|
|
|
+ let vehicleObj = {
|
|
|
+ carrierCode: ret
|
|
|
+ };
|
|
|
+ if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "请扫载具码",
|
|
|
+ duration: 1000
|
|
|
+ })
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ keywords.value = vehicleObj.carrierCode
|
|
|
+ init();
|
|
|
+ }
|
|
|
+ //扫码
|
|
|
+ function handleScan() {
|
|
|
+ showQrCodeReader.value = true;
|
|
|
+ // 引入原生插件
|
|
|
+ // const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
+ // if (mpaasScanModule) {
|
|
|
+ // // 调用插件的 mpaasScan 方法
|
|
|
+ // mpaasScanModule.mpaasScan({
|
|
|
+ // // 扫码识别类型,参数可多选,qrCode、barCode,
|
|
|
+ // // 如不设置,默认识别所有扫码类型,可能有些许影响识别效率
|
|
|
+ // scanType: ["qrCode", "barCode"],
|
|
|
+ // // 是否隐藏相册,默认false不隐藏
|
|
|
+ // hideAlbum: false,
|
|
|
+ // },
|
|
|
+ // (ret) => {
|
|
|
+ // console.log(ret);
|
|
|
+ // let vehicleObj = {
|
|
|
+ // carrierCode: ret.resp_result
|
|
|
+ // };
|
|
|
+ // if (!vehicleObj.carrierCode || vehicleObj.carrierCode == "") {
|
|
|
+ // uni.showToast({
|
|
|
+ // icon: "none",
|
|
|
+ // title: "请扫载具码",
|
|
|
+ // duration: 1000
|
|
|
+ // })
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // keywords.value = vehicleObj.carrierCode
|
|
|
+ // init();
|
|
|
+ // }
|
|
|
+ // );
|
|
|
+ // } else {
|
|
|
+ // // 测试时用
|
|
|
+ // keywords.value = "000642"
|
|
|
+ // init();
|
|
|
+ // }
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleShowTurnoverApplication(data) {
|
|
|
+ let productionPlan = {
|
|
|
+ id: data.productionPlanDetailId,
|
|
|
+ productionPlanId: data.productionPlanId,
|
|
|
+ productDescription: data.productDescription
|
|
|
+ }
|
|
|
+ store.planDetails = productionPlan
|
|
|
+ console.log(data)
|
|
|
+ //如果这批废了,则不能周转申请
|
|
|
+ if (data.isWaste == 1) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '此批已废,不能申请周转',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ isTakeStock().then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '正在盘点,不能申请周转',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let _data = data ?? {}
|
|
|
+ carrierFinishedCheck(data).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ // 调用子组件中的方法
|
|
|
+ turnoverApplicationDialog.value.open(_data)
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: res.msg
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ onReachBottom(() => {
|
|
|
+ console.log(status.value)
|
|
|
+ if (status.value) {
|
|
|
+ pageNum.value += 1
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ getAssistDayWorkList({
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
|
+ keywords: keywords.value,
|
|
|
+ pageNum: pageNum.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ normalStatus: normalStatus.value
|
|
|
+ }).then(res => {
|
|
|
+ const existingIds = new Set(listData.value.map(item => item.lotCode));
|
|
|
+ console.log(listData.value)
|
|
|
+ // 过滤出那些不在 existingIds 中的项,即新数据
|
|
|
+ const newRows = res.data.filter(row => !existingIds.has(row.lotCode));
|
|
|
+ console.log(newRows)
|
|
|
+ tempList.value.concat(newRows)
|
|
|
+ // 如果有新数据,将其添加到 listData
|
|
|
+ if (newRows.length > 0) {
|
|
|
+ listData.value = listData.value.concat(newRows);
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
+ } else {
|
|
|
+ uni.hideLoading();
|
|
|
+ // 如果没有新数据,更新状态表示没有更多数据
|
|
|
+ status.value = false;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(status.value)
|
|
|
+ })
|
|
|
+
|
|
|
+ function init() {
|
|
|
+ listData.value = []
|
|
|
+ status.value = true
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ pageNum.value = 1
|
|
|
+ let reqData = {
|
|
|
+ deptId: store.curDeptDetails.deptId,
|
|
|
+ keywords: keywords.value,
|
|
|
+ pageNum: pageNum.value,
|
|
|
+ pageSize: pageSize.value,
|
|
|
+ normalStatus: normalStatus.value
|
|
|
+ };
|
|
|
+ // console.log(normalStatus.value)
|
|
|
+
|
|
|
+ getAssistDayWorkList(reqData).then(res => {
|
|
|
+ console.log(res.data)
|
|
|
+ if (res.code == 200) {
|
|
|
+ res.data.forEach(item => {
|
|
|
+ let quantitySum = 0;
|
|
|
+ item.dayworkItemList.forEach(info => {
|
|
|
+ if (info.status < 4 && item.currentProcess.processStepNumber == info
|
|
|
+ .processStepNumber) {
|
|
|
+ quantitySum += info.qualifiedNum;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ item.totalQuantity = quantitySum;
|
|
|
+ });
|
|
|
+ tempList.value = res.data
|
|
|
+ // console.log(res)
|
|
|
+ listData.value = res.data
|
|
|
+ }
|
|
|
+
|
|
|
+ uni.hideLoading();
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleSearch() {
|
|
|
+ init();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleToreportingForWork(item) {
|
|
|
+ if (item.requisitionDepartmentId == store.curDeptDetails.deptId) {
|
|
|
+ store.isPreProcess = true;
|
|
|
+ } else {
|
|
|
+ store.isPreProcess = false;
|
|
|
+ }
|
|
|
+ let productionPlan = {
|
|
|
+ id: item.productionPlanDetailId,
|
|
|
+ productionPlanId: item.productionPlanId,
|
|
|
+ productDescription: item.productDescription
|
|
|
+ }
|
|
|
+ store.dayworkInfo = item
|
|
|
+ store.planDetails = productionPlan
|
|
|
+ uni.navigateTo({
|
|
|
+ url: "/pages/assistReportingForWork/index"
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleClickProcessList(item) {
|
|
|
+ let curProcessAfterList = [];
|
|
|
+ console.log("工序列表", item)
|
|
|
+ currentDaywork.value = item
|
|
|
+ editStatus.value = false
|
|
|
+ // if (item.isWasteRecycling == 1 || item.isAmend == 1) {
|
|
|
+ // editStatus.value = true
|
|
|
+ // } else {
|
|
|
+ // editStatus.value = false
|
|
|
+ // }
|
|
|
+ let nextIndex = 0;
|
|
|
+ for (let i = 0; i < item.processSequence.length; i++) {
|
|
|
+ if (item.nextProcess) {
|
|
|
+ if (item.nextProcess.processStepNumber == item.processSequence[i].processStepNumber) {
|
|
|
+ nextIndex = i;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ nextIndex = item.processSequence.length
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let i = 0; i < item.processSequence.length; i++) {
|
|
|
+ if (i >= nextIndex) {
|
|
|
+ curProcessAfterList.push(item.processSequence[i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (item.status == 3) {
|
|
|
+ curProcessAfterList.splice(0, 1)
|
|
|
+ }
|
|
|
+ console.log(curProcessAfterList)
|
|
|
+ curProcessAfte.value = curProcessAfterList;
|
|
|
+ showRight.value.open();
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleSearchCode() {
|
|
|
+ // console.log(normalStatus.value)
|
|
|
+ selectProduction.value.open(normalStatus.value);
|
|
|
+ }
|
|
|
+
|
|
|
+ function switchChange(event) {
|
|
|
+ uni.pageScrollTo({
|
|
|
+
|
|
|
+ scrollTop: 0,
|
|
|
+
|
|
|
+ duration: 100
|
|
|
+
|
|
|
+ });
|
|
|
+ pageNum.value = 1
|
|
|
+ console.log(event)
|
|
|
+ //异常批
|
|
|
+ if (normalStatus.value) {
|
|
|
+ normalStatus.value = false
|
|
|
+ init()
|
|
|
+ } else {
|
|
|
+ //正常批
|
|
|
+ normalStatus.value = true
|
|
|
+ init()
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleOpenDrawing() {
|
|
|
+ console.log(currentDaywork.value, "444")
|
|
|
+
|
|
|
+ var filteredProcess = currentDaywork.value.processSequence.filter(item => item.processStepNumber == currentDaywork
|
|
|
+ .value.currentProcess.processStepNumber);
|
|
|
+
|
|
|
+ // 检查 filteredProcess 是否有元素,并选择第一个元素
|
|
|
+ if (filteredProcess.length > 0) {
|
|
|
+ var firstMatch = filteredProcess[0]; // 获取第一个匹配的对象
|
|
|
+ console.log("currentDaywork", currentDaywork.value)
|
|
|
+ // 对 technologicalProcessDetailId 进行URL编码
|
|
|
+ var encodedId = encodeURIComponent(currentDaywork.value.productId);
|
|
|
+ var enTechnologicalProcessId = encodeURIComponent(currentDaywork.value.technologicalProcessId);
|
|
|
+ var enprocessCode = encodeURIComponent(firstMatch.processCode);
|
|
|
+ var encodeCode = encodeURIComponent(currentDaywork.value.lotCode);
|
|
|
+ var enProcessAlias = encodeURIComponent(firstMatch.processAlias);
|
|
|
+ var enIsWasteRecycling = encodeURIComponent(currentDaywork.value.isWasteRecycling);
|
|
|
+ var enIsAmend = encodeURIComponent(currentDaywork.value.isAmend);
|
|
|
+ // 构建查询参数字符串
|
|
|
+ var queryParam =
|
|
|
+ `param1=${encodedId}¶m2=${encodeCode}¶m3=${enprocessCode}¶m4=${enTechnologicalProcessId}¶m5=${enProcessAlias}¶m6=${enIsWasteRecycling}¶m7=${enIsAmend}`;
|
|
|
+
|
|
|
+ // 使用模板字符串构建完整的URL
|
|
|
+ var navigateUrl = `/pages/drawingMenu/index?${queryParam}`;
|
|
|
+
|
|
|
+ // 导航到指定页面
|
|
|
+ uni.navigateTo({
|
|
|
+ url: navigateUrl
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ console.log('No process matched the current process step number.');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function handleDoTurnoverAfter() {
|
|
|
+ reflush();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ function handleCancelTurnover(data) {
|
|
|
+ isTakeStock().then(response => {
|
|
|
+ if (response.data) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: 'none',
|
|
|
+ title: '正在盘点,不能取消周转',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ isMaskShow.value = true; // 显示遮罩层
|
|
|
+ uni.showLoading({
|
|
|
+ title: '加载中'
|
|
|
+ });
|
|
|
+ turnoverDelete(data).then(res => {
|
|
|
+ isMaskShow.value = false
|
|
|
+ if (res.code == 200) {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "success",
|
|
|
+ title: "取消成功",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ isLoding.value = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ init(store.planDetails.id);
|
|
|
+ }, 1000);
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: "none",
|
|
|
+ title: "取消失败",
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ isLoding.value = false;
|
|
|
+ setTimeout(() => {
|
|
|
+ init(store.planDetails.id);
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss">
|
|
|
+ $nav-height: 60rpx;
|
|
|
+
|
|
|
+ /* 遮罩层样式 */
|
|
|
+ .mask {
|
|
|
+ position: fixed;
|
|
|
+ /* 固定定位,覆盖整个屏幕 */
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background-color: rgba(0, 0, 0, 0.3);
|
|
|
+ /* 黑色背景,透明度30% */
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ /* 水平居中 */
|
|
|
+ align-items: center;
|
|
|
+ /* 垂直居中 */
|
|
|
+ z-index: 1000;
|
|
|
+ /* 确保遮罩层在其他元素之上 */
|
|
|
+ }
|
|
|
+
|
|
|
+ .box-bg {
|
|
|
+ width: 94%;
|
|
|
+ background-color: #F5F5F5;
|
|
|
+ padding: 5rpx 16rpx;
|
|
|
+ justify-content: space-around;
|
|
|
+ align-items: center;
|
|
|
+ margin: 24rpx auto 0;
|
|
|
+
|
|
|
+ .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 0;
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .list-title {
|
|
|
+ width: 100%;
|
|
|
+ margin-top: 16rpx;
|
|
|
+ height: 64rpx;
|
|
|
+ line-height: 64rpx;
|
|
|
+ align-items: center;
|
|
|
+ margin-left: 32rpx;
|
|
|
+
|
|
|
+ .label {
|
|
|
+
|
|
|
+ font-size: 32rpx;
|
|
|
+ margin-right: 24rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .icon-gear {
|
|
|
+ font-size: 56rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .switch {
|
|
|
+ margin-top: -8rpx;
|
|
|
+ transform: scale(0.7);
|
|
|
+ }
|
|
|
+
|
|
|
+ .scroll-container {
|
|
|
+ width: 92%;
|
|
|
+ margin: 24rpx auto 0 auto;
|
|
|
+ height: calc(90% - 100rpx);
|
|
|
+ overflow: scroll
|
|
|
+ }
|
|
|
+
|
|
|
+ .list-item {
|
|
|
+ background-color: #fff;
|
|
|
+ position: relative;
|
|
|
+ padding: 16rpx;
|
|
|
+ padding-bottom: 24rpx;
|
|
|
+ margin-bottom: 24rpx;
|
|
|
+ border-radius: 24rpx;
|
|
|
+
|
|
|
+ .title-container {
|
|
|
+
|
|
|
+ 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;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.finished {
|
|
|
+ border: 1px solid #BBBBBB;
|
|
|
+ background-color: #F5F5F5;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ color: #BBBBBB;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.turnover {
|
|
|
+ border: 1px solid #FF7901;
|
|
|
+ background-color: #F6FFFD;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ color: #FF7901;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .item-info {
|
|
|
+ margin-bottom: 8rpx;
|
|
|
+
|
|
|
+ .label {
|
|
|
+ font-size: 28rpx;
|
|
|
+ width: 220rpx;
|
|
|
+ color: #808080;
|
|
|
+
|
|
|
+ &.right {
|
|
|
+ flex: 1;
|
|
|
+ color: #000000;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .status-btn {
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ .turnover-tag {
|
|
|
+ padding-right: 12rpx;
|
|
|
+ padding-left: 12rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ border: 1rpx solid #FF7901;
|
|
|
+ background-color: #FF7901;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ .reporting-tag {
|
|
|
+ padding-right: 12rpx;
|
|
|
+ padding-left: 12rpx;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ margin-left: 16rpx;
|
|
|
+ border: 1rpx solid #1684fc;
|
|
|
+ background-color: #1684fc;
|
|
|
+ font-size: 28rpx;
|
|
|
+ color: #FFFFFF;
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .scan-btn {
|
|
|
+ height: 64rpx;
|
|
|
+ color: #ffffff;
|
|
|
+ background-color: #f47c3c;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ border-radius: 8rpx;
|
|
|
+ flex: 1;
|
|
|
+ }
|
|
|
+</style>
|