<template>
	<view class="app">
		<head-info :navIndex="2"></head-info>
		<view class="container">
			<view class="content">
				<view class="form">
					<view class="select">
						<superwei-combox :candidates="shipList" :isJSON="true" keyName="shipVvyname"
							placeholder="请选择船名航次" v-model="shipVvyname" @input="input_json"
							@select="select_json"></superwei-combox>
					</view>
					<button class="searchBtn" type="default" @click="search">搜索</button>
					<button class="searchBtn" type="default" @click="createTable">创建</button>
					<button class="searchBtn" type="default" @click="dropTable">删除表</button>
					<button class="searchBtn" type="default" @click="dropData">删除数据</button>
					<button class="searchBtn" type="default" @click="executeSql1('shipOption')">查询</button>
					<button class="searchBtn" type="default" @click="delAll">批量删除</button>
				</view>
				<view class="itemList">
					<template v-if="itemList.length > 0">
						<view v-for="(item, index) in itemList" :key="index" class="item">
							<view @click="toGo(item)">
								<view class="title">
									<image src="../../static/images/ship.png" mode="widthFix"></image>
									<view class="name">
										{{item.spmName}}
									</view>
								</view>
								<view class="row">
									<view class="nitem">
										进口航次: <text>{{item.inVvyName}}</text>
									</view>
									<view class="nitem">
										进口贸易类型: <text>{{item.inTradeTypeName}}</text>
									</view>
								</view>
								<view class="row">
									<view class="nitem">
										出口航次: <text>{{item.outVvyName}}</text>
									</view>
									<view class="nitem">
										出口贸易类型: <text>{{item.outTradeTypeName}}</text>
									</view>
								</view>
								<view class="row">
									<view class="nitem">
										计划泊位: <text>{{item.planBerthageName}}</text>
									</view>
									<view class="nitem">
										实际泊位: <text>{{item.actualBerthageName}}</text>
									</view>
								</view>
								<view class="statusBox statusBox1">
									<view class="statusInfo" v-if="item.uploadStatus == '1'">
										<text>已上传</text>
										<text>{{item.uploadTime}}</text>
									</view>
									<view class="statusInfo notStatus" v-else>
										<text>未上传</text>
									</view>
								</view>
								<view class="statusBox statusBox2">
									<view class="statusInfo" v-if="item.downloadStatus == '1'">
										<text>已下载</text>
										<text>{{item.downloadTime}}</text>
									</view>
									<view class="statusInfo notStatus" v-else>
										<text>未下载</text>
									</view>
								</view>
							</view>
							<view class="footer">
								<view class="fitem">
									<button :class="{fitem1:item.uploadTime != ''}" type="default"
										:disabled="item.uploadTime == ''" @click.stop="download(item)">下载</button>
									<button class="fitem2" type="default" @click.stop="upload(item)">上传</button>
								</view>
							</view>
						</view>
						<uni-popup ref="popup" type="message">
							<uni-popup-message :type="msgType" :message="popupText"
								:duration="2000"></uni-popup-message>
						</uni-popup>
					</template>
					<o-empty v-else height="70vh" bg="#f5f6fa" />
				</view>
				<view class="pageBox" v-if="itemList.length > 0">
					<uni-pagination :show-icon="true" :total="total" :pageSize="pageSize" :current="current"
						@change="changePage" />
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	import HeadInfo from '@/components/head-info/head-info';
	import sqlite from "../../common/sqlite.js"
	import tableList from "../../common/createDataTable.js"
	import api from "../../common/api.js"
	import {
		v4 as uuidv4
	} from 'uuid';
	export default {
		data() {
			return {
				loginObj: {},
				// 下载成功提示
				popupText: "",
				// 下载失败提示
				errorText: "",
				// 提示类型
				msgType: "",
				// 下载数据
				downloadData: {},

				// 港口
				portObj: {},
				// pamList: [],
				// 船名航次
				spmId: "", // 船名ID
				spmName: '', // 船名
				vvyId: "", // 航次ID
				vvyName: "", // 航次名
				shipVvyname: "",
				shipList: [],
				shipInput: "",
				itemList: [],
				// 分页
				total: 0,
				pageSize: 4,
				current: 1,

				// 作业查询数据
				workList: [{
						agentId: "1",
						agentName: "华图供应链管理（天津）有限公司",
						amount: "100",
						brdId: "1",
						brdName: "特斯拉1",
						bvdId: "1",
						bvdName: "无动力半挂车",
						bvmId: "1",
						bvmName: "轿车",
						carHeight: "100",
						carLength: "111",
						carWidth: "123",
						customsDeclareNo: "BG09759724",
						customsDeclareStatus: "未报关",
						mnfBl: "TD85875876",
						potId: "1",
						potName: "巴塞罗那",
						sourceType: "新能源",
						vvyId: "1",
						vvyName: "HC8595986",
						yardPos: "C4区15道*2,16道*2",
					},
					{
						agentId: "1",
						agentName: "华图供应链管理（天津）有限公司",
						amount: "100",
						brdId: "1",
						brdName: "特斯拉2",
						bvdId: "1",
						bvdName: "无动力半挂车",
						bvmId: "1",
						bvmName: "轿车",
						carHeight: "100",
						carLength: "111",
						carWidth: "123",
						customsDeclareNo: "BG09759724",
						customsDeclareStatus: "未报关",
						mnfBl: "TD85875876",
						potId: "1",
						potName: "巴塞罗那",
						sourceType: "新能源",
						vvyId: "1",
						vvyName: "HC8595986",
						yardPos: "C4区15道*2,16道*2",
					}
				],
				// 下拉数据
				optionData: [],

				// 批量删除表
				delList: ["shipInfoTable", "messageRespList", "workMessageRespList", "workMessageRespInfoList",
					"retallyMessageRespList", "infoRespList", "attachUnmoorRespList", "shipmentShipSupplyRespList",
					"shipmentAdviserLayoutRespList", "shipmentLoadUnloadNoticeRespList",
					"shipmentQualityConsultationRespList", "abnormalConditionRespList", "mafiListRespList",
					"safetyInspectionRespList", "safetyInspectionRespUrlList", "shipmentShipLoadPlansRespList",
					"shipOption", "workSignTable"
				]
			}
		},
		components: {
			HeadInfo,
		},
		onBackPress(options) {
			// 触发返回就会调用此方法，这里实现的是禁用物理返回，顶部导航栏的自定义返回 uni.navigateBack 仍可使用
			if (options.from == 'backbutton') {
				return true;
			} else if (options.from == 'navigateBack') {
				return false;
			}
		},
		mounted() {
			this.portObj = uni.getStorageSync('portObj')
			this.loginObj = uni.getStorageSync('loginObj')
			this.getShip()
		},
		methods: {
			createTable() {
				tableList.createAllTable()
			},
			// 批量删除
			delAll() {
				console.log('批量删除表');
				this.delList.forEach(v => {
					let sql = `DROP TABLE ${v};`
					this.executeSql(sql)
				})
			},
			dropTable() {
				console.log('删除表');
				let sql = 'shipInfoTable;'
				this.executeSql(sql)
			},
			dropData() {
				console.log('删除数据');
				let sql = "delete from shipOption"
				this.executeSql(sql)
			},
			executeSql(sql) {
				sqlite.executeSqlCeshi(sql).then((value) => {
					// 在resolve时执行的回调函数
					console.log(value)
				}).catch((error) => {
					// 在reject时执行的回调函数
					console.error(error);
				});
			},
			// 查
			executeSql1(tableName) {
				let sql = 'select * from ' + tableName
				this.executeSql(sql)
			},
			// 获取船的数据
			initData() {
				uni.request({
					url: `${this.$local}/api/shipOperate/select?pamId=${this.portObj.portId}&vvyId=${this.vvyId}&size=${this.pageSize}&current=${this.current}`,
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
						'Authorization': `Bearer ${this.loginObj.access_token}`
					},
					method: 'GET', //请求方式，必须为大写
					success: (res) => {
						if (res.statusCode === 200) {
							this.total = res.data.data.total
							this.itemList = res.data.data.records
						}
					}
				})
			},
			// 点击分页
			changePage(e) {
				this.current = e.current;
				this.initData()
			},
			// 获取船名航次下拉数据
			getShip() {
				uni.request({
					url: `${this.$local}/api/shipOperate/queryShipmentVoyageData?key=${this.shipInput}`,
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
						'Authorization': `Bearer ${this.loginObj.access_token}`
					},
					method: 'GET', //请求方式，必须为大写
					success: (res) => {
						if (res.statusCode === 200) {
							this.shipList = res.data.data
							this.shipList.forEach(v => {
								this.$set(v, "shipVvyname", `${v.spmName}/${v.vvyName}`)
							})
						}
					}
				})
			},
			// 船名航次下拉模糊查询
			input_json(e) {
				this.shipInput = e
				if (e == "") {
					this.vvyId = ""
				}
				this.getShip()
			},
			// 船名航次下拉选项
			select_json(e) {
				console.log(e)
				this.vvyId = e.vvyId
				this.vvyName = e.vvyName
				this.spmId = e.spmId
				this.spmName = e.spmName
			},
			// 点击搜索
			search() {
				this.initData()
			},
			// 下拉数据
			xlData() {
				for (let i = 0; i < this.optionData.length; i++) {
					this.optionData[i]["webId"] = uuidv4()
					let date = new Date().getTime()
					this.optionData[i]["webStatus"] = "0"
					this.optionData[i]["webDate"] = api.getDate(date)
					let dbTable = 'shipOption'
					let Arr = []
					for (let key in this.optionData[i]) {
						Arr.push(`'${ this.optionData[i][key]}'`);
					}
					let Str = Arr.join(',')
					// console.log(Str)
					sqlite.insertTableData(dbTable, Str).then((value) => {
						// 在resolve时执行的回调函数
						this.executeSql(value)
					}).catch((error) => {
						// 在reject时执行的回调函数
						console.error(error);
					});
				}
			},
			// 船舶基本信息
			shipDataInfo(info) {
				let date = new Date().getTime()
				let webId = uuidv4()
				let webDate = api.getDate(date)
				let sql =
					`insert into shipInfoTable values('${webId}','${info.agencyCname}','${info.ctyCnname}','${info.ctyCode}','${info.dataVersion}','${info.shipCname}',
					'${info.shipTypeName}','${info.spmBoardCentrele}','${info.spmBoardCentrerg}','${info.spmBoardFrontle}','${info.spmBoardFrontrg}','${info.spmBoardLaterle}',
					'${info.spmBoardLaterrg}','${info.spmCab}','${info.spmCabinht}','${info.spmCountrycd}','${info.spmEdicd}','${info.spmId}',
					'${info.spmLightWeight}','${info.spmMadeTime}','${info.spmMintide}','${info.spmMmsi}','${info.spmNationality}','${info.spmPilot}',
					'${info.spmPilotName}','${info.spmRemark}','${info.spmShipSign}','${info.spmShipType}','${info.spmTotalCargo}','${info.spmTrade}',
					'${info.spmTradeName}','${info.tenantId}','${info.termcd}','${info.valid}','${info.vslAudio}','${info.vslBaynum}',
					'${info.vslBkbaynum}','${info.vslBkendbay}','${info.vslBkstartbay}','${info.vslBksternnum}','${info.vslBreadth}','${info.vslCallid}',
					'${info.vslCallsign}','${info.vslCd}','${info.vslCnname}','${info.vslCstAgency}','${info.vslCstShippingline}','${info.vslCtyCountrycd}',
					'${info.vslDeckmaxrows}','${info.vslDeckmaxtiers}','${info.vslDepth}','${info.vslDerrickamount}','${info.vslDraftload}','${info.vslDraftunload}',
					'${info.vslEndlength}','${info.vslEnname}','${info.vslGton}','${info.vslHatchamount}','${info.vslHatchcoveramount}','${info.vslHatchmaxrows}',
					'${info.vslHatchmaxtiers}','${info.vslImono}','${info.vslLcg}','${info.vslLoa}','${info.vslLoaddisargereq}','${info.vslMadedt}',
					'${info.vslNetton}','${info.vslOrigin}','${info.vslPilotage}','${info.vslRfsocket}','${info.vslSailspeed}','${info.vslSpoptp}',
					'${info.vslStdId}','${info.vslStopsign}','${info.vslStowagereq}','${info.vslSummaryloading}','${info.vslTcg}','${info.vslTotallocation}',
					'${info.vslUncode}','${info.vslVcg}','${info.vslVtpcode}','${webDate}')`
				this.executeSql(sql)
			},
			// 作业查询数据
			zycxData() {
				let webStatus = 0
				let sql = ""
				for (let i = 0; i < this.workList.length; i++) {
					let date = new Date().getTime()
					let webId = uuidv4()
					let webDate = api.getDate(date)
					sql =
						`insert into shipmentShipLoadPlansRespList values('${webId}','${this.workList[i].agentId}','${this.workList[i].agentName}',
					'${this.workList[i].amount}','${this.workList[i].brdId}','${this.workList[i].brdName}','${this.workList[i].bvdId}','${this.workList[i].bvdName}','${this.workList[i].bvmId}',
					'${this.workList[i].bvmName}','${this.workList[i].carHeight}','${this.workList[i].carLength}','${this.workList[i].carWidth}',
					'${this.workList[i].customsDeclareNo}','${this.workList[i].customsDeclareStatus}','${this.workList[i].mnfBl}','${this.workList[i].potId}','${this.workList[i].potName}',
					'${this.workList[i].sourceType}','${this.workList[i].vvyId}','${this.workList[i].vvyName}','${this.workList[i].yardPos}',
					'${webStatus}','${webDate}')`
					this.executeSql(sql)
				}
			},
			// 下载
			download(item) {
				let vvyIds = []
				if (item.inVvyId != null && item.outVvyId == null) {
					vvyIds.push(item.inVvyId)
				} else if (item.outVvyId != null && item.inVvyId == null) {
					vvyIds.push(item.outVvyId)
				} else if (item.inVvyId != null && item.outVvyId != null) {
					vvyIds.push(item.inVvyId)
					vvyIds.push(item.outVvyId)
				}
				uni.request({
					url: `${this.$local}/api/shipOperate/download?vvyIds=${vvyIds}`,
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
						'Authorization': `Bearer ${this.loginObj.access_token}`
					},
					method: 'GET', //请求方式，必须为大写
					success: (res) => {
						console.log('接口返回------', res);
						if (res.statusCode == 200) {
							this.downloadData = res.data.data
							// this.shipDataInfo(this.downloadData.shipmentShipManage)
							this.optionData = []
							// 贸易类型
							this.downloadData.epTypeList.forEach(v => {
								this.optionData.push({
									dictionariesName: "epTypeList",
									ptrCode: v.ptrCode,
									ptrDesc: v.ptrDesc,
								})
							})
							// 装卸类型
							this.downloadData.handTypeList.forEach(v => {
								this.optionData.push({
									dictionariesName: "handTypeList",
									ptrCode: v.ptrCode,
									ptrDesc: v.ptrDesc,
								})
							})
							// 进出口
							this.downloadData.ieTypeList.forEach(v => {
								this.optionData.push({
									dictionariesName: "ieTypeList",
									ptrCode: v.ptrCode,
									ptrDesc: v.ptrDesc,
								})
							})
							// 装卸方式
							this.downloadData.loadTypeList.forEach(v => {
								this.optionData.push({
									dictionariesName: "loadTypeList",
									ptrCode: v.ptrCode,
									ptrDesc: v.ptrDesc,
								})
							})
							// 泊位
							this.downloadData.pubBerthesManageRespList.forEach(v => {
								this.optionData.push({
									dictionariesName: "bthList",
									ptrCode: v.bthId,
									ptrDesc: v.bthBthnm,
								})
							})
							// 翻仓类型
							this.downloadData.turnoverTypeList.forEach(v => {
								this.optionData.push({
									dictionariesName: "turnoverTypeList",
									ptrCode: v.ptrCode,
									ptrDesc: v.ptrDesc,
								})
							})
							// 天气预报
							this.downloadData.weatherForecastList.forEach(v => {
								this.optionData.push({
									dictionariesName: "weather",
									ptrCode: v.weatherType,
									ptrDesc: v.weatherTypeDesc,
								})
							})
							// 工班类型
							this.downloadData.shipmentBasicShiftList.forEach(v => {
								this.optionData.push({
									dictionariesName: "shiftList",
									ptrCode: v.pwcCode,
									ptrDesc: v.pwcTypeDesc,
								})
							})
							// 供给类型
							this.downloadData.supplyTypeList.forEach(v => {
								this.optionData.push({
									dictionariesName: "supplyTypeList",
									ptrCode: v.ptrCode,
									ptrDesc: v.ptrDesc,
								})
							})
							// 存下拉到数据库
							this.xlData()
							let webStatus = 0
							// 杂项单证人员信息表
							if (this.downloadData.messageRespList.length > 0) {
								this.downloadData.messageRespList.forEach(v => {
									let sql = `insert into messageRespList values('${v.pmeId}','${v.bthId}','${v.bthIdName}',
										'${v.jobStartTime}','${v.jobEndTime}','${v.shipPerson}','${v.vvyId}','${v.vvyName}','${v.weatherType}',
										'${v.weatherTypeDesc}','${v.workSuite}','${webStatus}','${v.createTime}')`
									this.executeSql(sql)
								})
							}
							// 工班信息
							let aId = uuidv4()
							if (this.downloadData.workMessageRespList.length > 0) {
								this.downloadData.workMessageRespList.forEach(v => {
									let sql = `insert into workMessageRespList values('${v.wkmId}','${this.downloadData.shipmentShipManage.spmId}','${aId}',
										'${v.vvyId}','${v.vvyName}','${v.loadType}','${v.loadTypeName}','${v.pwcType}',
										'${v.pwcTypeName}','${v.workStartTime}','${v.workEndTime}','${webStatus}','${v.createTime}')`
									this.executeSql(sql)
									if (v.workMessageDetailRespDTOS.length > 0) {
										v.workMessageDetailRespDTOS.forEach(v2 => {
											let sql2 = `insert into workMessageRespInfoList values('${v2.wkdId}','${v2.wkmId}','${v2.carType}',
											'${v2.carTypeName}','${v2.goodsNumber}','${v2.loadingType}','${v2.loadingTypeName}','${v2.remark}',
											'${webStatus}','${v.createTime}')`
											this.executeSql(sql2)
										})
									}
								})
							}
							let editStatus = 1
							// 翻仓信息
							if (this.downloadData.retallyRespList.length > 0) {
								this.downloadData.retallyRespList.forEach(v => {
									let sql = `insert into retallyMessageRespList values('${v.reyId}','${this.downloadData.shipmentShipManage.spmId}','${aId}',
										'${v.reyVvyId}','${v.reyVvyName}','${v.retallyType}','${v.retallyTypeName}','${v.retallyOrigin}','${v.retallyTerminus}',
										'${v.retallyStartTime}','${v.retallyEndTime}','${v.carType}','${v.carTypeName}',
										'${v.goodsNumber}','${v.goodsVolume}','${v.goodsWeight}','${editStatus}','${webStatus}','${webDate}')`
									this.executeSql(sql)
								})
							}
							// 其他信息
							if (this.downloadData.infoRespList.length > 0) {
								this.downloadData.infoRespList.forEach(v => {
									let sql =
										`insert into infoRespList values('${v.soiId}','${this.downloadData.shipmentShipManage.spmId}','${aId}','${v.vvyId}',
										'${v.vvyIdDesc}','${v.tecNum}','${v.startTm}','${v.endTm}','${v.weight}','${v.volume}','${v.genNum}',
										'${v.startTmPt}','${v.endTmPt}','${v.weightPt}','${v.volumePt}','${v.auxRemark}',
										'${v.waitRemark}','${v.workRemark}','${webStatus}','${v.createTime}')`
									this.executeSql(sql)
								})
							}
							
							uni.showToast({
								title: `下载成功`,
								icon: 'success',
								duration: 2000
							})
						} else {
							uni.showToast({
								title: `下载失败`,
								icon: 'success',
								duration: 2000
							})
						}
					}
				})
			},
			// 上传
			upload(item) {
				let workDataInfo = {
					"adviserLayoutReqList": [{
						"altId": "33333333333",
						"bthId": "2f166d975bdc58e6a461e3d01de11289",
						"createTime": "",
						"createUser": "",
						"endTime": "2023-07-14 10:00",
						"loaderType": "装货",
						"personNumber": 10,
						"pwcType": "123321",
						"remark": "12312312",
						"sparePart": 10,
						"startTime": "2023-07-13 12:00",
						"tenantId": "",
						"termcd": "",
						"updateTime": "",
						"updateUser": "",
						"valid": "",
						"vehicleSize": 20,
						"version": "",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299"
					}],
					"conditionReqList": [{
						"operationDate": "2023-07-14",
						"remark": "123123",
						"type": "2321312",
						"vacId": "333333",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299"
					}],
					"consultationReqList": [{
						"bthId": "2f166d975bdc58e6a461e3d01de11289",
						"handlingType": "装货",
						"operationDate": "2023-07-14",
						"spareNumber": "12",
						"vehiclesNumber": "22",
						"vqcId": "123132132131321",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299"
					}],
					"delAlIds": [],
					"delCsIds": [],
					"delCtIds": [],
					"delLnIds": [],
					"delMfIds": [],
					"delPmIds": [],
					"delSauIds": [],
					"delSiIds": [],
					"delSoiIds": [],
					"delSrmIds": [],
					"delSsIds": [],
					"delSwmIds": [],
					"inVvyId": "6cb63df0526f20ecbaa43795774a1299",
					"loadUnloadNoticeReqList": [{
						"sluId": "11111",
						"vbtId": "22222222",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299",
						"workDate": "2023-07-14"
					}],
					"outVvyId": "6cb63df0526f20ecbaa43795774a1299",
					"personMessageReqList": [{
						"bthId": "2f166d975bdc58e6a461e3d01de11289",
						"jobEndTime": "2023-7-14 10:00",
						"jobStartTime": "2023-7-13 12:00",
						"pmeId": "111",
						"remark": "123123123remark",
						"shipPerson": 0,
						"termcd": "2222",
						"valid": "33333",
						"vbtId": "44444",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299",
						"weatherType": "晴",
						"workSuite": 0
					}],
					"shipmentAttachUnmoorReqList": [{
						"attachTime": "2023-07-13 12:00",
						"bthId": "2f166d975bdc58e6a461e3d01de11289",
						"createTime": "",
						"createUser": "",
						"noProductBerthTime": "2023-07-13 12:00",
						"remark": "23123123",
						"sauId": "333333",
						"shiftingBerthTime": "2023-07-13 12:00",
						"shipDeadWeight": 30,
						"tenantId": "11122222",
						"termcd": "111222",
						"unmoorTime": "2023-07-13 12:00",
						"updateTime": "2023-07-13 12:00",
						"updateUser": "111111",
						"valid": "2222222",
						"version": 20,
						"vvyId": "6cb63df0526f20ecbaa43795774a1299"
					}],
					"shipmentMafiListReqList": [{
						"loadType": "卸货",
						"mafiBarcode": "000002",
						"pamId": "ac9b606e04a2bc71b876914a64ccb0b6",
						"size": 10,
						"smlId": "1111",
						"type": "FULL",
						"vtpId": "222222",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299",
						"workDate": "2023-07-14"
					}],
					"shipmentOtherInfoReqList": [{
						"auxRemark": "111111",
						"endTm": "2023-07-14 10:00:00",
						"genNum": 20,
						"remark": "12312321",
						"soiId": "222222",
						"startTm": "2023-07-13 12:00:00",
						"tecNum": 30,
						"volume": 20,
						"vvyId": "6cb63df0526f20ecbaa43795774a1299",
						"waitRemark": "123123",
						"weight": 40,
						"workRemark": "1231231"
					}],
					"shipmentRetallyMessageReqList": [{
						"remId": "123123",
						"retallyReqDTOS": [{
							"remId": "1231231312",
							"retallyDetailReqDTOS": [{
								"carType": "中型车",
								"goodsNumber": 10,
								"goodsVolume": 20,
								"goodsWeight": 30,
								"retallyEndTime": "2023-07-14 10:00:00",
								"retallyOrigin": "123123",
								"retallyStartTime": "2023-07-13 12:00:00",
								"retallyTerminus": "1231321",
								"reyId": "1231321",
								"rydId": "23123123"
							}],
							"retallyType": "",
							"reyId": ""
						}],
						"vvyId": "6cb63df0526f20ecbaa43795774a1299"
					}],
					"shipmentSafetyInspectionReqList": [{
						"importExport": "1231312",
						"remark": "123123",
						"spmId": "32131",
						"tradeType": "123213",
						"type": "123123",
						"uploadStatus": "未上传",
						"url": [],
						"vsiId": "123123",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299"
					}],
					"shipmentShipSupplyReqList": [{
						"sssId": "",
						"stopBerthage": "2f166d975bdc58e6a461e3d01de11289",
						"supplyAmount": 8,
						"supplyDate": "2023-07-14",
						"supplyType": "",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299",
						"vvyName": "511I"
					}],
					"shipmentWorkMessageReqList": [{
						"loadType": "自装",
						"pwcType": "123",
						"remark": "132311231",
						"vvyId": "6cb63df0526f20ecbaa43795774a1299",
						"wkmId": "123123",
						"workEndTime": "2023-07-13 10:00:00",
						"workStartTime": "2023-07-13 12:00:00",
						"workMessageDetailReqDTOS": [{
							"carType": "中型车",
							"goodsNumber": 3,
							"loadingType": "自装",
							"remark": "",
							"tenantId": "",
							"termcd": "",
							"valid": "",
							"wkdId": "",
							"wkmId": ""
						}],
					}],
					"vtpId": "123123"
				}
				uni.request({
					url: this.$local + '/api/shipOperate/upload',
					data: workDataInfo,
					header: {
						'Content-Type': 'application/json', //自定义请求头信息
						'Authorization': `Bearer ${this.loginObj.access_token}`
					},
					method: 'POST', //请求方式，必须为大写
					success: (res) => {
						console.log('接口返回------', res);
					}
				})
			},
			toGo(item) {
				uni.navigateTo({
					url: `/pages/shipWork/documentList`
				})
			}
		}
	};
