From 178d0ee433ecee57bbd57804cc29c593f3de7829 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期六, 02 十二月 2023 11:00:15 +0800
Subject: [PATCH] #
---
pages/business/goBusiness/modiReimburseOnlineDetl.vue | 203 +++++++++++++++++++++++++++++---------------------
1 files changed, 116 insertions(+), 87 deletions(-)
diff --git a/pages/business/goBusiness/modiReimburseOnlineDetl.vue b/pages/business/goBusiness/modiReimburseOnlineDetl.vue
index d26d288..e02f58b 100644
--- a/pages/business/goBusiness/modiReimburseOnlineDetl.vue
+++ b/pages/business/goBusiness/modiReimburseOnlineDetl.vue
@@ -6,24 +6,16 @@
<uni-nav-bar left-icon="left" :title="title" @clickLeft="back" @clickRight="scan" :fixed="true"
:border="false" rightWidth="160rpx" leftWidth="160rpx"
>
- <!-- <block slot="right">
- <view class="city">
- <view>
- <text class="uni-nav-bar-text">{{user.username}}</text>
- </view>
- <uni-icons type="arrowdown" color="#333333" size="20" />
- </view>
- </block> -->
</uni-nav-bar>
<view class="container">
<view style="height: 16rpx;"></view>
<view class="card" v-for="(item,index) in form">
- <view class="card-select" v-show="item.inputType != 'table'" style="width: 100%;">
+ <view class="card-select" v-show="item.inputType != 'table' && !item.hide" style="width: 100%;">
<view class="flex">
<view class="card-required" v-show="item.required">*</view>
<view >{{item.name}}</view>
</view>
- <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨椤圭洰" v-model="orderId"
+ <uni-combox :candidates="orderIds" placeholder="璇烽�夋嫨椤圭洰" v-model="item.value"
@input="getOrderId()" v-if="item.inputType == 'chose'">
</uni-combox>
<view class="flex">
@@ -53,8 +45,12 @@
<tr v-for="(item,index) in tableData">
<td class="scroll-item" v-for="(subitem,i) in table">
<view class="item-content" v-if="subitem.type != 'options'">
- <input type="text" v-model="item[subitem.type]">
+ <input type="text" v-model="item[subitem.type]">
</view>
+
+ <!-- <view class="item-content" v-if="subitem.type != 'options' && !subitem.isInput">
+ <text>{{item[subitem.type]}}</text> <text v-if="subitem.type == 'taxRate' || subitem.type == 'reimbursementRatio' ">%</text>
+ </view> -->
<view v-if="subitem.type == 'options'" style="color: red;" @click="delItem(index)">鍒犻櫎</view>
</td>
@@ -83,8 +79,8 @@
</view>
- <u-picker :show="reimburseId" :columns="reimburseIds" @confirm="reimburseIdConfirm"></u-picker>
- <u-picker :show="checkData" :columns="checkDatas" @confirm="checkDataConfirm"></u-picker>
+ <u-picker :show="reimburseId" :columns="reimburseIds" @confirm="reimburseIdConfirm" @cancel="cancel"></u-picker>
+ <u-picker :show="checkData" :columns="checkDatas" @confirm="checkDataConfirm" @cancel="cancel"></u-picker>
<view>
<!-- 鏅�氬脊绐� -->
@@ -120,32 +116,37 @@
title: '淇敼鎶ラ攢瀹℃壒',
radiolist2: [{
name: '椁愯垂',
+ id: 1,
disabled: false
},
{
name: '浣忓璐�',
+ id: 2,
disabled: false
},
{
name: '杞﹁垂',
+ id: 3,
disabled: false
}, {
name: '娌硅垂',
+ id: 4,
disabled: false
}, {
name: '鍏朵粬',
+ id: 5,
disabled: false
}
],
- radiovalue2: '椁愯垂',
+ radiovalue2: '',
form: [
- {name: '椤圭洰鍚�',placeholder: '璇烽�夋嫨',inputType: 'chose',type: 'orderId',value: '',submitVal: ''},
+ {name: '椤圭洰鍚�',placeholder: '璇烽�夋嫨',inputType: 'chose',type: 'orderId',value: '',submitVal: '',hide: true},
{name: '鎶ラ攢绫诲瀷',placeholder: '璇烽�夋嫨',required:true,inputType: 'select',type: 'reimburseId',value: '',submitVal: ''},
{name: '鏄惁鍐茶处',placeholder: '璇烽�夋嫨',required:true,inputType: 'select',type: 'checkData',value: '',submitVal: ''},
{name: '鎶ラ攢鏄庣粏',placeholder: '璇烽�夋嫨',inputType: 'table'}
],
table: [
- {name:'浜嬬敱',type: 'occupation'},
+ {name:'浜嬬敱',type: 'occupation',isInput:true},
{name:'璐圭敤绫诲瀷',type: 'expenseType$'},
{name:'绋庣巼',type: 'taxRate'},
{name:'鏈◣鏈竵閲戦',type: 'untaxedAmountInLocalCurrency'},
@@ -164,46 +165,11 @@
{name:'鎿嶄綔',type: 'options'}
],
tableData: [
- {
- occupation: 'CRMREIMBURSE1699507854268',
- expenseType$: '1',
- taxRate: '0.0',
- untaxedAmountInLocalCurrency: '1.1',
- untaxedAmount: '1.3',
- taxAmount: 'aaa',
- invoiceValue: '213',
- invoiceAmountInLocalCurrency: '123213',
- reimbursementRatio: '0.0',
- reimbursementAmount: 11,
- reimbursementAmountInLocalCurrency:12,
- cashierConfirmationAmount: 123,
- userId$: '123',
- deptId$: '璐㈠姟閮�',
- updateTime: '2023-11-11',
- updateUserName: 'name'
- },
- {
- occupation: '璇烽�夋嫨',
- expenseType$: '1',
- taxRate: '0.0',
- untaxedAmountInLocalCurrency: '1.1',
- untaxedAmount: '1.3',
- taxAmount: 'aaa',
- invoiceValue: '213',
- invoiceAmountInLocalCurrency: 'CRMREIMBURSE1699507854268',
- reimbursementRatio: '0.0',
- reimbursementAmount: 11,
- reimbursementAmountInLocalCurrency:12,
- cashierConfirmationAmount: 123,
- userId$: '123',
- deptId$: '璐㈠姟閮�',
- updateTime: '2023-11-11',
- updateUserName: 'name'
- },
],
dataRule: [
{occupation: ''}
],
+ reimburseId2: 0,
reimburseId: false,
reimburseIds: [['椤圭洰鏈畬鎴�','椤圭洰宸插畬鎴愬湪璐ㄤ繚鏈熷唴','闈為」鐩瀷鎶ラ攢','鍏朵粬']],
checkData: false,
@@ -214,36 +180,60 @@
orderIdList: [],
newDetl: {
occupation: '',
- expenseType$: '1',
- taxRate: '0.0',
- untaxedAmountInLocalCurrency: '1.1',
- untaxedAmount: '1.3',
- taxAmount: 'aaa',
- invoiceValue: '213',
- invoiceAmountInLocalCurrency: '123213',
- reimbursementRatio: '0.0',
- reimbursementAmount: 11,
- reimbursementAmountInLocalCurrency:12,
- cashierConfirmationAmount: 123,
- userId$: '123',
- deptId$: '璐㈠姟閮�',
- updateTime: '2023-11-11',
- updateUserName: 'name'
+ expenseType$: '',
+ expenseType: null,
+ taxRate: 0,
+ untaxedAmountInLocalCurrency: 0,
+ untaxedAmount: 0,
+ taxAmount: 0,
+ invoiceValue: 0,
+ invoiceAmountInLocalCurrency: 0,
+ reimbursementRatio: 0,
+ reimbursementAmount: 0,
+ reimbursementAmountInLocalCurrency:0,
+ cashierConfirmationAmount: 0,
+ userId$: '',
+ deptId$: '',
+ updateTime: '',
+ updateUserName: ''
},
+ fixtype: 'modi',
+ businessId: 0
}
},
onLoad(option) {
let _this = this
+ this.getOrderId('')
_this.list = []
const eventChannel = this.getOpenerEventChannel();
eventChannel.on('reimburseOnlineDetl', function(data) {
+ console.log(data);
if (data.data == 'add') {
_this.title = '娣诲姞鎶ラ攢瀹℃壒'
+ _this.fixtype = 'add'
+ _this.form[0].hide = false
}
- console.log(data)
- console.log(_this.title)
+ if (data.data == 'modi') {
+ _this.form[1].value = data.detl.list.templateName
+ _this.reimburseId2 = data.detl.list.id
+ for (let k in _this.reimburseIds[0]) {
+ if (_this.reimburseIds[0][k] == data.detl.list.templateName) {
+ _this.form[1].submitVal = k
+ }
+ }
+ _this.form[2].value = data.detl.list.checkData
+ _this.form[0].value = data.detl.list.orderId$
+ _this.getOrderId(data.detl.list.orderId$)
+ _this.tableData = data.detl.list.detl
+ }
+ // 鍑哄樊鐢宠鎶ラ攢
+ if (data.data == 'add2') {
+ _this.title = '娣诲姞鎶ラ攢瀹℃壒'
+ _this.fixtype = 'add2'
+ _this.businessId = data.detl.id
+ }
})
- this.getOrderId('')
+
},
methods: {
addDetl(type) {
@@ -254,14 +244,16 @@
popChange(n) {
// var detl=JSON.parse(JSON.stringify(this.newDetl)); // 鐗涢��
let detl = {...this.newDetl} // 鐗涢��
- console.log('groupChange', n);
- console.log(this.radiovalue2);
detl.expenseType$ = this.radiovalue2
+ for (let k in this.radiolist2) {
+ if (this.radiolist2[k].name == this.radiovalue2) {
+ detl.expenseType = this.radiolist2[k].id
+ }
+ }
this.tableData.push(detl)
this.$refs.popup.close()
},
radioChange(n) {
- console.log('radioChange', n);
},
showPicker(e) {
switch(e) {
@@ -304,18 +296,14 @@
this.tableData.splice(index,1)
},
reimburseIdConfirm(e) {
- console.log('confirm', e)
this.form[1].value = e.value[0]
this.form[1].submitVal = e.indexs[0]
this.reimburseId = false
- console.log(this.form);
},
checkDataConfirm(e) {
- console.log('confirm', e)
this.form[2].value = e.value[0]
this.form[2].submitVal = e.indexs[0]
this.checkData = false
- console.log(this.form);
},
// 琛ㄥ崟鎻愪氦
submit() {
@@ -329,8 +317,9 @@
]
}
+
for (let element of this.orderIdList) {
- if(element.value == this.orderId) {
+ if(element.value == this.form[0].value) {
param.orderId = element.id + ''
}
}
@@ -342,13 +331,8 @@
param.checkData = k.value
}
}
- console.log(this.form);
- console.log(param);
+ param.reimburseId = this.reimburseId2
param.reimburseOnlineDetls = this.tableData
- if (param.reimburseId == null || param.reimburseId === '') {
- uni.showToast({title: '鎶ラ攢绫诲瀷涓嶈兘涓虹┖', icon: "none", position: 'top'})
- return
- }
if (param.checkData == '') {
uni.showToast({title: '鏄惁鍐茶处涓嶈兘涓虹┖', icon: "none", position: 'top'})
return
@@ -357,11 +341,56 @@
uni.showToast({title: '璇锋坊鍔犳姤閿�鏄庣粏', icon: "none", position: 'top'})
return
}
- // console.log(this.orderIdList);
- // console.log(this.orderIds);
console.log(param);
+ if (this.fixtype == 'add') {
+ this.formAdd(param)
+ } else if (this.fixtype == 'add2') {
+ param['businessId'] = this.businessId
+ this.formAdd(param)
+ } else {
+ this.formModi(param)
+ }
+
},
-
+ formAdd(param) {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/reimburseOnline/from/add/auth`,
+ header: { 'token': uni.getStorageSync('token') },
+ data: JSON.stringify(param),
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ uni.navigateBack({})
+ } else if(res.code === 500) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ }
+ }
+ })
+ },
+ formModi(param) {
+ let _this = this
+ uni.request({
+ url: `${_this.baseUrl}/reimburseOnline/from/modify/auth`,
+ header: { 'token': uni.getStorageSync('token') },
+ data: JSON.stringify(param),
+ method: 'POST',
+ success(res) {
+ res = res.data
+ if (res.code === 200) {
+ uni.navigateBack({delta:2})
+ } else if(res.code === 500) {
+ uni.showToast({title: res.msg, icon: "none", position: 'top'})
+ }
+
+ }
+ })
+ },
+ cancel() {
+ this.reimburseId = false
+ this.checkData = false
+ },
back() {
uni.navigateBack({})
},
--
Gitblit v1.9.1