pad-app/pages/shipWork/shiftDetails.vue

386 lines
9.7 KiB
Vue
Raw Normal View History

2023-07-12 13:48:01 +08:00
<template>
<view class="shiftDetails">
<view class="container">
<custom-tabs type="c1" :value="tabsValue" @change="changeIndex">
2023-07-12 13:48:01 +08:00
<custom-tab-pane label="工班信息" name="c1_1">
2023-07-19 18:12:19 +08:00
<view></view>
<view class="ul">
<view class="li">
2023-07-12 13:48:01 +08:00
<p>船名</p>
<text>{{dataInfo[0].spmName}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>航次</p>
<text>{{dataInfo[0].vvyName}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>进出口</p>
<text>{{dataInfo[0].importExportFlagName}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>贸易类型</p>
<text>{{dataInfo[0].tradeTypeName}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>装卸类型</p>
<text> {{dataInfo[0].loadTypeName}}</text>
2023-07-19 18:12:19 +08:00
</view>
</view>
<view class="ul bUl borTop" v-for="(item,index) in shiftInfo" :key="index + 'a'">
2023-07-19 18:12:19 +08:00
<view class="li">
2023-07-12 13:48:01 +08:00
<p>工班</p>
<text> {{item.pwcTypeName}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>作业时间</p>
<text> {{item.workStartTime}} - {{item.workEndTime}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="ul bUl" v-for="(item2,index2) in item.shiftInfoList" :key="index2 + 'b'">
<view class="li">
<p>车型</p>
<text>{{item2.carTypeName}}</text>
</view>
<view class="li">
<p>数量</p>
<text>{{item2.goodsNumber}}</text>
</view>
<view class="li">
<p>装卸方式</p>
<text>{{item2.loadingTypeName}}</text>
</view>
<view class="li wLi">
<p>备注</p>
<text>{{item2.remark}}</text>
</view>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-07-12 13:48:01 +08:00
</custom-tab-pane>
<custom-tab-pane label="翻仓信息" name="c1_2">
<view class="fcInfo" v-for="(item,index) in this.fcList" :key="index">
2023-07-12 13:48:01 +08:00
<view class="fcBox">
<p>翻舱类型</p>
<text>{{item.retallyTypeName}}</text>
2023-07-12 13:48:01 +08:00
</view>
<view class="ul" v-for="(item2,index2) in item.fcInfo" :key="index2">
2023-07-19 18:12:19 +08:00
<view class="li">
2023-07-12 13:48:01 +08:00
<p>航次</p>
<text>{{item2.vvyName}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>翻舱起点</p>
<text>{{item2.retallyOrigin}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>翻舱终点</p>
<text>{{item2.retallyTerminus}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>作业时间</p>
<text>{{item2.retallyStartTime}} - {{item2.retallyEndTime}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>数量</p>
<text>{{item2.goodsNumber}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>体积</p>
<text>{{item2.goodsVolume}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>重量</p>
<text>{{item2.goodsWeight}}</text>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-07-12 13:48:01 +08:00
</view>
</custom-tab-pane>
<custom-tab-pane label="其他信息" name="c1_3">
<view class="otherInfo">
<p class="title">辅助作业</p>
2023-07-19 18:12:19 +08:00
<view class="ul">
<view class="li">
2023-07-12 13:48:01 +08:00
<p>技术工人</p>
<text>{{otherList.tecNum}}</text>
2023-07-19 18:12:19 +08:00
</view>
2023-08-04 17:06:33 +08:00
<view class="li">
<p>作业时间</p>
<text>{{otherList.tecStartTm}} - {{otherList.tecEndTm}}</text>
2023-08-04 17:06:33 +08:00
</view>
<view class="li">
<p>重量</p>
<text>{{otherList.tecWeight}}</text>
2023-08-04 17:06:33 +08:00
</view>
<view class="li">
<p>体积</p>
<text>{{otherList.tecVolume}}</text>
2023-08-04 17:06:33 +08:00
</view>
2023-07-19 18:12:19 +08:00
<view class="li">
2023-07-12 13:48:01 +08:00
<p>普通工人</p>
<text>{{otherList.genNum}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>作业时间</p>
<text>{{otherList.genStartTm}} - {{otherList.genEndTm}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>重量</p>
<text>{{otherList.genWeight}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li">
2023-07-12 13:48:01 +08:00
<p>体积</p>
<text>{{otherList.genVolume}}</text>
2023-07-19 18:12:19 +08:00
</view>
<view class="li wLi">
2023-07-12 13:48:01 +08:00
<p>描述</p>
<text>{{otherList.auxRemark}}</text>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-07-12 13:48:01 +08:00
<p class="title">待工作业</p>
2023-07-19 18:12:19 +08:00
<view class="ul">
<view class="li wLi">
2023-07-12 13:48:01 +08:00
<p>描述</p>
<text>{{otherList.waitRemark}}</text>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-07-12 13:48:01 +08:00
<p class="title">作业备注</p>
2023-07-19 18:12:19 +08:00
<view class="ul">
<view class="li wLi">
2023-07-12 13:48:01 +08:00
<p>描述</p>
<text>{{otherList.workRemark}}</text>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-07-12 13:48:01 +08:00
</view>
</custom-tab-pane>
</custom-tabs>
<uni-popup ref="popup" type="dialog">
<uni-popup-dialog type="error" confirmText="确定" title="通知" content="是否删除此条数据"
@confirm="delConfirm"></uni-popup-dialog>
</uni-popup>
2023-07-12 13:48:01 +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" @click="del"></van-button>
2023-07-19 18:12:19 +08:00
<van-button type="info" @click="edit('edit')"></van-button>
2023-07-12 13:48:01 +08:00
</view>
</view>
</view>
</template>
<script>
import sqlite from "../../common/sqlite.js"
2023-07-12 13:48:01 +08:00
export default {
data() {
return {
tabsValue: 0,
dataInfo: [{
spmName: "",
importExportFlagName: "",
tradeTypeName: ""
}],
shiftInfo: [],
fcList: [],
otherList: {},
2023-07-19 18:12:19 +08:00
shiftRowIndex: 0,
contactId: "",
2023-07-12 13:48:01 +08:00
}
},
2023-07-19 18:12:19 +08:00
mounted() {
this.dataInfo = uni.getStorageSync('shiftRow')
this.contactId = this.dataInfo[0].contactId
this.initData()
2023-07-19 18:12:19 +08:00
},
2023-07-12 13:48:01 +08:00
methods: {
// 查
executeSql1(tableName) {
let sql = `select * from ${tableName} WHERE contactId = '${this.contactId}';`
sqlite.executeSqlCeshi(sql).then((value) => {
if (tableName == 'workMessageRespList') {
this.shiftInfo = []
value.forEach(v => {
this.executeSql2('workMessageRespInfoList', v)
})
} else if (tableName == 'retallyMessageRespList') {
// console.log(value)
let arr = []
value.forEach(item => {
if (!arr[item.retallyType]) {
arr[item.retallyType] = {
retallyType: item.retallyType,
retallyTypeName: item.retallyTypeName,
fcInfo: []
};
}
arr[item.retallyType].fcInfo.push({
vvyId: item.vvyId,
vvyName: item.vvyName,
retallyOrigin: item.retallyOrigin,
retallyTerminus: item.retallyTerminus,
carType: item.carType,
carTypeName: item.carTypeName,
datetime: [item.retallyStartTime, item.retallyEndTime],
retallyStartTime: item.retallyStartTime,
retallyEndTime: item.retallyEndTime,
goodsNumber: item.goodsNumber,
goodsVolume: item.goodsVolume,
goodsWeight: item.goodsWeight
});
});
this.fcList = Object.values(arr)
} else if (tableName == 'infoRespList') {
this.otherList = value[0]
}
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
executeSql2(tableName, item) {
let sql = `select * from ${tableName} WHERE contactId = '${item.webId}';`
sqlite.executeSqlCeshi(sql).then((value) => {
item["shiftInfoList"] = []
value.forEach(v => {
item["shiftInfoList"].push(v)
})
this.shiftInfo.push(item)
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
initData() {
// 获取工班信息
this.executeSql1('workMessageRespList')
this.executeSql1('retallyMessageRespList')
this.executeSql1('infoRespList')
},
// 删除
executeSql(tableName) {
let sql = `DELETE FROM ${tableName} WHERE contactId = '${this.contactId}';`
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
console.log(value);
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
2023-07-12 13:48:01 +08:00
},
// 点击tabs
changeIndex(e) {},
2023-07-12 13:48:01 +08:00
// 取消
cancel() {
2023-07-26 14:34:20 +08:00
uni.setStorageSync('tabsType', 1);
2023-07-12 13:48:01 +08:00
uni.navigateTo({
2023-07-26 14:34:20 +08:00
url: '/pages/shipWork/mixWork'
2023-07-19 18:12:19 +08:00
})
},
// 弹框删除
delConfirm() {
this.executeSql('workMessageRespList')
this.executeSql('workMessageRespInfoList')
this.executeSql('retallyMessageRespList')
this.executeSql('infoRespList')
2023-07-26 14:34:20 +08:00
uni.setStorageSync('tabsType', 1);
2023-07-19 18:12:19 +08:00
uni.navigateTo({
2023-07-26 14:34:20 +08:00
url: '/pages/shipWork/mixWork'
2023-07-19 18:12:19 +08:00
})
},
// 删除
del() {
this.$refs.popup.open()
},
2023-07-19 18:12:19 +08:00
// 编辑
edit(state) {
this.obj = {
state: state
};
const params = encodeURIComponent(JSON.stringify(this.obj));
uni.navigateTo({
url: `/pages/shipWork/shiftAdd?params=${params}`
2023-07-12 13:48:01 +08:00
})
},
2023-08-01 09:32:45 +08:00
onBackPress(event) {
uni.setStorageSync('tabsType', 1);
uni.navigateTo({
url: '/pages/shipWork/mixWork'
})
return true;
},
2023-07-12 13:48:01 +08:00
}
}
</script>
<style lang="less" scoped>
.shiftDetails {
.container {
padding: 30px 20px;
background-color: #fff;
.fcInfo {
padding-bottom: 20px;
border-bottom: 1px solid #ccc;
.fcBox {
display: flex;
padding: 10px 20px;
line-height: 35px;
font-size: 16px;
}
}
.otherInfo {
.title {
margin: 20px 0;
font-size: 16px;
font-weight: bold;
padding-left: 10px;
border-left: 5px solid #2979ff;
}
}
2023-07-19 18:12:19 +08:00
.ul {
2023-07-12 13:48:01 +08:00
display: flex;
justify-content: space-between;
flex-wrap: wrap;
2023-07-19 18:12:19 +08:00
.li {
2023-08-04 17:06:33 +08:00
width: 50%;
2023-07-12 13:48:01 +08:00
display: flex;
padding: 10px 20px;
line-height: 35px;
font-size: 16px;
p {
min-width: 85px;
text-align: right;
}
}
.wLi {
width: calc(100% - 150px);
}
}
2023-07-19 18:12:19 +08:00
.bUl {
width: 100%;
}
.borTop {
2023-07-19 18:12:19 +08:00
border-top: 1px solid #999;
}
.borBtm {
border-bottom: 1px solid #999;
}
2023-07-12 13:48:01 +08:00
.btnList {
display: flex;
justify-content: center;
margin-top: 20px;
/deep/ .van-button {
margin: 30px 20px;
width: 120px;
height: 50px;
}
}
}
}
</style>