</script>

<style lang="less" scoped>
	.container {
		background-color: #f5f6fa;
		display: flex;
		min-height: calc(100vh - 68px - 40px);
	}

	.content {
		padding: 20px;
		min-height: calc(100vh - 68px - 40px);

		.form {
			display: flex;

			.select {
				width: 200px;
				margin-right: 20px;
			}

			.input {
				width: 200px;
				height: 35px;
				line-height: 35px;
				margin-left: 15px;
			}

			.searchBtn {
				height: 35px;
				line-height: 35px;
				margin-left: 0;
				font-size: 16px;
				color: #fff;
				background-color: #0067CF;
				margin-right: 10px;
			}
		}

		.itemList {
			width: 100%;
			display: flex;
			justify-content: flex-start;
			flex-wrap: wrap;

			/deep/.o-empty {
				width: 100%;
				margin-top: 15px;
			}

			.item {
				width: 49%;
				min-height: 204px;
				margin-top: 15px;
				margin-right: 2%;
				background-color: #fff;
				border-radius: 8px;
				padding: 10px 0;
				position: relative;

				.title {
					display: flex;
					padding: 10px 20px;

					image {
						width: 32px;
						height: 32px;
						margin-right: 12px;
					}

					.name {
						margin-top: 5px;
						font-size: 16px;
						color: #23262E;
						font-weight: bold;
					}
				}

				.row {
					display: flex;
					justify-content: space-between;
					font-size: 14px;
					padding: 10px 20px;

					.nitem {
						width: 46%;

						.text {
							color: #929292;
						}
					}
				}

				.footer {
					width: 100%;
					display: flex;
					justify-content: flex-end;
					border-top: 1px solid #EEEEEE;
					padding-top: 10px;

					.fitem {
						display: flex;
					}

					button {
						width: 72px;
						height: 28px;
						line-height: 28px;
						border-radius: 4px;
						margin-right: 16px;
						font-size: 14px;
						border: 1px solid rgba(0, 0, 0, .2);
					}

					.fitem1 {
						border: 1px solid #FC8300;
						color: #FC8300;
						background: #fff;

						/deep/:after {
							border: none;
						}
					}

					.fitem2 {
						background: #0067CF;
						color: #fff;
					}
				}

				.statusBox {
					.statusInfo {
						margin-bottom: 3px;
						padding: 5px;
						background: #F1F8FF;
						border-radius: 4px;
						font-size: 12px;
						color: #0067CF;

						text:first-child {
							margin-right: 10px;
						}
					}

					.notStatus {
						background: #FFF7EE;
						color: #FC8300;

						text:first-child {
							margin-right: 0;
						}
					}
				}

				.statusBox1 {
					position: absolute;
					top: 10px;
					right: 5px;
				}

				.statusBox2 {
					position: absolute;
					top: 40px;
					right: 5px;
				}
			}

			.item:nth-child(2n) {
				margin-right: 0;
			}
		}

		.pageBox {
			margin-top: 20px;
		}
	}
</style>