From ab1bc2129f97d45cc98dceb561aa1349cb43f99e Mon Sep 17 00:00:00 2001 From: Panzihang <819652404@qq.com> Date: Tue, 1 Aug 2023 09:32:45 +0800 Subject: [PATCH] =?UTF-8?q?sqlite=E5=8D=95=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/createDataTable.js | 88 +++++++++++++++++++ components/head-info/head-info.vue | 10 +-- pages/login/index.vue | 6 +- pages/shipWork/abnormal.vue | 27 +++++- pages/shipWork/abnormalAdd.vue | 97 ++++++++++++++------ pages/shipWork/brandDetails.vue | 8 +- pages/shipWork/carDetails.vue | 6 ++ pages/shipWork/documentList.vue | 6 ++ pages/shipWork/index.vue | 87 ++++++++++++++++++ pages/shipWork/mafi.vue | 29 +++++- pages/shipWork/mafiAdd.vue | 136 +++++++++++++++++++---------- pages/shipWork/mixWork.vue | 32 ++++++- pages/shipWork/notice.vue | 27 +++++- pages/shipWork/noticeAdd.vue | 91 ++++++++++++++----- pages/shipWork/opinion.vue | 27 +++++- pages/shipWork/opinionAdd.vue | 108 +++++++++++++++++------ pages/shipWork/patrol.vue | 27 +++++- pages/shipWork/patrolAdd.vue | 104 ++++++++++++++++------ pages/shipWork/peopleAdd.vue | 120 +++++++++++++++++-------- pages/shipWork/shiftAdd.vue | 13 ++- pages/shipWork/shiftDetails.vue | 9 +- pages/shipWork/shipInfo.vue | 8 ++ pages/shipWork/shipPlan.vue | 8 ++ pages/shipWork/supply.vue | 28 +++++- pages/shipWork/supplyAdd.vue | 125 ++++++++++++++++++-------- pages/shipWork/untieAdd.vue | 111 ++++++++++++++++------- pages/shipWork/untieCord.vue | 27 +++++- pages/shipWork/workAssign.vue | 27 +++++- pages/shipWork/workAssignAdd.vue | 120 +++++++++++++++++-------- pages/test/ceshi.vue | 9 +- 30 files changed, 1195 insertions(+), 326 deletions(-) create mode 100644 common/createDataTable.js diff --git a/common/createDataTable.js b/common/createDataTable.js new file mode 100644 index 0000000..7d13287 --- /dev/null +++ b/common/createDataTable.js @@ -0,0 +1,88 @@ +import sqlite from './sqlite.js' +module.exports = { + dbName: 'dianji_chat', + dbPath: '_doc/dianji_chat.db', + // 创建所有表 + createAllTable() { + this.createMessageRespList() + // this.createWorkMessageRespList() + this.creatAttachUnmoorRespList() + this.createShipmentShipSupplyRespList() + this.createShipmentAdviserLayoutRespList() + this.createShipmentLoadUnloadNoticeRespList() + this.createShipmentQualityConsultationRespList() + this.createAbnormalConditionRespList() + this.createMafiListRespList() + this.createSafetyInspectionRespList() + }, + // 创建人员信息 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() { + // 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) + // }, + // 创建系解缆 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) + }, + // 创建mifi 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) + }, + executeSql(sql) { + sqlite.executeSqlCeshi(sql).then((value) => { + // 在resolve时执行的回调函数 + console.log(value); + }).catch((error) => { + // 在reject时执行的回调函数 + console.error(error); + }); + }, +} \ No newline at end of file diff --git a/components/head-info/head-info.vue b/components/head-info/head-info.vue index f24ccb4..b83fbf5 100644 --- a/components/head-info/head-info.vue +++ b/components/head-info/head-info.vue @@ -12,7 +12,7 @@ - 切换港口 + 切换港区 @@ -49,15 +49,15 @@ type: "", portList: [{ value: "1", - title: "港口1" + title: "港区1" }, { value: "2", - title: "港口2" + title: "港区2" }, { value: "3", - title: "港口3" + title: "港区3" }, ], portId: "", @@ -74,7 +74,7 @@ showInfo() { this.infoType = !this.infoType }, - // 点击切换港口 + // 点击切换港区 tabsPort(type) { this.type = type this.$refs.popup.open(type) diff --git a/pages/login/index.vue b/pages/login/index.vue index 9a5ca28..e60900f 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -46,15 +46,15 @@ mounted() { this.portList = [{ value: "1", - title: "港口1" + title: "港区1" }, { value: "2", - title: "港口2" + title: "港区2" }, { value: "3", - title: "港口3" + title: "港区3" }, ] }, diff --git a/pages/shipWork/abnormal.vue b/pages/shipWork/abnormal.vue index f850840..c3e24b0 100644 --- a/pages/shipWork/abnormal.vue +++ b/pages/shipWork/abnormal.vue @@ -22,6 +22,7 @@ diff --git a/pages/shipWork/abnormalAdd.vue b/pages/shipWork/abnormalAdd.vue index cc2b8eb..4e71c49 100644 --- a/pages/shipWork/abnormalAdd.vue +++ b/pages/shipWork/abnormalAdd.vue @@ -53,6 +53,7 @@ diff --git a/pages/shipWork/brandDetails.vue b/pages/shipWork/brandDetails.vue index 6f910e6..b6553e9 100644 --- a/pages/shipWork/brandDetails.vue +++ b/pages/shipWork/brandDetails.vue @@ -251,7 +251,13 @@ uni.navigateTo({ url: `/pages/shipWork/carDetails` }) - } + }, + onBackPress(event) { + uni.navigateTo({ + url: '/pages/shipWork/documentList' + }) + return true; + }, } } diff --git a/pages/shipWork/carDetails.vue b/pages/shipWork/carDetails.vue index fad5816..31fcb93 100644 --- a/pages/shipWork/carDetails.vue +++ b/pages/shipWork/carDetails.vue @@ -142,6 +142,12 @@ } return newList }, + onBackPress(event) { + uni.navigateTo({ + url: '/pages/shipWork/brandDetails' + }) + return true; + }, }, } diff --git a/pages/shipWork/documentList.vue b/pages/shipWork/documentList.vue index 00c4a0f..7091274 100644 --- a/pages/shipWork/documentList.vue +++ b/pages/shipWork/documentList.vue @@ -85,6 +85,12 @@ url: `/pages/shipWork/${url}` }) }, + onBackPress(event) { + uni.navigateTo({ + url: '/pages/shipWork/index' + }) + return true; + }, } } diff --git a/pages/shipWork/index.vue b/pages/shipWork/index.vue index 4d8f947..e4b572a 100644 --- a/pages/shipWork/index.vue +++ b/pages/shipWork/index.vue @@ -10,6 +10,13 @@ v-model="shipName" @input="input_json" @select="select_json"> + + + + + + + diff --git a/pages/shipWork/mixWork.vue b/pages/shipWork/mixWork.vue index e7d0514..2e821d3 100644 --- a/pages/shipWork/mixWork.vue +++ b/pages/shipWork/mixWork.vue @@ -43,6 +43,7 @@ diff --git a/pages/shipWork/noticeAdd.vue b/pages/shipWork/noticeAdd.vue index a98e605..5e65ecf 100644 --- a/pages/shipWork/noticeAdd.vue +++ b/pages/shipWork/noticeAdd.vue @@ -42,6 +42,7 @@ diff --git a/pages/shipWork/opinion.vue b/pages/shipWork/opinion.vue index 18a5afe..a2bdeb9 100644 --- a/pages/shipWork/opinion.vue +++ b/pages/shipWork/opinion.vue @@ -24,6 +24,7 @@ diff --git a/pages/shipWork/opinionAdd.vue b/pages/shipWork/opinionAdd.vue index f9c894a..e001e75 100644 --- a/pages/shipWork/opinionAdd.vue +++ b/pages/shipWork/opinionAdd.vue @@ -64,6 +64,7 @@ diff --git a/pages/shipWork/patrol.vue b/pages/shipWork/patrol.vue index cdaf530..f5a09b1 100644 --- a/pages/shipWork/patrol.vue +++ b/pages/shipWork/patrol.vue @@ -19,6 +19,7 @@ diff --git a/pages/shipWork/patrolAdd.vue b/pages/shipWork/patrolAdd.vue index 6fa31fa..6cb54d2 100644 --- a/pages/shipWork/patrolAdd.vue +++ b/pages/shipWork/patrolAdd.vue @@ -29,12 +29,12 @@

*图片上传:

- + @@ -61,6 +61,7 @@ diff --git a/pages/shipWork/peopleAdd.vue b/pages/shipWork/peopleAdd.vue index ee34001..f985132 100644 --- a/pages/shipWork/peopleAdd.vue +++ b/pages/shipWork/peopleAdd.vue @@ -64,6 +64,7 @@ diff --git a/pages/shipWork/shiftAdd.vue b/pages/shipWork/shiftAdd.vue index 0433ce1..347da85 100644 --- a/pages/shipWork/shiftAdd.vue +++ b/pages/shipWork/shiftAdd.vue @@ -339,7 +339,7 @@ this.shiftRowIndex = uni.getStorageSync('shiftRowIndex') this.hcValue = this.dataInfo.vvyId this.hcTextValue = this.dataInfo.vvyName - this.zxValue = this.dataInfo.zxId + this.zxValue = this.dataInfo.loadType this.zxTextValue = this.dataInfo.zxTextValue this.ulList1 = this.dataInfo.shiftList this.fcUlList = this.dataInfo.fcList @@ -511,8 +511,8 @@ let addShiftObj = { vvyName: this.hcTextValue, vvyId: this.hcValue, - zxName: this.zxTextValue, - zxId: this.zxValue, + loadTypeName: this.zxTextValue, + loadType: this.zxValue, shiftList: this.ulList1, fcList: this.fcUlList, otherList: this.otherObj @@ -535,6 +535,13 @@ url: '/pages/shipWork/mixWork' }) }, + onBackPress(event) { + uni.setStorageSync('tabsType', 1); + uni.navigateTo({ + url: '/pages/shipWork/mixWork' + }) + return true; + }, } } diff --git a/pages/shipWork/shiftDetails.vue b/pages/shipWork/shiftDetails.vue index 6c773fb..617b8a6 100644 --- a/pages/shipWork/shiftDetails.vue +++ b/pages/shipWork/shiftDetails.vue @@ -23,7 +23,7 @@

