2023-07-12 17:46:47 +08:00
|
|
|
|
<template>
|
|
|
|
|
<view class="workAssignAdd">
|
|
|
|
|
<view class="container">
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<view class="ul">
|
|
|
|
|
<view class="li">
|
2023-07-12 17:46:47 +08:00
|
|
|
|
<p>船名:</p>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text>{{shipInfo.voyageScheduleDataList[0].spmName}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>航次:</p>
|
|
|
|
|
<uni-data-select v-model="vvyId" :localdata="hcList" @change="hcChange"
|
2023-07-12 17:46:47 +08:00
|
|
|
|
v-if="obj.state != 'look'"></uni-data-select>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text v-else>{{vvyName}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2023-07-12 17:46:47 +08:00
|
|
|
|
<p>进出口:</p>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text>{{shipInfo.voyageScheduleDataList[0].importExportFlagName}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
2023-07-12 17:46:47 +08:00
|
|
|
|
<p>贸易类型:</p>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text>{{shipInfo.voyageScheduleDataList[0].tradeTypeName}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>泊位:</p>
|
|
|
|
|
<uni-data-select v-model="bthId" :localdata="bwList" @change="bwChange"
|
2023-07-12 17:46:47 +08:00
|
|
|
|
v-if="obj.state != 'look'"></uni-data-select>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text v-else>{{bthIdName}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>工班:</p>
|
|
|
|
|
<uni-data-select v-model="pwcTypeId" :localdata="gbList" @change="gbChange"
|
2023-07-12 17:46:47 +08:00
|
|
|
|
v-if="obj.state != 'look'"></uni-data-select>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text v-else>{{pwcType}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>人数:</p>
|
|
|
|
|
<uni-number-box v-model="personNumber" v-if="obj.state != 'look'" />
|
|
|
|
|
<text v-else>{{personNumber}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>装卸类型:</p>
|
|
|
|
|
<uni-data-select v-model="loaderTypeId" :localdata="zxList" @change="zxChange"
|
2023-07-12 17:46:47 +08:00
|
|
|
|
v-if="obj.state != 'look'"></uni-data-select>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text v-else>{{loaderType}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>车辆数量:</p>
|
|
|
|
|
<uni-number-box v-model="vehicleSize" v-if="obj.state != 'look'" />
|
|
|
|
|
<text v-else>{{vehicleSize}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>备件数量:</p>
|
|
|
|
|
<uni-number-box v-model="sparePart" v-if="obj.state != 'look'" />
|
|
|
|
|
<text v-else>{{sparePart}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="li">
|
|
|
|
|
<p><text class="required" v-if="obj.state != 'look'">*</text>作业时间:</p>
|
2023-07-12 17:46:47 +08:00
|
|
|
|
<uni-datetime-picker v-model="workTime" type="datetimerange" rangeSeparator="-" @change="changeLog"
|
|
|
|
|
v-if="obj.state != 'look'" />
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<text v-else>{{startTime}} - {{endTime}}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
2023-07-12 17:46:47 +08:00
|
|
|
|
<view class="btnList">
|
|
|
|
|
<van-button type="default" @click="cancel">取消</van-button>
|
2023-07-20 17:16:08 +08:00
|
|
|
|
<van-button type="danger" v-if="obj.state == 'look'" @click="del">删除</van-button>
|
2023-07-12 17:46:47 +08:00
|
|
|
|
<van-button type="info" v-if="obj.state == 'add' || obj.state == 'edit'" @click="save">保存</van-button>
|
|
|
|
|
<van-button type="info" v-if="obj.state == 'look'" @click="toGo('edit')">编辑</van-button>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
shipInfo: {
|
|
|
|
|
voyageScheduleDataList: [{
|
|
|
|
|
spmName: "",
|
|
|
|
|
importExportFlagName: "",
|
|
|
|
|
tradeTypeName: ""
|
|
|
|
|
}]
|
|
|
|
|
},
|
2023-07-12 17:46:47 +08:00
|
|
|
|
obj: {},
|
2023-07-20 17:16:08 +08:00
|
|
|
|
assignRow: {},
|
|
|
|
|
assignRowIndex: {},
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 航次下拉框
|
2023-07-20 17:16:08 +08:00
|
|
|
|
vvyId: "",
|
|
|
|
|
vvyName: "",
|
|
|
|
|
hcList: [],
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 泊位下拉框
|
2023-07-20 17:16:08 +08:00
|
|
|
|
bthId: "",
|
|
|
|
|
bthIdName: "",
|
|
|
|
|
bwList: [],
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 工班下拉框
|
2023-07-20 17:16:08 +08:00
|
|
|
|
pwcTypeId: "",
|
|
|
|
|
pwcType: "",
|
|
|
|
|
gbList: [],
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 人数
|
2023-07-20 17:16:08 +08:00
|
|
|
|
personNumber: 0,
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 装卸类型下拉框
|
2023-07-20 17:16:08 +08:00
|
|
|
|
loaderTypeId: "",
|
|
|
|
|
loaderType: "",
|
|
|
|
|
zxList: [],
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 车辆数量
|
2023-07-20 17:16:08 +08:00
|
|
|
|
vehicleSize: 0,
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 备件数量
|
2023-07-20 17:16:08 +08:00
|
|
|
|
sparePart: 0,
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 作业时间
|
2023-07-20 17:16:08 +08:00
|
|
|
|
workTime: ['', ''],
|
|
|
|
|
startTime: "",
|
|
|
|
|
endTime: "",
|
2023-07-12 17:46:47 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
onLoad(options) {
|
|
|
|
|
if ('params' in options) {
|
|
|
|
|
// 获取传递的对象参数,使用decodeURIComponent解码,并转为对象
|
|
|
|
|
this.obj = JSON.parse(decodeURIComponent(options.params))
|
|
|
|
|
}
|
|
|
|
|
},
|
2023-07-20 17:16:08 +08:00
|
|
|
|
mounted() {
|
|
|
|
|
if (this.obj.state == 'edit' || this.obj.state == 'look') {
|
|
|
|
|
this.getRow();
|
|
|
|
|
}
|
|
|
|
|
this.getShip()
|
|
|
|
|
},
|
2023-07-12 17:46:47 +08:00
|
|
|
|
methods: {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
// 获取船只信息
|
|
|
|
|
getShip() {
|
|
|
|
|
this.shipInfo = uni.getStorageSync('shipInfo')
|
|
|
|
|
// 航次数据
|
|
|
|
|
this.shipInfo.voyageScheduleDataList.forEach((v, index) => {
|
|
|
|
|
this.hcList.push({
|
|
|
|
|
text: v.vvyName,
|
|
|
|
|
value: v.vvyId
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// 装卸类型数据
|
|
|
|
|
this.shipInfo.handTypeList.forEach((v, index) => {
|
|
|
|
|
this.zxList.push({
|
|
|
|
|
text: v.ptrDesc,
|
|
|
|
|
value: v.ptrCode
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// 工班数据
|
|
|
|
|
this.shipInfo.shipmentBasicShiftList.forEach((v, index) => {
|
|
|
|
|
this.gbList.push({
|
|
|
|
|
text: v.pwcTypeDesc,
|
|
|
|
|
value: v.pwcId
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
// 泊位数据
|
|
|
|
|
this.shipInfo.pubBerthesManageRespList.forEach((v, index) => {
|
|
|
|
|
this.bwList.push({
|
|
|
|
|
text: v.bthBthnm,
|
|
|
|
|
value: v.bthId
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 获取当前行信息
|
|
|
|
|
getRow() {
|
|
|
|
|
this.assignRow = uni.getStorageSync('assignRow');
|
|
|
|
|
this.assignRowIndex = uni.getStorageSync('assignRowIndex');
|
|
|
|
|
this.vvyId = this.assignRow.vvyId
|
|
|
|
|
this.vvyName = this.assignRow.vvyName
|
|
|
|
|
this.bthId = this.assignRow.bthId
|
|
|
|
|
this.bthIdName = this.assignRow.bthIdName
|
|
|
|
|
this.pwcTypeId = this.assignRow.pwcTypeId
|
|
|
|
|
this.pwcType = this.assignRow.pwcType
|
|
|
|
|
this.personNumber = this.assignRow.personNumber
|
|
|
|
|
this.loaderTypeId = this.assignRow.loaderTypeId
|
|
|
|
|
this.loaderType = this.assignRow.loaderType
|
|
|
|
|
this.vehicleSize = this.assignRow.vehicleSize
|
|
|
|
|
this.sparePart = this.assignRow.sparePart
|
|
|
|
|
this.workTime = this.assignRow.workTime
|
|
|
|
|
this.startTime = this.assignRow.startTime
|
|
|
|
|
this.endTime = this.assignRow.endTime
|
|
|
|
|
},
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 航次下拉
|
|
|
|
|
hcChange(e) {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
this.vvyId = e;
|
|
|
|
|
this.hcList.forEach(v => {
|
|
|
|
|
if (v.value == e) {
|
|
|
|
|
this.vvyName = v.text
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-07-12 17:46:47 +08:00
|
|
|
|
},
|
|
|
|
|
// 泊位下拉
|
|
|
|
|
bwChange(e) {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
this.bthId = e;
|
|
|
|
|
this.bwList.forEach(v => {
|
|
|
|
|
if (v.value == e) {
|
|
|
|
|
this.bthIdName = v.text
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-07-12 17:46:47 +08:00
|
|
|
|
},
|
|
|
|
|
// 工班下拉
|
|
|
|
|
gbChange(e) {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
this.pwcTypeId = e;
|
|
|
|
|
this.gbList.forEach(v => {
|
|
|
|
|
if (v.value == e) {
|
|
|
|
|
this.pwcType = v.text
|
|
|
|
|
}
|
|
|
|
|
})
|
2023-07-12 17:46:47 +08:00
|
|
|
|
},
|
|
|
|
|
// 装卸类型下拉
|
|
|
|
|
zxChange(e) {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
this.loaderTypeId = e;
|
|
|
|
|
this.zxList.forEach(v => {
|
|
|
|
|
if (v.value == e) {
|
|
|
|
|
this.loaderType = v.text
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 作业时间
|
|
|
|
|
changeLog(e) {
|
|
|
|
|
this.workTime = e
|
|
|
|
|
this.startTime = this.workTime[0].slice(0, this.workTime[0].length - 3)
|
|
|
|
|
this.endTime = this.workTime[1].slice(0, this.workTime[1].length - 3)
|
2023-07-12 17:46:47 +08:00
|
|
|
|
},
|
|
|
|
|
// 取消
|
|
|
|
|
cancel() {
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/shipWork/workAssign'
|
|
|
|
|
})
|
|
|
|
|
},
|
2023-07-20 17:16:08 +08:00
|
|
|
|
// 删除
|
|
|
|
|
del() {
|
|
|
|
|
let addAssignArr = uni.getStorageSync('addAssignArr')
|
|
|
|
|
addAssignArr.splice(this.assignRowIndex, 1)
|
|
|
|
|
uni.setStorageSync('addAssignArr', addAssignArr);
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/shipWork/workAssign'
|
|
|
|
|
})
|
|
|
|
|
},
|
2023-07-12 17:46:47 +08:00
|
|
|
|
// 保存
|
|
|
|
|
save() {
|
2023-07-20 17:16:08 +08:00
|
|
|
|
let addAssignArr = uni.getStorageSync('addAssignArr')
|
|
|
|
|
let addAssignObj = {
|
|
|
|
|
vvyId: this.vvyId,
|
|
|
|
|
vvyName: this.vvyName,
|
|
|
|
|
bthId: this.bthId,
|
|
|
|
|
bthIdName: this.bthIdName,
|
|
|
|
|
pwcTypeId: this.pwcTypeId,
|
|
|
|
|
pwcType: this.pwcType,
|
|
|
|
|
personNumber: this.personNumber,
|
|
|
|
|
loaderTypeId: this.loaderTypeId,
|
|
|
|
|
loaderType: this.loaderType,
|
|
|
|
|
vehicleSize: this.vehicleSize,
|
|
|
|
|
sparePart: this.sparePart,
|
|
|
|
|
workTime: this.workTime,
|
|
|
|
|
startTime: this.startTime,
|
|
|
|
|
endTime: this.endTime,
|
|
|
|
|
tradeTypeName: this.shipInfo.voyageScheduleDataList[0].tradeTypeName,
|
|
|
|
|
importExportFlagName: this.shipInfo.voyageScheduleDataList[0].importExportFlagName,
|
|
|
|
|
spmName: this.shipInfo.voyageScheduleDataList[0].spmName,
|
|
|
|
|
}
|
|
|
|
|
if (this.obj.state == "edit") {
|
|
|
|
|
addAssignArr[this.assignRowIndex] = addAssignObj;
|
|
|
|
|
uni.setStorageSync('addAssignArr', addAssignArr);
|
|
|
|
|
} else if (this.obj.state == "add") {
|
|
|
|
|
if (addAssignArr != "") {
|
|
|
|
|
addAssignArr.push(addAssignObj)
|
|
|
|
|
uni.setStorageSync('addAssignArr', addAssignArr);
|
|
|
|
|
} else {
|
|
|
|
|
addAssignArr = []
|
|
|
|
|
addAssignArr.push(addAssignObj)
|
|
|
|
|
uni.setStorageSync('addAssignArr', addAssignArr);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-12 17:46:47 +08:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: '/pages/shipWork/workAssign'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
// 编辑
|
|
|
|
|
toGo(state) {
|
|
|
|
|
this.obj.state = state;
|
|
|
|
|
const params = encodeURIComponent(JSON.stringify(this.obj));
|
|
|
|
|
uni.navigateTo({
|
|
|
|
|
url: `/pages/shipWork/workAssignAdd?params=${params}`
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
.workAssignAdd {
|
|
|
|
|
.container {
|
|
|
|
|
padding: 30px 20px;
|
|
|
|
|
|
2023-07-20 17:16:08 +08:00
|
|
|
|
.ul {
|
2023-07-12 17:46:47 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
2023-07-20 17:16:08 +08:00
|
|
|
|
.li {
|
2023-07-12 17:46:47 +08:00
|
|
|
|
width: 44%;
|
|
|
|
|
border-top: 1px solid #ccc;
|
|
|
|
|
border-bottom: 1px solid #ccc;
|
|
|
|
|
display: flex;
|
|
|
|
|
padding: 10px 20px;
|
|
|
|
|
line-height: 35px;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
|
|
|
|
|
.required {
|
|
|
|
|
color: red;
|
|
|
|
|
margin-right: 5px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p {
|
|
|
|
|
min-width: 85px;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/.uni-numbox {
|
|
|
|
|
border: 1px solid #ccc;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/.uni-numbox-btns {
|
|
|
|
|
border-right: 1px solid #ccc;
|
|
|
|
|
border-left: 1px solid #ccc;
|
|
|
|
|
padding: 0 14px;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/deep/.uni-numbox__value {
|
|
|
|
|
width: 100px;
|
|
|
|
|
height: 35px;
|
|
|
|
|
line-height: 35px;
|
|
|
|
|
background-color: #fff !important;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.btnList {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
/deep/ .van-button {
|
|
|
|
|
margin: 30px 20px;
|
|
|
|
|
width: 120px;
|
|
|
|
|
height: 50px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|