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

main
dengyu 4 months ago
parent 5d04184e2c
commit ce94432f58

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

@ -14,6 +14,7 @@
<view class="weui-cells">
<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>
{{receipttype}}
<view class="weui-cell__ft"><button bindtap="submitBill">提交</button></view>
</view>
未提交图片:

@ -17,6 +17,7 @@ Page({
DocList: [],
FeeList: [],
FuelList: [],
FHFEEGroup:[],
JYZList: ['中石油', '中石化', '金盾', '大象']
},
histype: "",
@ -169,22 +170,23 @@ Page({
})
},
vmodel_fee(e) {
console.log(e)
console.log(e, 11)
var that = this;
var gid = e.currentTarget.dataset.item;
//that.data.headData.FeeList[e.currentTarget.id]=e.detail.value;
that.data.headData.FeeList.forEach((x) => {
if (x.GID == gid) {
if (e.currentTarget.id == 'FEENAME') {
x.F_NO = e.detail.value;
}
if (e.currentTarget.id == 'AMOUNT') {
x.AMOUNT = e.detail.value;
that.data.headData.FHFEEGroup.forEach((x) => {
x.FeeList.forEach(i => {
if (i.GID == gid) {
console.log(i)
if (e.currentTarget.id == 'FEENAME') {
i.F_NO = e.detail.value;
}
if (e.currentTarget.id == 'AMOUNT') {
i.AMOUNT = e.detail.value;
}
}
}
})
})
this.setData({
headData: that.data.headData
@ -240,11 +242,12 @@ Page({
},
AddFeeClick(res) {
console.log(res)
const type = res.currentTarget.dataset.type
var that = this;
var headData = this.data.headData;
var GID = this.getGuid();
headData.FeeList.push({
headData.FHFEEGroup[type].FeeList.push({
GID: GID
});
this.setData({
@ -258,33 +261,33 @@ Page({
var newFeeList = [];
var openid = getApp().globalData.baseInfo.OPENID;
that.data.headData.FeeList.forEach((x) => {
if (x.GID == gid) {
var jsonstr = JSON.stringify({
openid: openid,
formname: '删除费用',
headData: that.data.headData,
FEEID: 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.FHFEEGroup.forEach((x) => {
x.FeeList.forEach(i => {
if (i.GID == gid) {
var jsonstr = JSON.stringify({
openid: openid,
formname: '删除费用',
headData: that.data.headData,
FEEID: 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(i);
}
})
})
that.data.headData.FeeList = newFeeList;
this.setData({
@ -404,8 +407,11 @@ Page({
// console.log("触发查询附件");
// console.log(e);
// console.log("e_end");
console.log(e.currentTarget.dataset.receipttype);
var receipttype=e.currentTarget.dataset.receipttype;
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) {

@ -73,9 +73,35 @@
<view class="customer-name">提交状态:{{headData.TASKSTATUS}} </view>
<!--
<view>费用列表</view>-->
<button type="default" size="default" loading="{{loading}}" plain="{{plain}}"
disabled="{{disabled}}" bindtap="AddFeeClick" hover-class="other-button-hover"> 添加费用 </button>
<view class="jiayouList" wx:for="{{headData.FeeList}}" wx:key="item" data-gid="{{item.GID}}">
<!-- <button type="default" size="default" loading="{{loading}}" plain="{{plain}}"
disabled="{{disabled}}" bindtap="AddFeeClick" hover-class="other-button-hover"> 添加费用 </button> -->
<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" >
<picker style="font-weight: bold;font-size: 16px;width: 200px;"
bindchange="vmodel_fee" id="FEENAME"
@ -95,30 +121,30 @@
</view>
<button type="default" size="mini" loading="{{loading}}" plain="{{plain}}" disabled="{{disabled}}"
bindtap="showDocList_Detail" data-rgid="{{item.GID}}" hover-class="other-button-hover"> 拍照上传 </button>
</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='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>
<picker bindchange="handleSelectType" data-index="{{idx}}" value="{{JYindex}}" range="{{headData.JYZList}}">
<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:'请选择'}}
</view>
</picker>
<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;"
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 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;"
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 style="display: flex;align-items: center;">
<label class="weui-label" style="font-weight: bold;font-size: 14px;text-align: right;">备注:</label>
@ -166,6 +192,9 @@
</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>

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