装卸类型:

- {{dataInfo.zxName}} + {{dataInfo.loadTypeName}}
@@ -206,6 +206,13 @@ url: `/pages/shipWork/shiftAdd?params=${params}` }) }, + onBackPress(event) { + uni.setStorageSync('tabsType', 1); + uni.navigateTo({ + url: '/pages/shipWork/mixWork' + }) + return true; + }, } } diff --git a/pages/shipWork/shipInfo.vue b/pages/shipWork/shipInfo.vue index 2818608..22a12e3 100644 --- a/pages/shipWork/shipInfo.vue +++ b/pages/shipWork/shipInfo.vue @@ -34,6 +34,14 @@ }, mounted() { this.shipInfo = uni.getStorageSync('shipInfo') + }, + methods: { + onBackPress(event) { + uni.navigateTo({ + url: '/pages/shipWork/documentList' + }) + return true; + }, } } diff --git a/pages/shipWork/shipPlan.vue b/pages/shipWork/shipPlan.vue index 1a97cca..3a5d296 100644 --- a/pages/shipWork/shipPlan.vue +++ b/pages/shipWork/shipPlan.vue @@ -49,6 +49,14 @@ mounted() { this.shipInfo = uni.getStorageSync('shipInfo') console.log(this.shipInfo) + }, + methods: { + onBackPress(event) { + uni.navigateTo({ + url: '/pages/shipWork/documentList' + }) + return true; + }, } } diff --git a/pages/shipWork/supply.vue b/pages/shipWork/supply.vue index a72c2eb..3d4de7a 100644 --- a/pages/shipWork/supply.vue +++ b/pages/shipWork/supply.vue @@ -22,6 +22,7 @@ diff --git a/pages/shipWork/supplyAdd.vue b/pages/shipWork/supplyAdd.vue index 9ce6275..906ccbe 100644 --- a/pages/shipWork/supplyAdd.vue +++ b/pages/shipWork/supplyAdd.vue @@ -22,9 +22,9 @@

