pad-app/pages/shipWork/shiftDetails.vue

528 lines
13 KiB
Vue
Raw Normal View History

2023-07-12 13:48:01 +08:00
<template>
<view class="shiftDetails">
2023-08-24 16:22:29 +08:00
<head-view :title="title"></head-view>
2023-11-01 18:40:05 +08:00
<view class="container contentFixed">
<view class="paddingBox">
<view class="ul ulInfo">
<view class="li">
<p>船名</p>
<text>{{shipInfo.vslCnname}}</text>
2023-07-19 18:12:19 +08:00
</view>
2023-11-01 18:40:05 +08:00
<view class="li">
<p>航次</p>
<text>{{dataInfo[0].vvyName}}</text>
2023-07-19 18:12:19 +08:00
</view>
2023-11-01 18:40:05 +08:00
<view class="li">
<p>进出口</p>
<text>{{dataInfo[0].importExportFlagName}}</text>
2023-07-12 13:48:01 +08:00
</view>
2023-11-01 18:40:05 +08:00
<view class="li">
<p>贸易类型</p>
<text>{{shipInfo.spmTradeName}}</text>
</view>
<view class="li">
<p>装卸类型</p>
<text> {{dataInfo[0].loadTypeName}}</text>
</view>
</view>
</view>
<van-tabs v-model="active" @click="onTabs" line-width="100px" line-height="5px" color="#0067CF"
title-active-color="#0067CF">
<van-tab title="工班信息">
<view class="shiftCss">
<view class="smasonry">
2023-12-27 17:57:26 +08:00
<view class="ul" v-for="(item,index) in shiftInfo1" :key="index + 'a'">
2023-11-01 18:40:05 +08:00
<view class="li">
<p>工班</p>
<text> {{item.pwcTypeName}}</text>
</view>
<view class="li">
<p>作业时间</p>
<text> {{item.workStartTime}} - {{item.workEndTime}}</text>
</view>
<view class="ul aUl" 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>
2024-04-02 18:05:56 +08:00
<text class="remark">{{item2.remark}}</text>
2023-11-01 18:40:05 +08:00
</view>
</view>
2023-07-19 18:12:19 +08:00
</view>
2023-11-01 18:40:05 +08:00
</view>
<view class="smasonry">
2023-12-27 17:57:26 +08:00
<view class="ul" v-for="(item,index) in shiftInfo2" :key="index + 'c'">
2023-11-01 18:40:05 +08:00
<view class="li">
<p>工班</p>
<text> {{item.pwcTypeName}}</text>
</view>
<view class="li">
<p>作业时间</p>
<text> {{item.workStartTime}} - {{item.workEndTime}}</text>
</view>
<view class="ul aUl" 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>
2024-04-02 18:05:56 +08:00
<text class="remark">{{item2.remark}}</text>
2023-11-01 18:40:05 +08:00
</view>
</view>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-11-01 18:40:05 +08:00
</view>
</van-tab>
<van-tab title="翻仓信息">
<view class="masonry">
<view class="masonryLi" v-for="(item,index) in this.fcList" :key="index">
<view class="ul">
<view class="li">
<p>翻舱类型</p>
<text>{{item.retallyTypeName}}</text>
</view>
<view class="li">
<p>翻舱起点</p>
<text>{{item.retallyOrigin}}</text>
</view>
<view class="li">
<p>翻舱终点</p>
<text>{{item.retallyTerminus}}</text>
</view>
<view class="li">
<p>作业时间</p>
<text>{{item.retallyStartTime}} - {{item.retallyEndTime}}</text>
</view>
<view class="li">
<p>车型</p>
<text>{{item.carTypeName}}</text>
</view>
<view class="li" v-if="item.carTypeName == '空马菲'">
<p>组数</p>
<text>{{item.mafiGroupNum}}</text>
</view>
<view class="li">
<p>数量</p>
<text>{{item.goodsNumber}}</text>
</view>
<view class="li">
<p>体积</p>
<text>{{item.goodsVolume}}</text>
</view>
<view class="li">
<p>重量</p>
<text>{{item.goodsWeight}}</text>
</view>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-11-01 18:40:05 +08:00
</view>
</van-tab>
<van-tab title="其他信息">
<view class="masonry">
<view class="otherInfo masonryLi" v-for="(item,index) in otherList" :key="index">
<view class="ul">
<p class="title">辅助作业</p>
<view class="li">
<p>技术工人</p>
<text>{{item.tecNum}}</text>
</view>
<view class="li">
<p>作业时间</p>
<text>{{item.startTm}} - {{item.endTm}}</text>
</view>
<view class="li">
<p>重量</p>
<text>{{item.weight}}</text>
</view>
<view class="li">
<p>体积</p>
<text>{{item.volume}}</text>
</view>
<view class="li">
<p>普通工人</p>
<text>{{item.genNum}}</text>
</view>
<view class="li">
<p>作业时间</p>
<text>{{item.startTmPt}} - {{item.endTmPt}}</text>
</view>
<view class="li">
<p>重量</p>
<text>{{item.weightPt}}</text>
</view>
<view class="li">
<p>体积</p>
<text>{{item.volumePt}}</text>
</view>
<view class="li wLi">
<p>描述</p>
<text>{{item.auxRemark}}</text>
</view>
<p class="title">待工作业</p>
<view class="li wLi">
<p>描述</p>
<text>{{item.waitRemark}}</text>
</view>
<p class="title">作业备注</p>
<view class="li wLi">
<p>描述</p>
<text>{{item.workRemark}}</text>
</view>
2023-07-19 18:12:19 +08:00
</view>
</view>
2023-07-12 13:48:01 +08:00
</view>
2023-11-01 18:40:05 +08:00
</van-tab>
</van-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">
2023-12-22 17:48:52 +08:00
<view class="btn qx" @click="cancel"></view>
2023-11-01 18:40:05 +08:00
<template v-if="status == 0 || status == 4 || status == 5 || status == 'null'">
2023-12-22 17:48:52 +08:00
<!-- <view class="btn sc" @click="del"></view> -->
<view class="btn bc" @click="edit('edit')"></view>
2023-11-01 18:40:05 +08:00
</template>
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 {
2023-11-01 18:40:05 +08:00
title: "工班信息详情",
active: 0,
dataInfo: [{
spmName: "",
importExportFlagName: "",
tradeTypeName: ""
}],
2023-11-01 18:40:05 +08:00
shipInfo: {},
shiftInfo: [],
2023-11-01 18:40:05 +08:00
shiftInfo1: [],
shiftInfo2: [],
fcList: [],
2023-11-01 18:40:05 +08:00
otherList: [],
2023-07-19 18:12:19 +08:00
shiftRowIndex: 0,
contactId: "",
2023-08-23 17:42:44 +08:00
aId: "",
2023-11-01 18:40:05 +08:00
vtpId: "",
// 审核状态
status: 0,
// 删除工班信息id
delSwmIds: [],
2023-07-12 13:48:01 +08:00
}
},
2023-07-19 18:12:19 +08:00
mounted() {
2023-11-01 18:40:05 +08:00
this.vtpId = uni.getStorageSync('vtpId')
2023-07-19 18:12:19 +08:00
this.dataInfo = uni.getStorageSync('shiftRow')
this.contactId = this.dataInfo[0].contactId
2023-08-23 17:42:44 +08:00
this.aId = this.dataInfo[0].aId
2023-11-01 18:40:05 +08:00
this.status = this.dataInfo[0].status
this.delSwmIds = uni.getStorageSync("delSwmIds")
this.initData()
2023-11-01 18:40:05 +08:00
let that = this
setTimeout(function() {
that.shiftInfo.forEach((v, index) => {
if (index % 2 == 0) {
that.shiftInfo1.push(v)
} else {
that.shiftInfo2.push(v)
}
})
}, 200)
2023-07-19 18:12:19 +08:00
},
2023-07-12 13:48:01 +08:00
methods: {
// 查
executeSql1(tableName) {
2023-08-23 17:42:44 +08:00
let sql = `select * from ${tableName} WHERE aId = '${this.aId}';`
sqlite.executeSqlCeshi(sql).then((value) => {
if (tableName == 'workMessageRespList') {
this.shiftInfo = []
value.forEach(v => {
this.executeSql2('workMessageRespInfoList', v)
})
} else if (tableName == 'retallyMessageRespList') {
2023-11-01 18:40:05 +08:00
this.fcList = value
} else if (tableName == 'infoRespList') {
2023-11-01 18:40:05 +08:00
this.otherList = value
}
}).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);
});
},
2023-11-01 18:40:05 +08:00
executeSql3(tableName) {
let sql = `select * from ${tableName} WHERE vtpId = '${this.vtpId}'`
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
this.shipInfo = value[0]
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
initData() {
2023-11-01 18:40:05 +08:00
this.executeSql3('shipInfoTable')
// 获取工班信息
this.executeSql1('workMessageRespList')
this.executeSql1('retallyMessageRespList')
this.executeSql1('infoRespList')
},
2023-11-01 18:40:05 +08:00
// 切换标签
onTabs(e) {
this.active = e.detail.index
},
// 删除
executeSql(tableName) {
2023-08-23 17:42:44 +08:00
let sql = ""
2023-08-24 16:22:29 +08:00
if (tableName == "workMessageRespInfoList") {
2023-08-23 17:42:44 +08:00
sql = `DELETE FROM ${tableName} WHERE contactId = '${this.contactId}';`
2023-08-24 16:22:29 +08:00
} else {
2023-08-23 17:42:44 +08:00
sql = `DELETE FROM ${tableName} WHERE aId = '${this.aId}';`
}
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
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-11-01 18:40:05 +08:00
uni.setStorageSync('tabsType', 1)
this.dataInfo.forEach(v => {
2023-11-28 17:52:09 +08:00
let reg = RegExp(/-/)
2023-12-08 17:42:10 +08:00
if (reg.test(v.webId) == false) {
2023-11-28 17:52:09 +08:00
this.delSwmIds.push(v.webId)
}
2023-11-01 18:40:05 +08:00
})
uni.setStorageSync('delSwmIds', this.delSwmIds);
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
})
},
}
}
</script>
<style lang="less" scoped>
.shiftDetails {
.container {
2023-11-01 18:40:05 +08:00
min-height: 100vh;
background-color: #F6F7F9;
2023-07-12 13:48:01 +08:00
2023-11-01 18:40:05 +08:00
.paddingBox {
padding: 16px;
}
.ulInfo {
padding: 0 16px;
.li {
width: 49% !important;
height: 56px;
line-height: 56px;
}
}
/deep/.van-tab {
padding-top: 10px;
}
/deep/.tab-pane {
width: 100%;
}
/deep/.van-ellipsis {
font-size: 18px;
font-weight: bold;
}
/deep/.van-tab--active {
font-size: 18px;
font-weight: bold;
}
/deep/ .van-tabs--line {
height: 60px;
}
/deep/ .van-tabs__wrap {
height: 60px;
}
.masonry {
background-color: #F6F7F9;
padding: 16px 16px 100px;
display: flex;
flex-wrap: wrap;
align-items: baseline;
gap: 16px;
2024-04-09 14:20:21 +08:00
justify-content: space-between;
2023-11-01 18:40:05 +08:00
.masonryLi {
width: 49%;
height: auto;
}
}
.shiftCss {
display: flex;
2023-07-12 13:48:01 +08:00
2023-11-01 18:40:05 +08:00
.smasonry {
2024-04-02 18:05:56 +08:00
width: 49%;
2023-11-01 18:40:05 +08:00
flex: 1;
2023-07-12 13:48:01 +08:00
display: flex;
2023-11-01 18:40:05 +08:00
flex-direction: column;
gap: 16px;
background-color: #F6F7F9;
padding: 16px 16px 100px;
align-items: baseline;
2024-04-02 18:05:56 +08:00
.remark{
word-break: break-all;
}
2023-07-12 13:48:01 +08:00
}
}
.otherInfo {
2023-11-01 18:40:05 +08:00
padding-bottom: 20px;
2023-07-12 13:48:01 +08:00
.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-11-01 18:40:05 +08:00
background-color: #fff;
border-radius: 8px;
2023-07-12 13:48:01 +08:00
display: flex;
justify-content: space-between;
flex-wrap: wrap;
2023-11-01 18:40:05 +08:00
padding: 0 16px 16px;
2023-12-27 17:57:26 +08:00
margin-bottom: 16px;
2023-07-19 18:12:19 +08:00
.li {
2023-11-01 18:40:05 +08:00
width: 100%;
2023-07-12 13:48:01 +08:00
display: flex;
2023-11-01 18:40:05 +08:00
justify-content: space-between;
2024-04-02 18:05:56 +08:00
min-height: 50px;
2023-11-01 18:40:05 +08:00
line-height: 50px;
2023-07-12 13:48:01 +08:00
font-size: 16px;
}
2024-04-02 18:05:56 +08:00
// .wLi {
// width: 100%;
// min-height: 50px;
// }
2023-07-12 13:48:01 +08:00
}
2023-11-01 18:40:05 +08:00
.aUl {
padding: 16px;
width: 100%;
2023-11-01 18:40:05 +08:00
background: #F7F7F7;
border-radius: 4px;
margin-top: 16px;
}
2023-07-12 13:48:01 +08:00
.btnList {
2023-11-01 18:40:05 +08:00
position: fixed;
bottom: 0;
2023-12-22 17:48:52 +08:00
left: 0;
right: 0;
2023-11-01 18:40:05 +08:00
height: 80px;
background-color: #fff;
2023-12-22 17:48:52 +08:00
display: flex;
justify-content: center;
2023-11-01 18:40:05 +08:00
box-shadow: 0 -3px 7px 0 rgba(0, 0, 0, 0.10);
2023-07-12 13:48:01 +08:00
2023-12-22 17:48:52 +08:00
.btn {
margin: 15.5px 17px;
width: 200px;
height: 49px;
border-radius: 2px;
font-size: 18px;
text-align: center;
line-height: 49px;
}
.qx {
background-color: #eee;
}
.sc {
background-color: #E50101;
color: #fff;
}
.bc {
color: #fff;
background: #0067CF;
2023-07-12 13:48:01 +08:00
}
}
}
}
</style>