新增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,4 +1,4 @@
|
||||||
<template>
|
<template>
|
||||||
<view class="peopleAdd">
|
<view class="peopleAdd">
|
||||||
<view class="container">
|
<view class="container">
|
||||||
<view class="ul">
|
<view class="ul">
|
||||||
|
@ -34,12 +34,14 @@
|
||||||
</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 @change="workChange" v-model="workValue" v-if="obj.state != 'look'" />
|
<uni-number-box @change="workChange" v-model="workValue" :max="1000000000"
|
||||||
|
v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{peopleRow.workSuite}}</text>
|
<text v-else>{{peopleRow.workSuite}}</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 @change="shipChange" v-model="shipValue" v-if="obj.state != 'look'" />
|
<uni-number-box @change="shipChange" v-model="shipValue" :max="1000000000"
|
||||||
|
v-if="obj.state != 'look'" />
|
||||||
<text v-else>{{peopleRow.shipPerson}}</text>
|
<text v-else>{{peopleRow.shipPerson}}</text>
|
||||||
</view>
|
</view>
|
||||||
<view class="li">
|
<view class="li">
|
||||||
|
@ -61,9 +63,9 @@
|
||||||
</view>
|
</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 {
|
||||||
|
@ -302,9 +304,9 @@
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.peopleAdd {
|
.peopleAdd {
|
||||||
.container {
|
.container {
|
||||||
padding: 30px 20px;
|
padding: 30px 20px;
|
||||||
|
@ -367,4 +369,4 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</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}',
|
||||||
|
'${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)
|
||||||
}
|
}
|
||||||
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);
|
|
||||||
}
|
}
|
||||||
|
// 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