新增sqlit数据表
parent
96f8e07a89
commit
63c0c44643
|
@ -4,20 +4,50 @@ module.exports = {
|
|||
dbPath: '_doc/dianji_chat.db',
|
||||
// 创建所有表
|
||||
createAllTable() {
|
||||
// 创建船舶基本信息
|
||||
this.createShipInfoTable()
|
||||
// 创建人员信息
|
||||
this.createMessageRespList()
|
||||
// this.createWorkMessageRespList()
|
||||
// 创建工班信息
|
||||
this.createWorkMessageRespList()
|
||||
// 创建工班信息详细
|
||||
this.createWorkMessageRespInfoList()
|
||||
// // 创建工班信息翻仓
|
||||
// this.createRetallyMessageRespList()
|
||||
// // 创建工班信息翻仓详情
|
||||
// this.createRetallyMessageRespInfoList()
|
||||
// // 创建工班信息其他
|
||||
// this.createInfoRespList()
|
||||
// 创建系解缆
|
||||
this.creatAttachUnmoorRespList()
|
||||
// 创建供给
|
||||
this.createShipmentShipSupplyRespList()
|
||||
// 创建指导员作业布置
|
||||
this.createShipmentAdviserLayoutRespList()
|
||||
// 创建船舶装卸通知书
|
||||
this.createShipmentLoadUnloadNoticeRespList()
|
||||
// 创建质量意见征询
|
||||
this.createShipmentQualityConsultationRespList()
|
||||
// 创建异常情况
|
||||
this.createAbnormalConditionRespList()
|
||||
// 创建mafi
|
||||
this.createMafiListRespList()
|
||||
// 创建安全巡检
|
||||
this.createSafetyInspectionRespList()
|
||||
// 创建作业查询
|
||||
this.createShipmentShipLoadPlansRespList()
|
||||
// 创建船舶资料
|
||||
this.createShipmentShipManage()
|
||||
// 创建下拉数据
|
||||
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
|
||||
createMessageRespList() {
|
||||
let sql =
|
||||
|
@ -25,12 +55,38 @@ module.exports = {
|
|||
this.executeSql(sql)
|
||||
},
|
||||
// 创建工班信息 workMessageRespList
|
||||
// createWorkMessageRespList() {
|
||||
// console.log('创建表');
|
||||
// let sql =
|
||||
// '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)
|
||||
// },
|
||||
createWorkMessageRespList() {
|
||||
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"));'
|
||||
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
|
||||
creatAttachUnmoorRespList() {
|
||||
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"));'
|
||||
this.executeSql(sql)
|
||||
},
|
||||
// 创建mifi mafiListRespList
|
||||
// 创建mafi mafiListRespList
|
||||
createMafiListRespList() {
|
||||
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"));'
|
||||
|
|
|
@ -15,8 +15,7 @@
|
|||
<button class="searchBtn" type="default" @click="createTable">创建</button>
|
||||
<button class="searchBtn" type="default" @click="dropTable">删除表</button>
|
||||
<button class="searchBtn" type="default" @click="dropData">删除数据</button>
|
||||
<button class="searchBtn" type="default" @click="add">新增</button>
|
||||
<button class="searchBtn" type="default" @click="executeSql1('messageRespList')">查询</button>
|
||||
<button class="searchBtn" type="default" @click="executeSql1('shipInfoTable')">查询</button>
|
||||
</view>
|
||||
<view class="itemList">
|
||||
<template v-if="itemList.length > 0">
|
||||
|
@ -118,7 +117,17 @@
|
|||
pageSize: 4,
|
||||
current: 1,
|
||||
|
||||
shipInfo: {},
|
||||
// 船舶基本信息
|
||||
shipInfo: {
|
||||
vslCd: "123",
|
||||
vslCnname: "测试船只",
|
||||
vvyId: "hangciId",
|
||||
vvyName: "hangciName",
|
||||
importExportFlag: "jinchukouId",
|
||||
importExportFlagName: "进口",
|
||||
tradeType: "maoyileixingId",
|
||||
tradeTypeName: "外贸"
|
||||
},
|
||||
// 船舶资料
|
||||
shipData: {
|
||||
vslCd: "123",
|
||||
|
@ -309,7 +318,7 @@
|
|||
},
|
||||
mounted() {
|
||||
this.pamValue = uni.getStorageSync('portObj').portId
|
||||
this.shipInfo = uni.getStorageSync('shipInfo').voyageScheduleDataList
|
||||
// this.shipInfo = uni.getStorageSync('shipInfo').voyageScheduleDataList
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
|
@ -348,28 +357,13 @@
|
|||
},
|
||||
dropTable() {
|
||||
console.log('删除表');
|
||||
let sql = 'DROP TABLE shipmentShipLoadPlansRespList;'
|
||||
let sql = 'DROP TABLE shipInfoTable;'
|
||||
this.executeSql(sql)
|
||||
},
|
||||
dropData() {
|
||||
let sql = "delete from shipOption"
|
||||
let sql = "delete from shipInfoTable"
|
||||
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) {
|
||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||
|
@ -387,8 +381,7 @@
|
|||
// 获取船的数据
|
||||
initData() {
|
||||
uni.request({
|
||||
url: this.$local + '/api/shipOperate/select?pamId=' + this.pamValue + "&vvyId=" + this
|
||||
.shipValue,
|
||||
url: `${this.$local}/api/shipOperate/select?pamId=${this.pamValue}&vvyId=${this.shipValue}`,
|
||||
header: {
|
||||
'Content-Type': 'application/json' //自定义请求头信息
|
||||
},
|
||||
|
@ -423,7 +416,7 @@
|
|||
// 获取船名航次下拉数据
|
||||
getShip() {
|
||||
uni.request({
|
||||
url: this.$local + '/api/shipOperate/queryShipmentVoyageData?key=' + this.shipInput,
|
||||
url: `${this.$local}/api/shipOperate/queryShipmentVoyageData?key=${this.shipInput}`,
|
||||
header: {
|
||||
'Content-Type': 'application/json' //自定义请求头信息
|
||||
},
|
||||
|
@ -460,6 +453,19 @@
|
|||
}]
|
||||
// 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() {
|
||||
let webStatus = 0
|
||||
|
@ -473,6 +479,7 @@
|
|||
'${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}',
|
||||
'${webStatus}','${webDate}')`
|
||||
console.log(sql)
|
||||
this.executeSql(sql)
|
||||
},
|
||||
// 作业查询数据
|
||||
|
@ -524,6 +531,7 @@
|
|||
this.zycxData()
|
||||
this.cbzlData()
|
||||
this.xlData()
|
||||
this.shipDataInfo()
|
||||
// let ids = []
|
||||
// if (item.inVvyId != null && item.outVvyId == null) {
|
||||
// ids.push(item.inVvyId)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<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>
|
||||
</view>
|
||||
<view class="li">
|
||||
|
|
|
@ -71,6 +71,9 @@
|
|||
this.shipInfo = uni.getStorageSync('shipInfo')
|
||||
if (this.tabsType == 0) {
|
||||
this.executeSql1('messageRespList')
|
||||
} else {
|
||||
this.executeSql1('workMessageRespList')
|
||||
this.executeSql1('workMessageRespInfoList')
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -80,6 +83,8 @@
|
|||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||
if (this.tabsType == 0) {
|
||||
this.peopleInfo = value
|
||||
} else {
|
||||
console.log(value)
|
||||
}
|
||||
}).catch((error) => {
|
||||
// 在reject时执行的回调函数
|
||||
|
@ -96,8 +101,11 @@
|
|||
this.tabsIndex = index;
|
||||
if (item == "人员信息") {
|
||||
this.tabsType = 0;
|
||||
this.executeSql1('messageRespList')
|
||||
} else {
|
||||
this.tabsType = 1;
|
||||
this.executeSql1('workMessageRespList')
|
||||
this.executeSql1('workMessageRespInfoList')
|
||||
}
|
||||
},
|
||||
// 点击新增
|
||||
|
|
|
@ -34,12 +34,12 @@
|
|||
</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'" />
|
||||
<uni-number-box v-model="vehicleSize" :max="1000000000" 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'" />
|
||||
<uni-number-box v-model="sparePart" :max="1000000000" v-if="obj.state != 'look'" />
|
||||
<text v-else>{{sparePart}}</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
|
@ -100,7 +100,7 @@
|
|||
sparePart: 0,
|
||||
// 作业时间
|
||||
workTime: [''],
|
||||
|
||||
|
||||
// 下拉数据
|
||||
optionData: [],
|
||||
}
|
||||
|
|
|
@ -1,370 +1,372 @@
|
|||
<template>
|
||||
<view class="peopleAdd">
|
||||
<view class="container">
|
||||
<view class="ul">
|
||||
<view class="li">
|
||||
<p>船名:</p>
|
||||
<text>{{shipInfo.voyageScheduleDataList[0].spmName}}</text>
|
||||
<template>
|
||||
<view class="peopleAdd">
|
||||
<view class="container">
|
||||
<view class="ul">
|
||||
<view class="li">
|
||||
<p>船名:</p>
|
||||
<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 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>
|
||||
<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 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>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import sqlite from "../../common/sqlite.js"
|
||||
import api from "../../common/api.js"
|
||||
import {
|
||||
v4 as uuidv4
|
||||
} from 'uuid';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shipInfo: {
|
||||
voyageScheduleDataList: [{
|
||||
spmName: "",
|
||||
importExportFlagName: "",
|
||||
tradeTypeName: ""
|
||||
}]
|
||||
},
|
||||
peopleRow: {},
|
||||
peopleRowIndex: 0,
|
||||
obj: {},
|
||||
// 航次下拉框
|
||||
hcValue: "",
|
||||
hcTextValue: "",
|
||||
hcList: [],
|
||||
// 泊位下拉框
|
||||
bwValue: "",
|
||||
bwTextValue: "",
|
||||
bwList: [],
|
||||
// 天气下拉框
|
||||
tqValue: "",
|
||||
tqTextValue: "",
|
||||
tqList: [{
|
||||
value: "0",
|
||||
text: "晴"
|
||||
<script>
|
||||
import sqlite from "../../common/sqlite.js"
|
||||
import api from "../../common/api.js"
|
||||
import {
|
||||
v4 as uuidv4
|
||||
} from 'uuid';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shipInfo: {
|
||||
voyageScheduleDataList: [{
|
||||
spmName: "",
|
||||
importExportFlagName: "",
|
||||
tradeTypeName: ""
|
||||
}]
|
||||
},
|
||||
{
|
||||
value: " 1",
|
||||
text: "阴"
|
||||
}, {
|
||||
value: "2",
|
||||
text: "雨"
|
||||
}
|
||||
],
|
||||
// 作业组数
|
||||
workValue: 0,
|
||||
// 单船人数
|
||||
shipValue: 0,
|
||||
// 作业时间
|
||||
datetime: ['', ''],
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
peopleRow: {},
|
||||
peopleRowIndex: 0,
|
||||
obj: {},
|
||||
// 航次下拉框
|
||||
hcValue: "",
|
||||
hcTextValue: "",
|
||||
hcList: [],
|
||||
// 泊位下拉框
|
||||
bwValue: "",
|
||||
bwTextValue: "",
|
||||
bwList: [],
|
||||
// 天气下拉框
|
||||
tqValue: "",
|
||||
tqTextValue: "",
|
||||
tqList: [{
|
||||
value: "0",
|
||||
text: "晴"
|
||||
},
|
||||
{
|
||||
value: " 1",
|
||||
text: "阴"
|
||||
}, {
|
||||
value: "2",
|
||||
text: "雨"
|
||||
}
|
||||
],
|
||||
// 作业组数
|
||||
workValue: 0,
|
||||
// 单船人数
|
||||
shipValue: 0,
|
||||
// 作业时间
|
||||
datetime: ['', ''],
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
|
||||
// 下拉数据
|
||||
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);
|
||||
});
|
||||
// 下拉数据
|
||||
optionData: [],
|
||||
}
|
||||
},
|
||||
// 获取船只信息
|
||||
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({
|
||||
text: v.ptrDesc,
|
||||
value: v.ptrCode
|
||||
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);
|
||||
});
|
||||
},
|
||||
// 获取船只信息
|
||||
getShip() {
|
||||
this.shipInfo = uni.getStorageSync('shipInfo')
|
||||
// 航次下拉数据
|
||||
let hcOption = []
|
||||
this.optionData.forEach((v, index) => {
|
||||
if (v.dictionariesName == 'vvyList') {
|
||||
hcOption.push(v)
|
||||
}
|
||||
})
|
||||
})
|
||||
// 船舶下拉数据
|
||||
let bwOption = []
|
||||
this.optionData.forEach((v, index) => {
|
||||
if (v.dictionariesName == 'bthList') {
|
||||
bwOption.push(v)
|
||||
}
|
||||
})
|
||||
bwOption.forEach((v, index) => {
|
||||
this.bwList.push({
|
||||
text: v.ptrDesc,
|
||||
value: v.ptrCode
|
||||
hcOption.forEach((v, index) => {
|
||||
this.hcList.push({
|
||||
text: v.ptrDesc,
|
||||
value: v.ptrCode
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取当前行信息
|
||||
getRow() {
|
||||
this.peopleRow = uni.getStorageSync('peopleRow');
|
||||
this.hcValue = this.peopleRow.vvyId
|
||||
this.hcTextValue = this.peopleRow.vvyName
|
||||
this.tqValue = this.peopleRow.weatherId
|
||||
this.tqTextValue = this.peopleRow.weatherType
|
||||
this.bwValue = this.peopleRow.bthId
|
||||
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
|
||||
this.endTime = this.peopleRow.jobEndTime
|
||||
},
|
||||
// 航次下拉
|
||||
hcChange(e) {
|
||||
this.hcValue = e;
|
||||
this.hcList.forEach(v => {
|
||||
if (v.value == e) {
|
||||
this.hcTextValue = v.text
|
||||
}
|
||||
})
|
||||
},
|
||||
// 泊位下拉
|
||||
bwChange(e) {
|
||||
this.bwValue = e;
|
||||
this.bwList.forEach(v => {
|
||||
if (v.value == e) {
|
||||
this.bwTextValue = v.text
|
||||
}
|
||||
})
|
||||
},
|
||||
// 天气下拉
|
||||
tqChange(e) {
|
||||
this.tqValue = e;
|
||||
this.tqList.forEach(v => {
|
||||
if (v.value == e) {
|
||||
this.tqTextValue = v.text
|
||||
}
|
||||
})
|
||||
},
|
||||
// 作业组数
|
||||
workChange(val) {
|
||||
this.workValue = val;
|
||||
},
|
||||
// 单船人数
|
||||
shipChange(val) {
|
||||
this.shipValue = val;
|
||||
},
|
||||
// 作业时间
|
||||
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)
|
||||
},
|
||||
// 取消
|
||||
cancel() {
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
// 弹框删除
|
||||
delConfirm() {
|
||||
let sql = `DELETE FROM messageRespList WHERE webId = '${this.peopleRow.webId}';`
|
||||
this.executeSql(sql)
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
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}',
|
||||
// 船舶下拉数据
|
||||
let bwOption = []
|
||||
this.optionData.forEach((v, index) => {
|
||||
if (v.dictionariesName == 'bthList') {
|
||||
bwOption.push(v)
|
||||
}
|
||||
})
|
||||
bwOption.forEach((v, index) => {
|
||||
this.bwList.push({
|
||||
text: v.ptrDesc,
|
||||
value: v.ptrCode
|
||||
})
|
||||
})
|
||||
},
|
||||
// 获取当前行信息
|
||||
getRow() {
|
||||
this.peopleRow = uni.getStorageSync('peopleRow');
|
||||
this.hcValue = this.peopleRow.vvyId
|
||||
this.hcTextValue = this.peopleRow.vvyName
|
||||
this.tqValue = this.peopleRow.weatherId
|
||||
this.tqTextValue = this.peopleRow.weatherType
|
||||
this.bwValue = this.peopleRow.bthId
|
||||
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
|
||||
this.endTime = this.peopleRow.jobEndTime
|
||||
},
|
||||
// 航次下拉
|
||||
hcChange(e) {
|
||||
this.hcValue = e;
|
||||
this.hcList.forEach(v => {
|
||||
if (v.value == e) {
|
||||
this.hcTextValue = v.text
|
||||
}
|
||||
})
|
||||
},
|
||||
// 泊位下拉
|
||||
bwChange(e) {
|
||||
this.bwValue = e;
|
||||
this.bwList.forEach(v => {
|
||||
if (v.value == e) {
|
||||
this.bwTextValue = v.text
|
||||
}
|
||||
})
|
||||
},
|
||||
// 天气下拉
|
||||
tqChange(e) {
|
||||
this.tqValue = e;
|
||||
this.tqList.forEach(v => {
|
||||
if (v.value == e) {
|
||||
this.tqTextValue = v.text
|
||||
}
|
||||
})
|
||||
},
|
||||
// 作业组数
|
||||
workChange(val) {
|
||||
this.workValue = val;
|
||||
},
|
||||
// 单船人数
|
||||
shipChange(val) {
|
||||
this.shipValue = val;
|
||||
},
|
||||
// 作业时间
|
||||
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)
|
||||
},
|
||||
// 取消
|
||||
cancel() {
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
// 弹框删除
|
||||
delConfirm() {
|
||||
let sql = `DELETE FROM messageRespList WHERE webId = '${this.peopleRow.webId}';`
|
||||
this.executeSql(sql)
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
// 删除
|
||||
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}',
|
||||
vvyId = '${this.hcValue}',vvyName = '${this.hcTextValue}',weatherId = '${this.tqValue}',
|
||||
weatherType = '${this.tqTextValue}',workSuite = '${this.workValue}',webStatus = '${webStatus}',
|
||||
webDate = '${webDate}' WHERE webId = '${this.peopleRow.webId}';`
|
||||
this.executeSql(sql)
|
||||
} else if (this.obj.state == "add") {
|
||||
let sql = `insert into messageRespList values('${webId}','${this.bwValue}','${this.bwTextValue}',
|
||||
this.executeSql(sql)
|
||||
} else if (this.obj.state == "add") {
|
||||
let sql = `insert into messageRespList values('${webId}','${this.bwValue}','${this.bwTextValue}',
|
||||
'${this.startTime}','${this.endTime}','${this.shipValue}','${this.hcValue}','${this.hcTextValue}','${this.tqValue}',
|
||||
'${this.tqTextValue}','${this.workValue}','${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}',
|
||||
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}','${this.shipInfo.voyageScheduleDataList[0].spmName}',
|
||||
'${webStatus}','${webDate}')`
|
||||
this.executeSql(sql)
|
||||
}
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
toGo(state) {
|
||||
this.obj.state = state;
|
||||
const params = encodeURIComponent(JSON.stringify(this.obj));
|
||||
uni.navigateTo({
|
||||
url: `/pages/shipWork/peopleAdd?params=${params}`
|
||||
})
|
||||
},
|
||||
executeSql(sql) {
|
||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||
// 在resolve时执行的回调函数
|
||||
console.log(value);
|
||||
}).catch((error) => {
|
||||
// 在reject时执行的回调函数
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
onBackPress(event) {
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
return true;
|
||||
},
|
||||
this.executeSql(sql)
|
||||
}
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
toGo(state) {
|
||||
this.obj.state = state;
|
||||
const params = encodeURIComponent(JSON.stringify(this.obj));
|
||||
uni.navigateTo({
|
||||
url: `/pages/shipWork/peopleAdd?params=${params}`
|
||||
})
|
||||
},
|
||||
executeSql(sql) {
|
||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||
// 在resolve时执行的回调函数
|
||||
console.log(value);
|
||||
}).catch((error) => {
|
||||
// 在reject时执行的回调函数
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
onBackPress(event) {
|
||||
uni.setStorageSync('tabsType', 0);
|
||||
uni.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
return true;
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.peopleAdd {
|
||||
.container {
|
||||
padding: 30px 20px;
|
||||
background-color: #fff;
|
||||
<style lang="less" scoped>
|
||||
.peopleAdd {
|
||||
.container {
|
||||
padding: 30px 20px;
|
||||
background-color: #fff;
|
||||
|
||||
.ul {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
.li {
|
||||
width: 44%;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
.ul {
|
||||
display: flex;
|
||||
padding: 10px 20px;
|
||||
line-height: 35px;
|
||||
margin-bottom: 20px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
|
||||
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;
|
||||
.li {
|
||||
width: 44%;
|
||||
border-top: 1px solid #ccc;
|
||||
border-bottom: 1px solid #ccc;
|
||||
display: flex;
|
||||
padding: 10px 20px;
|
||||
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 {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.btnList {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
||||
/deep/ .van-button {
|
||||
margin: 30px 20px;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
/deep/ .van-button {
|
||||
margin: 30px 20px;
|
||||
width: 120px;
|
||||
height: 50px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
|
@ -52,7 +52,7 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<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 class="li">
|
||||
<p class="liTitle"><text class="required">*</text>装卸方式:</p>
|
||||
|
@ -106,15 +106,15 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<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 class="li">
|
||||
<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 class="li">
|
||||
<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>
|
||||
|
@ -128,11 +128,7 @@
|
|||
<view class="ul">
|
||||
<view class="li">
|
||||
<p class="liTitle"><text class="required">*</text>技术工人:</p>
|
||||
<uni-number-box v-model="otherObj.jsWorker" />
|
||||
</view>
|
||||
<view class="li">
|
||||
<p class="liTitle"><text class="required">*</text>普通工人:</p>
|
||||
<uni-number-box v-model="otherObj.ptworker" />
|
||||
<uni-number-box v-model="otherObj.jsWorker" :max="1000000000" />
|
||||
</view>
|
||||
<view class="li">
|
||||
<p class="liTitle"><text class="required">*</text>作业时间 :</p>
|
||||
|
@ -141,11 +137,28 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<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 class="li">
|
||||
<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 class="li">
|
||||
<p class="liTitle">描述:</p>
|
||||
|
@ -183,6 +196,10 @@
|
|||
|
||||
<script>
|
||||
import sqlite from "../../common/sqlite.js"
|
||||
import api from "../../common/api.js"
|
||||
import {
|
||||
v4 as uuidv4
|
||||
} from 'uuid';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
@ -262,12 +279,17 @@
|
|||
// 其他信息
|
||||
otherObj: {
|
||||
jsWorker: 0,
|
||||
ptworker: 0,
|
||||
datetime: ['', ''],
|
||||
startTime: "",
|
||||
endTime: "",
|
||||
zlValue: 0,
|
||||
tjValue: 0,
|
||||
ptworker: 0,
|
||||
datetime2: ['', ''],
|
||||
startTime2: "",
|
||||
endTime2: "",
|
||||
zlValue2: 0,
|
||||
tjValue2: 0,
|
||||
describe: "",
|
||||
dgWork: "",
|
||||
notes: "",
|
||||
|
@ -435,7 +457,9 @@
|
|||
this.ulList1[index].ulList2.push({
|
||||
cxValue: "",
|
||||
numValue: 0,
|
||||
cxTextValue: "",
|
||||
fsValue: "",
|
||||
fsTextValue: "",
|
||||
notes: "",
|
||||
})
|
||||
},
|
||||
|
@ -452,6 +476,10 @@
|
|||
changeLog(item) {
|
||||
item.startTime = item.datetime[0].slice(0, item.datetime[0].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) {
|
||||
|
@ -540,7 +568,6 @@
|
|||
delFc2(index, index2) {
|
||||
this.fcUlList[index].fcUlList2.splice(index2, 1)
|
||||
},
|
||||
|
||||
// 取消
|
||||
cancel() {
|
||||
uni.setStorageSync('tabsType', 1);
|
||||
|
@ -558,34 +585,70 @@
|
|||
},
|
||||
// 保存
|
||||
save() {
|
||||
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);
|
||||
if (this.obj.state == "edit") {} else if (this.obj.state == "add") {
|
||||
for (let i = 0; i < this.ulList1.length; i++) {
|
||||
let webId = uuidv4()
|
||||
let contactId = ""
|
||||
let webStatus = "0"
|
||||
let date = new Date().getTime()
|
||||
let webDate = api.getDate(date)
|
||||
let sql = `insert into workMessageRespList values('${webId}','${contactId}','${this.hcValue}',
|
||||
'${this.hcTextValue}','${this.zxValue}','${this.zxTextValue}','${this.ulList1[i].gbValue}',
|
||||
'${this.ulList1[i].gbTextValue}','${this.ulList1[i].startTime}','${this.ulList1[i].endTime}',
|
||||
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}',
|
||||
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}','${this.shipInfo.voyageScheduleDataList[0].spmName}',
|
||||
'${webStatus}','${webDate}')`
|
||||
this.executeSql(sql)
|
||||
for (let j = 0; j < this.ulList1[i].ulList2.length; j++) {
|
||||
let webId = uuidv4()
|
||||
let contactId = ""
|
||||
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.navigateTo({
|
||||
url: '/pages/shipWork/mixWork'
|
||||
})
|
||||
},
|
||||
executeSql(sql) {
|
||||
sqlite.executeSqlCeshi(sql).then((value) => {
|
||||
// 在resolve时执行的回调函数
|
||||
console.log(value);
|
||||
}).catch((error) => {
|
||||
// 在reject时执行的回调函数
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
onBackPress(event) {
|
||||
uni.setStorageSync('tabsType', 1);
|
||||
uni.navigateTo({
|
||||
|
|
|
@ -97,10 +97,6 @@
|
|||
<p>技术工人:</p>
|
||||
<text>{{dataInfo.otherList.jsWorker}}</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
<p>普通工人:</p>
|
||||
<text>{{dataInfo.otherList.ptworker}}</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
<p>作业时间:</p>
|
||||
<text>{{dataInfo.otherList.startTime}} - {{dataInfo.otherList.endTime}}</text>
|
||||
|
@ -113,6 +109,22 @@
|
|||
<p>体积:</p>
|
||||
<text>{{dataInfo.otherList.tjValue}}</text>
|
||||
</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">
|
||||
<p>描述:</p>
|
||||
<text>{{dataInfo.otherList.describe}}</text>
|
||||
|
@ -251,7 +263,7 @@
|
|||
flex-wrap: wrap;
|
||||
|
||||
.li {
|
||||
width: 45%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
padding: 10px 20px;
|
||||
line-height: 35px;
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<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>
|
||||
</view>
|
||||
<view class="li">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
</view>
|
||||
<view class="li">
|
||||
<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>
|
||||
</view>
|
||||
<view class="li">
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
</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'" />
|
||||
<uni-number-box v-model="personNumber" :max="1000000000" v-if="obj.state != 'look'" />
|
||||
<text v-else>{{personNumber}}</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
|
@ -45,12 +45,12 @@
|
|||
</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'" />
|
||||
<uni-number-box v-model="vehicleSize" :max="1000000000" 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'" />
|
||||
<uni-number-box v-model="sparePart" :max="1000000000" v-if="obj.state != 'look'" />
|
||||
<text v-else>{{sparePart}}</text>
|
||||
</view>
|
||||
<view class="li">
|
||||
|
|
Loading…
Reference in New Issue