diff --git a/common/createDataTable.js b/common/createDataTable.js index 5726317..87dd273 100644 --- a/common/createDataTable.js +++ b/common/createDataTable.js @@ -15,6 +15,8 @@ module.exports = { this.createMafiListRespList() this.createSafetyInspectionRespList() this.createShipmentShipLoadPlansRespList() + this.createShipmentShipManage() + this.createShipOption() }, // 创建人员信息 messageRespList createMessageRespList() { @@ -79,15 +81,26 @@ module.exports = { }, // 创建作业查询 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,"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); + // console.log(value); }).catch((error) => { // 在reject时执行的回调函数 console.error(error); diff --git a/common/sqlite.js b/common/sqlite.js index cc70458..4b7ea00 100644 --- a/common/sqlite.js +++ b/common/sqlite.js @@ -118,25 +118,17 @@ module.exports = { // 判断有没有传参 if (dbTable !== undefined && data !== undefined) { // 判断传的参是否有值 - var bol = (JSON.stringify(data) == "{}"); + var bol = (data == ""); if (!bol) { if (condition == undefined) { - var sql = `INSERT INTO ${dbTable} VALUES('${data}')`; + var sql = `INSERT INTO ${dbTable} VALUES(${data})`; + // console.log(sql); } else { var sql = `INSERT INTO ${dbTable} (${condition}) VALUES(${data})`; } + // console.log(sql); return new Promise((resolve, reject) => { - // 表格添加数据 - plus.sqlite.executeSql({ - name: this.dbName, - sql: sql, - success(e) { - resolve(e); - }, - fail(e) { - reject(e); - } - }) + resolve(sql) }) } else { return new Promise((resolve, reject) => { diff --git a/pages.json b/pages.json index f9a2e0f..a6fe760 100644 --- a/pages.json +++ b/pages.json @@ -15,10 +15,7 @@ { "path": "pages/index/instruct", "style": { - "navigationBarTitleText": "指令", - "usingComponents": { - "van-progress": "/wxcomponents/vant/dist/progress/index" - } + "navigationBarTitleText": "指令" } }, { @@ -48,10 +45,7 @@ { "path": "pages/shipWork/sign", "style": { - "navigationBarTitleText": "单证签名", - "usingComponents": { - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "单证签名" } }, { @@ -63,28 +57,18 @@ { "path": "pages/shipWork/peopleAdd", "style": { - "navigationBarTitleText": "杂项作业(人员信息)", - "usingComponents": { - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "杂项作业(人员信息)" } }, { "path": "pages/shipWork/shiftAdd", "style": { - "navigationBarTitleText": "杂项作业(工班信息)", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "杂项作业(工班信息)" } }, { "path": "pages/shipWork/shiftDetails", "style": { - "navigationBarTitleText": "杂项作业(工班信息)", - "usingComponents": { - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "杂项作业(工班信息)" } }, { "path": "pages/shipWork/untieCord", @@ -95,11 +79,7 @@ { "path": "pages/shipWork/untieAdd", "style": { - "navigationBarTitleText": "系解缆信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "系解缆信息" } }, { @@ -111,11 +91,7 @@ { "path": "pages/shipWork/supplyAdd", "style": { - "navigationBarTitleText": "供给信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "供给信息" } }, { @@ -127,11 +103,7 @@ { "path": "pages/shipWork/workAssignAdd", "style": { - "navigationBarTitleText": "指导员作业布置信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "指导员作业布置信息" } }, { "path": "pages/shipWork/notice", @@ -142,11 +114,7 @@ { "path": "pages/shipWork/noticeAdd", "style": { - "navigationBarTitleText": "船舶装卸通知书信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "船舶装卸通知书信息" } }, { "path": "pages/shipWork/opinion", @@ -156,11 +124,7 @@ }, { "path": "pages/shipWork/opinionAdd", "style": { - "navigationBarTitleText": "质量意见征询信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "质量意见征询信息" } }, { "path": "pages/shipWork/abnormal", @@ -170,11 +134,7 @@ }, { "path": "pages/shipWork/abnormalAdd", "style": { - "navigationBarTitleText": "异常情况信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "异常情况信息" } }, { "path": "pages/shipWork/mafi", @@ -184,11 +144,7 @@ }, { "path": "pages/shipWork/mafiAdd", "style": { - "navigationBarTitleText": "MAFI清单信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "MAFI清单信息" } }, { "path": "pages/shipWork/patrol", @@ -198,11 +154,7 @@ }, { "path": "pages/shipWork/patrolAdd", "style": { - "navigationBarTitleText": "安全巡检信息", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "安全巡检信息" } }, { "path": "pages/shipWork/shipInfo", @@ -234,30 +186,19 @@ { "path": "pages/monitor/edit", "style": { - "navigationBarTitleText": "编辑货物质量", - "usingComponents": { - "van-icon": "/wxcomponents/vant/dist/icon/index", - "van-button": "/wxcomponents/vant/dist/button/index", - "van-uploader": "/wxcomponents/vant/dist/uploader/index" - } + "navigationBarTitleText": "编辑货物质量" } }, { "path": "pages/monitor/details", "style": { - "navigationBarTitleText": "质损详情", - "usingComponents": { - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "质损详情" } }, { "path": "pages/monitor/sign", "style": { - "navigationBarTitleText": "签名", - "usingComponents": { - "van-button": "/wxcomponents/vant/dist/button/index" - } + "navigationBarTitleText": "签名" } }, { @@ -276,8 +217,14 @@ "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#0052A4", "navigationBarTitleText": "港口Ipad", - "navigationBarTextStyle": "white" - + "navigationBarTextStyle": "white", + "usingComponents": { + "van-icon": "/wxcomponents/vant/dist/icon/index", + "van-button": "/wxcomponents/vant/dist/button/index", + "van-uploader": "/wxcomponents/vant/dist/uploader/index", + "van-progress": "/wxcomponents/vant/dist/progress/index", + "van-stepper": "/wxcomponents/vant/dist/stepper/index" + } }, "uniIdRouter": {}, diff --git a/pages/shipWork/abnormalAdd.vue b/pages/shipWork/abnormalAdd.vue index e7297b3..38f5ac1 100644 --- a/pages/shipWork/abnormalAdd.vue +++ b/pages/shipWork/abnormalAdd.vue @@ -81,6 +81,9 @@ type: "", // 描述 remark: "", + + // 下拉数据 + optionData: [], } }, onLoad(options) { @@ -93,17 +96,35 @@ if (this.obj.state == 'edit' || this.obj.state == 'look') { this.getRow(); } - this.getShip() + 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') - // 航次数据 - this.shipInfo.voyageScheduleDataList.forEach((v, index) => { + // 航次下拉数据 + let hcOption = [] + this.optionData.forEach((v, index) => { + if (v.dictionariesName == 'vvyList') { + hcOption.push(v) + } + }) + hcOption.forEach((v, index) => { this.hcList.push({ - text: v.vvyName, - value: v.vvyId + text: v.ptrDesc, + value: v.ptrCode }) }) }, @@ -138,9 +159,6 @@ }, // 弹框删除 delConfirm() { - // let addAbnormalArr = uni.getStorageSync('addAbnormalArr') - // addAbnormalArr.splice(this.abnormalRowIndex, 1) - // uni.setStorageSync('addAbnormalArr', addAbnormalArr); let sql = `DELETE FROM abnormalConditionRespList WHERE webId = '${this.abnormalRow.webId}';` this.executeSql(sql) uni.navigateTo({ @@ -170,30 +188,6 @@ '${this.shipInfo.voyageScheduleDataList[0].spmName}','${webStatus}','${webDate}')` this.executeSql(sql) } - // let addAbnormalArr = uni.getStorageSync('addAbnormalArr') - // let addAbnormalObj = { - // vvyId: this.vvyId, - // vvyName: this.vvyName, - // type: this.type, - // remark: this.remark, - // workTime: this.workTime, - // tradeTypeName: this.shipInfo.voyageScheduleDataList[0].tradeTypeName, - // importExportFlagName: this.shipInfo.voyageScheduleDataList[0].importExportFlagName, - // spmName: this.shipInfo.voyageScheduleDataList[0].spmName, - // } - // if (this.obj.state == "edit") { - // addAbnormalArr[this.abnormalRowIndex] = addAbnormalObj; - // uni.setStorageSync('addAbnormalArr', addAbnormalArr); - // } else if (this.obj.state == "add") { - // if (addAbnormalArr != "") { - // addAbnormalArr.push(addAbnormalObj) - // uni.setStorageSync('addAbnormalArr', addAbnormalArr); - // } else { - // addAbnormalArr = [] - // addAbnormalArr.push(addAbnormalObj) - // uni.setStorageSync('addAbnormalArr', addAbnormalArr); - // } - // } uni.navigateTo({ url: '/pages/shipWork/abnormal' }) diff --git a/pages/shipWork/brandDetails.vue b/pages/shipWork/brandDetails.vue index 44a6519..553a4b9 100644 --- a/pages/shipWork/brandDetails.vue +++ b/pages/shipWork/brandDetails.vue @@ -27,7 +27,12 @@
货代:{{item.agentName}}
+