pad-app/pages/shipWork/abnormal.vue

149 lines
3.1 KiB
Vue

<template>
<view class="abnormal">
<view class="container">
<view class="signBox">
<p class="sign" @click="sign"></p>
</view>
<template v-if="infoList.length > 0">
<view class="ul">
<view class="li" v-for="(item,index) in infoList" :key="index" @click="add('look',item,index)">
<view class="title">类型:{{item.type}}</view>
<p>上传状态:未上传</p>
<p>航次:{{item.vvyName}}</p>
<p>贸易类型:{{item.importExportFlagName}}</p>
<p>进出口:{{item.tradeTypeName}}</p>
</view>
</view>
</template>
<o-empty v-else height="70vh" bg="#f5f6fa" />
<view class="addBtn" @click="add('add')">+ </view>
</view>
</view>
</template>
<script>
import sqlite from "../../common/sqlite.js"
export default {
data() {
return {
shipInfo: {},
infoList: []
}
},
mounted() {
// this.shipInfo = uni.getStorageSync('shipInfo')
// this.infoList = uni.getStorageSync('addAbnormalArr')
this.executeSql1('abnormalConditionRespList')
},
methods: {
// 查
executeSql(sql) {
sqlite.executeSqlCeshi(sql).then((value) => {
// 在resolve时执行的回调函数
this.infoList = value
console.log(this.infoList)
}).catch((error) => {
// 在reject时执行的回调函数
console.error(error);
});
},
executeSql1(tableName) {
let sql = `select * from ${tableName}`
this.executeSql(sql)
},
// 点击签名
sign() {
uni.navigateTo({
url: '/pages/shipWork/sign'
})
},
// 点击新增
add(state, item, index) {
if (state != 'add') {
uni.setStorageSync('abnormalRow', item);
uni.setStorageSync('abnormalRowIndex', index);
}
const obj = {
state: state,
}
const params = encodeURIComponent(JSON.stringify(obj));
uni.navigateTo({
url: `/pages/shipWork/abnormalAdd?params=${params}`
})
},
onBackPress(event) {
uni.navigateTo({
url: '/pages/shipWork/documentList'
})
return true;
},
}
}
</script>
<style lang="less" scoped>
.abnormal {
.container {
padding: 30px 20px;
.signBox {
display: flex;
justify-content: flex-end;
.sign {
text-align: right;
color: #2979ff;
padding: 10px;
background: #fff;
border: 1px solid #ccc;
}
}
.ul {
padding: 20px 0;
.li {
display: flex;
justify-content: space-between;
border-bottom: 1px solid #ccc;
padding: 20px;
.title {
font-size: 16px;
font-weight: bold;
display: flex;
flex-direction: column;
justify-content: center;
}
.shift {
p {
font-size: 16px;
}
}
.state {
display: flex;
flex-direction: column;
justify-content: center;
}
}
}
.addBtn {
position: fixed;
right: 50px;
bottom: 50px;
width: 100px;
height: 100px;
border-radius: 50%;
background-color: #2979ff;
color: #fff;
font-size: 24px;
text-align: center;
line-height: 100px;
font-weight: bold;
}
}
}
</style>