|
@@ -3,10 +3,10 @@
|
|
|
<view class="lot-info uni-column">
|
|
|
<view class="lot-code uni-row">
|
|
|
<text>批次号</text>
|
|
|
- <text style="margin-left: 24rpx;">D2423156000691</text>
|
|
|
+ <text style="margin-left: 24rpx;">{{ dayworkItem.lotCode }}</text>
|
|
|
</view>
|
|
|
<view class="product-info">
|
|
|
- 产品描述
|
|
|
+ 产品描述: {{ dayworkItem.productDescription }}
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
@@ -75,17 +75,57 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { ref } from 'vue'
|
|
|
+ import {
|
|
|
+ onMounted,
|
|
|
+ getCurrentInstance
|
|
|
+ } from 'vue';
|
|
|
+ import { getSortingDayworkItem } from '@/api/business/sortDaywork.js'
|
|
|
import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
|
|
|
|
|
|
const unfitInfos = ref([])
|
|
|
const consultations = ref([])
|
|
|
+ const dayworkInfo = ref({})
|
|
|
+ const dayworkItem = ref({})
|
|
|
|
|
|
/***************************** 页面生命周期函数 *****************************/
|
|
|
onShow(() => {
|
|
|
|
|
|
})
|
|
|
+ onMounted(() => {
|
|
|
+ const instance = getCurrentInstance().proxy
|
|
|
+ const eventChannel = instance.getOpenerEventChannel();
|
|
|
+
|
|
|
+ eventChannel.on('acceptDataFromOpenerPage', function(data) {
|
|
|
+ console.log('acceptDataFromOpenerPage', data)
|
|
|
+ if (data && data.data) {
|
|
|
+ dayworkInfo.value = data.data
|
|
|
+ init({
|
|
|
+ id: data.data.id
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let reqParam = {
|
|
|
+ id: dayworkInfo.value.id
|
|
|
+ }
|
|
|
+ init(reqParam);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
|
|
|
/***************************** 定义了一些方法 *****************************/
|
|
|
+ const init = (data) => {
|
|
|
+ // 获取当前报工信息
|
|
|
+ getSortingDayworkItem(data).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code === 200) {
|
|
|
+ dayworkItem.value = res.data
|
|
|
+ } else {
|
|
|
+ uni.showToast({
|
|
|
+ icon: none,
|
|
|
+ title: res.message
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
const addUnfitInfo = (data) => {
|
|
|
const info = {
|
|
|
title: data.title,
|