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.

238 lines
6.2 KiB

12 months ago
<template>
<view class="" style="background-color: #fff;">
<view class="">
11 months ago
<view class="">
<view class="cell_box uni-flex uni-row">
11 months ago
<!-- <view class="cell_info">
<view class="text_lightblue">类型</view>
<view>{{getInspectType(jobContent.inspectType)}}</view>
11 months ago
</view> -->
<view class="cell_info">
<view class="text_lightblue">收货数</view>
<view>{{jobContent.receiveQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">检验数</view>
<view>{{jobContent.sampleQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
<view class="cell_info">
<view class="text_lightblue">不合格数</view>
<view style="color: #F56C6C;">{{jobContent.failedQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
11 months ago
<view class="cell_info">
<view class="text_lightblue">报废数</view>
<view style="color: #EC9C00">{{jobContent.crackQty}}{{getUnitInfo(jobContent.uom)}}</view>
</view>
</view>
11 months ago
<!-- <u-line /> -->
</view>
</view>
<u-line />
12 months ago
<uni-collapse ref="collapse1" @change="">
<uni-collapse-item :open="true">
<template v-slot:title>
11 months ago
<item-compare-qty :dataContent="dataContent" :handleQty="Number(dataContent.handleQty)"
:isShowStdPack="false">
12 months ago
</item-compare-qty>
<view class="" style="margin-left: 20rpx; ">
<batch :batch="jobContent.batch"></batch>
12 months ago
</view>
</template>
<u-line />
12 months ago
<view class="" v-for="(item,index) in dataContent.subList">
12 months ago
<uni-swipe-action ref="swipeAction">
<uni-swipe-action-item @click="swipeClick($event,item,index)"
:right-options="item.scaned?scanOptions:detailOptions">
11 months ago
<recommend :detail="item" :isShowPack="true" :isShowBatch="isShowBatch"
11 months ago
:isShowFromLocation="isShowLocation" style=' border-bottom: 0upx solid #fff;'></recommend>
11 months ago
<view v-if="item.failedQty>0||item.crackQty>0" :class="item.scaned?'scan_view':''"
style="font-size: 32rpx;padding-left: 2px;">
11 months ago
<view class="cell_box uni-flex uni-row">
<view class="cell_info uni-flex uni-row">
<view class="text_lightblue">
不合格
</view>
<view style="padding-left: 12rpx;color: #F56C6C;">
{{item.failedQty}}
</view>
12 months ago
</view>
11 months ago
<view class="cell_info uni-flex uni-row">
<view class="text_lightblue">
报废
</view>
<view style="padding-left: 12rpx;color: #EC9C00">
{{item.crackQty}}
</view>
12 months ago
</view>
11 months ago
<view class="cell_info uni-flex uni-row">
<view class="text_lightblue">
合格
</view>
11 months ago
<view style="padding-left: 12rpx;color: #34C759">
11 months ago
{{item.goodQty}}
</view>
</view>
12 months ago
</view>
11 months ago
</view>
12 months ago
</uni-swipe-action-item>
</uni-swipe-action>
<u-line />
</view>
11 months ago
12 months ago
</uni-collapse-item>
</uni-collapse>
11 months ago
<inspectEdit ref='inspectEdit' @getInspectResult='getInspectResult'>
12 months ago
</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';
11 months ago
12 months ago
export default {
components: {
itemCompareQty,
recommend,
comMessage,
jobDetailPopup,
batch,
inspectEdit
},
props: {
dataContent: {
type: Object,
default: {}
},
jobContent: {
12 months 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: {},
11 months ago
editItem: {},
editIndex: 0,
12 months ago
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: {
11 months ago
getInspectType(value) {
return getInspectType(value)
},
11 months ago
swipeClick(e, item, index) {
12 months ago
if (e.content.text == "详情") {
this.detail(item)
} else if (e.content.text == "编辑") {
11 months ago
this.edit(item, index)
12 months ago
} else if (e.content.text == "移除") {
this.remove(item)
}
},
11 months ago
edit(item, index) {
12 months ago
this.editIndex = index;
this.editItem = item;
this.$refs.inspectEdit.openEditPopup(this.editItem);
},
detail(item) {
this.showItem = item;
this.$refs.receiptHint.openScanPopup(item)
12 months ago
},
remove(item) {
this.$refs.message.showQuestionMessage("确定移除扫描信息?",
res => {
if (res) {
item.scaned = false
item.failedQty = 0;
item.crackQty = 0;
item.sampleQty = 0;
item.notPassedQty = 0;
11 months ago
item.inspectResult = ""
item.failedReason = ""
11 months ago
// item.handleQty = 0;
item.handleQty = null;
11 months ago
item.photos = ""
12 months ago
this.$forceUpdate()
this.$emit('remove', item)
}
});
},
confirm(qty) {
this.$emit('updateData')
},
11 months ago
getInspectResult(result) {
this.dataContent.subList[this.editIndex] = result;
12 months ago
if (this.$refs.collapse1 != undefined) {
this.$nextTick(res => {
this.$refs.collapse1.resize()
})
}
11 months ago
this.$emit('updateData', )
},
getUnitInfo(value) {
return getUnitInfo(value).label
},
11 months ago
12 months ago
}
}
</script>
<style>
</style>