修改bug

dev3
wuwx 2024-04-19 16:21:28 +08:00
parent 00abdecbdc
commit fef5854a56
26 changed files with 742 additions and 145 deletions

View File

@ -188,7 +188,7 @@ module.exports = {
// 创建下拉数据 shipOption
createShipOption() {
let sql =
'CREATE TABLE if not exists shipOption ("dictionariesName" text,"ptrCode" text,"ptrDesc" text,"webId" text NOT NULL,"vtpId" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
'CREATE TABLE if not exists shipOption ("dictionariesName" text,"ptrCode" text,"ptrDesc" text,"ptrEnDesc" text,"webId" text NOT NULL,"vtpId" text,"webStatus" text,"webDate" text, PRIMARY KEY("webId"));'
this.executeSql(sql)
},
// 创建单证签名表 workSignTable

View File

@ -99,9 +99,9 @@
<template v-if="itemList.length > 0">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow ref="waterfallsFlowRef" :value="itemList" :column="2"
:columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow ref="waterfallsFlowRef" :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -204,8 +204,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</template>
@ -292,9 +292,9 @@
<checkbox-group @change="checkChange">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow ref="waterfallsFlowRef" :value="itemList" :column="2"
:columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow ref="waterfallsFlowRef" :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -420,8 +420,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</checkbox-group>
@ -467,9 +467,9 @@
<template v-if="itemList.length > 0">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow ref="waterfallsFlowRef" :value="itemList" :column="2"
:columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow ref="waterfallsFlowRef" :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -574,8 +574,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</template>
@ -2086,12 +2086,13 @@
}
.exp {
width: 100%;
width: 49%;
background: #FFFFFF;
border-radius: 8px;
padding: 16px;
padding-right: 0;
position: relative;
margin-top: 10px;
}
/deep/.waterfalls-flow {

View File

@ -39,7 +39,7 @@
<view class="tab">
<view @click="zzlFlag = !zzlFlag" :class="[zzlFlag ? 'bottom' : '']">指令发送进度</view>
<view @click="zzlFlag = !zzlFlag" :class="[zzlFlag ? '' : 'bottom']">装船进度</view>
<view class="changBox">
<view class="changBox" v-show="!zzlFlag">
<view class="change" @click.stop="clickTab('td')" :class="[filterType == 'MNF_BL_TYPE' ? 'ava' : '']">按提单</view>
<view class="change" @click.stop="clickTab('pp')" :class="[filterType == 'BRD_TYPE' ? 'ava' : '']">按品牌</view>
<view class="change" @click.stop="clickTab('gk')" :class="[filterType == 'POT_TYPE' ? 'ava' : '']">按港口</view>
@ -103,8 +103,9 @@
<template v-if="itemList.length > 0">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -207,8 +208,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</template>
@ -236,7 +237,7 @@
<view class="tab">
<view @click="fzlFlag = !fzlFlag" :class="[fzlFlag ? 'bottom' : '']">指令发送进度</view>
<view @click="fzlFlag = !fzlFlag" :class="[fzlFlag ? '' : 'bottom']">装船进度</view>
<view class="changBox">
<view class="changBox" v-show="!fzlFlag">
<view class="change" @click.stop="clickTab('td')" :class="[filterType == 'MNF_BL_TYPE' ? 'ava' : '']">按提单</view>
<view class="change" @click.stop="clickTab('pp')" :class="[filterType == 'BRD_TYPE' ? 'ava' : '']">按品牌</view>
<view class="change" @click.stop="clickTab('gk')" :class="[filterType == 'POT_TYPE' ? 'ava' : '']">按港口</view>
@ -301,8 +302,9 @@
<checkbox-group @change="checkChange">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -428,8 +430,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</checkbox-group>
@ -1876,12 +1878,13 @@
}
.exp {
width: 100%;
width: 49%;
background: #FFFFFF;
border-radius: 8px;
padding: 16px;
padding-right: 0;
position: relative;
margin-top: 10px;
}
/deep/.waterfalls-flow {

View File

@ -109,6 +109,7 @@
<script>
import HeadInfo from '@/components/head-info/head-info';
import api from "../../common/api.js"
import { downloadPackage } from '../../upDate.js'
export default {
data() {
return {
@ -187,6 +188,7 @@
}
},
mounted() {
downloadPackage()
this.initData()
},
methods: {

View File

@ -42,7 +42,7 @@
<view class="tab">
<view @click="zzlFlag = !zzlFlag" :class="[zzlFlag ? 'bottom' : '']">指令发送进度</view>
<view @click="zzlFlag = !zzlFlag" :class="[zzlFlag ? '' : 'bottom']">装船进度</view>
<view class="changBox">
<view class="changBox" v-show="!zzlFlag">
<view class="change" @click.stop="clickTab('td')" :class="[filterType == 'MNF_BL_TYPE' ? 'ava' : '']">按提单</view>
<view class="change" @click.stop="clickTab('pp')" :class="[filterType == 'BRD_TYPE' ? 'ava' : '']">按品牌</view>
<view class="change" @click.stop="clickTab('gk')" :class="[filterType == 'POT_TYPE' ? 'ava' : '']">按港口</view>
@ -106,8 +106,9 @@
<template v-if="itemList.length > 0">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -212,7 +213,7 @@
</view>
</view>
</template>
</custom-waterfalls-flow>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</template>
@ -240,7 +241,7 @@
<view class="tab">
<view @click="fzlFlag = !fzlFlag" :class="[fzlFlag ? 'bottom' : '']">指令发送进度</view>
<view @click="fzlFlag = !fzlFlag" :class="[fzlFlag ? '' : 'bottom']">装船进度</view>
<view class="changBox">
<view class="changBox" v-show="!fzlFlag">
<view class="change" @click.stop="clickTab('td')" :class="[filterType == 'MNF_BL_TYPE' ? 'ava' : '']">按提单</view>
<view class="change" @click.stop="clickTab('pp')" :class="[filterType == 'BRD_TYPE' ? 'ava' : '']">按品牌</view>
<view class="change" @click.stop="clickTab('gk')" :class="[filterType == 'POT_TYPE' ? 'ava' : '']">按港口</view>
@ -306,8 +307,9 @@
<checkbox-group @change="checkChange">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -433,8 +435,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</checkbox-group>
@ -487,8 +489,9 @@
<template v-if="itemList.length > 0">
<view class="itemBox">
<view class="itemList">
<custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1">
<template v-slot:default="item">
<!-- <custom-waterfalls-flow :value="itemList" :column="2" :columnSpace="1"> -->
<!-- <template v-slot:default="item"> -->
<template v-for="item in itemList">
<view class="exp">
<view class="item">
<view class="row">
@ -592,8 +595,8 @@
</view>
</view>
</view>
</template>
</custom-waterfalls-flow>
</template>
<!-- </custom-waterfalls-flow> -->
</view>
</view>
</template>
@ -680,6 +683,12 @@
{{item.tierHeight}}m
</view>
</view>
<view class="numBox">
<view class="num" v-for="index in item.shipSpace" :key="index">
{{index}}
</view>
</view>
<view class="tableHead" @click="clickShow(item)">
<text>{{item.shipDecks}}层明细({{goodsInfo[index].stowageList.length}})</text>
@ -718,7 +727,7 @@
<uni-td>{{item2.carLength}}</uni-td>
<uni-td>{{item2.carWidth}}</uni-td>
<uni-td>{{item2.carHeight}}</uni-td>
<uni-td>{{item2.cabinNoList}}</uni-td>
<uni-td>{{item2.cabinNoList.join()}}</uni-td>
</uni-tr>
</template>
</uni-table>
@ -2400,12 +2409,13 @@
}
.exp {
width: 100%;
width: 49%;
background: #FFFFFF;
border-radius: 8px;
padding: 16px;
padding-right: 0;
position: relative;
margin-top: 10px;
}
/deep/.waterfalls-flow {
@ -2680,7 +2690,6 @@
margin-right: 20px;
}
}
.imgLi {
display: flex;
@ -2812,6 +2821,17 @@
}
}
}
.numBox {
width: 1102px;
display: flex;
// margin: 0 auto;
justify-content: center;
.num {
width:20%;
display: flex;
justify-content: center;
}
}
//
.cwMain {

View File

@ -661,11 +661,11 @@
},
{
id: "DEFAULT",
text: "恢复默认"
text: "默认"
},
],
sortName:'',
trendPlansOrderRule:''
sortName:'默认',
trendPlansOrderRule:'DEFAULT'
}
},
onBackPress(options) {
@ -806,7 +806,12 @@
},
//
shipInput(e) {
this.getShip(e)
if(e) {
this.getShip(e)
} else {
this.vvySpmId = ''
this.getShip('')
}
},
//
shipSelect(e) {
@ -939,7 +944,7 @@
//
getSurvey() {
uni.request({
url: `${this.$local}/api/yardGoods/monitor/situation?pamId=${this.portObj.portId}&pymId=${this.dcId}`,
url: `${this.$local}/api/yardGoods/monitor/v2/situation?pamId=${this.portObj.portId}&pymId=${this.dcId}`,
header: {
'Content-Type': 'application/json', //
'Authorization': `Bearer ${this.loginObj.access_token}`
@ -990,7 +995,7 @@
//
getQy() {
uni.request({
url: `${this.$local}/api/yardGoods/monitor/v2/region/page?spmId=${this.shipId}&vvyId=${this.vvyId}&pymId=${this.dcId}&displayFlag=0&brdId=${this.brdId}&potId=${this.potId}&vinCode=${this.vinCode}&workStatuss=${this.workId}&size=1000&trendPlansOrderRule=${this.trendPlansOrderRule}`,
url: `${this.$local}/api/yardGoods/monitor/v2/region/list?spmId=${this.shipId}&vvyId=${this.vvyId}&pymId=${this.dcId}&displayFlag=0&brdId=${this.brdId}&potId=${this.potId}&vinCode=${this.vinCode}&workStatuss=${this.workId}&size=1000&trendPlansOrderRule=${this.trendPlansOrderRule}`,
// url: `${this.$local}/api/yardGoods/monitor/region/statistics?spmId=${this.shipId}&vvyId=${this.vvyId}&pymId=${this.dcId}&displayFlag=0&brdId=${this.brdId}&potId=${this.potId}&vinCode=${this.vinCode}&workStatuss=${this.workId}&size=1000`,
header: {
'Content-Type': 'application/json', //
@ -999,7 +1004,7 @@
method: 'GET', //
success: (res) => {
if (res.statusCode == 200) {
this.qyList = res.data.data.records
this.qyList = res.data.data
// console.log(this.qyList);
this.qyList.forEach(v => {
if (v.totalSeatAmount == null) {
@ -1080,8 +1085,8 @@
//
sortSelect(e) {
this.trendPlansOrderRule = e.id
this.getQy()
},
this.getQy()
},
//
inputChange(e) {
clearTimeout(timerId)

View File

@ -184,9 +184,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/abnormal'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/abnormal'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -207,6 +217,38 @@
},
//
save() {
if (this.vvyId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入航次!'
})
return
}
if (this.operationDate == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入作业日期!'
})
return
}
if (this.type == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入类型!'
})
return
}
if (this.remark == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入描述!'
})
return
}
let date = new Date().getTime()
let vacId = uuidv4()
let webStatus = 0

View File

@ -157,11 +157,11 @@
if (tableName == "voyageScheduleDataDetailRespDTOList") {
value.forEach(v => {
if (v.importExportFlagName == '出口') {
this.inVvyId = v.vvyId
this.inVvyName = v.vvyName
} else {
this.outVvyId = v.vvyId
this.outVvyName = v.vvyName
} else {
this.inVvyId = v.vvyId
this.inVvyName = v.vvyName
}
})
this.shipName = `${value[0].spmName}`

View File

@ -226,7 +226,7 @@
tableList.createAllTable()
},
//
delAll() {
delAll() {n
console.log('批量删除表');
this.allList.forEach(v => {
let sql = `DROP TABLE ${v};`
@ -245,7 +245,7 @@
},
dropTable() {
console.log('删除表');
let sql = 'DROP TABLE shipmentQualityConsultationRespList;'
let sql = 'DROP TABLE shipOption;'
this.executeSql(sql)
},
dropData() {
@ -445,6 +445,7 @@
dictionariesName: "epTypeList",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc:''
})
})
//
@ -453,6 +454,7 @@
dictionariesName: "handTypeList",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc:''
})
})
//
@ -461,6 +463,7 @@
dictionariesName: "carList",
ptrCode: v.bvmId,
ptrDesc: v.bvmName,
ptrEnDesc:v.bvmEnName
})
})
//
@ -469,6 +472,7 @@
dictionariesName: "ieTypeList",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc:''
})
})
//
@ -477,6 +481,7 @@
dictionariesName: "loadTypeList",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc:''
})
})
//
@ -485,6 +490,7 @@
dictionariesName: "bthList",
ptrCode: v.bthId,
ptrDesc: v.bthBthnm,
ptrEnDesc:v.bthEnBthnm
})
})
//
@ -493,6 +499,7 @@
dictionariesName: "turnoverTypeList",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc:''
})
})
//
@ -502,6 +509,7 @@
dictionariesName: "weather",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc: v.ptrEnDesc
})
})
//
@ -510,6 +518,7 @@
dictionariesName: "shiftList",
ptrCode: v.pwcCode,
ptrDesc: v.pwcTypeDesc,
ptrEnDesc:''
})
})
//
@ -518,6 +527,7 @@
dictionariesName: "supplyTypeList",
ptrCode: v.ptrCode,
ptrDesc: v.ptrDesc,
ptrEnDesc:''
})
})
//
@ -528,6 +538,7 @@
dictionariesName: "vvyList",
ptrCode: v.vvyId,
ptrDesc: v.vvyName,
ptrEnDesc:''
})
})
@ -845,8 +856,36 @@
if (delMfIds == null || delMfIds == "") {
delMfIds = []
}
console.log('111',that.evaluateTable);
console.log('222',that.shipmentQualityConsultationRespList);
let workSignTableArr = []
that.workSignTable.forEach(item => {
if(item.vvyId.indexOf('/') != -1) {
workSignTableArr.push(
{
webId:item.webId,
vtpId:item.vtpId,
bizId:item.bizId,
signFile:item.signFile,
bizType:item.bizType,
sort:item.sort,
vvyId:item.vvyId.split('/')[0],
webDate:item.webDate,
},
{
webId:item.webId,
vtpId:item.vtpId,
bizId:item.bizId,
signFile:item.signFile,
bizType:item.bizType,
sort:item.sort,
vvyId:item.vvyId.split('/')[1],
webDate:item.webDate,
}
)
} else {
workSignTableArr.push(item)
}
})
let workDataInfo = {
"adviserLayoutReqList": that.shipmentAdviserLayoutRespList, //
"conditionReqList": that.abnormalConditionRespList, //
@ -874,10 +913,11 @@
"shipmentSafetyInspectionReqList": [], //
"shipmentShipSupplyReqList": that.shipmentShipSupplyRespList, //
"shipmentWorkMessageReqList": that.workMessageRespList, // -
"shipmentWorkSignAppendixReqList": that.workSignTable,
// "shipmentWorkSignAppendixReqList": that.workSignTable,
"shipmentWorkSignAppendixReqList": workSignTableArr, //
"vtpId": item.vtpId
}
console.log(workDataInfo)
console.log('上传参数',workDataInfo)
uni.request({
url: that.$local + '/api/shipOperate/upload',
data: workDataInfo,
@ -887,7 +927,7 @@
},
method: 'POST', //
success: (res) => {
console.log('接口返回------', res);
console.log('上传接口返回------', res);
that.lotusLoadingData.isShow = false
if (res.data.status == 200) {
that.allList.forEach(v => {

View File

@ -262,9 +262,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/mafi'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/mafi'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -285,6 +295,38 @@
},
//
save() {
if (this.vvyId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入航次!'
})
return
}
if (this.workDate == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入作业日期!'
})
return
}
if (this.mafiBarcode == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入马菲版号!'
})
return
}
if (this.typeId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入类型!'
})
return
}
let date = new Date().getTime()
let smlId = uuidv4()
let webStatus = 0

