<template>
	<view class="warp">
		<view class="transaction">
			<u-form :model="list" ref="uForm" class="uForm">
				<u-form-item label="合同编号" prop="contractNo" label-width="140">
					<u-input v-model="list.contractNo" input-align="right" placeholder="" disabled />
				</u-form-item>
				<u-form-item label="任务编号" prop="processNo" label-width="140">
					<u-input v-model="list.processNo" input-align="right" placeholder="" disabled />
				</u-form-item>
				<u-form-item label="货名" prop="goodsName" label-width="140">
					<u-input v-model="list.goodsName" input-align="right" placeholder="" disabled />
				</u-form-item>
				<u-form-item label="发货地址" prop="sendDetailedAddress" label-width="140" label-position='top'>
					<u-input v-model="list.sendDetailedAddress" input-align="left" placeholder="" disabled />
				</u-form-item>
				<u-form-item label="收货地址" prop="receiveDetailedAddress" label-width="140" label-position='top'>
					<u-input v-model="list.receiveDetailedAddress" input-align="left" placeholder="请输入收货地址" disabled />
				</u-form-item>
				<u-form-item label="运费（元/吨）" prop="tranPrice" label-width="250">
					<u-input v-model="list.tranPriceIng" input-align="right" placeholder="请输入运费单价" />
				</u-form-item>
			</u-form>
		</view>
		<u-toast ref="uToast" />
		<view class="bottom-btn">
			<u-button type="primary" class="submit" hover-class="none" @click="passSubmit()">通过</u-button>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				list: {},
				id: "",
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getList()
		},
		methods: {
			getList() {
				this.$api.doRequest('get', '/tranProcessInfo/getTranProcess', {
					id: this.id
				}).then(res => {
					this.list = res.data.data
				})
			},
			passSubmit() {
				var tranProcessInfo = {}
				tranProcessInfo.id = this.list.id
				tranProcessInfo.flag = "1"
				tranProcessInfo.tranPriceIng = this.list.tranPriceIng
				this.$api.doRequest('post', '/tranProcessInfo/api/setUpTranPrice', tranProcessInfo).then(res => {
						that.$api.msg('审核通过成功')
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.transaction {
		background-color: #FFFFFF;
		margin: 10rpx;
		padding-bottom: 10rpx;
		border-radius: 20rpx;
	}

	.uForm {
		padding: 0 40rpx;
	}

	.u-form-item {
		padding: 0;
	}

	.bottom-btn {
		width: 100%;
		position: fixed;
		bottom: 40rpx;
		display: flex;
		z-index: 2;
	}

	.submit {
		width: 40%;
		background: #22C572;
		border-radius: 10rpx;
	}
</style>
