新增sqlit数据表
parent
96f8e07a89
commit
63c0c44643
|
@ -4,20 +4,50 @@ module.exports = {
|
||||||
dbPath: '_doc/dianji_chat.db',
|
dbPath: '_doc/dianji_chat.db',
|
||||||
// 创建所有表
|
// 创建所有表
|
||||||
createAllTable() {
|
createAllTable() {
|
||||||
|
// 创建船舶基本信息
|
||||||
|
this.createShipInfoTable()
|
||||||
|
// 创建人员信息
|
||||||
this.createMessageRespList()
|
this.createMessageRespList()
|
||||||
// this.createWorkMessageRespList()
|
// 创建工班信息
|
||||||
|
this.createWorkMessageRespList()
|
||||||
|
// 创建工班信息详细
|
||||||
|
this.createWorkMessageRespInfoList()
|
||||||
|
// // 创建工班信息翻仓
|
||||||
|
// this.createRetallyMessageRespList()
|
||||||
|
// // 创建工班信息翻仓详情
|
||||||
|
// this.createRetallyMessageRespInfoList()
|
||||||
|
// // 创建工班信息其他
|
||||||
|
// this.createInfoRespList()
|
||||||
|
// 创建系解缆
|
||||||
this.creatAttachUnmoorRespList()
|
this.creatAttachUnmoorRespList()
|
||||||
|
// 创建供给
|
||||||
this.createShipmentShipSupplyRespList()
|
this.createShipmentShipSupplyRespList()
|
||||||
|
// 创建指导员作业布置
|
||||||
this.createShipmentAdviserLayoutRespList()
|
this.createShipmentAdviserLayoutRespList()
|
||||||
|
// 创建船舶装卸通知书
|
||||||
this.createShipmentLoadUnloadNoticeRespList()
|
this.createShipmentLoadUnloadNoticeRespList()
|
||||||
|
// 创建质量意见征询
|
||||||
this.createShipmentQualityConsultationRespList()
|
this.createShipmentQualityConsultationRespList()
|
||||||
|
// 创建异常情况
|
||||||
this.createAbnormalConditionRespList()
|
this.createAbnormalConditionRespList()
|
||||||
|
// 创建mafi
|
||||||
this.createMafiListRespList()
|
this.createMafiListRespList()
|
||||||
|
// 创建安全巡检
|
||||||
this.createSafetyInspectionRespList()
|
this.createSafetyInspectionRespList()
|
||||||
|
// 创建作业查询
|
||||||
this.createShipmentShipLoadPlansRespList()
|
this.createShipmentShipLoadPlansRespList()
|
||||||
|
// 创建船舶资料
|
||||||
this.createShipmentShipManage()
|
this.createShipmentShipManage()
|
||||||
|
// 创建下拉数据
|
||||||
this.createShipOption()
|
this.createShipOption()
|
||||||
},
|
},
|
||||||
|
// 创建船舶基本信息 shipInfoTable
|
||||||
|
createShipInfoTable() {
|
||||||
|
console.log("创建船舶基本信息表")
|
||||||
|
let sql =
|
||||||
|
'CREATE TABLE if not exists shipInfoTable ("webId" text NOT NULL,"vslCd" text,"vslCnname" text,"vvyId" text,"vvyName" text,"importExportFlag" text,"importExportFlagName" text,"tradeType" text,"tradeTypeName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
|
this.executeSql(sql)
|
||||||
|
},
|
||||||
// 创建人员信息 messageRespList
|
// 创建人员信息 messageRespList
|
||||||
createMessageRespList() {
|
createMessageRespList() {
|
||||||
let sql =
|
let sql =
|
||||||
|
@ -25,12 +55,38 @@ module.exports = {
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
},
|
},
|
||||||
// 创建工班信息 workMessageRespList
|
// 创建工班信息 workMessageRespList
|
||||||
// createWorkMessageRespList() {
|
createWorkMessageRespList() {
|
||||||
// console.log('创建表');
|
let sql =
|
||||||
// let sql =
|
'CREATE TABLE if not exists workMessageRespList ("webId" text NOT NULL,"contactId" text,"vvyId" text,"vvyName" text,"loadType" text,"loadTypeName" text,"pwcType" text,"pwcTypeName" text,"workStartTime" text,"workEndTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
// 'CREATE TABLE if not exists workMessageRespList ("webId" text NOT NULL,"bthId" text,"bthIdName" text,"jobStartTime" text,"jobEndTime" text,"shipPerson" text,"vvyId" text,"vvyName" text,"weatherId" text,"weatherType" text,"workSuite" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
this.executeSql(sql)
|
||||||
// this.executeSql(sql)
|
},
|
||||||
// },
|
// 创建工班信息详细 workMessageRespInfoList
|
||||||
|
createWorkMessageRespInfoList() {
|
||||||
|
let sql =
|
||||||
|
'CREATE TABLE if not exists workMessageRespInfoList ("webId" text NOT NULL,"contactId" text,"carType" text,"carTypeName" text,"goodsNumber" text,"loadingType" text,"loadingTypeName" text,"remark" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
|
this.executeSql(sql)
|
||||||
|
},
|
||||||
|
// 创建工班信息翻仓 retallyMessageRespList
|
||||||
|
createRetallyMessageRespList() {
|
||||||
|
console.log('创建工班信息翻仓表');
|
||||||
|
let sql =
|
||||||
|
'CREATE TABLE if not exists workMessageRespFlipList ("webId" text NOT NULL,"contactId" text,"vvyId" text,"vvyName" text,"retallyType" text,"retallyTypeName" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
|
this.executeSql(sql)
|
||||||
|
},
|
||||||
|
// 创建工班信息翻仓详情 retallyMessageRespInfoList
|
||||||
|
createRetallyMessageRespInfoList() {
|
||||||
|
console.log('创建工班信息翻仓详情表');
|
||||||
|
let sql =
|
||||||
|
'CREATE TABLE if not exists retallyMessageRespInfoList ("webId" text NOT NULL,"contactId" text,"vvyId" text,"vvyName" text,"retallyOrigin" text,"retallyTerminus" text,"carType" text,"carTypeName" text,"retallyStartTime" text,"retallyEndTime" text,"goodsNumber" text,"goodsVolume" text,"goodsWeight" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
|
this.executeSql(sql)
|
||||||
|
},
|
||||||
|
// 创建工班信息其他 infoRespList
|
||||||
|
createInfoRespList() {
|
||||||
|
console.log('创建工班信息翻仓其他表');
|
||||||
|
let sql =
|
||||||
|
'CREATE TABLE if not exists infoRespList ("webId" text NOT NULL,"contactId" text,"vvyId" text,"vvyName" text,"tecNum" text,"tecStartTm" text,"tecEndTm" text,"tecWeight" text,"tecVolume" text,"genNum" text,"genStartTm" text,"genEndTm" text,"genWeight" text,"genVolume" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
|
this.executeSql(sql)
|
||||||
|
},
|
||||||
// 创建系解缆 attachUnmoorRespList
|
// 创建系解缆 attachUnmoorRespList
|
||||||
creatAttachUnmoorRespList() {
|
creatAttachUnmoorRespList() {
|
||||||
let sql =
|
let sql =
|
||||||
|
@ -67,7 +123,7 @@ module.exports = {
|
||||||
'CREATE TABLE if not exists abnormalConditionRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"type" text,"remark" text,"workTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
'CREATE TABLE if not exists abnormalConditionRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"type" text,"remark" text,"workTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
},
|
},
|
||||||
// 创建mifi mafiListRespList
|
// 创建mafi mafiListRespList
|
||||||
createMafiListRespList() {
|
createMafiListRespList() {
|
||||||
let sql =
|
let sql =
|
||||||
'CREATE TABLE if not exists mafiListRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"loaderTypeId" text,"loaderType" text,"typeId" text,"type" text,"size" text,"mafiBarcode" text,"workDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
'CREATE TABLE if not exists mafiListRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"loaderTypeId" text,"loaderType" text,"typeId" text,"type" text,"size" text,"mafiBarcode" text,"workDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
|
||||||
|
|
|
@ -15,8 +15,7 @@
|
||||||
<button class="searchBtn" type="default" @click="createTable">创建</button>
|
<button class="searchBtn" type="default" @click="createTable">创建</button>
|
||||||
<button class="searchBtn" type="default" @click="dropTable">删除表</button>
|
<button class="searchBtn" type="default" @click="dropTable">删除表</button>
|
||||||
<button class="searchBtn" type="default" @click="dropData">删除数据</button>
|
<button class="searchBtn" type="default" @click="dropData">删除数据</button>
|
||||||
<button class="searchBtn" type="default" @click="add">新增</button>
|
<button class="searchBtn" type="default" @click="executeSql1('shipInfoTable')">查询</button>
|
||||||
<button class="searchBtn" type="default" @click="executeSql1('messageRespList')">查询</button>
|
|
||||||
</view>
|
</view>
|
||||||
<view class="itemList">
|
<view class="itemList">
|
||||||
<template v-if="itemList.length > 0">
|
<template v-if="itemList.length > 0">
|
||||||
|
@ -118,7 +117,17 @@
|
||||||
pageSize: 4,
|
pageSize: 4,
|
||||||
current: 1,
|
current: 1,
|
||||||
|
|
||||||
shipInfo: {},
|
// 船舶基本信息
|
||||||
|
shipInfo: {
|
||||||
|
vslCd: "123",
|
||||||
|
vslCnname: "测试船只",
|
||||||
|
vvyId: "hangciId",
|
||||||
|
vvyName: "hangciName",
|
||||||
|
importExportFlag: "jinchukouId",
|
||||||
|
importExportFlagName: "进口",
|
||||||
|
tradeType: "maoyileixingId",
|
||||||
|
tradeTypeName: "外贸"
|
||||||
|
},
|
||||||
// 船舶资料
|
// 船舶资料
|
||||||
shipData: {
|
shipData: {
|
||||||
vslCd: "123",
|
vslCd: "123",
|
||||||
|
@ -309,7 +318,7 @@
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.pamValue = uni.getStorageSync('portObj').portId
|
this.pamValue = uni.getStorageSync('portObj').portId
|
||||||
this.shipInfo = uni.getStorageSync('shipInfo').voyageScheduleDataList
|
// this.shipInfo = uni.getStorageSync('shipInfo').voyageScheduleDataList
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
open() {
|
open() {
|
||||||
|
@ -348,28 +357,13 @@
|
||||||
},
|
},
|
||||||
dropTable() {
|
dropTable() {
|
||||||
console.log('删除表');
|
console.log('删除表');
|
||||||
let sql = 'DROP TABLE shipmentShipLoadPlansRespList;'
|
let sql = 'DROP TABLE shipInfoTable;'
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
},
|
},
|
||||||
dropData() {
|
dropData() {
|
||||||
let sql = "delete from shipOption"
|
let sql = "delete from shipInfoTable"
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
},
|
},
|
||||||
add() {
|
|
||||||
let data = this.shipInfo
|
|
||||||
data.forEach(v => {
|
|
||||||
let date = new Date().getTime()
|
|
||||||
let str = String(date)
|
|
||||||
v["id"] = Number(str.slice(str.length - 5))
|
|
||||||
})
|
|
||||||
let dbTable = 'messageRespList'
|
|
||||||
let sql = '';
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
sql = "insert into " + dbTable + " values('" + data[i].id + "','" + data[i].berthStatus + "')";
|
|
||||||
this.executeSql(sql)
|
|
||||||
console.log(data[i].id)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
// 查
|
// 查
|
||||||
executeSql(sql) {
|
executeSql(sql) {
|
||||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||||
|
@ -387,8 +381,7 @@
|
||||||
// 获取船的数据
|
// 获取船的数据
|
||||||
initData() {
|
initData() {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: this.$local + '/api/shipOperate/select?pamId=' + this.pamValue + "&vvyId=" + this
|
url: `${this.$local}/api/shipOperate/select?pamId=${this.pamValue}&vvyId=${this.shipValue}`,
|
||||||
.shipValue,
|
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json' //自定义请求头信息
|
'Content-Type': 'application/json' //自定义请求头信息
|
||||||
},
|
},
|
||||||
|
@ -423,7 +416,7 @@
|
||||||
// 获取船名航次下拉数据
|
// 获取船名航次下拉数据
|
||||||
getShip() {
|
getShip() {
|
||||||
uni.request({
|
uni.request({
|
||||||
url: this.$local + '/api/shipOperate/queryShipmentVoyageData?key=' + this.shipInput,
|
url: `${this.$local}/api/shipOperate/queryShipmentVoyageData?key=${this.shipInput}`,
|
||||||
header: {
|
header: {
|
||||||
'Content-Type': 'application/json' //自定义请求头信息
|
'Content-Type': 'application/json' //自定义请求头信息
|
||||||
},
|
},
|
||||||
|
@ -460,6 +453,19 @@
|
||||||
}]
|
}]
|
||||||
// this.initData()
|
// this.initData()
|
||||||
},
|
},
|
||||||
|
// 船舶基本信息
|
||||||
|
shipDataInfo() {
|
||||||
|
let webStatus = 0
|
||||||
|
let sql = ""
|
||||||
|
let date = new Date().getTime()
|
||||||
|
let webId = uuidv4()
|
||||||
|
let webDate = api.getDate(date)
|
||||||
|
sql =
|
||||||
|
`insert into shipInfoTable values('${webId}','${this.shipInfo.vslCd}','${this.shipInfo.vslCnname}',
|
||||||
|
'${this.shipInfo.vvyId}','${this.shipInfo.vvyName}','${this.shipInfo.importExportFlag}','${this.shipInfo.importExportFlagName}',
|
||||||
|
'${this.shipInfo.tradeType}','${this.shipInfo.tradeTypeName}','${webStatus}','${webDate}')`
|
||||||
|
this.executeSql(sql)
|
||||||
|
},
|
||||||
// 船舶资料数据
|
// 船舶资料数据
|
||||||
cbzlData() {
|
cbzlData() {
|
||||||
let webStatus = 0
|
let webStatus = 0
|
||||||
|
@ -473,6 +479,7 @@
|
||||||
'${this.shipData.spmCabinht}','${this.shipData.spmMintide}','${this.shipData.spmCab}','${this.shipData.spmBoardCentrele}',
|
'${this.shipData.spmCabinht}','${this.shipData.spmMintide}','${this.shipData.spmCab}','${this.shipData.spmBoardCentrele}',
|
||||||
'${this.shipData.spmBoardFrontle}','${this.shipData.spmBoardLaterle}','${this.shipData.spmBoardCentrerg}','${this.shipData.spmBoardFrontrg}','${this.shipData.spmBoardLaterrg}',
|
'${this.shipData.spmBoardFrontle}','${this.shipData.spmBoardLaterle}','${this.shipData.spmBoardCentrerg}','${this.shipData.spmBoardFrontrg}','${this.shipData.spmBoardLaterrg}',
|
||||||
'${webStatus}','${webDate}')`
|
'${webStatus}','${webDate}')`
|
||||||
|
console.log(sql)
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
},
|
},
|
||||||
// 作业查询数据
|
// 作业查询数据
|
||||||
|
@ -524,6 +531,7 @@
|
||||||
this.zycxData()
|
this.zycxData()
|
||||||
this.cbzlData()
|
this.cbzlData()
|
||||||
this.xlData()
|
this.xlData()
|
||||||
|
this.shipDataInfo()
|
||||||
// let ids = []
|
// let ids = []
|
||||||
// if (item.inVvyId != null && item.outVvyId == null) {
|
// if (item.inVvyId != null && item.outVvyId == null) {
|
||||||
// ids.push(item.inVvyId)
|
// ids.push(item.inVvyId)
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>尺码:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>尺码:</p>
|
||||||
<uni-number-box v-model="size" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="size" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{size}}</text>
|
<text v-else>{{size}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
|
|
@ -71,6 +71,9 @@
|
||||||
this.shipInfo = uni.getStorageSync('shipInfo')
|
this.shipInfo = uni.getStorageSync('shipInfo')
|
||||||
if (this.tabsType == 0) {
|
if (this.tabsType == 0) {
|
||||||
this.executeSql1('messageRespList')
|
this.executeSql1('messageRespList')
|
||||||
|
} else {
|
||||||
|
this.executeSql1('workMessageRespList')
|
||||||
|
this.executeSql1('workMessageRespInfoList')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -80,6 +83,8 @@
|
||||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||||
if (this.tabsType == 0) {
|
if (this.tabsType == 0) {
|
||||||
this.peopleInfo = value
|
this.peopleInfo = value
|
||||||
|
} else {
|
||||||
|
console.log(value)
|
||||||
}
|
}
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
// 在reject时执行的回调函数
|
// 在reject时执行的回调函数
|
||||||
|
@ -96,8 +101,11 @@
|
||||||
this.tabsIndex = index;
|
this.tabsIndex = index;
|
||||||
if (item == "人员信息") {
|
if (item == "人员信息") {
|
||||||
this.tabsType = 0;
|
this.tabsType = 0;
|
||||||
|
this.executeSql1('messageRespList')
|
||||||
} else {
|
} else {
|
||||||
this.tabsType = 1;
|
this.tabsType = 1;
|
||||||
|
this.executeSql1('workMessageRespList')
|
||||||
|
this.executeSql1('workMessageRespInfoList')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 点击新增
|
// 点击新增
|
||||||
|
|
|
@ -34,12 +34,12 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>车辆数量:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>车辆数量:</p>
|
||||||
<uni-number-box v-model="vehicleSize" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="vehicleSize" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{vehicleSize}}</text>
|
<text v-else>{{vehicleSize}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>备件数量:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>备件数量:</p>
|
||||||
<uni-number-box v-model="sparePart" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="sparePart" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{sparePart}}</text>
|
<text v-else>{{sparePart}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
|
|
@ -1,370 +1,372 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="peopleAdd">
|
<view class="peopleAdd">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="ul">
|
<view class="ul">
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p>船名:</p>
|
<p>船名:</p>
|
||||||
<text>{{shipInfo.voyageScheduleDataList[0].spmName}}</text>
|
<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="hcValue" :localdata="hcList" @change="hcChange"
|
||||||
|
v-if="obj.state != 'look'"></uni-data-select>
|
||||||
|
<text v-else>{{peopleRow.vvyName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>进出口:</p>
|
||||||
|
<text>{{shipInfo.voyageScheduleDataList[0].importExportFlagName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>贸易类型:</p>
|
||||||
|
<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="tqValue" :localdata="tqList" @change="tqChange"
|
||||||
|
v-if="obj.state != 'look'"></uni-data-select>
|
||||||
|
<text v-else>{{peopleRow.weatherType}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p><text class="required" v-if="obj.state != 'look'">*</text>泊位:</p>
|
||||||
|
<uni-data-select v-model="bwValue" :localdata="bwList" @change="bwChange"
|
||||||
|
v-if="obj.state != 'look'"></uni-data-select>
|
||||||
|
<text v-else>{{peopleRow.bthIdName}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p><text class="required" v-if="obj.state != 'look'">*</text>作业组数:</p>
|
||||||
|
<uni-number-box @change="workChange" v-model="workValue" :max="1000000000"
|
||||||
|
v-if="obj.state != 'look'" />
|
||||||
|
<text v-else>{{peopleRow.workSuite}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p><text class="required" v-if="obj.state != 'look'">*</text>单船人数:</p>
|
||||||
|
<uni-number-box @change="shipChange" v-model="shipValue" :max="1000000000"
|
||||||
|
v-if="obj.state != 'look'" />
|
||||||
|
<text v-else>{{peopleRow.shipPerson}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>作业时间:</p>
|
||||||
|
<uni-datetime-picker v-model="datetime" type="datetimerange" rangeSeparator="-" @change="changeLog"
|
||||||
|
v-if="obj.state != 'look'" />
|
||||||
|
<text v-else>{{peopleRow.jobStartTime}} - {{peopleRow.jobEndTime}}</text>
|
||||||
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<uni-popup ref="popup" type="dialog">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>航次:</p>
|
<uni-popup-dialog type="error" confirmText="确定" title="通知" content="是否删除此条数据"
|
||||||
<uni-data-select v-model="hcValue" :localdata="hcList" @change="hcChange"
|
@confirm="delConfirm"></uni-popup-dialog>
|
||||||
v-if="obj.state != 'look'"></uni-data-select>
|
</uni-popup>
|
||||||
<text v-else>{{peopleRow.vvyName}}</text>
|
<view class="btnList">
|
||||||
|
<van-button type="default" @click="cancel">取消</van-button>
|
||||||
|
<van-button type="danger" v-if="obj.state == 'look'" @click="del">删除</van-button>
|
||||||
|
<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 class="li">
|
|
||||||
<p>进出口:</p>
|
|
||||||
<text>{{shipInfo.voyageScheduleDataList[0].importExportFlagName}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="li">
|
|
||||||
<p>贸易类型:</p>
|
|
||||||
<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="tqValue" :localdata="tqList" @change="tqChange"
|
|
||||||
v-if="obj.state != 'look'"></uni-data-select>
|
|
||||||
<text v-else>{{peopleRow.weatherType}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="li">
|
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>泊位:</p>
|
|
||||||
<uni-data-select v-model="bwValue" :localdata="bwList" @change="bwChange"
|
|
||||||
v-if="obj.state != 'look'"></uni-data-select>
|
|
||||||
<text v-else>{{peopleRow.bthIdName}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="li">
|
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>作业组数:</p>
|
|
||||||
<uni-number-box @change="workChange" v-model="workValue" v-if="obj.state != 'look'" />
|
|
||||||
<text v-else>{{peopleRow.workSuite}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="li">
|
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>单船人数:</p>
|
|
||||||
<uni-number-box @change="shipChange" v-model="shipValue" v-if="obj.state != 'look'" />
|
|
||||||
<text v-else>{{peopleRow.shipPerson}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="li">
|
|
||||||
<p>作业时间:</p>
|
|
||||||
<uni-datetime-picker v-model="datetime" type="datetimerange" rangeSeparator="-" @change="changeLog"
|
|
||||||
v-if="obj.state != 'look'" />
|
|
||||||
<text v-else>{{peopleRow.jobStartTime}} - {{peopleRow.jobEndTime}}</text>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
<uni-popup ref="popup" type="dialog">
|
|
||||||
<uni-popup-dialog type="error" confirmText="确定" title="通知" content="是否删除此条数据"
|
|
||||||
@confirm="delConfirm"></uni-popup-dialog>
|
|
||||||
</uni-popup>
|
|
||||||
<view class="btnList">
|
|
||||||
<van-button type="default" @click="cancel">取消</van-button>
|
|
||||||
<van-button type="danger" v-if="obj.state == 'look'" @click="del">删除</van-button>
|
|
||||||
<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>
|
</view>
|
||||||
</view>
|
</template>
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import sqlite from "../../common/sqlite.js"
|
import sqlite from "../../common/sqlite.js"
|
||||||
import api from "../../common/api.js"
|
import api from "../../common/api.js"
|
||||||
import {
|
import {
|
||||||
v4 as uuidv4
|
v4 as uuidv4
|
||||||
} from 'uuid';
|
} from 'uuid';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
shipInfo: {
|
shipInfo: {
|
||||||
voyageScheduleDataList: [{
|
voyageScheduleDataList: [{
|
||||||
spmName: "",
|
spmName: "",
|
||||||
importExportFlagName: "",
|
importExportFlagName: "",
|
||||||
tradeTypeName: ""
|
tradeTypeName: ""
|
||||||
}]
|
}]
|
||||||
},
|
|
||||||
peopleRow: {},
|
|
||||||
peopleRowIndex: 0,
|
|
||||||
obj: {},
|
|
||||||
// 航次下拉框
|
|
||||||
hcValue: "",
|
|
||||||
hcTextValue: "",
|
|
||||||
hcList: [],
|
|
||||||
// 泊位下拉框
|
|
||||||
bwValue: "",
|
|
||||||
bwTextValue: "",
|
|
||||||
bwList: [],
|
|
||||||
// 天气下拉框
|
|
||||||
tqValue: "",
|
|
||||||
tqTextValue: "",
|
|
||||||
tqList: [{
|
|
||||||
value: "0",
|
|
||||||
text: "晴"
|
|
||||||
},
|
},
|
||||||
{
|
peopleRow: {},
|
||||||
value: " 1",
|
peopleRowIndex: 0,
|
||||||
text: "阴"
|
obj: {},
|
||||||
}, {
|
// 航次下拉框
|
||||||
value: "2",
|
hcValue: "",
|
||||||
text: "雨"
|
hcTextValue: "",
|
||||||
}
|
hcList: [],
|
||||||
],
|
// 泊位下拉框
|
||||||
// 作业组数
|
bwValue: "",
|
||||||
workValue: 0,
|
bwTextValue: "",
|
||||||
// 单船人数
|
bwList: [],
|
||||||
shipValue: 0,
|
// 天气下拉框
|
||||||
// 作业时间
|
tqValue: "",
|
||||||
datetime: ['', ''],
|
tqTextValue: "",
|
||||||
startTime: "",
|
tqList: [{
|
||||||
endTime: "",
|
value: "0",
|
||||||
|
text: "晴"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: " 1",
|
||||||
|
text: "阴"
|
||||||
|
}, {
|
||||||
|
value: "2",
|
||||||
|
text: "雨"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
// 作业组数
|
||||||
|
workValue: 0,
|
||||||
|
// 单船人数
|
||||||
|
shipValue: 0,
|
||||||
|
// 作业时间
|
||||||
|
datetime: ['', ''],
|
||||||
|
startTime: "",
|
||||||
|
endTime: "",
|
||||||
|
|
||||||
// 下拉数据
|
// 下拉数据
|
||||||
optionData: [],
|
optionData: [],
|
||||||
}
|
}
|
||||||
},
|
|
||||||
onLoad(options) {
|
|
||||||
if ('params' in options) {
|
|
||||||
// 获取传递的对象参数,使用decodeURIComponent解码,并转为对象
|
|
||||||
this.obj = JSON.parse(decodeURIComponent(options.params))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
if (this.obj.state == "edit" || this.obj.state == "look") {
|
|
||||||
this.getRow()
|
|
||||||
}
|
|
||||||
this.executeSql1('shipOption')
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 查
|
|
||||||
executeSql1(tableName) {
|
|
||||||
let sql = `select * from ${tableName}`
|
|
||||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
|
||||||
// 在resolve时执行的回调函数
|
|
||||||
this.optionData = value
|
|
||||||
this.getShip()
|
|
||||||
}).catch((error) => {
|
|
||||||
// 在reject时执行的回调函数
|
|
||||||
console.error(error);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
// 获取船只信息
|
onLoad(options) {
|
||||||
getShip() {
|
if ('params' in options) {
|
||||||
this.shipInfo = uni.getStorageSync('shipInfo')
|
// 获取传递的对象参数,使用decodeURIComponent解码,并转为对象
|
||||||
// 航次下拉数据
|
this.obj = JSON.parse(decodeURIComponent(options.params))
|
||||||
let hcOption = []
|
}
|
||||||
this.optionData.forEach((v, index) => {
|
},
|
||||||
if (v.dictionariesName == 'vvyList') {
|
mounted() {
|
||||||
hcOption.push(v)
|
if (this.obj.state == "edit" || this.obj.state == "look") {
|
||||||
}
|
this.getRow()
|
||||||
})
|
}
|
||||||
hcOption.forEach((v, index) => {
|
this.executeSql1('shipOption')
|
||||||
this.hcList.push({
|
},
|
||||||
text: v.ptrDesc,
|
methods: {
|
||||||
value: v.ptrCode
|
// 查
|
||||||
|
executeSql1(tableName) {
|
||||||
|
let sql = `select * from ${tableName}`
|
||||||
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||||
|
// 在resolve时执行的回调函数
|
||||||
|
this.optionData = value
|
||||||
|
this.getShip()
|
||||||
|
}).catch((error) => {
|
||||||
|
// 在reject时执行的回调函数
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 获取船只信息
|
||||||
|
getShip() {
|
||||||
|
this.shipInfo = uni.getStorageSync('shipInfo')
|
||||||
|
// 航次下拉数据
|
||||||
|
let hcOption = []
|
||||||
|
this.optionData.forEach((v, index) => {
|
||||||
|
if (v.dictionariesName == 'vvyList') {
|
||||||
|
hcOption.push(v)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
})
|
hcOption.forEach((v, index) => {
|
||||||
// 船舶下拉数据
|
this.hcList.push({
|
||||||
let bwOption = []
|
text: v.ptrDesc,
|
||||||
this.optionData.forEach((v, index) => {
|
value: v.ptrCode
|
||||||
if (v.dictionariesName == 'bthList') {
|
})
|
||||||
bwOption.push(v)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
bwOption.forEach((v, index) => {
|
|
||||||
this.bwList.push({
|
|
||||||
text: v.ptrDesc,
|
|
||||||
value: v.ptrCode
|
|
||||||
})
|
})
|
||||||
})
|
// 船舶下拉数据
|
||||||
},
|
let bwOption = []
|
||||||
// 获取当前行信息
|
this.optionData.forEach((v, index) => {
|
||||||
getRow() {
|
if (v.dictionariesName == 'bthList') {
|
||||||
this.peopleRow = uni.getStorageSync('peopleRow');
|
bwOption.push(v)
|
||||||
this.hcValue = this.peopleRow.vvyId
|
}
|
||||||
this.hcTextValue = this.peopleRow.vvyName
|
})
|
||||||
this.tqValue = this.peopleRow.weatherId
|
bwOption.forEach((v, index) => {
|
||||||
this.tqTextValue = this.peopleRow.weatherType
|
this.bwList.push({
|
||||||
this.bwValue = this.peopleRow.bthId
|
text: v.ptrDesc,
|
||||||
this.bwTextValue = this.peopleRow.bthIdName
|
value: v.ptrCode
|
||||||
this.workValue = this.peopleRow.workSuite
|
})
|
||||||
this.shipValue = this.peopleRow.shipPerson
|
})
|
||||||
this.datetime = [this.peopleRow.jobStartTime, this.peopleRow.jobEndTime]
|
},
|
||||||
this.startTime = this.peopleRow.jobStartTime
|
// 获取当前行信息
|
||||||
this.endTime = this.peopleRow.jobEndTime
|
getRow() {
|
||||||
},
|
this.peopleRow = uni.getStorageSync('peopleRow');
|
||||||
// 航次下拉
|
this.hcValue = this.peopleRow.vvyId
|
||||||
hcChange(e) {
|
this.hcTextValue = this.peopleRow.vvyName
|
||||||
this.hcValue = e;
|
this.tqValue = this.peopleRow.weatherId
|
||||||
this.hcList.forEach(v => {
|
this.tqTextValue = this.peopleRow.weatherType
|
||||||
if (v.value == e) {
|
this.bwValue = this.peopleRow.bthId
|
||||||
this.hcTextValue = v.text
|
this.bwTextValue = this.peopleRow.bthIdName
|
||||||
}
|
this.workValue = this.peopleRow.workSuite
|
||||||
})
|
this.shipValue = this.peopleRow.shipPerson
|
||||||
},
|
this.datetime = [this.peopleRow.jobStartTime, this.peopleRow.jobEndTime]
|
||||||
// 泊位下拉
|
this.startTime = this.peopleRow.jobStartTime
|
||||||
bwChange(e) {
|
this.endTime = this.peopleRow.jobEndTime
|
||||||
this.bwValue = e;
|
},
|
||||||
this.bwList.forEach(v => {
|
// 航次下拉
|
||||||
if (v.value == e) {
|
hcChange(e) {
|
||||||
this.bwTextValue = v.text
|
this.hcValue = e;
|
||||||
}
|
this.hcList.forEach(v => {
|
||||||
})
|
if (v.value == e) {
|
||||||
},
|
this.hcTextValue = v.text
|
||||||
// 天气下拉
|
}
|
||||||
tqChange(e) {
|
})
|
||||||
this.tqValue = e;
|
},
|
||||||
this.tqList.forEach(v => {
|
// 泊位下拉
|
||||||
if (v.value == e) {
|
bwChange(e) {
|
||||||
this.tqTextValue = v.text
|
this.bwValue = e;
|
||||||
}
|
this.bwList.forEach(v => {
|
||||||
})
|
if (v.value == e) {
|
||||||
},
|
this.bwTextValue = v.text
|
||||||
// 作业组数
|
}
|
||||||
workChange(val) {
|
})
|
||||||
this.workValue = val;
|
},
|
||||||
},
|
// 天气下拉
|
||||||
// 单船人数
|
tqChange(e) {
|
||||||
shipChange(val) {
|
this.tqValue = e;
|
||||||
this.shipValue = val;
|
this.tqList.forEach(v => {
|
||||||
},
|
if (v.value == e) {
|
||||||
// 作业时间
|
this.tqTextValue = v.text
|
||||||
changeLog(e) {
|
}
|
||||||
this.datetime = e;
|
})
|
||||||
this.startTime = this.datetime[0].slice(0, this.datetime[0].length - 3)
|
},
|
||||||
this.endTime = this.datetime[1].slice(0, this.datetime[1].length - 3)
|
// 作业组数
|
||||||
},
|
workChange(val) {
|
||||||
// 取消
|
this.workValue = val;
|
||||||
cancel() {
|
},
|
||||||
uni.setStorageSync('tabsType', 0);
|
// 单船人数
|
||||||
uni.navigateTo({
|
shipChange(val) {
|
||||||
url: '/pages/shipWork/mixWork'
|
this.shipValue = val;
|
||||||
})
|
},
|
||||||
},
|
// 作业时间
|
||||||
// 弹框删除
|
changeLog(e) {
|
||||||
delConfirm() {
|
this.datetime = e;
|
||||||
let sql = `DELETE FROM messageRespList WHERE webId = '${this.peopleRow.webId}';`
|
this.startTime = this.datetime[0].slice(0, this.datetime[0].length - 3)
|
||||||
this.executeSql(sql)
|
this.endTime = this.datetime[1].slice(0, this.datetime[1].length - 3)
|
||||||
uni.setStorageSync('tabsType', 0);
|
},
|
||||||
uni.navigateTo({
|
// 取消
|
||||||
url: '/pages/shipWork/mixWork'
|
cancel() {
|
||||||
})
|
uni.setStorageSync('tabsType', 0);
|
||||||
},
|
uni.navigateTo({
|
||||||
// 删除
|
url: '/pages/shipWork/mixWork'
|
||||||
del() {
|
})
|
||||||
this.$refs.popup.open()
|
},
|
||||||
},
|
// 弹框删除
|
||||||
// 保存
|
delConfirm() {
|
||||||
save() {
|
let sql = `DELETE FROM messageRespList WHERE webId = '${this.peopleRow.webId}';`
|
||||||
let date = new Date().getTime()
|
this.executeSql(sql)
|
||||||
let webId = uuidv4()
|
uni.setStorageSync('tabsType', 0);
|
||||||
let webStatus = 0
|
uni.navigateTo({
|
||||||
let webDate = api.getDate(date)
|
url: '/pages/shipWork/mixWork'
|
||||||
if (this.obj.state == "edit") {
|
})
|
||||||
let sql =
|
},
|
||||||
`UPDATE messageRespList SET bthId = '${this.bwValue}',bthIdName = '${this.bwTextValue}',
|
// 删除
|
||||||
|
del() {
|
||||||
|
this.$refs.popup.open()
|
||||||
|
},
|
||||||
|
// 保存
|
||||||
|
save() {
|
||||||
|
let date = new Date().getTime()
|
||||||
|
let webId = uuidv4()
|
||||||
|
let webStatus = 0
|
||||||
|
let webDate = api.getDate(date)
|
||||||
|
if (this.obj.state == "edit") {
|
||||||
|
let sql =
|
||||||
|
`UPDATE messageRespList SET bthId = '${this.bwValue}',bthIdName = '${this.bwTextValue}',
|
||||||
jobStartTime = '${this.startTime}',jobEndTime = '${this.endTime}',shipPerson = '${this.shipValue}',
|
jobStartTime = '${this.startTime}',jobEndTime = '${this.endTime}',shipPerson = '${this.shipValue}',
|
||||||
vvyId = '${this.hcValue}',vvyName = '${this.hcTextValue}',weatherId = '${this.tqValue}',
|
vvyId = '${this.hcValue}',vvyName = '${this.hcTextValue}',weatherId = '${this.tqValue}',
|
||||||
weatherType = '${this.tqTextValue}',workSuite = '${this.workValue}',webStatus = '${webStatus}',
|
weatherType = '${this.tqTextValue}',workSuite = '${this.workValue}',webStatus = '${webStatus}',
|
||||||
webDate = '${webDate}' WHERE webId = '${this.peopleRow.webId}';`
|
webDate = '${webDate}' WHERE webId = '${this.peopleRow.webId}';`
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
} else if (this.obj.state == "add") {
|
} else if (this.obj.state == "add") {
|
||||||
let sql = `insert into messageRespList values('${webId}','${this.bwValue}','${this.bwTextValue}',
|
let sql = `insert into messageRespList values('${webId}','${this.bwValue}','${this.bwTextValue}',
|
||||||
'${this.startTime}','${this.endTime}','${this.shipValue}','${this.hcValue}','${this.hcTextValue}','${this.tqValue}',
|
'${this.startTime}','${this.endTime}','${this.shipValue}','${this.hcValue}','${this.hcTextValue}','${this.tqValue}',
|
||||||
'${this.tqTextValue}','${this.workValue}','${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}',
|
'${this.tqTextValue}','${this.workValue}','${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}',
|
||||||
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}','${this.shipInfo.voyageScheduleDataList[0].spmName}',
|
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}','${this.shipInfo.voyageScheduleDataList[0].spmName}',
|
||||||
'${webStatus}','${webDate}')`
|
'${webStatus}','${webDate}')`
|
||||||
this.executeSql(sql)
|
this.executeSql(sql)
|
||||||
}
|
}
|
||||||
uni.setStorageSync('tabsType', 0);
|
uni.setStorageSync('tabsType', 0);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/shipWork/mixWork'
|
url: '/pages/shipWork/mixWork'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 编辑
|
// 编辑
|
||||||
toGo(state) {
|
toGo(state) {
|
||||||
this.obj.state = state;
|
this.obj.state = state;
|
||||||
const params = encodeURIComponent(JSON.stringify(this.obj));
|
const params = encodeURIComponent(JSON.stringify(this.obj));
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `/pages/shipWork/peopleAdd?params=${params}`
|
url: `/pages/shipWork/peopleAdd?params=${params}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
executeSql(sql) {
|
executeSql(sql) {
|
||||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||||
// 在resolve时执行的回调函数
|
// 在resolve时执行的回调函数
|
||||||
console.log(value);
|
console.log(value);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
// 在reject时执行的回调函数
|
// 在reject时执行的回调函数
|
||||||
console.error(error);
|
console.error(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onBackPress(event) {
|
onBackPress(event) {
|
||||||
uni.setStorageSync('tabsType', 0);
|
uni.setStorageSync('tabsType', 0);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/shipWork/mixWork'
|
url: '/pages/shipWork/mixWork'
|
||||||
})
|
})
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
</script>
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.peopleAdd {
|
.peopleAdd {
|
||||||
.container {
|
.container {
|
||||||
padding: 30px 20px;
|
padding: 30px 20px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
|
||||||
.ul {
|
.ul {
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
justify-content: space-between;
|
|
||||||
|
|
||||||
.li {
|
|
||||||
width: 44%;
|
|
||||||
border-top: 1px solid #ccc;
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10px 20px;
|
flex-wrap: wrap;
|
||||||
line-height: 35px;
|
justify-content: space-between;
|
||||||
margin-bottom: 20px;
|
|
||||||
|
|
||||||
p {
|
.li {
|
||||||
min-width: 85px;
|
width: 44%;
|
||||||
text-align: right;
|
border-top: 1px solid #ccc;
|
||||||
}
|
border-bottom: 1px solid #ccc;
|
||||||
|
display: flex;
|
||||||
.required {
|
padding: 10px 20px;
|
||||||
color: red;
|
|
||||||
margin-right: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/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;
|
line-height: 35px;
|
||||||
background-color: #fff !important;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
p {
|
||||||
|
min-width: 85px;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.required {
|
||||||
|
color: red;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/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 {
|
.btnList {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|
||||||
/deep/ .van-button {
|
/deep/ .van-button {
|
||||||
margin: 30px 20px;
|
margin: 30px 20px;
|
||||||
width: 120px;
|
width: 120px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
</style>
|
||||||
</style>
|
|
|
@ -52,7 +52,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required">*</text>数量:</p>
|
<p><text class="required">*</text>数量:</p>
|
||||||
<uni-number-box @change="numChange" v-model="item2.numValue" />
|
<uni-number-box @change="numChange" v-model="item2.numValue" :max="1000000000" />
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>装卸方式:</p>
|
<p class="liTitle"><text class="required">*</text>装卸方式:</p>
|
||||||
|
@ -106,15 +106,15 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>数量:</p>
|
<p class="liTitle"><text class="required">*</text>数量:</p>
|
||||||
<uni-number-box v-model="item2.numValue" />
|
<uni-number-box v-model="item2.numValue" :max="1000000000" />
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>体积:</p>
|
<p class="liTitle"><text class="required">*</text>体积:</p>
|
||||||
<uni-number-box v-model="item2.tjValue" />
|
<uni-number-box v-model="item2.tjValue" :max="1000000000" />
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>重量:</p>
|
<p class="liTitle"><text class="required">*</text>重量:</p>
|
||||||
<uni-number-box v-model="item2.zlValue" />
|
<uni-number-box v-model="item2.zlValue" :max="1000000000" />
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -128,11 +128,7 @@
|
||||||
<view class="ul">
|
<view class="ul">
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>技术工人:</p>
|
<p class="liTitle"><text class="required">*</text>技术工人:</p>
|
||||||
<uni-number-box v-model="otherObj.jsWorker" />
|
<uni-number-box v-model="otherObj.jsWorker" :max="1000000000" />
|
||||||
</view>
|
|
||||||
<view class="li">
|
|
||||||
<p class="liTitle"><text class="required">*</text>普通工人:</p>
|
|
||||||
<uni-number-box v-model="otherObj.ptworker" />
|
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>作业时间 :</p>
|
<p class="liTitle"><text class="required">*</text>作业时间 :</p>
|
||||||
|
@ -141,11 +137,28 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>重量:</p>
|
<p class="liTitle"><text class="required">*</text>重量:</p>
|
||||||
<uni-number-box v-model="otherObj.zlValue" />
|
<uni-number-box v-model="otherObj.zlValue" :max="1000000000" />
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle"><text class="required">*</text>体积:</p>
|
<p class="liTitle"><text class="required">*</text>体积:</p>
|
||||||
<uni-number-box v-model="otherObj.tjValue" />
|
<uni-number-box v-model="otherObj.tjValue" :max="1000000000" />
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p class="liTitle"><text class="required">*</text>普通工人:</p>
|
||||||
|
<uni-number-box v-model="otherObj.ptworker" :max="1000000000" />
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p class="liTitle"><text class="required">*</text>作业时间 :</p>
|
||||||
|
<uni-datetime-picker v-model="otherObj.datetime2" type="datetimerange" rangeSeparator="-"
|
||||||
|
@change="changeLog(otherObj)" />
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p class="liTitle"><text class="required">*</text>重量:</p>
|
||||||
|
<uni-number-box v-model="otherObj.zlValue2" :max="1000000000" />
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p class="liTitle"><text class="required">*</text>体积:</p>
|
||||||
|
<uni-number-box v-model="otherObj.tjValue2" :max="1000000000" />
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p class="liTitle">描述:</p>
|
<p class="liTitle">描述:</p>
|
||||||
|
@ -183,6 +196,10 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import sqlite from "../../common/sqlite.js"
|
import sqlite from "../../common/sqlite.js"
|
||||||
|
import api from "../../common/api.js"
|
||||||
|
import {
|
||||||
|
v4 as uuidv4
|
||||||
|
} from 'uuid';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -262,12 +279,17 @@
|
||||||
// 其他信息
|
// 其他信息
|
||||||
otherObj: {
|
otherObj: {
|
||||||
jsWorker: 0,
|
jsWorker: 0,
|
||||||
ptworker: 0,
|
|
||||||
datetime: ['', ''],
|
datetime: ['', ''],
|
||||||
startTime: "",
|
startTime: "",
|
||||||
endTime: "",
|
endTime: "",
|
||||||
zlValue: 0,
|
zlValue: 0,
|
||||||
tjValue: 0,
|
tjValue: 0,
|
||||||
|
ptworker: 0,
|
||||||
|
datetime2: ['', ''],
|
||||||
|
startTime2: "",
|
||||||
|
endTime2: "",
|
||||||
|
zlValue2: 0,
|
||||||
|
tjValue2: 0,
|
||||||
describe: "",
|
describe: "",
|
||||||
dgWork: "",
|
dgWork: "",
|
||||||
notes: "",
|
notes: "",
|
||||||
|
@ -435,7 +457,9 @@
|
||||||
this.ulList1[index].ulList2.push({
|
this.ulList1[index].ulList2.push({
|
||||||
cxValue: "",
|
cxValue: "",
|
||||||
numValue: 0,
|
numValue: 0,
|
||||||
|
cxTextValue: "",
|
||||||
fsValue: "",
|
fsValue: "",
|
||||||
|
fsTextValue: "",
|
||||||
notes: "",
|
notes: "",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -452,6 +476,10 @@
|
||||||
changeLog(item) {
|
changeLog(item) {
|
||||||
item.startTime = item.datetime[0].slice(0, item.datetime[0].length - 3)
|
item.startTime = item.datetime[0].slice(0, item.datetime[0].length - 3)
|
||||||
item.endTime = item.datetime[1].slice(0, item.datetime[1].length - 3)
|
item.endTime = item.datetime[1].slice(0, item.datetime[1].length - 3)
|
||||||
|
if (item.startTime2 != undefined) {
|
||||||
|
item.startTime2 = item.datetime2[0].slice(0, item.datetime2[0].length - 3)
|
||||||
|
item.endTime2 = item.datetime2[1].slice(0, item.datetime2[1].length - 3)
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 工班信息删除
|
// 工班信息删除
|
||||||
delGb(index) {
|
delGb(index) {
|
||||||
|
@ -540,7 +568,6 @@
|
||||||
delFc2(index, index2) {
|
delFc2(index, index2) {
|
||||||
this.fcUlList[index].fcUlList2.splice(index2, 1)
|
this.fcUlList[index].fcUlList2.splice(index2, 1)
|
||||||
},
|
},
|
||||||
|
|
||||||
// 取消
|
// 取消
|
||||||
cancel() {
|
cancel() {
|
||||||
uni.setStorageSync('tabsType', 1);
|
uni.setStorageSync('tabsType', 1);
|
||||||
|
@ -558,34 +585,70 @@
|
||||||
},
|
},
|
||||||
// 保存
|
// 保存
|
||||||
save() {
|
save() {
|
||||||
let addShiftArr = uni.getStorageSync('addShiftArr')
|
if (this.obj.state == "edit") {} else if (this.obj.state == "add") {
|
||||||
let addShiftObj = {
|
for (let i = 0; i < this.ulList1.length; i++) {
|
||||||
vvyName: this.hcTextValue,
|
let webId = uuidv4()
|
||||||
vvyId: this.hcValue,
|
let contactId = ""
|
||||||
loadTypeName: this.zxTextValue,
|
let webStatus = "0"
|
||||||
loadType: this.zxValue,
|
let date = new Date().getTime()
|
||||||
shiftList: this.ulList1,
|
let webDate = api.getDate(date)
|
||||||
fcList: this.fcUlList,
|
let sql = `insert into workMessageRespList values('${webId}','${contactId}','${this.hcValue}',
|
||||||
otherList: this.otherObj
|
'${this.hcTextValue}','${this.zxValue}','${this.zxTextValue}','${this.ulList1[i].gbValue}',
|
||||||
}
|
'${this.ulList1[i].gbTextValue}','${this.ulList1[i].startTime}','${this.ulList1[i].endTime}',
|
||||||
if (this.obj.state == 'add') {
|
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}',
|
||||||
if (addShiftArr != "") {
|
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}','${this.shipInfo.voyageScheduleDataList[0].spmName}',
|
||||||
addShiftArr.push(addShiftObj)
|
'${webStatus}','${webDate}')`
|
||||||
uni.setStorageSync('addShiftArr', addShiftArr);
|
this.executeSql(sql)
|
||||||
} else {
|
for (let j = 0; j < this.ulList1[i].ulList2.length; j++) {
|
||||||
addShiftArr = []
|
let webId = uuidv4()
|
||||||
addShiftArr.push(addShiftObj)
|
let contactId = ""
|
||||||
uni.setStorageSync('addShiftArr', addShiftArr);
|
let webDate = api.getDate(date)
|
||||||
|
let sql2 = `insert into workMessageRespInfoList values('${webId}','${contactId}','${this.ulList1[i].ulList2[j].cxValue}',
|
||||||
|
'${this.ulList1[i].ulList2[j].cxTextValue}','${this.ulList1[i].ulList2[j].numValue}','${this.ulList1[i].ulList2[j].fsValue}',
|
||||||
|
'${this.ulList1[i].ulList2[j].fsTextValue}','${this.ulList1[i].ulList2[j].notes}',
|
||||||
|
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}','${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}',
|
||||||
|
'${this.shipInfo.voyageScheduleDataList[0].spmName}','${webStatus}','${webDate}')`
|
||||||
|
this.executeSql(sql2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
addShiftArr[this.shiftRowIndex] = addShiftObj;
|
|
||||||
uni.setStorageSync('addShiftArr', addShiftArr);
|
|
||||||
}
|
}
|
||||||
|
// let addShiftArr = uni.getStorageSync('addShiftArr')
|
||||||
|
// let addShiftObj = {
|
||||||
|
// vvyName: this.hcTextValue,
|
||||||
|
// vvyId: this.hcValue,
|
||||||
|
// loadTypeName: this.zxTextValue,
|
||||||
|
// loadType: this.zxValue,
|
||||||
|
// shiftList: this.ulList1,
|
||||||
|
// fcList: this.fcUlList,
|
||||||
|
// otherList: this.otherObj
|
||||||
|
// }
|
||||||
|
// if (this.obj.state == 'add') {
|
||||||
|
// if (addShiftArr != "") {
|
||||||
|
// addShiftArr.push(addShiftObj)
|
||||||
|
// uni.setStorageSync('addShiftArr', addShiftArr);
|
||||||
|
// } else {
|
||||||
|
// addShiftArr = []
|
||||||
|
// addShiftArr.push(addShiftObj)
|
||||||
|
// uni.setStorageSync('addShiftArr', addShiftArr);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// addShiftArr[this.shiftRowIndex] = addShiftObj;
|
||||||
|
// uni.setStorageSync('addShiftArr', addShiftArr);
|
||||||
|
// }
|
||||||
uni.setStorageSync('tabsType', 1);
|
uni.setStorageSync('tabsType', 1);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/shipWork/mixWork'
|
url: '/pages/shipWork/mixWork'
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
executeSql(sql) {
|
||||||
|
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||||
|
// 在resolve时执行的回调函数
|
||||||
|
console.log(value);
|
||||||
|
}).catch((error) => {
|
||||||
|
// 在reject时执行的回调函数
|
||||||
|
console.error(error);
|
||||||
|
});
|
||||||
|
},
|
||||||
onBackPress(event) {
|
onBackPress(event) {
|
||||||
uni.setStorageSync('tabsType', 1);
|
uni.setStorageSync('tabsType', 1);
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|
|
@ -97,10 +97,6 @@
|
||||||
<p>技术工人:</p>
|
<p>技术工人:</p>
|
||||||
<text>{{dataInfo.otherList.jsWorker}}</text>
|
<text>{{dataInfo.otherList.jsWorker}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
|
||||||
<p>普通工人:</p>
|
|
||||||
<text>{{dataInfo.otherList.ptworker}}</text>
|
|
||||||
</view>
|
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p>作业时间:</p>
|
<p>作业时间:</p>
|
||||||
<text>{{dataInfo.otherList.startTime}} - {{dataInfo.otherList.endTime}}</text>
|
<text>{{dataInfo.otherList.startTime}} - {{dataInfo.otherList.endTime}}</text>
|
||||||
|
@ -113,6 +109,22 @@
|
||||||
<p>体积:</p>
|
<p>体积:</p>
|
||||||
<text>{{dataInfo.otherList.tjValue}}</text>
|
<text>{{dataInfo.otherList.tjValue}}</text>
|
||||||
</view>
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>普通工人:</p>
|
||||||
|
<text>{{dataInfo.otherList.ptworker}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>作业时间:</p>
|
||||||
|
<text>{{dataInfo.otherList.startTime2}} - {{dataInfo.otherList.endTime2}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>重量:</p>
|
||||||
|
<text>{{dataInfo.otherList.zlValue2}}</text>
|
||||||
|
</view>
|
||||||
|
<view class="li">
|
||||||
|
<p>体积:</p>
|
||||||
|
<text>{{dataInfo.otherList.tjValue2}}</text>
|
||||||
|
</view>
|
||||||
<view class="li wLi">
|
<view class="li wLi">
|
||||||
<p>描述:</p>
|
<p>描述:</p>
|
||||||
<text>{{dataInfo.otherList.describe}}</text>
|
<text>{{dataInfo.otherList.describe}}</text>
|
||||||
|
@ -251,7 +263,7 @@
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
|
||||||
.li {
|
.li {
|
||||||
width: 45%;
|
width: 50%;
|
||||||
display: flex;
|
display: flex;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
line-height: 35px;
|
line-height: 35px;
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>供给量:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>供给量:</p>
|
||||||
<uni-number-box v-model="supplyAmount" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="supplyAmount" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{supplyAmount}}</text>
|
<text v-else>{{supplyAmount}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>船舶净吨:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>船舶净吨:</p>
|
||||||
<uni-number-box v-model="zlShip" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="zlShip" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{zlShip}}</text>
|
<text v-else>{{zlShip}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>人数:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>人数:</p>
|
||||||
<uni-number-box v-model="personNumber" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="personNumber" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{personNumber}}</text>
|
<text v-else>{{personNumber}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
@ -45,12 +45,12 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>车辆数量:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>车辆数量:</p>
|
||||||
<uni-number-box v-model="vehicleSize" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="vehicleSize" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{vehicleSize}}</text>
|
<text v-else>{{vehicleSize}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
<p><text class="required" v-if="obj.state != 'look'">*</text>备件数量:</p>
|
<p><text class="required" v-if="obj.state != 'look'">*</text>备件数量:</p>
|
||||||
<uni-number-box v-model="sparePart" v-if="obj.state != 'look'" />
|
<uni-number-box v-model="sparePart" :max="1000000000" v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{sparePart}}</text>
|
<text v-else>{{sparePart}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
|
Loading…
Reference in New Issue