diff --git a/app.js b/app.js index 2790cfd..253371b 100644 --- a/app.js +++ b/app.js @@ -23,8 +23,8 @@ App({ this.globalData = { - //serverUrl: 'http://localhost:10200/Dispatch/WxApp', - serverUrl: 'https://trans.qzfanghe.com/Dispatch/WxApp', + serverUrl: 'http://localhost:10200/Dispatch/WxApp', + //serverUrl: 'https://trans.qzfanghe.com/Dispatch/WxApp', baseInfo: null, detailInfo:null diff --git a/pages/INFO_FILES/INFO_FILES.js b/pages/INFO_FILES/INFO_FILES.js index 6eaf038..086aeec 100644 --- a/pages/INFO_FILES/INFO_FILES.js +++ b/pages/INFO_FILES/INFO_FILES.js @@ -11,6 +11,7 @@ Page({ upFiles: [], upResult:[], gid:"", + r_gid:"", homeurl:"", picurl:"" }, @@ -19,8 +20,10 @@ Page({ * 生命周期函数--监听页面加载 */ onLoad: function (options) { + //console.log(options); this.setData({ gid: options.gid + ,r_gid:options.r_gid }) @@ -79,13 +82,16 @@ Page({ var that = this; var openid=getApp().globalData.baseInfo.OPENID; var gid=this.data.gid; + var r_gid=this.data.r_gid; var jsonstr=JSON.stringify( { openid:openid, formname:'司机上传附件', - GId:gid + GId:gid, + R_GID:r_gid } ); + console.log(jsonstr); wx.request({ url: getApp().globalData.serverUrl + '/FHDriverInterface', header: {'content-type': 'application/x-www-form-urlencoded'}, @@ -94,7 +100,7 @@ Page({ jsonstr }, success: function (r) { - console.log(r); + //console.log(r); that.setData({ dataList: r.data.Data }) @@ -114,7 +120,7 @@ Page({ maxDuration: 30, camera: 'back', success(res) { - console.log(res) + //console.log(res) // var files = that.data.upFiles; // files.push(res.tempFilePaths[0]) // that.setData({ @@ -148,10 +154,11 @@ Page({ name: 'file', formData: { gid: that.data.gid, + r_gid: that.data.r_gid, openid: openid }, success(res) { - console.log(res) + //console.log(res) if (res.statusCode == 200) { that.query(); wx.hideLoading(); @@ -196,10 +203,11 @@ Page({ jsonstr }, success: function (r) { - console.log(r); - that.setData({ - dataList: r.data.Data - }) + //console.log(r); + // that.setData({ + // dataList: r.data.Data + // }) + that.query(); } }) diff --git a/pages/INFO_FILES/INFO_FILES.wxml b/pages/INFO_FILES/INFO_FILES.wxml index 88aa228..001f54f 100644 --- a/pages/INFO_FILES/INFO_FILES.wxml +++ b/pages/INFO_FILES/INFO_FILES.wxml @@ -29,9 +29,8 @@ - - + 删除 diff --git a/pages/WORKDETAIL/WORKDETAIL.js b/pages/WORKDETAIL/WORKDETAIL.js index d2d5c25..133315c 100644 --- a/pages/WORKDETAIL/WORKDETAIL.js +++ b/pages/WORKDETAIL/WORKDETAIL.js @@ -89,6 +89,7 @@ Page({ this.data.headData.FuelList.push({ JYTYPE: '' + //,JYCOUNT:1 }) this.setData({ headData: this.data.headData @@ -290,6 +291,46 @@ Page({ headData: that.data.headData }) }, + DelFuelClick(e) { + + //console.log(e); + var that = this; + var gid = e.currentTarget.dataset.item; + var newFeeList = []; + var openid = getApp().globalData.baseInfo.OPENID; + + that.data.headData.FuelList.forEach((x) => { + if (x.GID == gid) { + //console.log('删除加油1'); + var jsonstr = JSON.stringify({ + openid: openid, + formname: '删除加油', + headData: that.data.headData, + GID: gid + }); + wx.request({ + url: getApp().globalData.serverUrl + '/FHDriverInterface', + header: { + 'content-type': 'application/x-www-form-urlencoded' + }, + method: 'POST', + data: { + jsonstr + }, + success: function (r) { + //that.query(); + //wx.hideLoading(); + } + }) + } else { + newFeeList.push(x); + } + }) + that.data.headData.FuelList = newFeeList; + this.setData({ + headData: that.data.headData + }) + }, SubmitClick(res) { wx.showLoading({ title: '请稍候' @@ -357,12 +398,38 @@ Page({ }, showDocList(e) { + + var that = this; + var gid = this.data.gid; + // console.log("触发查询附件"); + // console.log(e); + // console.log("e_end"); + wx.navigateTo({ + url: '/pages/INFO_FILES/INFO_FILES?gid=' + gid+'&r_gid=' + }) + }, + showDocList_Detail(e) { + //显示费用的图片。用receipt_doc.r_gid来关联费用或者加油ID var that = this; var gid = this.data.gid; + // console.log("触发查询附件"); + // console.log(e); + // console.log("e_end"); + console.log(e.currentTarget.dataset.rgid); + + if(!e.currentTarget.dataset.rgid){ + wx.showToast({ + icon: 'none', + title: '请先执行保存', + }); + return; + } + var r_gid=e.currentTarget.dataset.rgid; wx.navigateTo({ - url: '/pages/INFO_FILES/INFO_FILES?gid=' + gid + url: '/pages/INFO_FILES/INFO_FILES?gid=' + gid+'&r_gid='+r_gid }) }, + // bindPickerChange: function(e) { // //console.log('picker发送选择改变,携带值为', e.detail.value) // this.setData({ diff --git a/pages/WORKDETAIL/WORKDETAIL.wxml b/pages/WORKDETAIL/WORKDETAIL.wxml index 90493fa..6dc4b46 100644 --- a/pages/WORKDETAIL/WORKDETAIL.wxml +++ b/pages/WORKDETAIL/WORKDETAIL.wxml @@ -71,45 +71,54 @@ --> 提交状态:{{headData.TASKSTATUS}} - 费用列表 + - - - - - - 费用名称:[{{headData.FeeNameList[item.F_NO]}}] - - - - + + + + + 费用:{{headData.FeeNameList[item.F_NO]}} + + + + + + - 加油记录 - + + + 删除 - 加油类型: + 加油/维修类型: {{item.JYTYPE?item.JYTYPE:'请选择'}} + + - - + + - - + + @@ -118,6 +127,9 @@ 现金 + + @@ -138,19 +150,22 @@ 封号:{{item.SEALNO}} - + + + +--> + \ No newline at end of file