*泊位:

- - {{bthIdName}} + {{stopBerthageName}}

*供给类型:

@@ -59,6 +59,7 @@ diff --git a/pages/shipWork/untieAdd.vue b/pages/shipWork/untieAdd.vue index 73431bd..6abf4df 100644 --- a/pages/shipWork/untieAdd.vue +++ b/pages/shipWork/untieAdd.vue @@ -67,6 +67,7 @@ diff --git a/pages/shipWork/untieCord.vue b/pages/shipWork/untieCord.vue index 1ab6a87..63d95bb 100644 --- a/pages/shipWork/untieCord.vue +++ b/pages/shipWork/untieCord.vue @@ -23,6 +23,7 @@ diff --git a/pages/shipWork/workAssign.vue b/pages/shipWork/workAssign.vue index 71708f1..04eda87 100644 --- a/pages/shipWork/workAssign.vue +++ b/pages/shipWork/workAssign.vue @@ -22,6 +22,7 @@ diff --git a/pages/shipWork/workAssignAdd.vue b/pages/shipWork/workAssignAdd.vue index 81ce67e..6065e42 100644 --- a/pages/shipWork/workAssignAdd.vue +++ b/pages/shipWork/workAssignAdd.vue @@ -75,6 +75,7 @@ diff --git a/pages/test/ceshi.vue b/pages/test/ceshi.vue index 4e8045b..529ce17 100644 --- a/pages/test/ceshi.vue +++ b/pages/test/ceshi.vue @@ -113,8 +113,9 @@ data.id++ // let sql = "insert into " + this.dbTable + " values('" + data.id + "','" + data.content + // "','" + data.fromId + "','" + data.toId + "'," + data.flag + ")"; - let sql = "insert into " + this.dbTable + "(id, content, fromId, toId, flag) values('" + data.id + "','" + data.content + - "','" + data.fromId + "','" + data.toId + "'," + data.flag + ")"; + let sql = "insert into " + this.dbTable + "(id, content, fromId, toId, flag) values('" + data.id + "','" + + data.content + + "','" + data.fromId + "','" + data.toId + "'," + data.flag + ")"; this.executeSql(sql) }, insertListChatRow() { @@ -164,11 +165,7 @@ }); }, executeSql(sql) { -<<<<<<< HEAD - sqlite.executeSqlCeshi(sql).then((value) => { -======= Sqlite.executeSqlCeshi(sql).then((value) => { ->>>>>>> 99e78e950aa9ec6dccfe44174d8f77ac3239cf00 // 在resolve时执行的回调函数 this.sqlData = value console.log(value); // 输出:Hello, World!