You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
5.2 KiB

1 year ago
<template>
<view class="" style="background-color: #fff;">
<view class="">
<view class="" style="font-size: 32rpx;margin-left: 20rpx;">
<view class="">
检验类型 : {{getInspectType(jobContent.inspectType)}}
</view>
<view class="">
收货数量 : {{jobContent.receiveQty}}{{getUnitInfo(jobContent.uom)}}
</view>
<view class="">
检验数量 : {{jobContent.sampleQty}}{{getUnitInfo(jobContent.uom)}}
</view>
<view class="">
不合格数量 : {{jobContent.failedQty}}{{getUnitInfo(jobContent.uom)}}
</view>
<view class="">
报废数量 : {{jobContent.crackQty}}{{getUnitInfo(jobContent.uom)}}
</view>
</view>
</view>
<u-line />
1 year ago
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
<item-compare-qty :dataContent="dataContent" :handleQty="Number(dataContent.handleQty)">
</item-compare-qty>
<view class="" style="margin-left: 20rpx; ">
<batch :batch="jobContent.batch"></batch>
1 year ago
</view>
1 year ago
</template>
<u-line />
1 year ago
<view class="" v-for="(item,index) in dataContent.subList">
1 year ago
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
1 year ago
<recommend :detail="item" :isShowPack="isShowPack"
:isShowBatch="isShowBatch" :isShowFromLocation="isShowLocation"></recommend>
1 year ago
<view v-if="item.failedQty>0||item.crackQty>0" :class="item.scaned?'scan_view':''" style="font-size: 32rpx;padding-left: 3rpx;">
1 year ago
<view class="" >
不合格数量 {{item.failedQty}}
</view>
<view class="" >
报废数量 {{item.crackQty}}
</view>
<view class="" >
合格数量 {{item.goodQty}}
</view>
1 year ago
</view>
</uni-swipe-action-item>
</uni-swipe-action>
<u-line />
</view>
</uni-collapse-item>
</uni-collapse>
<inspectEdit ref='inspectEdit'
@getInspectResult='getInspectResult'>
</inspectEdit>
<job-detail-popup ref="receiptHint" :dataContent="showItem"></job-detail-popup>
<com-message ref="message"></com-message>
</view>
</template>
<script>
import itemCompareQty from '@/mycomponents/item/itemCompareQty.vue'
import recommend from '@/mycomponents/recommend/recommend.vue'
import jobDetailPopup from '@/mycomponents/job/jobDetailPopup.vue'
import comMessage from '@/mycomponents/common/comMessage.vue'
import batch from '@/mycomponents/balance/batch.vue'
import inspectEdit from "@/pages/inspect/coms/inspectEdit.vue"
import {
getDetailOption,
getDetailEditRemoveOption,
getDetailRemoveOption
} from '@/common/array.js';
import {
getUnitInfo,
getInspectType
} from '@/common/directory.js';
1 year ago
export default {
components: {
itemCompareQty,
recommend,
comMessage,
jobDetailPopup,
batch,
inspectEdit
},
props: {
dataContent: {
type: Object,
default: {}
},
jobContent: {
1 year ago
type: Object,
default: {}
},
isShowPack: {
type: Boolean,
default: true
},
isShowBatch: {
type: Boolean,
default: true
},
isShowLocation: {
type: Boolean,
default: true
},
jobType: {
type: String,
default: ""
},
},
watch: {
},
data() {
return {
option: [],
showItem: {},
editItem: {
},
editIndex:0,
detailOptions: [],
scanOptions: []
}
},
mounted() {
if (this.detailOptions.length == 0) {
this.detailOptions = getDetailOption();
}
if (this.scanOptions.length == 0) {
this.scanOptions = getDetailEditRemoveOption();
// if (this.dataContent.allowModifyQty == 1) {
// this.scanOptions = getDetailEditRemoveOption();
// } else {
// this.scanOptions = getDetailRemoveOption();
// }
}
},
methods: {
getInspectType(value){
return getInspectType(value)
},
1 year ago
swipeClick(e, item,index) {
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
this.edit(item,index)
} else if (e.content.text == "移除") {
this.remove(item)
}
},
edit(item,index) {
this.editIndex = index;
this.editItem = item;
this.$refs.inspectEdit.openEditPopup(this.editItem);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup()
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.failedQty = 0;
item.crackQty = 0;
item.sampleQty = 0;
item.notPassedQty = 0;
item.inspectResult =""
item.failedReason =""
1 year ago
item.photos =""
1 year ago
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.$emit('updateData')
},
getInspectResult(result){
1 year ago
this.dataContent.subList[this.editIndex]= result;
1 year ago
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
1 year ago
this.$emit('updateData',)
},
getUnitInfo(value) {
return getUnitInfo(value).label
},
1 year ago
}
}
</script>
<style>
</style>