方合小程序,增加费用的分组,图片

main
dengyu 4 months ago
parent 5d04184e2c
commit ce94432f58

@ -12,6 +12,7 @@ Page({
upResult:[], upResult:[],
gid:"", gid:"",
r_gid:"", r_gid:"",
receipttype:"",
homeurl:"", homeurl:"",
picurl:"" picurl:""
}, },
@ -24,6 +25,7 @@ Page({
this.setData({ this.setData({
gid: options.gid gid: options.gid
,r_gid:options.r_gid ,r_gid:options.r_gid
,receipttype:options.receipttype
}) })
@ -83,12 +85,14 @@ Page({
var openid=getApp().globalData.baseInfo.OPENID; var openid=getApp().globalData.baseInfo.OPENID;
var gid=this.data.gid; var gid=this.data.gid;
var r_gid=this.data.r_gid; var r_gid=this.data.r_gid;
var receipttype=this.data.receipttype;
var jsonstr=JSON.stringify( var jsonstr=JSON.stringify(
{ {
openid:openid, openid:openid,
formname:'司机上传附件', formname:'司机上传附件',
GId:gid, GId:gid,
R_GID:r_gid R_GID:r_gid,
receipttype:receipttype
} }
); );
console.log(jsonstr); console.log(jsonstr);
@ -156,6 +160,7 @@ Page({
formData: { formData: {
gid: that.data.gid, gid: that.data.gid,
r_gid: that.data.r_gid, r_gid: that.data.r_gid,
receipttype:that.data.receipttype,
openid: openid openid: openid
}, },
success(res) { success(res) {

@ -14,6 +14,7 @@
<view class="weui-cells"> <view class="weui-cells">
<view class="weui-cell" style="background:none;margin-bottom:5px !important;"> <view class="weui-cell" style="background:none;margin-bottom:5px !important;">
<view class="increase weui-cell__bd" bindtap="chooseFile"><image src="../../images/increase.png"></image>拍照</view> <view class="increase weui-cell__bd" bindtap="chooseFile"><image src="../../images/increase.png"></image>拍照</view>
{{receipttype}}
<view class="weui-cell__ft"><button bindtap="submitBill">提交</button></view> <view class="weui-cell__ft"><button bindtap="submitBill">提交</button></view>
</view> </view>
未提交图片: 未提交图片:

@ -17,6 +17,7 @@ Page({
DocList: [], DocList: [],
FeeList: [], FeeList: [],
FuelList: [], FuelList: [],
FHFEEGroup:[],
JYZList: ['中石油', '中石化', '金盾', '大象'] JYZList: ['中石油', '中石化', '金盾', '大象']
}, },
histype: "", histype: "",
@ -169,22 +170,23 @@ Page({
}) })
}, },
vmodel_fee(e) { vmodel_fee(e) {
console.log(e) console.log(e, 11)
var that = this; var that = this;
var gid = e.currentTarget.dataset.item; var gid = e.currentTarget.dataset.item;
//that.data.headData.FeeList[e.currentTarget.id]=e.detail.value; //that.data.headData.FeeList[e.currentTarget.id]=e.detail.value;
that.data.headData.FeeList.forEach((x) => { that.data.headData.FHFEEGroup.forEach((x) => {
x.FeeList.forEach(i => {
if (x.GID == gid) { if (i.GID == gid) {
console.log(i)
if (e.currentTarget.id == 'FEENAME') { if (e.currentTarget.id == 'FEENAME') {
x.F_NO = e.detail.value; i.F_NO = e.detail.value;
} }
if (e.currentTarget.id == 'AMOUNT') { if (e.currentTarget.id == 'AMOUNT') {
x.AMOUNT = e.detail.value; i.AMOUNT = e.detail.value;
}
} }
} })
}) })
this.setData({ this.setData({
headData: that.data.headData headData: that.data.headData
@ -240,11 +242,12 @@ Page({
}, },
AddFeeClick(res) { AddFeeClick(res) {
console.log(res)
const type = res.currentTarget.dataset.type
var that = this; var that = this;
var headData = this.data.headData; var headData = this.data.headData;
var GID = this.getGuid(); var GID = this.getGuid();
headData.FeeList.push({ headData.FHFEEGroup[type].FeeList.push({
GID: GID GID: GID
}); });
this.setData({ this.setData({
@ -258,33 +261,33 @@ Page({
var newFeeList = []; var newFeeList = [];
var openid = getApp().globalData.baseInfo.OPENID; var openid = getApp().globalData.baseInfo.OPENID;
that.data.headData.FeeList.forEach((x) => { that.data.headData.FHFEEGroup.forEach((x) => {
x.FeeList.forEach(i => {
if (x.GID == gid) { if (i.GID == gid) {
var jsonstr = JSON.stringify({
var jsonstr = JSON.stringify({ openid: openid,
openid: openid, formname: '删除费用',
formname: '删除费用', headData: that.data.headData,
headData: that.data.headData, FEEID: gid
FEEID: gid });
}); wx.request({
wx.request({ url: getApp().globalData.serverUrl + '/FHDriverInterface',
url: getApp().globalData.serverUrl + '/FHDriverInterface', header: {
header: { 'content-type': 'application/x-www-form-urlencoded'
'content-type': 'application/x-www-form-urlencoded' },
}, method: 'POST',
method: 'POST', data: {
data: { jsonstr
jsonstr },
}, success: function (r) {
success: function (r) { that.query();
//that.query(); //wx.hideLoading();
//wx.hideLoading(); }
} })
}) } else {
} else { newFeeList.push(i);
newFeeList.push(x); }
} })
}) })
that.data.headData.FeeList = newFeeList; that.data.headData.FeeList = newFeeList;
this.setData({ this.setData({
@ -404,8 +407,11 @@ Page({
// console.log("触发查询附件"); // console.log("触发查询附件");
// console.log(e); // console.log(e);
// console.log("e_end"); // console.log("e_end");
console.log(e.currentTarget.dataset.receipttype);
var receipttype=e.currentTarget.dataset.receipttype;
wx.navigateTo({ wx.navigateTo({
url: '/pages/INFO_FILES/INFO_FILES?gid=' + gid+'&r_gid=' url: '/pages/INFO_FILES/INFO_FILES?gid=' + gid+'&receipttype='+receipttype+'&r_gid='
}) })
}, },
showDocList_Detail(e) { showDocList_Detail(e) {

@ -73,9 +73,35 @@
<view class="customer-name">提交状态:{{headData.TASKSTATUS}} </view> <view class="customer-name">提交状态:{{headData.TASKSTATUS}} </view>
<!-- <!--
<view>费用列表</view>--> <view>费用列表</view>-->
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}" <!-- <button type="default" size="default" loading="{{loading}}" plain="{{plain}}"
disabled="{{disabled}}" bindtap="AddFeeClick" hover-class="other-button-hover"> 添加费用 </button> disabled="{{disabled}}" bindtap="AddFeeClick" hover-class="other-button-hover"> 添加费用 </button> -->
<view class="jiayouList" wx:for="{{headData.FeeList}}" wx:key="item" data-gid="{{item.GID}}"> <view class="jiayouList" wx:for="{{headData.FHFEEGroup}}" wx:for-index="index" wx:key="index" wx:for-item="item">
<view>
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}"
disabled="{{disabled}}" bindtap="AddFeeClick" data-type="{{index}}" hover-class="other-button-hover"> 添加{{item.FEEGROUP}} </button></view>
<view wx:for="{{item.FeeList}}" wx:key="row.GID" wx:for-item="row">
<view class="fee-title">
<picker style="font-weight: bold;font-size: 16px;width: 200px;"
bindchange="vmodel_fee" id="FEENAME"
data-item="{{row.GID}}"
value="{{row.F_NO}}" range="{{item.FeeNameList}}">
<view class="picker">
<text wx:if="{{item.FeeNameList[row.F_NO]}}"> {{item.FeeNameList[row.F_NO]}}</text> <text wx:else>请选择费用名</text>
</view>
</picker>
<input class="number" id="AMOUNT" style="font-weight: bold;font-size: 18px;"
value="{{row.AMOUNT}}" data-item="{{row.GID}}" bindinput="vmodel_fee" placeholder="请输入金额" />
<button type="mini" size="mini" style="font-size: 16px;width: 130px;"
loading="{{loading}}" plain="{{plain}}" data-item="{{row.GID}}"
disabled="{{disabled}}" bindtap="DelFeeClick" hover-class="other-button-hover">
<image style="font-size: 10px;width: 12px;height: 12px;" src="../../images/delete.png"></image>
删除 </button>
</view>
<button type="default" size="mini" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}"
bindtap="showDocList_Detail" data-rgid="{{row.GID}}" hover-class="other-button-hover"> 拍照上传 </button>
</view>
</view>
<!-- <view class="jiayouList" wx:for="{{headData.FeeList}}" wx:key="item" data-gid="{{item.GID}}">
<view class="weui-cell" > <view class="weui-cell" >
<picker style="font-weight: bold;font-size: 16px;width: 200px;" <picker style="font-weight: bold;font-size: 16px;width: 200px;"
bindchange="vmodel_fee" id="FEENAME" bindchange="vmodel_fee" id="FEENAME"
@ -95,30 +121,30 @@
</view> </view>
<button type="default" size="mini" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" <button type="default" size="mini" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}"
bindtap="showDocList_Detail" data-rgid="{{item.GID}}" hover-class="other-button-hover"> 拍照上传 </button> bindtap="showDocList_Detail" data-rgid="{{item.GID}}" hover-class="other-button-hover"> 拍照上传 </button>
</view> </view> -->
<!-- <!--
<view>加油记录</view>--> <view>加油记录</view>-->
<button type="primary" size="default" plain="{{plain}}" bindtap="handleAddjiayou"> 添加加油/维修 </button> <button type="primary" size="default" plain="{{plain}}" bindtap="handleAddjiayou"> 添加加油 </button>
<view class="jiayouList"> <view class="jiayouList">
<view class='jiayouItem' wx:for-index="idx" wx:for="{{headData.FuelList}}" wx:key="item"> <view class='jiayouItem' wx:for-index="idx" wx:for="{{headData.FuelList}}" wx:key="item">
<view class="delete-btn" style="text-align: right;" bindtap="DelFuelClick" data-item="{{item.GID}}"><image style="font-weight: bold;font-size: 10px;width: 12px;height: 12px;" src="../../images/delete.png"></image>删除</view> <view class="delete-btn" style="text-align: right;" bindtap="DelFuelClick" data-item="{{item.GID}}"><image style="font-weight: bold;font-size: 10px;width: 12px;height: 12px;" src="../../images/delete.png"></image>删除</view>
<picker bindchange="handleSelectType" data-index="{{idx}}" value="{{JYindex}}" range="{{headData.JYZList}}"> <picker bindchange="handleSelectType" data-index="{{idx}}" value="{{JYindex}}" range="{{headData.JYZList}}">
<view class="picker"> <view class="picker">
<text style="font-weight: bold;font-size: 14px;width: 136px;text-align: right;display: inline-block;">加油/维修类型:</text> <text style="font-weight: bold;font-size: 14px;width: 136px;text-align: right;display: inline-block;">加油类型:</text>
{{item.JYTYPE?item.JYTYPE:'请选择'}} {{item.JYTYPE?item.JYTYPE:'请选择'}}
</view> </view>
</picker> </picker>
<view style="display: flex;margin:5px 0px;"> <view style="display: flex;margin:5px 0px;">
<label class="weui-label" style="font-weight: bold;font-size: 14px;width: 145px;text-align: right;">加油(气/维修)量:</label> <label class="weui-label" style="font-weight: bold;font-size: 14px;width: 145px;text-align: right;">加油(气)量:</label>
<input type="digit" style="font-weight: bold;font-size: 18px;" <input type="digit" style="font-weight: bold;font-size: 18px;"
bindinput="handleInput" data-index="{{idx}}" data-type='JYCOUNT' value="{{item.JYCOUNT}}" placeholder="请输入加油(气/维修)量" /> bindinput="handleInput" data-index="{{idx}}" data-type='JYCOUNT' value="{{item.JYCOUNT}}" placeholder="请输入加油(气)量" />
</view> </view>
<view style="display: flex;"> <view style="display: flex;">
<label class="weui-label" style="font-weight: bold;font-size: 14px;width: 145px;text-align: right;">加油(气/维修)金额:</label> <label class="weui-label" style="font-weight: bold;font-size: 14px;width: 145px;text-align: right;">加油(气)金额:</label>
<input type="digit" style="font-weight: bold;font-size: 18px;" <input type="digit" style="font-weight: bold;font-size: 18px;"
bindinput="handleInput" data-index="{{idx}}" data-type='JYAMOUNT' value="{{item.JYAMOUNT}}" placeholder="请输入加油(气/维修)金额" /> bindinput="handleInput" data-index="{{idx}}" data-type='JYAMOUNT' value="{{item.JYAMOUNT}}" placeholder="请输入加油(气)金额" />
</view> </view>
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<label class="weui-label" style="font-weight: bold;font-size: 14px;text-align: right;">备注:</label> <label class="weui-label" style="font-weight: bold;font-size: 14px;text-align: right;">备注:</label>
@ -166,6 +192,9 @@
</view> </view>
--> -->
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="showDocList" hover-class="other-button-hover"> 拍照上传 </button> <button type="default" size="default" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="showDocList" hover-class="other-button-hover" data-receipttype="提空照片"> 提空照片 </button>
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="showDocList" hover-class="other-button-hover" data-receipttype="装货照片"> 装货照片 </button>
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="showDocList" hover-class="other-button-hover" data-receipttype="修改照片"> 修改照片 </button>
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}" bindtap="showDocList" hover-class="other-button-hover" data-receipttype="入库照片"> 入库照片 </button>
</view> </view>
</view> </view>

@ -14,3 +14,8 @@
background: rgb(226, 225, 225); background: rgb(226, 225, 225);
padding: 5px; padding: 5px;
} }
.fee-title {
display: flex;
margin: 50rpx 0;
}
Loading…
Cancel
Save