2023-07-11 17:29:53 +08:00
< template >
< view class = "shiftAdd" >
< view class = "container" >
< uni -steps :options ="stepList" :active ="active" / >
< view class = "line" > < / view >
2023-07-12 13:48:01 +08:00
<!-- 工班信息 -- >
< template v-if ="active == 0" >
2023-07-18 17:37:15 +08:00
< view class = "ul ul1" >
< view class = "li" >
2023-07-12 13:48:01 +08:00
< p > 船名 : < / p >
2023-07-18 17:37:15 +08:00
< text > { { shipInfo . voyageScheduleDataList [ 0 ] . spmName } } < / text >
< / view >
< view class = "li" >
< p > < text class = "required" > * < / text > 航次 : < / p >
2023-07-12 13:48:01 +08:00
< uni -data -select v-model ="hcValue" :localdata="hcList" @change="hcChange" > < / uni -data -select >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
2023-07-12 13:48:01 +08:00
< p > 进出口 : < / p >
2023-07-18 17:37:15 +08:00
< text > { { shipInfo . voyageScheduleDataList [ 0 ] . importExportFlagName } } < / text >
< / view >
< view class = "li" >
2023-07-12 13:48:01 +08:00
< p > 贸易类型 : < / p >
2023-07-18 17:37:15 +08:00
< text > { { shipInfo . voyageScheduleDataList [ 0 ] . tradeTypeName } } < / text >
< / view >
< view class = "li" >
< p > < text class = "required" > * < / text > 装卸类型 : < / p >
2023-07-12 13:48:01 +08:00
< uni -data -select v-model ="zxValue" :localdata="zxList" @change="zxChange" > < / uni -data -select >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-24 16:56:46 +08:00
< view class = "widthLi" v-for ="(item,index) in ulList1" :key="index+'ul'" >
< view class = "ulTop" > < text @click ="ulAdd1" > 添 加 工 班 < / text > < text v -if = " index > 0 "
2023-08-18 17:28:11 +08:00
@ click = "delGb(item,index)" > 删除 < / text > < van -icon name = "arrow-down" / > < / view >
2023-07-24 16:56:46 +08:00
< view class = "ul" >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 工班 : < / p >
< uni -data -select v -model = " item.gbValue " :localdata ="gbList"
@ change = "gbChange(item,index)" > < / u n i - d a t a - s e l e c t >
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 作业时间 : < / p >
< uni -datetime -picker v -model = " item.datetime " type = "datetimerange" rangeSeparator = "-"
@ change = "changeLog(item)" / >
< / view >
< view class = "widthLi" v-for ="(item2,index2) in item.ulList2" :key="index2+'ul2'" >
< view class = "ulTop" > < text @click ="ulAdd2(index)" > 添 加 工 班 信 息 < / text > < / text > < text v -if = " index2 > 0 "
2023-08-18 17:28:11 +08:00
@ click = "delGb2(item2,index,index2)" > 删除 < / text > < van -icon name = "arrow-down" / > < / view >
2023-07-24 16:56:46 +08:00
< view class = "ul" >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 车型 : < / p >
2023-08-15 09:18:52 +08:00
< uni -data -select v -model = " item2.carType " :localdata ="cxList"
2023-07-24 16:56:46 +08:00
@ change = "cxChange(item,index,item2,index2)" > < / u n i - d a t a - s e l e c t >
< / view >
< view class = "li" >
< p > < text class = "required" > * < / text > 数量 : < / p >
2023-08-15 09:18:52 +08:00
< uni -number -box @change ="numChange" v -model = " item2.goodsNumber " :max ="1000000000" / >
2023-07-24 16:56:46 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 装卸方式 : < / p >
2023-08-15 09:18:52 +08:00
< uni -data -select v -model = " item2.loadingType " :localdata ="fsList"
2023-07-24 16:56:46 +08:00
@ change = "fsChange(item,index,item2,index2)" > < / u n i - d a t a - s e l e c t >
< / view >
< view class = "li widthLi" >
< p class = "liTitle" > 备注 : < / p >
2023-08-15 09:18:52 +08:00
< uni -easyinput type = "textarea" autoHeight v -model = " item2.remark "
2023-07-24 16:56:46 +08:00
placeholder = "请输入任务描述(200字以内)" maxlength = "200" > < / u n i - e a s y i n p u t >
< / view >
< / view >
< / view >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-12 13:48:01 +08:00
< / template >
<!-- 翻仓信息 -- >
< template v-if ="active == 1" >
< view v-for ="(item,index) in fcUlList" :key="index + 'fc'" >
2023-07-24 16:56:46 +08:00
< view class = "ulTop" > < text @click ="fcAdd" > 添 加 翻 仓 类 型 < / text > < text v -if = " index > 0 "
2023-08-18 17:28:11 +08:00
@ click = "delFc(item,index)" > 删除 < / text > < van -icon name = "arrow-down" / > < / view >
2023-07-18 17:37:15 +08:00
< view class = "ul fcUl" >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 翻仓类型 : < / p >
2023-07-12 13:48:01 +08:00
< uni -data -select v -model = " item.fcValue " :localdata ="fcList"
2023-07-19 18:12:19 +08:00
@ change = "fcChange(item,index)" > < / u n i - d a t a - s e l e c t >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-12 13:48:01 +08:00
< view v-for ="(item2,index2) in item.fcUlList2" :key="index2 + 'fc2'" >
2023-07-24 16:56:46 +08:00
< view class = "ulTop" > < text @click ="fcAdd2(index)" > 添 加 翻 仓 信 息 < / text > < / text > < text v -if = " index2 > 0 "
2023-08-18 17:28:11 +08:00
@ click = "delFc2(item2,index,index2)" > 删除 < / text > < van -icon name = "arrow-down" / > < / view >
2023-07-18 17:37:15 +08:00
< view class = "ul ul2 fcUl2" >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 翻舱起点位置 : < / p >
2023-07-19 18:12:19 +08:00
< uni -easyinput v-model ="item2.qdValue" placeholder="请输入翻舱起点位置" > < / uni -easyinput >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 翻舱终点位置 : < / p >
2023-07-19 18:12:19 +08:00
< uni -easyinput v-model ="item2.zdValue" placeholder="请输入翻舱终点位置" > < / uni -easyinput >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 作业时间 : < / p >
2023-07-19 18:12:19 +08:00
< uni -datetime -picker v -model = " item2.datetime " type = "datetimerange" rangeSeparator = "-"
@ change = "changeLog(item2)" / >
2023-07-18 17:37:15 +08:00
< / view >
2023-08-15 09:18:52 +08:00
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 车型 : < / p >
< uni -data -select v -model = " item2.carType " :localdata ="cxList"
@ change = "fccxChange(index,item2,index2)" > < / u n i - d a t a - s e l e c t >
< / view >
2023-07-18 17:37:15 +08:00
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 数量 : < / p >
2023-08-15 09:18:52 +08:00
< uni -number -box v -model = " item2.goodsNumber " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 体积 : < / p >
2023-08-04 17:06:33 +08:00
< uni -number -box v -model = " item2.tjValue " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 重量 : < / p >
2023-08-04 17:06:33 +08:00
< uni -number -box v -model = " item2.zlValue " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-12 13:48:01 +08:00
< / view >
< / view >
< / template >
<!-- 其他信息 -- >
< template v-if ="active == 2" >
< view class = "otherWork" >
< p class = "title" > 辅助作业 < / p >
2023-07-18 17:37:15 +08:00
< view class = "ul" >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 技术工人 : < / p >
2023-08-15 09:18:52 +08:00
< uni -number -box v -model = " otherObj.jsworker " :max ="1000000000" / >
2023-08-04 17:06:33 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 作业时间 : < / p >
< uni -datetime -picker v -model = " otherObj.datetime " type = "datetimerange" rangeSeparator = "-"
@ change = "changeLog(otherObj)" / >
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 重量 : < / p >
< uni -number -box v -model = " otherObj.zlValue " :max ="1000000000" / >
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 体积 : < / p >
< uni -number -box v -model = " otherObj.tjValue " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 普通工人 : < / p >
2023-08-04 17:06:33 +08:00
< uni -number -box v -model = " otherObj.ptworker " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 作业时间 : < / p >
2023-08-04 17:06:33 +08:00
< uni -datetime -picker v -model = " otherObj.datetime2 " type = "datetimerange" rangeSeparator = "-"
2023-07-19 18:12:19 +08:00
@ change = "changeLog(otherObj)" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 重量 : < / p >
2023-08-04 17:06:33 +08:00
< uni -number -box v -model = " otherObj.zlValue2 " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
< p class = "liTitle" > < text class = "required" > * < / text > 体积 : < / p >
2023-08-04 17:06:33 +08:00
< uni -number -box v -model = " otherObj.tjValue2 " :max ="1000000000" / >
2023-07-18 17:37:15 +08:00
< / view >
< view class = "li" >
2023-07-12 13:48:01 +08:00
< p class = "liTitle" > 描述 : < / p >
< uni -easyinput type = "textarea" autoHeight v -model = " otherObj.describe "
placeholder = "请输入任务描述(200字以内)" maxlength = "200" > < / u n i - e a s y i n p u t >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-12 13:48:01 +08:00
< p class = "title" > 待工作业 < / p >
2023-07-18 17:37:15 +08:00
< view class = "ul" >
< view class = "li" >
2023-07-12 13:48:01 +08:00
< p class = "liTitle" > 描述 : < / p >
< uni -easyinput type = "textarea" autoHeight v -model = " otherObj.dgWork "
placeholder = "请输入任务描述(200字以内)" maxlength = "200" > < / u n i - e a s y i n p u t >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-12 13:48:01 +08:00
< p class = "title" > 作业备注 < / p >
2023-07-18 17:37:15 +08:00
< view class = "ul" >
< view class = "li" >
2023-07-12 13:48:01 +08:00
< p class = "liTitle" > 描述 : < / p >
2023-08-15 09:18:52 +08:00
< uni -easyinput type = "textarea" autoHeight v -model = " otherObj.remark "
2023-07-12 13:48:01 +08:00
placeholder = "请输入任务描述(200字以内)" maxlength = "200" > < / u n i - e a s y i n p u t >
2023-07-18 17:37:15 +08:00
< / view >
< / view >
2023-07-12 13:48:01 +08:00
< / view >
< / template >
2023-07-11 17:29:53 +08:00
< view class = "btnList" >
< van -button type = "default" @click ="cancel" > 取 消 < / van -button >
2023-07-19 18:12:19 +08:00
< van -button type = "info" @click ="back" v-if ="active > 0" > 上 一 步 < / van -button >
< van -button type = "info" @click ="save" v-if ="active == 2" > 保 存 < / van -button >
2023-07-12 13:48:01 +08:00
< van -button type = "info" @click ="next" v-if ="active < 2" > 下 一 步 < / van -button >
2023-07-11 17:29:53 +08:00
< / view >
< / view >
< / view >
< / template >
< script >
2023-08-03 15:36:23 +08:00
import sqlite from "../../common/sqlite.js"
2023-08-04 17:06:33 +08:00
import api from "../../common/api.js"
import {
v4 as uuidv4
} from 'uuid' ;
2023-07-11 17:29:53 +08:00
export default {
data ( ) {
return {
2023-07-18 17:37:15 +08:00
shipInfo : {
voyageScheduleDataList : [ {
spmName : "" ,
importExportFlagName : "" ,
tradeTypeName : ""
} ]
} ,
2023-07-11 17:29:53 +08:00
obj : { } ,
2023-07-19 18:12:19 +08:00
dataInfo : { } ,
shiftRowIndex : 0 ,
2023-07-11 17:29:53 +08:00
active : 0 ,
stepList : [ {
2023-07-18 17:37:15 +08:00
title : '工班信息'
2023-07-11 17:29:53 +08:00
} ,
{
2023-07-18 17:37:15 +08:00
title : '翻舱信息'
2023-07-11 17:29:53 +08:00
} ,
{
2023-07-18 17:37:15 +08:00
title : '其他信息'
}
2023-07-11 17:29:53 +08:00
] ,
2023-07-18 17:37:15 +08:00
// 工班信息
// 航次下拉框
hcValue : "" ,
hcTextValue : "" ,
hcList : [ ] ,
2023-07-11 17:29:53 +08:00
// 装卸类型下拉框
zxValue : "" ,
2023-07-18 17:37:15 +08:00
zxTextValue : "" ,
zxList : [ ] ,
2023-08-15 09:18:52 +08:00
ulList1 : [ ] ,
2023-07-11 17:29:53 +08:00
// 工班下拉框
2023-07-19 18:12:19 +08:00
gbList : [ ] ,
2023-07-11 17:29:53 +08:00
// 车型下拉
2023-07-19 18:12:19 +08:00
cxList : [ ] ,
2023-07-11 17:29:53 +08:00
// 装卸方式下拉
2023-07-19 18:12:19 +08:00
fsList : [ ] ,
2023-07-12 13:48:01 +08:00
// 翻仓信息
// 翻仓类型下拉
2023-07-20 17:16:08 +08:00
fcList : [ ] ,
2023-07-12 13:48:01 +08:00
fcUlList : [ {
fcValue : "" ,
2023-07-19 18:12:19 +08:00
fcTextValue : "" ,
2023-07-12 13:48:01 +08:00
fcUlList2 : [ {
qdValue : "" ,
zdValue : "" ,
2023-08-15 09:18:52 +08:00
carType : "" ,
carTypeName : "" ,
2023-07-19 18:12:19 +08:00
datetime : [ '' , '' ] ,
startTime : "" ,
endTime : "" ,
2023-08-15 09:18:52 +08:00
goodsNumber : 0 ,
2023-07-12 13:48:01 +08:00
tjValue : 0 ,
2023-08-15 09:18:52 +08:00
zlValue : 0 ,
editStatus : 0 ,
2023-07-12 13:48:01 +08:00
} ] ,
} ] ,
// 其他信息
otherObj : {
2023-08-15 09:18:52 +08:00
webId : '' ,
contactId : '' ,
jsworker : '' ,
2023-07-19 18:12:19 +08:00
datetime : [ '' , '' ] ,
2023-08-15 09:18:52 +08:00
startTime : '' ,
endTime : '' ,
zlValue : '' ,
tjValue : '' ,
ptworker : '' ,
datetime2 : '' ,
startTime2 : '' ,
endTime2 : '' ,
zlValue2 : '' ,
tjValue2 : '' ,
describe : '' ,
dgWork : '' ,
remark : ''
} ,
// 下拉数据
optionData : [ ] ,
2023-08-03 15:36:23 +08:00
2023-08-15 09:18:52 +08:00
contactId : "" ,
2023-08-18 17:28:11 +08:00
// 工班删除ids
shiftDelList : [ ] ,
// 工班信息删除ids
shiftInfoDelList : [ ] ,
// 翻仓信息删除ids
fcInfoDelList : [ ] ,
2023-07-11 17:29:53 +08:00
}
} ,
onLoad ( options ) {
if ( 'params' in options ) {
// 获取传递的对象参数, 使用decodeURIComponent解码, 并转为对象
this . obj = JSON . parse ( decodeURIComponent ( options . params ) )
}
} ,
2023-07-18 17:37:15 +08:00
mounted ( ) {
2023-08-15 09:18:52 +08:00
this . dataInfo = uni . getStorageSync ( 'shiftRow' )
this . contactId = this . dataInfo [ 0 ] . contactId
this . executeSql2 ( 'shipOption' )
this . executeSql2 ( 'shipInfoTable' )
2023-07-19 18:12:19 +08:00
if ( this . obj . state == 'edit' ) {
2023-08-15 09:18:52 +08:00
this . ulList1 = [ ]
2023-07-19 18:12:19 +08:00
this . editData ( ) ;
2023-08-15 09:18:52 +08:00
} else if ( this . obj . state == 'add' ) {
this . ulList1 = [ {
gbValue : "" ,
gbTextValue : "" ,
datetime : [ '' , '' ] ,
startTime : "" ,
endTime : "" ,
ulList2 : [ {
carType : "" ,
carTypeName : "" ,
goodsNumber : 0 ,
loadingType : "" ,
loadingTypeName : "" ,
remark : "" ,
} ]
} ]
2023-07-19 18:12:19 +08:00
}
2023-07-18 17:37:15 +08:00
} ,
2023-07-11 17:29:53 +08:00
methods : {
2023-08-03 15:36:23 +08:00
// 查
2023-08-15 09:18:52 +08:00
executeSql2 ( tableName ) {
let sql = ` select * from ${ tableName } ; `
sqlite . executeSqlCeshi ( sql ) . then ( ( value ) => {
if ( tableName == 'shipOption' ) {
this . optionData = value
this . getShip ( )
} else {
this . shipObj = value
}
} )
} ,
2023-08-03 15:36:23 +08:00
executeSql1 ( tableName ) {
2023-08-15 09:18:52 +08:00
let sql = ` select * from ${ tableName } WHERE contactId = ' ${ this . contactId } '; `
2023-08-03 15:36:23 +08:00
sqlite . executeSqlCeshi ( sql ) . then ( ( value ) => {
// 在resolve时执行的回调函数
2023-08-15 09:18:52 +08:00
if ( tableName == 'workMessageRespList' ) {
this . hcValue = value [ 0 ] . vvyId
this . hcTextValue = value [ 0 ] . vvyName
this . zxValue = value [ 0 ] . loadType
this . zxTextValue = value [ 0 ] . loadTypeName
this . ulList1 = [ ]
value . forEach ( ( v , index ) => {
let obj = {
webId : v . webId ,
contactId : v . contactId ,
datetime : [ v . workStartTime , v . workEndTime ] ,
startTime : v . workStartTime ,
endTime : v . workEndTime ,
gbValue : v . pwcType ,
gbTextValue : v . pwcTypeName ,
ulList2 : [ ]
}
this . getData ( obj )
} )
} else if ( tableName == 'retallyMessageRespList' ) {
2023-08-18 17:28:11 +08:00
// console.log(value);
2023-08-15 09:18:52 +08:00
let arr = [ ] ;
value . forEach ( item => {
if ( ! arr [ item . retallyType ] ) {
arr [ item . retallyType ] = {
webId : item . webId ,
contactId : item . contactId ,
fcValue : item . retallyType ,
fcTextValue : item . retallyTypeName ,
fcUlList2 : [ ]
} ;
}
arr [ item . retallyType ] . fcUlList2 . push ( {
2023-08-18 17:28:11 +08:00
webId : item . webId ,
2023-08-15 09:18:52 +08:00
qdValue : item . retallyOrigin ,
zdValue : item . retallyTerminus ,
carType : item . carType ,
carTypeName : item . carTypeName ,
datetime : [ item . retallyStartTime , item . retallyEndTime ] ,
startTime : item . retallyStartTime ,
endTime : item . retallyEndTime ,
goodsNumber : item . goodsNumber ,
tjValue : item . goodsVolume ,
zlValue : item . goodsWeight ,
editStatus : item . editStatus ,
} ) ;
} ) ;
this . fcUlList = Object . values ( arr ) ;
2023-08-18 17:28:11 +08:00
// console.log(this.fcUlList);
2023-08-15 09:18:52 +08:00
} else if ( tableName == 'infoRespList' ) {
this . otherObj . webId = value [ 0 ] . webId
this . otherObj . contactId = value [ 0 ] . contactId
this . otherObj . jsworker = value [ 0 ] . tecNum
this . otherObj . datetime = [ value [ 0 ] . tecStartTm , value [ 0 ] . tecEndTm ]
this . otherObj . startTime = value [ 0 ] . tecStartTm
this . otherObj . endTime = value [ 0 ] . tecEndTm
this . otherObj . zlValue = value [ 0 ] . tecWeight
this . otherObj . tjValue = value [ 0 ] . tecVolume
this . otherObj . ptworker = value [ 0 ] . genNum
this . otherObj . datetime2 = [ value [ 0 ] . genStartTm , value [ 0 ] . tecEndTm ]
this . otherObj . startTime2 = value [ 0 ] . genStartTm
this . otherObj . endTime2 = value [ 0 ] . genEndTm
this . otherObj . zlValue2 = value [ 0 ] . genWeight
this . otherObj . tjValue2 = value [ 0 ] . genVolume
this . otherObj . describe = value [ 0 ] . auxRemark
this . otherObj . dgWork = value [ 0 ] . waitRemark
this . otherObj . remark = value [ 0 ] . workRemark
}
} ) . catch ( ( error ) => {
// 在reject时执行的回调函数
console . error ( error ) ;
} ) ;
} ,
getData ( obj ) {
let sql = ` select * from workMessageRespInfoList WHERE contactId = ' ${ obj . webId } '; `
sqlite . executeSqlCeshi ( sql ) . then ( ( value ) => {
obj . ulList2 = value
this . ulList1 . push ( obj )
2023-08-03 15:36:23 +08:00
} ) . catch ( ( error ) => {
// 在reject时执行的回调函数
console . error ( error ) ;
} ) ;
} ,
2023-07-18 17:37:15 +08:00
// 获取船只信息
getShip ( ) {
this . shipInfo = uni . getStorageSync ( 'shipInfo' )
2023-08-03 15:36:23 +08:00
// 航次下拉数据
let hcOption = [ ]
this . optionData . forEach ( ( v , index ) => {
if ( v . dictionariesName == 'vvyList' ) {
hcOption . push ( v )
}
} )
hcOption . forEach ( ( v , index ) => {
2023-07-18 17:37:15 +08:00
this . hcList . push ( {
2023-08-03 15:36:23 +08:00
text : v . ptrDesc ,
value : v . ptrCode
2023-07-18 17:37:15 +08:00
} )
} )
2023-07-19 18:12:19 +08:00
// 装卸类型数据
2023-08-03 15:36:23 +08:00
let zxOption = [ ]
this . optionData . forEach ( ( v , index ) => {
if ( v . dictionariesName == 'handTypeList' ) {
zxOption . push ( v )
}
} )
zxOption . forEach ( ( v , index ) => {
2023-07-18 17:37:15 +08:00
this . zxList . push ( {
text : v . ptrDesc ,
value : v . ptrCode
} )
} )
2023-07-19 18:12:19 +08:00
// 工班数据
2023-08-03 15:36:23 +08:00
let gbOption = [ ]
this . optionData . forEach ( ( v , index ) => {
if ( v . dictionariesName == 'shiftList' ) {
gbOption . push ( v )
}
} )
gbOption . forEach ( ( v , index ) => {
2023-07-19 18:12:19 +08:00
this . gbList . push ( {
2023-08-03 15:36:23 +08:00
text : v . ptrDesc ,
value : v . ptrCode
2023-07-19 18:12:19 +08:00
} )
} )
// 车型数据
2023-08-03 15:36:23 +08:00
let cxOption = [ ]
this . optionData . forEach ( ( v , index ) => {
if ( v . dictionariesName == 'carList' ) {
cxOption . push ( v )
}
} )
cxOption . forEach ( ( v , index ) => {
2023-07-19 18:12:19 +08:00
this . cxList . push ( {
2023-08-03 15:36:23 +08:00
text : v . ptrDesc ,
value : v . ptrCode
2023-07-19 18:12:19 +08:00
} )
} )
// 装卸方式
2023-08-03 15:36:23 +08:00
let fsOption = [ ]
this . optionData . forEach ( ( v , index ) => {
if ( v . dictionariesName == 'loadTypeList' ) {
fsOption . push ( v )
}
} )
fsOption . forEach ( ( v , index ) => {
2023-07-19 18:12:19 +08:00
this . fsList . push ( {
text : v . ptrDesc ,
value : v . ptrCode
} )
} )
// 翻仓类型
2023-08-03 15:36:23 +08:00
let fcOption = [ ]
this . optionData . forEach ( ( v , index ) => {
if ( v . dictionariesName == 'turnoverTypeList' ) {
fcOption . push ( v )
}
} )
fcOption . forEach ( ( v , index ) => {
2023-07-19 18:12:19 +08:00
this . fcList . push ( {
2023-07-20 17:16:08 +08:00
text : v . ptrDesc ,
value : v . ptrCode
2023-07-19 18:12:19 +08:00
} )
} )
} ,
//状态为编辑获取数据
editData ( ) {
2023-08-15 09:18:52 +08:00
this . executeSql1 ( 'workMessageRespList' )
this . executeSql1 ( 'retallyMessageRespList' )
this . executeSql1 ( 'infoRespList' )
2023-07-18 17:37:15 +08:00
} ,
2023-07-12 13:48:01 +08:00
// 工班信息相关
2023-07-11 17:29:53 +08:00
// 航次下拉
hcChange ( e ) {
this . hcValue = e ;
2023-07-18 17:37:15 +08:00
this . hcList . forEach ( v => {
if ( v . value == e ) {
this . hcTextValue = v . text
}
} )
2023-07-11 17:29:53 +08:00
} ,
// 装卸类型下拉
zxChange ( e ) {
this . zxValue = e ;
2023-07-18 17:37:15 +08:00
this . zxList . forEach ( v => {
if ( v . value == e ) {
this . zxTextValue = v . text
}
} )
2023-07-11 17:29:53 +08:00
} ,
2023-07-24 16:56:46 +08:00
// 工班信息添加
2023-07-11 17:29:53 +08:00
ulAdd1 ( ) {
2023-07-12 13:48:01 +08:00
this . ulList1 . push ( {
2023-07-19 18:12:19 +08:00
datetime : [ '' , '' ] ,
2023-07-12 13:48:01 +08:00
gbValue : "" ,
2023-07-24 16:56:46 +08:00
gbTextValue : "" ,
ulList2 : [ {
2023-08-15 09:18:52 +08:00
carType : "" ,
carTypeName : "" ,
goodsNumber : 0 ,
loadingType : "" ,
loadingTypeName : "" ,
remark : "" ,
2023-07-24 16:56:46 +08:00
} ] ,
} )
} ,
ulAdd2 ( index ) {
this . ulList1 [ index ] . ulList2 . push ( {
2023-08-15 09:18:52 +08:00
carType : "" ,
carTypeName : "" ,
goodsNumber : 0 ,
loadingType : "" ,
loadingTypeName : "" ,
remark : "" ,
2023-07-12 13:48:01 +08:00
} )
2023-07-11 17:29:53 +08:00
} ,
// 工班下拉
2023-07-19 18:12:19 +08:00
gbChange ( item , index ) {
this . ulList1 [ index ] . gbValue = item . gbValue
this . gbList . forEach ( v => {
if ( v . value == item . gbValue ) {
item . gbTextValue = v . text
}
} )
} ,
2023-07-11 17:29:53 +08:00
// 作业时间
2023-07-19 18:12:19 +08:00
changeLog ( item ) {
2023-08-18 17:28:11 +08:00
// item.datetime[0].slice(0, item.datetime[0].length - 3)
2023-08-15 09:18:52 +08:00
item . startTime = item . datetime [ 0 ]
item . endTime = item . datetime [ 1 ]
item . startTime2 = item . datetime2 [ 0 ]
item . endTime2 = item . datetime2 [ 1 ]
2023-07-19 18:12:19 +08:00
} ,
2023-07-24 16:56:46 +08:00
// 工班信息删除
2023-08-18 17:28:11 +08:00
delGb ( item , index ) {
2023-07-24 16:56:46 +08:00
this . ulList1 . splice ( index , 1 )
2023-08-18 17:28:11 +08:00
if ( item . webId != null ) {
this . shiftDelList . push ( item . webId )
this . shiftDelList = Array . from ( new Set ( this . shiftDelList ) )
item . ulList2 . forEach ( v => {
this . shiftInfoDelList . push ( v . webId )
} )
this . shiftInfoDelList = Array . from ( new Set ( this . shiftInfoDelList ) )
}
2023-07-11 17:29:53 +08:00
} ,
2023-08-18 17:28:11 +08:00
delGb2 ( item2 , index , index2 ) {
2023-07-24 16:56:46 +08:00
this . ulList1 [ index ] . ulList2 . splice ( index2 , 1 )
2023-08-18 17:28:11 +08:00
if ( item2 . webId != null ) {
this . shiftInfoDelList . push ( item . webId )
this . shiftInfoDelList = Array . from ( new Set ( this . shiftInfoDelList ) )
}
2023-07-11 17:43:29 +08:00
} ,
2023-07-11 17:29:53 +08:00
// 车型下拉
2023-07-24 16:56:46 +08:00
cxChange ( item , index , item2 , index2 ) {
2023-08-15 09:18:52 +08:00
this . ulList1 [ index ] . ulList2 [ index2 ] . carType = item2 . carType
2023-07-19 18:12:19 +08:00
this . cxList . forEach ( v => {
2023-08-15 09:18:52 +08:00
if ( v . value == item2 . carType ) {
item2 . carTypeName = v . text
2023-07-19 18:12:19 +08:00
}
} )
} ,
2023-07-11 17:29:53 +08:00
// 数量
2023-07-12 13:48:01 +08:00
numChange ( val ) { } ,
2023-07-11 17:29:53 +08:00
// 装卸方式下拉
2023-07-24 16:56:46 +08:00
fsChange ( item , index , item2 , index2 ) {
2023-08-15 09:18:52 +08:00
this . ulList1 [ index ] . ulList2 [ index2 ] . loadingType = item2 . loadingType
2023-07-19 18:12:19 +08:00
this . fsList . forEach ( v => {
2023-08-15 09:18:52 +08:00
if ( v . value == item2 . loadingType ) {
item2 . loadingTypeName = v . text
2023-07-19 18:12:19 +08:00
}
} )
} ,
2023-07-12 13:48:01 +08:00
// 翻仓信息
// 翻仓类型下拉
2023-07-19 18:12:19 +08:00
fcChange ( item , index ) {
this . fcUlList [ index ] . fcValue = item . fcValue
this . fcList . forEach ( v => {
if ( v . value == item . fcValue ) {
item . fcTextValue = v . text
}
} )
} ,
2023-08-15 09:18:52 +08:00
// 翻仓车型
fccxChange ( index , item2 , index2 ) {
this . fcUlList [ index ] . fcUlList2 [ index2 ] . carType = item2 . carType
this . cxList . forEach ( v => {
if ( v . value == item2 . carType ) {
item2 . carTypeName = v . text
2023-07-19 18:12:19 +08:00
}
} )
} ,
2023-07-12 13:48:01 +08:00
// 翻仓add
fcAdd ( ) {
this . fcUlList . push ( {
fcValue : "" ,
2023-07-19 18:12:19 +08:00
fcTextValue : "" ,
2023-07-12 13:48:01 +08:00
fcUlList2 : [ {
qdValue : "" ,
zdValue : "" ,
2023-08-15 09:18:52 +08:00
carType : "" ,
carTypeName : "" ,
2023-07-19 18:12:19 +08:00
datetime : [ '' , '' ] ,
startTime : "" ,
endTime : "" ,
2023-08-15 09:18:52 +08:00
goodsNumber : 0 ,
2023-07-19 18:12:19 +08:00
tjValue : 0 ,
2023-08-15 09:18:52 +08:00
zlValue : 0 ,
editStatus : 0 ,
2023-07-19 18:12:19 +08:00
} ] ,
2023-07-12 13:48:01 +08:00
} )
} ,
fcAdd2 ( index ) {
this . fcUlList [ index ] . fcUlList2 . push ( {
qdValue : "" ,
zdValue : "" ,
2023-08-15 09:18:52 +08:00
carType : "" ,
carTypeName : "" ,
2023-07-19 18:12:19 +08:00
datetime : [ '' , '' ] ,
startTime : "" ,
endTime : "" ,
2023-08-15 09:18:52 +08:00
goodsNumber : 0 ,
2023-07-12 13:48:01 +08:00
tjValue : 0 ,
2023-08-15 09:18:52 +08:00
zlValue : 0 ,
editStatus : 0 ,
2023-07-12 13:48:01 +08:00
} )
} ,
// 翻仓删除
2023-08-18 17:28:11 +08:00
delFc ( item , index ) {
2023-07-24 16:56:46 +08:00
this . fcUlList . splice ( index , 1 )
2023-08-18 17:28:11 +08:00
if ( item . webId != null ) {
item . fcUlList2 . forEach ( v => {
this . fcInfoDelList . push ( v . webId )
} )
this . fcInfoDelList = Array . from ( new Set ( this . fcInfoDelList ) )
}
2023-07-24 16:56:46 +08:00
} ,
2023-08-18 17:28:11 +08:00
delFc2 ( item2 , index , index2 ) {
2023-07-12 13:48:01 +08:00
this . fcUlList [ index ] . fcUlList2 . splice ( index2 , 1 )
2023-08-18 17:28:11 +08:00
if ( item2 . webId != null ) {
this . fcInfoDelList . push ( item2 . webId )
this . fcInfoDelList = Array . from ( new Set ( this . fcInfoDelList ) )
}
2023-07-11 17:29:53 +08:00
} ,
// 取消
cancel ( ) {
2023-07-26 14:34:20 +08:00
uni . setStorageSync ( 'tabsType' , 1 ) ;
2023-07-11 17:29:53 +08:00
uni . navigateTo ( {
2023-07-26 14:34:20 +08:00
url : '/pages/shipWork/mixWork'
2023-07-11 17:29:53 +08:00
} )
} ,
2023-07-19 18:12:19 +08:00
// 上一步
back ( ) {
this . active = this . active - 1
} ,
2023-07-12 13:48:01 +08:00
// 下一步
next ( ) {
this . active = this . active + 1
} ,
2023-07-19 18:12:19 +08:00
// 保存
save ( ) {
2023-08-15 09:18:52 +08:00
let date = new Date ( ) . getTime ( )
let contactId = this . shipObj [ 0 ] . webId
2023-08-18 17:28:11 +08:00
console . log ( contactId )
2023-08-15 09:18:52 +08:00
let webStatus = "0"
let editStatus = 1
if ( this . obj . state == "edit" ) {
// 工班信息
for ( let i = 0 ; i < this . ulList1 . length ; i ++ ) {
if ( this . ulList1 [ i ] . webId != '' && this . ulList1 [ i ] . webId != null ) {
let webDate = api . getDate ( date )
let sql =
` UPDATE workMessageRespList SET vvyId = ' ${ this . hcValue } ',vvyName = ' ${ this . hcTextValue } ',
loadType = '${this.zxValue}' , loadTypeName = '${this.zxTextValue}' , pwcType = '${this.ulList1[i].gbValue}' ,
pwcTypeName = '${this.ulList1[i].gbTextValue}' , workStartTime = '${this.ulList1[i].startTime}' ,
workEndTime = '${this.ulList1[i].endTime}' , webStatus = '${webStatus}' , webDate = '${webDate}' WHERE webId = '${this.ulList1[i].webId}' ; `
this . executeSql ( sql )
for ( let j = 0 ; j < this . ulList1 [ i ] . ulList2 . length ; j ++ ) {
if ( this . ulList1 [ i ] . ulList2 [ j ] . webId != '' && this . ulList1 [ i ] . ulList2 [ j ] . webId != null ) {
let sql2 =
` UPDATE workMessageRespInfoList SET carType = ' ${ this . ulList1 [ i ] . ulList2 [ j ] . carType } ',carTypeName = ' ${ this . ulList1 [ i ] . ulList2 [ j ] . carTypeName } ',
goodsNumber = '${this.ulList1[i].ulList2[j].goodsNumber}' , loadingType = '${this.ulList1[i].ulList2[j].loadingType}' ,
loadingTypeName = '${this.ulList1[i].ulList2[j].loadingTypeName}' , remark = '${this.ulList1[i].ulList2[j].remark}' ,
webStatus = '${webStatus}' , webDate = '${webDate}' WHERE webId = '${this.ulList1[i].ulList2[j].webId}' ; `
this . executeSql ( sql2 )
} else {
let webId2 = uuidv4 ( )
let webDate = api . getDate ( date )
let sql2 = ` insert into workMessageRespInfoList values(' ${ webId2 } ',' ${ this . ulList1 [ i ] . webId } ',' ${ this . ulList1 [ i ] . ulList2 [ j ] . carType } ',
'${this.ulList1[i].ulList2[j].carTypeName}' , '${this.ulList1[i].ulList2[j].goodsNumber}' , '${this.ulList1[i].ulList2[j].loadingType}' ,
'${this.ulList1[i].ulList2[j].loadingTypeName}' , '${this.ulList1[i].ulList2[j].remark}' ,
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' , '${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' ,
'${this.shipInfo.voyageScheduleDataList[0].spmName}' , '${webStatus}' , '${webDate}' ) `
this . executeSql ( sql2 )
}
}
} else {
let webId = uuidv4 ( )
let webDate = api . getDate ( date )
let sql = ` insert into workMessageRespList values(' ${ webId } ',' ${ contactId } ',' ${ this . hcValue } ',
'${this.hcTextValue}' , '${this.zxValue}' , '${this.zxTextValue}' , '${this.ulList1[i].gbValue}' ,
'${this.ulList1[i].gbTextValue}' , '${this.ulList1[i].startTime}' , '${this.ulList1[i].endTime}' ,
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' ,
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' , '${this.shipInfo.voyageScheduleDataList[0].spmName}' ,
'${webStatus}' , '${webDate}' ) `
this . executeSql ( sql )
for ( let j = 0 ; j < this . ulList1 [ i ] . ulList2 . length ; j ++ ) {
if ( this . ulList1 [ i ] . ulList2 [ j ] . webId != '' && this . ulList1 [ i ] . ulList2 [ j ] . webId != null ) {
let sql2 =
` UPDATE workMessageRespInfoList SET carType = ' ${ this . ulList1 [ i ] . ulList2 [ j ] . carType } ',carTypeName = ' ${ this . ulList1 [ i ] . ulList2 [ j ] . carTypeName } ',
goodsNumber = '${this.ulList1[i].ulList2[j].goodsNumber}' , loadingType = '${this.ulList1[i].ulList2[j].loadingType}' ,
loadingTypeName = '${this.ulList1[i].ulList2[j].loadingTypeName}' , remark = '${this.ulList1[i].ulList2[j].remark}' ,
webStatus = '${webStatus}' , webDate = '${webDate}' WHERE webId = '${this.ulList1[i].ulList2[j].webId}' ; `
this . executeSql ( sql2 )
} else {
let webId2 = uuidv4 ( )
let webDate = api . getDate ( date )
let sql2 = ` insert into workMessageRespInfoList values(' ${ webId2 } ',' ${ webId } ',' ${ this . ulList1 [ i ] . ulList2 [ j ] . carType } ',
'${this.ulList1[i].ulList2[j].carTypeName}' , '${this.ulList1[i].ulList2[j].goodsNumber}' , '${this.ulList1[i].ulList2[j].loadingType}' ,
'${this.ulList1[i].ulList2[j].loadingTypeName}' , '${this.ulList1[i].ulList2[j].remark}' ,
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' , '${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' ,
'${this.shipInfo.voyageScheduleDataList[0].spmName}' , '${webStatus}' , '${webDate}' ) `
this . executeSql ( sql2 )
}
}
}
}
// 翻仓信息
for ( let i = 0 ; i < this . fcUlList . length ; i ++ ) {
if ( this . fcUlList [ i ] . webId != null ) {
for ( let j = 0 ; j < this . fcUlList [ i ] . fcUlList2 . length ; j ++ ) {
let webId = uuidv4 ( )
let webDate = api . getDate ( date )
if ( this . fcUlList [ i ] . fcUlList2 [ j ] . editStatus != 0 ) {
let sql =
` UPDATE retallyMessageRespList SET vvyId = ' ${ this . hcValue } ', vvyName = ' ${ this . hcTextValue } ',
retallyType = '${this.fcUlList[i].fcValue}' , retallyTypeName = '${this.fcUlList[i].fcTextValue}' ,
retallyOrigin = '${this.fcUlList[i].fcUlList2[j].qdValue}' , retallyTerminus = '${this.fcUlList[i].fcUlList2[j].zdValue}' ,
retallyStartTime = '${this.fcUlList[i].fcUlList2[j].startTime}' , retallyEndTime = '${this.fcUlList[i].fcUlList2[j].endTime}' ,
carType = '${this.fcUlList[i].fcUlList2[j].carType}' , carTypeName = '${this.fcUlList[i].fcUlList2[j].carTypeName}' ,
goodsNumber = '${this.fcUlList[i].fcUlList2[j].goodsNumber}' , goodsVolume = '${this.fcUlList[i].fcUlList2[j].tjValue}' ,
goodsWeight = '${this.fcUlList[i].fcUlList2[j].zlValue}' , webStatus = '${webStatus}' ,
2023-08-18 17:28:11 +08:00
webDate = '${webDate}' WHERE webId = '${this.fcUlList[i].fcUlList2[j].webId}' ; `
2023-08-15 09:18:52 +08:00
this . executeSql ( sql )
} else {
let sql =
` insert into retallyMessageRespList values(' ${ webId } ',' ${ this . fcUlList [ i ] . contactId } ',' ${ this . hcValue } ',' ${ this . hcTextValue } ',' ${ this . fcUlList [ i ] . fcValue } ',
'${this.fcUlList[i].fcTextValue}' , '${this.fcUlList[i].fcUlList2[j].qdValue}' , '${this.fcUlList[i].fcUlList2[j].zdValue}' ,
'${this.fcUlList[i].fcUlList2[j].startTime}' , '${this.fcUlList[i].fcUlList2[j].endTime}' , '${this.fcUlList[i].fcUlList2[j].carType}' ,
'${this.fcUlList[i].fcUlList2[j].carTypeName}' , '${this.fcUlList[i].fcUlList2[j].goodsNumber}' , '${this.fcUlList[i].fcUlList2[j].tjValue}' ,
'${this.fcUlList[i].fcUlList2[j].zlValue}' , '${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' ,
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' , '${this.shipInfo.voyageScheduleDataList[0].spmName}' ,
'${editStatus}' , '${webStatus}' , '${webDate}' ) `
this . executeSql ( sql )
}
}
} else {
for ( let j = 0 ; j < this . fcUlList [ i ] . fcUlList2 . length ; j ++ ) {
let webId = uuidv4 ( )
let webDate = api . getDate ( date )
let sql =
` insert into retallyMessageRespList values(' ${ webId } ',' ${ contactId } ',' ${ this . hcValue } ',' ${ this . hcTextValue } ',' ${ this . fcUlList [ i ] . fcValue } ',
'${this.fcUlList[i].fcTextValue}' , '${this.fcUlList[i].fcUlList2[j].qdValue}' , '${this.fcUlList[i].fcUlList2[j].zdValue}' ,
'${this.fcUlList[i].fcUlList2[j].startTime}' , '${this.fcUlList[i].fcUlList2[j].endTime}' , '${this.fcUlList[i].fcUlList2[j].carType}' ,
'${this.fcUlList[i].fcUlList2[j].carTypeName}' , '${this.fcUlList[i].fcUlList2[j].goodsNumber}' , '${this.fcUlList[i].fcUlList2[j].tjValue}' ,
'${this.fcUlList[i].fcUlList2[j].zlValue}' , '${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' ,
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' , '${this.shipInfo.voyageScheduleDataList[0].spmName}' ,
'${editStatus}' , '${webStatus}' , '${webDate}' ) `
this . executeSql ( sql )
}
}
}
// 其他信息
let webDate = api . getDate ( date )
let sql =
` UPDATE infoRespList SET vvyId = ' ${ this . hcValue } ', vvyName = ' ${ this . hcTextValue } ', tecNum = ' ${ this . otherObj . jsworker } ',
tecStartTm = '${this.otherObj.startTime}' , tecEndTm = '${this.otherObj.endTime}' , tecWeight = '${this.otherObj.zlValue}' ,
tecVolume = '${this.otherObj.tjValue}' , genNum = '${this.otherObj.ptworker}' ,
genStartTm = '${this.otherObj.startTime2}' , genEndTm = '${this.otherObj.endTime2}' , genWeight = '${this.otherObj.zlValue2}' ,
genVolume = '${this.otherObj.tjValue2}' , auxRemark = '${this.otherObj.describe}' , waitRemark = '${this.otherObj.dgWork}' ,
workRemark = '${this.otherObj.remark}' , webStatus = '${webStatus}' , webDate = '${webDate}' WHERE webId = '${this.otherObj.webId}' ; `
this . executeSql ( sql )
2023-08-18 17:28:11 +08:00
// 删除工班信息
this . shiftDelList . forEach ( v => {
let sql = ` DELETE FROM workMessageRespList WHERE webId = ' ${ v } '; `
this . executeSql ( sql )
} )
// 删除工班详细信息
this . shiftInfoDelList . forEach ( v => {
let sql = ` DELETE FROM workMessageRespInfoList WHERE webId = ' ${ v } '; `
this . executeSql ( sql )
} )
// 删除翻仓信息
this . fcInfoDelList . forEach ( v => {
let sql = ` DELETE FROM retallyMessageRespList WHERE webId = ' ${ v } '; `
this . executeSql ( sql )
} )
2023-08-15 09:18:52 +08:00
} else if ( this . obj . state == "add" ) {
// 工班信息
2023-08-04 17:06:33 +08:00
for ( let i = 0 ; i < this . ulList1 . length ; i ++ ) {
let webId = uuidv4 ( )
let webDate = api . getDate ( date )
let sql = ` insert into workMessageRespList values(' ${ webId } ',' ${ contactId } ',' ${ this . hcValue } ',
'${this.hcTextValue}' , '${this.zxValue}' , '${this.zxTextValue}' , '${this.ulList1[i].gbValue}' ,
'${this.ulList1[i].gbTextValue}' , '${this.ulList1[i].startTime}' , '${this.ulList1[i].endTime}' ,
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' ,
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' , '${this.shipInfo.voyageScheduleDataList[0].spmName}' ,
'${webStatus}' , '${webDate}' ) `
this . executeSql ( sql )
for ( let j = 0 ; j < this . ulList1 [ i ] . ulList2 . length ; j ++ ) {
2023-08-15 09:18:52 +08:00
let webId2 = uuidv4 ( )
2023-08-04 17:06:33 +08:00
let webDate = api . getDate ( date )
2023-08-15 09:18:52 +08:00
let sql2 = ` insert into workMessageRespInfoList values(' ${ webId2 } ',' ${ webId } ',' ${ this . ulList1 [ i ] . ulList2 [ j ] . carType } ',
'${this.ulList1[i].ulList2[j].carTypeName}' , '${this.ulList1[i].ulList2[j].goodsNumber}' , '${this.ulList1[i].ulList2[j].loadingType}' ,
'${this.ulList1[i].ulList2[j].loadingTypeName}' , '${this.ulList1[i].ulList2[j].remark}' ,
2023-08-04 17:06:33 +08:00
'${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' , '${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' ,
'${this.shipInfo.voyageScheduleDataList[0].spmName}' , '${webStatus}' , '${webDate}' ) `
this . executeSql ( sql2 )
}
2023-07-19 18:12:19 +08:00
}
2023-08-15 09:18:52 +08:00
// 翻仓信息
for ( let i = 0 ; i < this . fcUlList . length ; i ++ ) {
for ( let j = 0 ; j < this . fcUlList [ i ] . fcUlList2 . length ; j ++ ) {
let webId = uuidv4 ( )
let webDate = api . getDate ( date )
let sql =
` insert into retallyMessageRespList values(' ${ webId } ',' ${ contactId } ',' ${ this . hcValue } ',' ${ this . hcTextValue } ',' ${ this . fcUlList [ i ] . fcValue } ',
'${this.fcUlList[i].fcTextValue}' , '${this.fcUlList[i].fcUlList2[j].qdValue}' , '${this.fcUlList[i].fcUlList2[j].zdValue}' ,
'${this.fcUlList[i].fcUlList2[j].startTime}' , '${this.fcUlList[i].fcUlList2[j].endTime}' , '${this.fcUlList[i].fcUlList2[j].carType}' ,
'${this.fcUlList[i].fcUlList2[j].carTypeName}' , '${this.fcUlList[i].fcUlList2[j].goodsNumber}' , '${this.fcUlList[i].fcUlList2[j].tjValue}' ,
'${this.fcUlList[i].fcUlList2[j].zlValue}' , '${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' ,
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' , '${this.shipInfo.voyageScheduleDataList[0].spmName}' ,
'${editStatus}' , '${webStatus}' , '${webDate}' ) `
this . executeSql ( sql )
}
}
// 其他信息
let webId = uuidv4 ( )
let webDate = api . getDate ( date )
let sql =
` insert into infoRespList values(' ${ webId } ',' ${ contactId } ',' ${ this . hcValue } ',' ${ this . hcTextValue } ',' ${ this . otherObj . jsworker } ',
'${this.otherObj.startTime}' , '${this.otherObj.endTime}' , '${this.otherObj.zlValue}' , '${this.otherObj.tjValue}' , '${this.otherObj.ptworker}' ,
'${this.otherObj.startTime2}' , '${this.otherObj.endTime2}' , '${this.otherObj.zlValue2}' , '${this.otherObj.tjValue2}' , '${this.otherObj.describe}' ,
'${this.otherObj.dgWork}' , '${this.otherObj.remark}' , '${this.shipInfo.voyageScheduleDataList[0].tradeTypeName}' ,
'${this.shipInfo.voyageScheduleDataList[0].importExportFlagName}' , '${this.shipInfo.voyageScheduleDataList[0].spmName}' ,
'${webStatus}' , '${webDate}' ) `
this . executeSql ( sql )
2023-07-19 18:12:19 +08:00
}
2023-07-26 14:34:20 +08:00
uni . setStorageSync ( 'tabsType' , 1 ) ;
2023-07-19 18:12:19 +08:00
uni . navigateTo ( {
2023-07-26 14:34:20 +08:00
url : '/pages/shipWork/mixWork'
2023-07-19 18:12:19 +08:00
} )
} ,
2023-08-04 17:06:33 +08:00
executeSql ( sql ) {
sqlite . executeSqlCeshi ( sql ) . then ( ( value ) => {
// 在resolve时执行的回调函数
2023-08-15 09:18:52 +08:00
// console.log(value)
2023-08-04 17:06:33 +08:00
} ) . catch ( ( error ) => {
// 在reject时执行的回调函数
console . error ( error ) ;
} ) ;
} ,
2023-08-01 09:32:45 +08:00
onBackPress ( event ) {
uni . setStorageSync ( 'tabsType' , 1 ) ;
uni . navigateTo ( {
url : '/pages/shipWork/mixWork'
} )
return true ;
} ,
2023-07-11 17:29:53 +08:00
}
}
< / script >
< style lang = "less" scoped >
. shiftAdd {
. container {
padding : 30 px 20 px ;
background - color : # fff ;
/deep/ . uni - steps _ _row - title {
font - size : 20 px ;
}
/deep/ . uni - icons {
font - size : 20 px ! important ;
}
/deep/ . uni - steps _ _row - container {
margin - top : 10 px ;
}
. line {
width : 100 % ;
height : 10 px ;
background : # f2f2f2 ;
2023-07-12 13:48:01 +08:00
margin : 20 px 0 ;
2023-07-11 17:29:53 +08:00
}
. ulTop {
width : 100 % ;
padding : 20 px ;
text - align : right ;
border - top : 1 px solid # ccc ;
2023-07-18 17:37:15 +08:00
text {
2023-07-11 17:29:53 +08:00
color : # 2979 ff ;
margin - right : 10 px ;
}
2023-07-11 17:43:29 +08:00
2023-07-18 17:37:15 +08:00
text : nth - of - type ( 2 ) {
2023-07-11 17:43:29 +08:00
color : red ;
}
2023-07-11 17:29:53 +08:00
}
2023-07-12 13:48:01 +08:00
. fcUl {
2023-07-18 17:37:15 +08:00
. li {
2023-07-12 13:48:01 +08:00
border : none ;
margin - bottom : 0 ;
. liTitle {
width : 120 px ;
}
}
}
. fcUl2 {
. liTitle {
width : 120 px ;
}
}
2023-07-18 17:37:15 +08:00
. ul {
2023-07-11 17:29:53 +08:00
display : flex ;
flex - wrap : wrap ;
justify - content : space - between ;
2023-07-12 13:48:01 +08:00
margin - bottom : 20 px ;
2023-07-11 17:29:53 +08:00
2023-07-18 17:37:15 +08:00
. li {
2023-07-11 17:29:53 +08:00
width : 44 % ;
border - top : 1 px solid # ccc ;
border - bottom : 1 px solid # ccc ;
display : flex ;
padding : 10 px 20 px ;
line - height : 35 px ;
margin - bottom : 20 px ;
. required {
color : red ;
margin - right : 5 px ;
}
. liTitle {
min - width : 85 px ;
text - align : right ;
}
/deep/ . uni - numbox {
border : 1 px solid # ccc ;
box - sizing : border - box ;
}
/deep/ . uni - numbox - btns {
border - right : 1 px solid # ccc ;
border - left : 1 px solid # ccc ;
padding : 0 14 px ;
box - sizing : border - box ;
}
/deep/ . uni - numbox _ _value {
width : 100 px ;
height : 35 px ;
line - height : 35 px ;
background - color : # fff ! important ;
}
}
. widthLi {
width : 100 % ;
}
}
. ul2 {
padding : 0 ;
margin - top : 0 ;
2023-07-18 17:37:15 +08:00
. li {
2023-07-11 17:29:53 +08:00
border : none ;
margin - bottom : 0 ;
}
}
2023-07-12 13:48:01 +08:00
. otherWork {
padding : 0 20 px ;
. title {
font - size : 16 px ;
font - weight : bold ;
padding - left : 10 px ;
border - left : 5 px solid # 2979 ff ;
margin - bottom : 20 px ;
}
2023-07-18 17:37:15 +08:00
. ul {
. li {
2023-07-12 13:48:01 +08:00
border : none ;
}
2023-07-18 17:37:15 +08:00
. li : last - child {
2023-07-12 13:48:01 +08:00
width : 100 % ;
}
}
}
2023-07-11 17:29:53 +08:00
. btnList {
display : flex ;
justify - content : center ;
2023-07-12 13:48:01 +08:00
margin - top : 20 px ;
2023-07-11 17:29:53 +08:00
/deep/ . van - button {
margin : 30 px 20 px ;
width : 120 px ;
height : 50 px ;
}
}
}
}
< / style >