|
@@ -156,7 +156,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view>
|
|
<view>
|
|
- <zb-table :columns="getRelateList()" :stripe="true" :fit="true" @dele="dele"
|
|
|
|
|
|
+ <zb-table :columns="getRelateList()" :stripe="true" :fit="false" @dele="dele"
|
|
:data="processInspecion.relateList"></zb-table>
|
|
:data="processInspecion.relateList"></zb-table>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -198,7 +198,7 @@
|
|
</view>
|
|
</view>
|
|
|
|
|
|
<view class="btns-container uni-row">
|
|
<view class="btns-container uni-row">
|
|
- <view v-if="editable()" class="finished-btn" @click="endWork">结束报工</view>
|
|
|
|
|
|
+ <view v-if="editable() && navigateOnce== 0" class="finished-btn" @click="endWork">结束报工</view>
|
|
<view v-if="editable()" class="question-btn uni-column" @click.stop="handleAddConsultation">
|
|
<view v-if="editable()" class="question-btn uni-column" @click.stop="handleAddConsultation">
|
|
<uni-icons type="headphones" size="24" />
|
|
<uni-icons type="headphones" size="24" />
|
|
<text>咨询</text>
|
|
<text>咨询</text>
|
|
@@ -245,11 +245,13 @@
|
|
const consultations = ref([]) //咨询信息
|
|
const consultations = ref([]) //咨询信息
|
|
const flag = ref(false)
|
|
const flag = ref(false)
|
|
const showTransfer = ref(true)
|
|
const showTransfer = ref(true)
|
|
|
|
+ const navigateOnce = ref(0)
|
|
const processInspecion = ref({
|
|
const processInspecion = ref({
|
|
remark: "",
|
|
remark: "",
|
|
rejectNum: 0,
|
|
rejectNum: 0,
|
|
examiningNum: 0,
|
|
examiningNum: 0,
|
|
status: 0,
|
|
status: 0,
|
|
|
|
+ lot: {}
|
|
})
|
|
})
|
|
const editRelate = ref(false)
|
|
const editRelate = ref(false)
|
|
const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
|
|
const urlList = JSON.parse(uni.getStorageSync('baseUrl'))
|
|
@@ -265,17 +267,19 @@
|
|
name: 'lotCode',
|
|
name: 'lotCode',
|
|
label: '批号',
|
|
label: '批号',
|
|
align: 'center',
|
|
align: 'center',
|
|
- width: 200
|
|
|
|
|
|
+ width: 100
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'allCarriers',
|
|
name: 'allCarriers',
|
|
label: '箱号',
|
|
label: '箱号',
|
|
- align: 'center'
|
|
|
|
|
|
+ align: 'center',
|
|
|
|
+ width: 80
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name: 'isMaster',
|
|
name: 'isMaster',
|
|
label: '主检查单',
|
|
label: '主检查单',
|
|
align: 'center',
|
|
align: 'center',
|
|
|
|
+ width: 60,
|
|
filters: {
|
|
filters: {
|
|
0: '否',
|
|
0: '否',
|
|
1: '是'
|
|
1: '是'
|
|
@@ -286,6 +290,7 @@
|
|
type: 'operation',
|
|
type: 'operation',
|
|
label: '关联',
|
|
label: '关联',
|
|
align: 'center',
|
|
align: 'center',
|
|
|
|
+ width: 60,
|
|
renders: [{
|
|
renders: [{
|
|
name: '删除',
|
|
name: '删除',
|
|
type: 'warn',
|
|
type: 'warn',
|
|
@@ -377,13 +382,18 @@
|
|
})
|
|
})
|
|
|
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
- // uni.$off('addWasteInfoEvent');
|
|
|
|
|
|
+ navigateOnce.value = 0
|
|
|
|
+ uni.$off('addWasteInfoEvent');
|
|
if (!flag.value) {
|
|
if (!flag.value) {
|
|
if (store.processInspection != null) {
|
|
if (store.processInspection != null) {
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
title: '加载中'
|
|
title: '加载中'
|
|
});
|
|
});
|
|
- processInspecion.value = store.processInspection
|
|
|
|
|
|
+ console.log(store.processInspection)
|
|
|
|
+ processInspecion.value = {
|
|
|
|
+ ...store.processInspection,
|
|
|
|
+ lot: {}
|
|
|
|
+ }
|
|
selectOutsourcedInspecion(processInspecion.value).then(res => {
|
|
selectOutsourcedInspecion(processInspecion.value).then(res => {
|
|
console.log("res", res);
|
|
console.log("res", res);
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
@@ -680,7 +690,11 @@
|
|
// delta: index
|
|
// delta: index
|
|
// }
|
|
// }
|
|
// );
|
|
// );
|
|
- uni.navigateBack()
|
|
|
|
|
|
+ if (navigateOnce.value == 0) {
|
|
|
|
+ navigateOnce.value = 1
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ }
|
|
|
|
+
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -695,7 +709,7 @@
|
|
function handleSelectInspectionChamber(data) {
|
|
function handleSelectInspectionChamber(data) {
|
|
processInspecion.value.inspectionChamberId = data
|
|
processInspecion.value.inspectionChamberId = data
|
|
console.log(processInspecion.value)
|
|
console.log(processInspecion.value)
|
|
- saveOutsourcedInspecion(processInspecion.value).then(res => {
|
|
|
|
|
|
+ saveOutsourceInspectionWithRelate(processInspecion.value).then(res => {
|
|
if (res.code == 200) {
|
|
if (res.code == 200) {
|
|
// let index = 0;
|
|
// let index = 0;
|
|
// let pages = getCurrentPages();
|
|
// let pages = getCurrentPages();
|
|
@@ -712,7 +726,10 @@
|
|
// delta: index
|
|
// delta: index
|
|
// }
|
|
// }
|
|
// );
|
|
// );
|
|
- uni.navigateBack()
|
|
|
|
|
|
+ if (navigateOnce.value == 0) {
|
|
|
|
+ navigateOnce.value = 1
|
|
|
|
+ uni.navigateBack()
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -797,7 +814,7 @@
|
|
unfitInfos.value.push(info)
|
|
unfitInfos.value.push(info)
|
|
console.log(data)
|
|
console.log(data)
|
|
|
|
|
|
- uni.$off('addWasteInfoEvent')
|
|
|
|
|
|
+ // uni.$off('addWasteInfoEvent')
|
|
}
|
|
}
|
|
// 删除不合格信息
|
|
// 删除不合格信息
|
|
const handleDelWaste = (index) => {
|
|
const handleDelWaste = (index) => {
|
|
@@ -816,17 +833,19 @@
|
|
}
|
|
}
|
|
|
|
|
|
const addRelate = (relates) => {
|
|
const addRelate = (relates) => {
|
|
|
|
+ isEventTriggered.value = true;
|
|
processInspecion.value.relateList = relates
|
|
processInspecion.value.relateList = relates
|
|
- uni.$off('relateEvent')
|
|
|
|
|
|
+ // uni.$off('relateEvent')
|
|
}
|
|
}
|
|
|
|
|
|
const handleAddLot = () => {
|
|
const handleAddLot = () => {
|
|
console.log('添加关联')
|
|
console.log('添加关联')
|
|
|
|
+ isEventTriggered.value = false;
|
|
uni.$once('relateEvent', (data) => {
|
|
uni.$once('relateEvent', (data) => {
|
|
- // if (!isEventTriggered.value) {
|
|
|
|
- // 如果事件尚未触发,则执行事件触发逻辑
|
|
|
|
- addRelate(data)
|
|
|
|
- // }
|
|
|
|
|
|
+ if (!isEventTriggered.value) {
|
|
|
|
+ // 如果事件尚未触发,则执行事件触发逻辑
|
|
|
|
+ addRelate(data)
|
|
|
|
+ }
|
|
// uni.$off('relateEvent')
|
|
// uni.$off('relateEvent')
|
|
})
|
|
})
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -844,10 +863,10 @@
|
|
isEventTriggered.value = false;
|
|
isEventTriggered.value = false;
|
|
// 监听事件
|
|
// 监听事件
|
|
uni.$once('wasteConsultationEvent', (data) => {
|
|
uni.$once('wasteConsultationEvent', (data) => {
|
|
- // if (!isEventTriggered.value) {
|
|
|
|
- // 如果事件尚未触发,则执行事件触发逻辑
|
|
|
|
- addConsultation(data)
|
|
|
|
- // }
|
|
|
|
|
|
+ if (!isEventTriggered.value) {
|
|
|
|
+ // 如果事件尚未触发,则执行事件触发逻辑
|
|
|
|
+ addConsultation(data)
|
|
|
|
+ }
|
|
// uni.$off('wasteConsultationEvent')
|
|
// uni.$off('wasteConsultationEvent')
|
|
})
|
|
})
|
|
|
|
|