From 9daa1cb4b217ab03d3aeec56557dc28df96624f0 Mon Sep 17 00:00:00 2001 From: Panzihang <819652404@qq.com> Date: Tue, 1 Aug 2023 14:35:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96=EF=BC=8C?= =?UTF-8?q?=E6=96=B0=E5=A2=9Eapi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/api.js | 13 ++++++++ common/createDataTable.js | 8 +++++ pages/shipWork/abnormal.vue | 7 ++--- pages/shipWork/abnormalAdd.vue | 14 ++------- pages/shipWork/index.vue | 52 ++++++++++++++++---------------- pages/shipWork/mafi.vue | 7 ++--- pages/shipWork/mafiAdd.vue | 14 ++------- pages/shipWork/mixWork.vue | 10 ++---- pages/shipWork/notice.vue | 7 ++--- pages/shipWork/noticeAdd.vue | 14 ++------- pages/shipWork/patrol.vue | 7 ++--- pages/shipWork/patrolAdd.vue | 14 ++------- pages/shipWork/peopleAdd.vue | 14 ++------- pages/shipWork/supply.vue | 7 ++--- pages/shipWork/supplyAdd.vue | 15 ++------- pages/shipWork/untieAdd.vue | 14 ++------- pages/shipWork/untieCord.vue | 8 ++--- pages/shipWork/workAssign.vue | 7 ++--- pages/shipWork/workAssignAdd.vue | 17 +++-------- 19 files changed, 81 insertions(+), 168 deletions(-) create mode 100644 common/api.js diff --git a/common/api.js b/common/api.js new file mode 100644 index 0000000..7a32754 --- /dev/null +++ b/common/api.js @@ -0,0 +1,13 @@ +module.exports = { + // 获取日期 传一个时间戳 转为YY-MM-DD hh-mm-ss 格式 + getDate(date) { + var date = new Date(date); + var YY = date.getFullYear() + '-'; + var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; + var DD = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()); + var hh = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'; + var mm = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()) + ':'; + var ss = (date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()); + return YY + MM + DD + " " + hh + mm + ss; + }, +} \ No newline at end of file diff --git a/common/createDataTable.js b/common/createDataTable.js index 7d13287..d23e2af 100644 --- a/common/createDataTable.js +++ b/common/createDataTable.js @@ -14,6 +14,7 @@ module.exports = { this.createAbnormalConditionRespList() this.createMafiListRespList() this.createSafetyInspectionRespList() + this.createShipmentShipLoadPlansRespList() }, // 创建人员信息 messageRespList createMessageRespList() { @@ -76,6 +77,13 @@ module.exports = { '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() { + console.log("创建作业查询表"); + 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, PRIMARY KEY("webId"));' + this.executeSql(sql) + }, executeSql(sql) { sqlite.executeSqlCeshi(sql).then((value) => { // 在resolve时执行的回调函数 diff --git a/pages/shipWork/abnormal.vue b/pages/shipWork/abnormal.vue index c3e24b0..01d90e6 100644 --- a/pages/shipWork/abnormal.vue +++ b/pages/shipWork/abnormal.vue @@ -37,7 +37,8 @@ }, methods: { // 查 - executeSql(sql) { + executeSql1(tableName) { + let sql = `select * from ${tableName}` sqlite.executeSqlCeshi(sql).then((value) => { // 在resolve时执行的回调函数 this.infoList = value @@ -47,10 +48,6 @@ console.error(error); }); }, - executeSql1(tableName) { - let sql = `select * from ${tableName}` - this.executeSql(sql) - }, // 点击签名 sign() { uni.navigateTo({ diff --git a/pages/shipWork/abnormalAdd.vue b/pages/shipWork/abnormalAdd.vue index 4e71c49..af66d3a 100644 --- a/pages/shipWork/abnormalAdd.vue +++ b/pages/shipWork/abnormalAdd.vue @@ -54,6 +54,7 @@