View File

@ -52,7 +52,8 @@
<p>Berthed at Haitong:</p><text>{{bwInfo}}</text>
</view> -->
<view class="li">
<text>Foreman Working time:</text><text>{{ RYSJ[0].minStartTime |
<text>Foreman Working time:</text>
<text v-if="RYSJ.length > 0">{{ RYSJ[0].minStartTime |
textFilter }}-{{ RYSJ[0].maxEndTime | textFilter }}</text>
</view>
<view class="li">
@ -145,7 +146,7 @@
</view>
<view class="cellY">
<view class="item" v-for="(item3, index3) in item2.infoArr" :key="index3">
车型:{{ item3.carTypeName }},数量:{{ item3.goodsNumber }}
{{ item3.carTypeName }}*{{ item3.goodsNumber }}
</view>
</view>
</view>
@ -234,7 +235,7 @@
</view>
<view class="cellY">
<view class="item" v-for="(item3, index3) in item2.infoArr" :key="index3">
车型:{{ item3.carTypeName }},数量:{{ item3.goodsNumber }}
{{ item3.carTypeName }}*{{ item3.goodsNumber }}
</view>
</view>
</view>
@ -323,7 +324,7 @@
</view>
<view class="cellY">
<view class="item" v-for="(item3, index3) in item2.infoArr" :key="index3">
车型:{{ item3.carTypeName }},数量:{{ item3.goodsNumber }}
{{ item3.carTypeName }}*{{ item3.goodsNumber }}
</view>
</view>
</view>
@ -400,7 +401,7 @@
<view class="rowThree">
<view class="title bo_r bo_b">
Rehangdling翻舱
Rehangdling
</view>
<view class="fclist">
<view class="fcbt">
@ -476,10 +477,10 @@
</view>
<view class="weight cellX">
<view class="text bo_r">
车型:{{ item.carTypeName }},数量:{{ item.goodsNumber }}
{{ item.carTypeName }}*{{ item.goodsNumber }}
</view>
<view class="text">
重量:{{ item.goodsWeight }},体积:{{ item.goodsVolume }}
{{ item.goodsWeight }}T/{{ item.goodsVolume }}
</view>
</view>
</view>
@ -489,7 +490,7 @@
<view class="fcbt">
<view class="bt">
<view class="kind bo_r">
Shift Of Dock
Shift Of Deck
</view>
<view class="ceY">
<view class="concat" v-if="fcArr2.length == 0">
@ -527,10 +528,10 @@
</view>
<view class="weight cellX">
<view class="text bo_r">
车型:{{ item.carTypeName }},数量:{{ item.goodsNumber }}
{{ item.carTypeName }}*{{ item.goodsNumber }}
</view>
<view class="text">
重量:{{ item.goodsWeight }},体积:{{ item.goodsVolume }}
{{ item.goodsWeight }}T/{{ item.goodsVolume }}
</view>
</view>
</view>
@ -576,10 +577,10 @@
</view>
<view class="weight cellX">
<view class="text bo_r">
车型:{{ item.carTypeName }},数量:{{ item.goodsNumber }}
{{ item.carTypeName }}*{{ item.goodsNumber }}
</view>
<view class="text">
重量:{{ item.goodsWeight }},体积:{{ item.goodsVolume }}
{{ item.goodsWeight }}T/{{ item.goodsVolume }}
</view>
</view>
</view>
@ -717,7 +718,6 @@ export default {
//
endTime: "",
//
peopleInfo: {},
peopleList: [],
peopleArr: [],
tqInfo: "",
@ -755,7 +755,9 @@ export default {
delId: "",
PTGR: [],
JSGR: [],
RYSJ: []
RYSJ: [],
carList:[],
weatherList:[]
}
},
onLoad(option) {
@ -768,9 +770,16 @@ export default {
let that = this
that.executeSql2()
that.executeSql('shipInfoTable')
this.executeSql('shipOption')
that.aaa()
setTimeout(function () {
that.fcList.forEach(v => {
//
that.carList.forEach(item2 => {
if(v.carTypeName == item2.ptrDesc) {
v.carTypeName = item2.ptrEnDesc
}
})
let endT = v.retallyEndTime.slice(0, 10)
if (endT == that.dateId) {
if (v.retallyTypeName == '舱内翻') {
@ -797,6 +806,14 @@ export default {
that.qtArr.push({})
}
that.shiftInfo.forEach(v => {
//
v.infoArr.forEach(item1 => {
that.carList.forEach(item2 => {
if(item1.carTypeName == item2.ptrDesc) {
item1.carTypeName = item2.ptrEnDesc
}
})
})
let arr = api.arrFrom(v.infoArr, "webId")
that.$set(v, "infoArr", arr)
if(v.pwcTypeName == '一工班') {
@ -814,7 +831,12 @@ export default {
that.peopleArr.push(v)
}
})
that.tqInfo = that.peopleArr[0].weatherType
// that.tqInfo = that.peopleArr[0].weatherType
that.weatherList.forEach(item => {
if(that.peopleArr[0].weatherType == item.ptrDesc) {
that.tqInfo = item.ptrEnDesc
}
})
that.peopleArr.forEach(v => {
that.zyzsInfo += Number(v.workSuite)
that.dcrsInfo += Number(v.shipPerson)
@ -825,12 +847,14 @@ export default {
},
filters: {
textFilter(value) {
if(value) {
let split_s = value.split(" ")
let result = split_s[1].split(":")
let date = split_s[0].split("-")
let sum = result[0] + ":" + result[1] + "(" + date[2] + ")"
return sum
}
}
},
},
methods: {
// /
@ -840,8 +864,14 @@ export default {
// resolve
if (tableName == 'shipInfoTable') {
this.shipInfo = value[0]
} else {
this.peopleInfo = value[0]
} else if(tableName == 'shipOption'){
value.forEach(item => {
if(item.dictionariesName == 'carList') {
this.carList.push(item)
} else if(item.dictionariesName == 'weather') {
this.weatherList.push(item)
}
})
}
}).catch((error) => {
// reject
@ -850,19 +880,38 @@ export default {
},
//
executeSql2(type) {
let sql = `SELECT
strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '0 day', 'start of day', '+22 hours')) || ',' || strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '1 day', 'start of day', '+22 hours')) AS work_shift
FROM workMessageRespList WHERE workMessageRespList.vtpId='${this.vtpId}'
GROUP BY work_shift
UNION SELECT strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '-1 day', 'start of day', '+22 hours')) || ',' || strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '0 day', 'start of day', '+22 hours')) AS work_shift
FROM workMessageRespList WHERE workMessageRespList.vtpId='${this.vtpId}'
GROUP BY work_shift;`
// let sql = `SELECT
// strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '0 day', 'start of day', '+22 hours')) || ',' || strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '1 day', 'start of day', '+22 hours')) AS work_shift
// FROM workMessageRespList WHERE workMessageRespList.vtpId='${this.vtpId}'
// GROUP BY work_shift
// UNION SELECT strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '-1 day', 'start of day', '+22 hours')) || ',' || strftime('%Y-%m-%d %H:00:00', datetime(workEndTime, '0 day', 'start of day', '+22 hours')) AS work_shift
// FROM workMessageRespList WHERE workMessageRespList.vtpId='${this.vtpId}'
// GROUP BY work_shift;`
let sql = `WITH RECURSIVE date_ranges AS(
SELECT DISTINCT date
FROM (SELECT DATE(DATETIME(workStartTime, '+2 hour')) AS date FROM workMessageRespList WHERE vtpId='${this.vtpId}'
UNION
SELECT DATE(DATETIME(retallyStartTime, '+2 hour')) AS date FROM retallyMessageRespList WHERE vtpId='${this.vtpId}'
UNION
SELECT DATE(DATETIME(startTm, '+2 hour')) AS date FROM infoRespList WHERE vtpId='${this.vtpId}'
UNION
SELECT DATE(DATETIME(startTmPt, '+2 hour')) AS date FROM infoRespList WHERE vtpId='${this.vtpId}'
UNION
SELECT DATE(DATETIME(jobStartTime, '+2 hour')) AS date FROM messageRespList WHERE vtpId='${this.vtpId}')
WHERE date IS NOT Null)
SELECT DISTINCT
datetime(date(date,'-1 day') || ' 22:00:00') AS start_time,
datetime(date || ' 21:59:59') AS end_time
FROM date_ranges WHERE start_time is not NULL
ORDER BY start_time ASC;`
sqlite.executeSqlCeshi(sql).then((value) => {
this.timeArr = value
value.forEach((v, index) => {
console.log('v', v);
this.startTime = v.work_shift.split(",")[0]
this.endTime = v.work_shift.split(",")[1]
// console.log('v', v);
// this.startTime = v.work_shift.split(",")[0]
// this.endTime = v.work_shift.split(",")[1]
this.startTime = v.start_time
this.endTime = v.end_time
let sql2 =
`Select COUNT(*),pwcTypeName,vvyId,vvyName,MIN(workStartTime) AS workStartTime, MAX(workEndTime)
AS workEndTime FROM (SELECT * FROM workMessageRespList WHERE workStartTime>='${this.startTime}' and
@ -927,6 +976,7 @@ export default {
this.tabsArr.push({
shiftArr: value
})
console.log('value',value);
}
}).catch((error) => {
// reject
@ -959,7 +1009,7 @@ export default {
`SELECT * FROM workMessageRespInfoList WHERE workMessageRespInfoList.contactId = '${id}'`
sqlite.executeSqlCeshi(sql).then((value) => {
// this.$set(this.gbArr[index], "infoArr", value)
this.shiftInfo[index].infoArr.push(...value)
this.shiftInfo[index]?.infoArr.push(...value)
}).catch((error) => {
// reject
console.error(error);
@ -1017,7 +1067,6 @@ export default {
executeSql6(sql) {
sqlite.executeSqlCeshi(sql).then((value) => {
// resolve
console.log('value', value);
if (value.length > 0) {
this.peopleList.push(...value)
}
@ -1112,6 +1161,14 @@ export default {
this.executeSql5()
setTimeout(() => {
this.shiftInfo.forEach(v => {
//
v.infoArr.forEach(item1 => {
this.carList.forEach(item2 => {
if(item1.carTypeName == item2.ptrDesc) {
item1.carTypeName = item2.ptrEnDesc
}
})
})
let arr = api.arrFrom(v.infoArr, "webId")
this.$set(v, "infoArr", arr)
if(v.pwcTypeName == '一工班') {
@ -1124,6 +1181,12 @@ export default {
})
},300)
this.fcList.forEach(v => {
//
this.carList.forEach(item2 => {
if(v.carTypeName == item2.ptrDesc) {
v.carTypeName = item2.ptrEnDesc
}
})
let endT = v.retallyEndTime.slice(0, 10)
if (endT == this.dateId) {
if (v.retallyTypeName == '舱内翻') {
@ -1155,7 +1218,12 @@ export default {
this.peopleArr.push(v)
}
})
this.tqInfo = this.peopleArr[0].weatherType
// this.tqInfo = this.peopleArr[0].weatherType
this.weatherList.forEach(item => {
if(this.peopleArr[0].weatherType == item.ptrDesc) {
this.tqInfo = item.ptrEnDesc
}
})
this.peopleArr.forEach(v => {
this.zyzsInfo += Number(v.workSuite)
this.dcrsInfo += Number(v.shipPerson)

View File

@ -169,9 +169,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/notice'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/notice'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -192,6 +202,22 @@
},
//
save() {
if (this.vvyId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入航次!'
})
return
}
if (this.workDate == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入作业日期!'
})
return
}
let date = new Date().getTime()
let sluId = uuidv4()
let webStatus = 0

View File

@ -280,9 +280,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/opinion'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/opinion'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -303,6 +313,23 @@
},
//
save() {
if (this.bthId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入泊位!'
})
return
}
if (this.operationDate == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入作业日期!'
})
return
}
let date = new Date().getTime()
let vqcId = uuidv4()
let webStatus = 0

View File

@ -366,6 +366,7 @@
//
isSgin: false,
bthList:[]
}
},
onLoad(option) {
@ -385,15 +386,24 @@
this.current4 = uni.getStorageSync("current4")
this.remake = uni.getStorageSync("remake")
this.executeSql('shipInfoTable')
this.executeSql('shipOption')
},
methods: {
//
executeSql(tableName) {
let sql = `select * from ${tableName} WHERE vtpId = '${this.vtpId}'`
sqlite.executeSqlCeshi(sql).then((value) => {
// resolve
this.shipInfo = value[0]
this.executeSql1('shipmentQualityConsultationRespList', this.tabsValue)
if(tableName == 'shipInfoTable') {
// resolve
this.shipInfo = value[0]
this.executeSql1('shipmentQualityConsultationRespList', this.tabsValue)
}else if(tableName == 'shipOption'){
value.forEach(item => {
if(item.dictionariesName == 'bthList') {
this.bthList.push(item)
}
})
}
}).catch((error) => {
// reject
console.error(error);
@ -415,6 +425,11 @@
}
this.tabsList.push(obj)
})
this.bthList.forEach(item => {
if(item.ptrDesc == this.tableInfo.bthIdName) {
this.tableInfo.bthIdName = item.ptrEnDesc
}
})
this.executeSql2()
}).catch((error) => {
// reject

View File

@ -29,17 +29,18 @@
</view>
<view class="li tpLi">
<p><text class="required" v-if="obj.state != 'look'">*</text></p>
<template v-if="obj.state != 'look'">
<!-- <template v-if="obj.state != 'look'"> -->
<template>
<view class="picture">
<uni-file-picker limit="9" v-model="urlList2" fileMediatype="image" @select="select"
@delete="delUrl" title="最多选择9张图片"></uni-file-picker>
</view>
</template>
<view class="pictureLook" v-else>
<!-- <view class="pictureLook" v-else>
<view v-for="(item,index) in urlList2" :key="index">
<image :src="item.url" mode="widthFix" @click="clickImg(urlList2,index)" />
</view>
</view>
</view> -->
</view>
<view class="li wLi">
<p><text class="required" v-if="obj.state != 'look'">*</text></p>
@ -104,6 +105,7 @@
//
optionData: [],
spmId: ''
}
},
onLoad(options) {
@ -142,6 +144,7 @@
this.getShip()
} else if (tableName == 'shipInfoTable') {
this.shipInfo = value[0]
this.spmId = this.shipInfo.spmId
} else if (tableName == 'voyageScheduleDataDetailRespDTOList') {
this.vvyInfo = value
this.hcList = []
@ -215,8 +218,9 @@
method: 'GET', //
success: (res) => {
if (res.statusCode == 200) {
console.log('res',res.data);
this.urlList2.push(res.data)
this.urlList2.push({
url:res.data
})
}
}
})
@ -281,9 +285,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/patrol'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/patrol'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -311,6 +325,38 @@
},
//
save() {
if (this.vvyId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入航次!'
})
return
}
if (this.type == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入类型!'
})
return
}
if (!this.urlList2.length) {
uni.showModal({
title: '提示',
showCancel: false,
content: '请上传图片!'
})
return
}
if (this.remark == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入描述!'
})
return
}
let spmTradeName = ""
if (this.spmTradeName == "内贸") {
spmTradeName = "N"
@ -326,7 +372,8 @@
let dto = {
"importExport": importExportName,
"remark": this.remark,
"spmId": this.vtpId,
// "spmId": this.vtpId,
"spmId": this.spmId,
"tradeType": spmTradeName,
"type": this.type,
"uploadStatus": "",

View File

@ -367,9 +367,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/mixWork'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/mixWork'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {

View File

@ -432,6 +432,7 @@
this.ulList1 = []
this.editData();
this.jzXgType = true
} else if (this.obj.state == 'add') {
this.title = "新增工班信息"
this.ulList1 = [{
@ -498,9 +499,19 @@
if (tableName == 'workMessageRespList') {
this.hcValue = value[0].vvyId
this.hcTextValue = value[0].vvyName
this.importExportFlagName = value[0].importExportFlagName
this.zxValue = value[0].loadType
this.zxTextValue = value[0].loadTypeName
this.vvyInfo.forEach(v => {
if (v.vvyId == value[0].vvyId) {
this.importExportFlagName = v.importExportFlagName
this.spmTradeName = v.tradeTypeName
if (this.importExportFlagName == "进口") {
this.zxTextValue = "卸货"
this.zxValue = "2"
} else {
this.zxTextValue = "装货"
this.zxValue = "1"
}
}
})
this.ulList1 = []
value.forEach((v, index) => {
let obj = {
@ -1411,9 +1422,19 @@
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/mixWork'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/mixWork'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
save() {

View File

@ -6,7 +6,7 @@
<view class="ul ulInfo">
<view class="li">
<p>船名</p>
<text>{{shipInfo.vslCnname}}</text>
<text>{{shipInfo.spmName}}</text>
</view>
<view class="li">
<p>航次</p>
@ -18,11 +18,11 @@
</view>
<view class="li">
<p>贸易类型</p>
<text>{{shipInfo.spmTradeName}}</text>
<text>{{shipInfo.tradeTypeName}}</text>
</view>
<view class="li">
<p>装卸类型</p>
<text> {{dataInfo[0].loadTypeName}}</text>
<text> {{dataInfo[0].importExportFlagName == '出口' ? '装货' : '卸货'}}</text>
</view>
</view>
</view>
@ -300,7 +300,7 @@
});
},
initData() {
this.executeSql3('shipInfoTable')
this.executeSql3('voyageScheduleDataDetailRespDTOList')
//
this.executeSql1('workMessageRespList')
this.executeSql1('retallyMessageRespList')

View File

@ -172,6 +172,16 @@
let date = new Date().getTime()
let webId = uuidv4()
let webDate = api.getDate(date)
//
if(that.nextUrl == 'untieSign' || that.nextUrl == 'supplySign' || that.nextUrl == 'workAssignSign') {
let sql2 = `DELETE FROM workSignTable WHERE bizId = '${signId}';`
sqlite.executeSqlCeshi(sql2).then(() => {
console.log('------');
}).catch((error) => {
// reject
console.error(error);
});
}
let sql =
`insert into workSignTable values('${webId}','${that.vtpId}','${signId}','${that.signImgUrl}','${that.signTable}','${that.signType}','${that.vvyId}','${webDate}')`
sqlite.executeSqlCeshi(sql).then((

View File

@ -247,9 +247,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/supply'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/supply'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -270,6 +280,39 @@
},
//
save() {
if (this.vvyId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入航次!'
})
return
}
if (this.stopBerthage == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入泊位!'
})
return
}
if (this.supplyTypeId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入供给类型!'
})
return
}
if (this.supplyDate == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入日期!'
})
return
}
let date = new Date().getTime()
let sssId = uuidv4()
let webStatus = 0

View File

@ -95,6 +95,7 @@
czSign: {},
delId: "",
vtpId: "",
bthList:[]
}
},
onLoad(option) {
@ -105,15 +106,24 @@
mounted() {
this.vtpId = uni.getStorageSync('vtpId')
this.executeSql('shipInfoTable')
this.executeSql('shipOption')
},
methods: {
//
executeSql(tableName) {
let sql = `select * from ${tableName} WHERE vtpId='${this.vtpId}'`
sqlite.executeSqlCeshi(sql).then((value) => {
if(tableName == 'shipInfoTable') {
// resolve
this.shipInfo = value[0]
this.executeSql1('shipmentShipSupplyRespList', this.tabsValue)
} else if(tableName == 'shipOption') {
value.forEach(item => {
if(item.dictionariesName == 'bthList') {
this.bthList.push(item)
}
})
}
}).catch((error) => {
// reject
console.error(error);
@ -133,6 +143,12 @@
}
this.tabsList.push(obj)
})
this.bthList.forEach(item => {
if(item.ptrDesc == this.tableInfo.stopBerthageName) {
this.tableInfo.stopBerthageName = item.ptrEnDesc
}
})
this.executeSql2()
}).catch((error) => {
// reject

View File

@ -277,9 +277,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/untieCord'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/untieCord'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {
@ -300,6 +310,30 @@
},
//
save() {
if (this.vvyId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入航次!'
})
return
}
if (this.bthId == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入泊位!'
})
return
}
if (this.attachTime == "") {
uni.showModal({
title: '提示',
showCancel: false,
content: '请输入系揽时间!'
})
return
}
let date = new Date().getTime()
let sauId = uuidv4()
let webStatus = 0

View File

@ -122,7 +122,7 @@
czSign: {},
delId: "",
vtpId: "",
bthList:[]
}
},
onLoad(option) {
@ -133,15 +133,24 @@
mounted() {
this.vtpId = uni.getStorageSync('vtpId')
this.executeSql('shipInfoTable')
this.executeSql('shipOption')
},
methods: {
//
executeSql(tableName) {
let sql = `select * from ${tableName} WHERE vtpId = '${this.vtpId}'`
sqlite.executeSqlCeshi(sql).then((value) => {
// resolve
this.shipInfo = value[0]
this.executeSql1('attachUnmoorRespList', this.tabsValue)
if(tableName == 'shipInfoTable') {
// resolve
this.shipInfo = value[0]
this.executeSql1('attachUnmoorRespList', this.tabsValue)
}else if(tableName == 'shipOption'){
value.forEach(item => {
if(item.dictionariesName == 'bthList') {
this.bthList.push(item)
}
})
}
}).catch((error) => {
// reject
console.error(error);
@ -160,6 +169,11 @@
}
this.tabsList.push(obj)
})
this.bthList.forEach(item => {
if(item.ptrDesc == this.tableInfo.bthIdName) {
this.tableInfo.bthIdName = item.ptrEnDesc
}
})
this.executeSql2()
}).catch((error) => {
// reject

View File

@ -306,9 +306,19 @@
},
//
cancel() {
uni.navigateTo({
url: '/pages/shipWork/workAssign'
})
uni.showModal({
title: '提示',
content: '将退出编辑,所有内容不保留',
success: function (res) {
if (res.confirm) {
uni.navigateTo({
url: '/pages/shipWork/workAssign'
})
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
},
//
delConfirm() {

View File

@ -322,6 +322,7 @@
zdySign: {},
delId: "",
vtpId: "",
bthList:[]
}
},
onLoad(option) {
@ -332,15 +333,24 @@
mounted() {
this.vtpId = uni.getStorageSync('vtpId')
this.executeSql('shipInfoTable')
this.executeSql('shipOption')
},
methods: {
//
executeSql(tableName) {
let sql = `select * from ${tableName}`
let sql = `select * from ${tableName} WHERE vtpId='${this.vtpId}'`
sqlite.executeSqlCeshi(sql).then((value) => {
if(tableName == 'shipInfoTable') {
// resolve
this.shipInfo = value[0]
this.executeSql1('shipmentAdviserLayoutRespList', this.tabsValue)
}else if(tableName == 'shipOption'){
value.forEach(item => {
if(item.dictionariesName == 'bthList') {
this.bthList.push(item)
}
})
}
}).catch((error) => {
// reject
console.error(error);
@ -359,6 +369,11 @@
}
this.tabsList.push(obj)
})
this.bthList.forEach(item => {
if(item.ptrDesc == this.tableInfo.bthIdName) {
this.tableInfo.bthIdName = item.ptrEnDesc
}
})
this.executeSql2()
}).catch((error) => {
// reject

86
upDate.js 100644
View File

@ -0,0 +1,86 @@
import Vue from 'vue'
// 获取当前版本号
function getLocalVersion() {
return new Promise((resolve, reject) => {
plus.runtime.getProperty(plus.runtime.appid, function (widgetInfo) {
const version = widgetInfo.version
resolve(version)
})
}).catch(err => {
console.log(err);
})
}
export function downloadPackage() {
return new Promise((resolve, reject) => {
// 相关接口
let token = uni.getStorageSync('loginObj')
let version
const reqDTO = {
obligateData1: 'pad'
}
uni.request({
url: `${Vue.prototype.$local}/api/version/getMsg`,
header: {
'Content-Type': 'application/json', //自定义请求头信息
'Authorization': `Bearer ${token.access_token}`
},
data: reqDTO,
method: 'POST', //请求方式,必须为大写
success: (res) => {
if (res.statusCode == 200 && res.data.data != null) {
getLocalVersion().then(resD => {
if (res.data.data.versionNum != resD) {
uni.showModal({
title: '检测到有版本更新!',
content: '请升级app到最新版本',
cancelText: '暂不升级',
showCancel: false,
confirmText: '立即升级',
success: resDD => {
if (resDD.confirm) {
const task = plus.downloader.createDownload(res.data.data.url);
task.addEventListener('statechanged', (download, status) => {
console.log(download,status);
if (status == 200) {
const {
downloadedSize,
totalSize,
filename,
state,
} = download;
const p = (downloadedSize / totalSize).toFixed(2) * 100;
const isComplete = state === 4;
console.log(['下载中' + p, 'status=' + status, '是否下载完成' + (isComplete)].join(''))
// onProgress && onProgress(p);
if (isComplete) {
console.log('下载完成,开始安装')
plus.runtime.install(filename, {}, () => {
console.log('安装成功')
}, () => {
console.log('安装失败')
});
}
}
}, false);
task.start();
}
}
})
}
})
}
},
fail: function (err) {
uni.showModal({
title: '提示',
showCancel: false,
content: '请求超时,请退出重新进入!'
})
}
})
resolve(version)
}).catch(err => {
console.log(err);
})
}