import sqlite from './sqlite.js' module.exports = { dbName: 'dianji_chat', dbPath: '_doc/dianji_chat.db', // 创建所有表 createAllTable() { // 创建船舶基本信息 this.createShipInfoTable() // 创建人员信息 this.createMessageRespList() // 创建工班信息 this.createWorkMessageRespList() // 创建工班信息详细 this.createWorkMessageRespInfoList() // // 创建工班信息翻仓 this.createRetallyMessageRespList() // // 创建工班信息其他 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() { 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 = 'CREATE TABLE if not exists messageRespList ("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) }, // 创建工班信息 workMessageRespList 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() { let sql = 'CREATE TABLE if not exists retallyMessageRespList ("webId" text NOT NULL,"contactId" text,"vvyId" text,"vvyName" text,"retallyType" text,"retallyTypeName" text,"retallyOrigin" text,"retallyTerminus" text,"retallyStartTime" text,"retallyEndTime" text,"carType" text,"carTypeName" text,"goodsNumber" text,"goodsVolume" text,"goodsWeight" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"editStatus" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建工班信息其他 infoRespList createInfoRespList() { 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,"auxRemark" text,"waitRemark" text,"workRemark" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建系解缆 attachUnmoorRespList creatAttachUnmoorRespList() { let sql = 'CREATE TABLE if not exists attachUnmoorRespList ("webId" text NOT NULL,"shipDeadWeight" text,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"attachTime" text,"unmoorTime" text,"shiftingBerthTime" text,"noProductBerthTime" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建供给 shipmentShipSupplyRespList createShipmentShipSupplyRespList() { let sql = 'CREATE TABLE if not exists shipmentShipSupplyRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"stopBerthage" text,"stopBerthageName" text,"sssId" text,"supplyType" text,"supplyAmount" text,"supplyDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建指导员作业布置 shipmentAdviserLayoutRespList createShipmentAdviserLayoutRespList() { let sql = 'CREATE TABLE if not exists shipmentAdviserLayoutRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"pwcTypeId" text,"pwcType" text,"personNumber" text,"loaderTypeId" text,"loaderType" text,"vehicleSize" text,"sparePart" text,"workTime" text,"startTime" text,"endTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建船舶装卸通知书 shipmentLoadUnloadNoticeRespList createShipmentLoadUnloadNoticeRespList() { let sql = 'CREATE TABLE if not exists shipmentLoadUnloadNoticeRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"workDate" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建质量意见征询 shipmentQualityConsultationRespList createShipmentQualityConsultationRespList() { let sql = 'CREATE TABLE if not exists shipmentQualityConsultationRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"bthId" text,"bthIdName" text,"loaderTypeId" text,"loaderType" text,"vehicleSize" text,"sparePart" text,"workTime" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建异常情况 abnormalConditionRespList createAbnormalConditionRespList() { let sql = '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) }, // 创建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"));' this.executeSql(sql) }, // 创建安全巡检 safetyInspectionRespList createSafetyInspectionRespList() { let sql = 'CREATE TABLE if not exists safetyInspectionRespList ("webId" text NOT NULL,"vvyId" text,"vvyName" text,"type" text,"remark" text,"tradeTypeName" text,"importExportFlagName" text,"spmName" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建作业查询 shipmentShipLoadPlansRespList createShipmentShipLoadPlansRespList() { let sql = 'CREATE TABLE if not exists shipmentShipLoadPlansRespList ("webId" text NOT NULL,"agentId" text,"agentName" text,"amount" text,"brdId" text,"brdName" text,"bvdId" text,"bvdName" text,"bvmId" text,"bvmName" text,"carHeight" text,"carLength" text,"carWidth" text,"customsDeclareNo" text,"customsDeclareStatus" text,"mnfBl" text,"potId" text,"potName" text,"sourceType" text,"vvyId" text,"vvyName" text,"yardPos" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建船舶资料 shipmentShipManage createShipmentShipManage() { let sql = 'CREATE TABLE if not exists shipmentShipManage ("webId" text NOT NULL,"vslCd" text,"vslCnname" text,"vslGton" text,"vslNetton" text,"vslLoa" text,"vslBreadth" text,"vslDraftunload" text,"vslDraftload" text,"spmCabinht" text,"spmMintide" text,"spmCab" text,"spmBoardCentrele" text,"spmBoardFrontle" text,"spmBoardLaterle" text,"spmBoardCentrerg" text,"spmBoardFrontrg" text,"spmBoardLaterrg" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, // 创建下拉数据 shipOption createShipOption() { let sql = 'CREATE TABLE if not exists shipOption ("dictionariesName" text,"ptrCode" text,"ptrDesc" text,"webId" text NOT NULL,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));' this.executeSql(sql) }, executeSql(sql) { sqlite.executeSqlCeshi(sql).then((value) => { // 在resolve时执行的回调函数 console.log(value); }).catch((error) => { // 在reject时执行的回调函数 console.error(error); }); }, }