|
@@ -10,13 +10,15 @@
|
|
<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
|
|
<view v-if="listData.length == 0" style="color: #999;margin: 50% auto;">
|
|
<text>暂无生产计划</text>
|
|
<text>暂无生产计划</text>
|
|
</view>
|
|
</view>
|
|
- <view v-else style="height: calc(100% - 100rpx); overflow: auto;">
|
|
|
|
|
|
+ <view v-else style="height: calc(100% - 100rpx); overflow: auto;padding-bottom: 100rpx;">
|
|
<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
|
|
<view v-for="(item, index) in listData" :key="index" @click="handleToBatchReporting(item)"
|
|
class="list-item">
|
|
class="list-item">
|
|
<view class="title-container uni-row">
|
|
<view class="title-container uni-row">
|
|
<view class="title uni-row">
|
|
<view class="title uni-row">
|
|
<text class="label">生产计划单号</text>
|
|
<text class="label">生产计划单号</text>
|
|
<text class="label code">{{ item['productionPlanNo'] }}</text>
|
|
<text class="label code">{{ item['productionPlanNo'] }}</text>
|
|
|
|
+ <text class="label" style="margin-left: 20px;">序号</text>
|
|
|
|
+ <text class="label code">{{ item['lineNumber'] }}</text>
|
|
</view>
|
|
</view>
|
|
<view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
|
|
<view v-if="item['dayWorkList'].length > 0" class="tag"><text class="label">进行中</text></view>
|
|
<view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
|
|
<view v-else type="default" class="tag not-start"><text class="label">未开始</text></view>
|
|
@@ -43,12 +45,19 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
+ <view class="bottom uni-row">
|
|
|
|
+ <button class="start-batch-btn" style="margin-right: 10rpx;background-color: #67c337;"
|
|
|
|
+ @click="handleScanCode">扫码报工</button>
|
|
|
|
+ <button class="start-batch-btn" type="primary" @click="handleSearchCode">查箱号</button>
|
|
|
|
+ </view>
|
|
|
|
+ <dialog-selectDaywork ref='selectDaywork'
|
|
|
|
+ @handleSelectDaywork='handleSelectDaywork'></dialog-selectDaywork>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
import {
|
|
import {
|
|
- getPlanDetailsList
|
|
|
|
|
|
+ getPlanDetailsList,selectByCarrierCode,selectInfoByLotCode
|
|
} from '@/api/business/planDetails.js'
|
|
} from '@/api/business/planDetails.js'
|
|
import {
|
|
import {
|
|
ref
|
|
ref
|
|
@@ -73,6 +82,8 @@
|
|
|
|
|
|
const listData = ref([])
|
|
const listData = ref([])
|
|
const keywords = ref('')
|
|
const keywords = ref('')
|
|
|
|
+ const selectDaywork = ref(null)
|
|
|
|
+ const carrierCode = ref(null)
|
|
|
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
// dayworkItem数据更改后刷新数据
|
|
// dayworkItem数据更改后刷新数据
|
|
@@ -108,6 +119,7 @@
|
|
})
|
|
})
|
|
|
|
|
|
function reflush() {
|
|
function reflush() {
|
|
|
|
+ keywords.value = ''
|
|
init();
|
|
init();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -133,6 +145,30 @@
|
|
url: '/pages/sortBatchReporting/index'
|
|
url: '/pages/sortBatchReporting/index'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+ //查箱号
|
|
|
|
+ function handleSearchCode() {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: '/pages/sortProductionPlan/details'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ //带回
|
|
|
|
+ function handleSelectDaywork(data) {
|
|
|
|
+ console.log(data)
|
|
|
|
+ //查询计划单信息跳转
|
|
|
|
+ selectInfoByLotCode({lotCode:data}).then(res=>{
|
|
|
|
+ store.planDetails = res.data
|
|
|
|
+ var code = encodeURIComponent(carrierCode.value);
|
|
|
|
+ // 构建查询参数字符串
|
|
|
|
+ var queryParam =
|
|
|
|
+ `param1=${code}`;
|
|
|
|
+
|
|
|
|
+ // 使用模板字符串构建完整的URL
|
|
|
|
+ var navigateUrl = `/pages/sortBatchReporting/index?${queryParam}`;
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ url: navigateUrl
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
function handleSearch() {
|
|
function handleSearch() {
|
|
let reqParam = {
|
|
let reqParam = {
|
|
@@ -141,6 +177,77 @@
|
|
reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
|
|
reqParam.tenantId = !store.tenantId ? store.userInfo.tenantId : store.tenantId;
|
|
init(reqParam)
|
|
init(reqParam)
|
|
}
|
|
}
|
|
|
|
+ function handleScanCode() {
|
|
|
|
+ // 引入原生插件
|
|
|
|
+ const mpaasScanModule = uni.requireNativePlugin("Mpaas-Scan-Module");
|
|
|
|
+ // const mpaasScanModule = null
|
|
|
|
+ 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;
|
|
|
|
+ }
|
|
|
|
+ selectByCarrierCode({
|
|
|
|
+ carrierCode: vehicleObj.carrierCode,
|
|
|
|
+ deptId:Number(store.curDeptDetails.deptId)
|
|
|
|
+ }).then(response => {
|
|
|
|
+ carrierCode.value = vehicleObj.carrierCode
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ if (response.data.length > 1) {
|
|
|
|
+ selectDaywork.value.open(response.data)
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ handleSelectDaywork(response.data[0].lotCode)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: response.msg,
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ } else {
|
|
|
|
+ // 测试时用
|
|
|
|
+ selectByCarrierCode({
|
|
|
|
+ carrierCode: '000745',
|
|
|
|
+ deptId:Number(store.curDeptDetails.deptId)
|
|
|
|
+ }).then(response => {
|
|
|
|
+ if (response.code == 200) {
|
|
|
|
+ carrierCode.value = '000745'
|
|
|
|
+ if (response.data.length > 1) {
|
|
|
|
+ selectDaywork.value.open(response.data)
|
|
|
|
+ } else {
|
|
|
|
+ handleSelectDaywork(response.data[0].lotCode)
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ uni.showToast({
|
|
|
|
+ icon: 'none',
|
|
|
|
+ title: response.msg,
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
@@ -255,4 +362,36 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ .bottom {
|
|
|
|
+ height: 10%;
|
|
|
|
+ position: fixed;
|
|
|
|
+ right: 0;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ border-top: 1px solid #999999;
|
|
|
|
+ padding: 16rpx 32rpx;
|
|
|
|
+ align-items: center;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ justify-content: space-evenly;
|
|
|
|
+
|
|
|
|
+ .start-batch-btn {
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: 80rpx;
|
|
|
|
+ line-height: 80rpx;
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .view-end-btn {
|
|
|
|
+ flex: 1;
|
|
|
|
+ height: 80rpx;
|
|
|
|
+ line-height: 80rpx;
|
|
|
|
+ border-radius: 8rpx;
|
|
|
|
+ color: #FFFFFF;
|
|
|
|
+ font-size: 28rpx;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|