<!-- 收货任务详情 -->
<template>
	<view class="device-detail" style="padding-bottom: 0 !important;">
		<comRequestTopInfo :requestContent="dataContent"></comRequestTopInfo>
		<view class="margin_xs_bottom">
			<!-- <view class="label_order">
				<image class="icon_normal" src="@/static/icons_ui/icon_apply_num.svg"></image>
				<text>{{dataContent.injectionIssueRequestNumber}}</text>
				<text>申请单：{{dataContent.deliverRequestNumber}}</text>
			</view> -->

			<view class="label_order">
				<image class="icon_normal" src="@/static/icons_ui/icon_customer.svg"></image>
				<text>{{dataContent.worker}}</text>
			</view>

		</view>
		<view class="uni-flex uni-row receipt_bot">
			<view class="label_order">
				<image class="icon_normal" src="@/static/icons_ui/icon_date.svg">
				</image>
				<text
					class="text_darkblue">{{dataContent.creationTime===null?'无':dataContent.creationTime| formatDate}}</text>
			</view>
		</view>
		<view class="" style="display: flex; justify-content: space-between; margin-bottom: 15rpx;">
			<view class="">

			</view>
			<view class="" style="float: right;" >
				
				<view class="uni-flex uni-row">
					<!-- 新增，执行中 -->
					<button v-if="dataContent.requestStatus==1||dataContent.requestStatus==5" type="primary" style="width: 140rpx; font-size: 32rpx; margin-right: 20rpx;"
						@click.stop="cancle()">取消</button>
						<!-- 部分完成可以完成 -->
					<button v-if="dataContent.requestStatus==9" type="primary" style="width: 140rpx; font-size: 32rpx; margin-right: 20rpx;"
						@click.stop="finish()">完成</button>
				</view>

			</view>

		</view>

	</view>
</template>

<script>
	import {
		dateFormat,
		showConfirmMsg
	} from '@/common/basic.js';
	import comRequestTopInfo from '@/mycomponents/comRequest/comRequestTopInfo.vue'

	export default {
		components: {
			comRequestTopInfo
		},
		props: {
			dataContent: {
				type: Object,
				default: {}
			}
		},
		filters: {
			formatDate: function(val) {
				return dateFormat(val)
			}
		},
		data() {
			return {

			};
		},

		mounted() {

		},
		methods: {
			finish() {
				showConfirmMsg("是否确认完成?", callback => {
					if (callback) {
						this.$emit("finish", this.dataContent)
					}
				})
			},
			cancle() {
				showConfirmMsg("是否确认取消?", callback => {
					if (callback) {
						this.$emit("cancle", this.dataContent)
					}
				})
			}

		}
	}
</script>

<style scoped lang="scss">
</style>