| | |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-table :data="applicationDetailArr" border highlight-current-row> |
| | | <el-table :data="rbDetails" border highlight-current-row> |
| | | <el-table-column prop="starttime" slot="" label="出发日期" align="center" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.starttime" type="date" |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="操作" align="center" width="120"> |
| | | <!-- deleteRow(scope.$index, applicationDetailArr) --> |
| | | <!-- deleteRow(scope.$index, rbDetails) --> |
| | | |
| | | <template slot-scope="scope"> |
| | | <el-button @click.native.prevent=" |
| | | deleteRow(scope.$index, applicationDetailArr, scope.row) |
| | | deleteRow(scope.$index, rbDetails, scope.row) |
| | | " type="text" size="small" disabled> |
| | | 删除 |
| | | </el-button> |
| | |
| | | donorname: null, |
| | | bigstrmoney: null, |
| | | }, |
| | | applicationDetailArr: [], |
| | | rbDetails: [], |
| | | baselist: [], |
| | | balist: [], |
| | | standardlevel: 0, |
| | |
| | | uploadflag: null, |
| | | uploadtime: null, |
| | | }; |
| | | this.applicationDetailArr = [ |
| | | this.rbDetails = [ |
| | | { |
| | | index: 0, |
| | | searchAddress: { |
| | |
| | | let ids = response1.data.id; |
| | | getReimbursementdetaillist(ids).then((res2) => { |
| | | console.log("修改的details数据", res2); |
| | | this.applicationDetailArr = res2.data; |
| | | for (let i = 0; i < this.applicationDetailArr.length; i++) { |
| | | this.applicationDetailArr[i].index = i; |
| | | this.applicationDetailArr[i].searchAddress = { |
| | | sheng: this.applicationDetailArr[i].travelprovincename, |
| | | shi: this.applicationDetailArr[i].travelcityname, |
| | | qu: this.applicationDetailArr[i].traveltownname, |
| | | this.rbDetails = res2.data; |
| | | for (let i = 0; i < this.rbDetails.length; i++) { |
| | | this.rbDetails[i].index = i; |
| | | this.rbDetails[i].searchAddress = { |
| | | sheng: this.rbDetails[i].travelprovincename, |
| | | shi: this.rbDetails[i].travelcityname, |
| | | qu: this.rbDetails[i].traveltownname, |
| | | }; |
| | | } |
| | | //this.sumTotalFee(); |
| | |
| | | this.title = "查看报销申请"; |
| | | let ids = response.data.id; |
| | | getReimbursementdetaillist(ids).then((res) => { |
| | | this.applicationDetailArr = res.data; |
| | | for (let i = 0; i < this.applicationDetailArr.length; i++) { |
| | | this.applicationDetailArr[i].index = i; |
| | | this.applicationDetailArr[i].searchAddress = { |
| | | sheng: this.applicationDetailArr[i].travelprovincename, |
| | | shi: this.applicationDetailArr[i].travelcityname, |
| | | qu: this.applicationDetailArr[i].traveltownname, |
| | | this.rbDetails = res.data; |
| | | for (let i = 0; i < this.rbDetails.length; i++) { |
| | | this.rbDetails[i].index = i; |
| | | this.rbDetails[i].searchAddress = { |
| | | sheng: this.rbDetails[i].travelprovincename, |
| | | shi: this.rbDetails[i].travelcityname, |
| | | qu: this.rbDetails[i].traveltownname, |
| | | }; |
| | | } |
| | | this.sumTotalFee(); |
| | |
| | | submitForm() { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | // this.applicationDetailArr.forEach(item=>{ |
| | | // this.rbDetails.forEach(item=>{ |
| | | // item.destination = this.searchAddress.sheng |
| | | // }) |
| | | |
| | |
| | | console.log("大写", this.form.bigstrmoney); |
| | | updateReimbursement(this.form).then((response) => { |
| | | // console.log('更新主表的信息',response); |
| | | for (let i = 0; i < this.applicationDetailArr.length; i++) { |
| | | console.log("你好", this.applicationDetailArr[i].rbid); |
| | | if (this.applicationDetailArr[i].rbid != null) { |
| | | updateReimbursementdetail(this.applicationDetailArr[i]); |
| | | for (let i = 0; i < this.rbDetails.length; i++) { |
| | | console.log("你好", this.rbDetails[i].rbid); |
| | | if (this.rbDetails[i].rbid != null) { |
| | | updateReimbursementdetail(this.rbDetails[i]); |
| | | } else { |
| | | console.log("修改时新增的id", this.form.id); |
| | | this.applicationDetailArr[i].rbid = this.form.id; |
| | | addReimbursementdetail(this.applicationDetailArr[i]); |
| | | this.rbDetails[i].rbid = this.form.id; |
| | | addReimbursementdetail(this.rbDetails[i]); |
| | | } |
| | | } |
| | | this.$modal.msgSuccess("修改成功"); |
| | |
| | | console.log( |
| | | "主表新增成功了:", |
| | | response, |
| | | this.applicationDetailArr |
| | | this.rbDetails |
| | | ); |
| | | listReimbursementdetailid().then((res) => { |
| | | let id = res.data; |
| | | for (let i = 0; i < this.applicationDetailArr.length; i++) { |
| | | this.applicationDetailArr[i].rbid = id; |
| | | addReimbursementdetail(this.applicationDetailArr[i]); |
| | | for (let i = 0; i < this.rbDetails.length; i++) { |
| | | this.rbDetails[i].rbid = id; |
| | | addReimbursementdetail(this.rbDetails[i]); |
| | | } |
| | | console.log("idaaaaaa:", res); |
| | | }); |
| | | //details新增 |
| | | |
| | | // applicationDetailArr |
| | | // rbDetails |
| | | }); |
| | | } |
| | | } |
| | |
| | | //新增一行 |
| | | addRow() { |
| | | let rowData = { |
| | | index: this.applicationDetailArr.length, |
| | | index: this.rbDetails.length, |
| | | searchAddress: { |
| | | sheng: "", |
| | | shi: "", |
| | |
| | | uploadTime: null, |
| | | total: 0, |
| | | }; |
| | | this.applicationDetailArr.push(rowData); |
| | | this.rbDetails.push(rowData); |
| | | }, |
| | | |
| | | deleteRow(index, rows, row) { |
| | |
| | | // debugger; |
| | | let allSum = 0; |
| | | try { |
| | | for (let i = 0; i < this.applicationDetailArr.length; i++) { |
| | | for (let i = 0; i < this.rbDetails.length; i++) { |
| | | let totalFee = 0; |
| | | //计算当前报销内容费用合计 |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].trafficexpense))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].trafficexpense); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].trafficexpense))) { |
| | | totalFee += parseFloat(this.rbDetails[i].trafficexpense); |
| | | } |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].cityfee))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].cityfee); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].cityfee))) { |
| | | totalFee += parseFloat(this.rbDetails[i].cityfee); |
| | | } |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].hotelexpense))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].hotelexpense); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].hotelexpense))) { |
| | | totalFee += parseFloat(this.rbDetails[i].hotelexpense); |
| | | } |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].otherexpense))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].otherexpense); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].otherexpense))) { |
| | | totalFee += parseFloat(this.rbDetails[i].otherexpense); |
| | | } |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].foodexpenses))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].foodexpenses); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].foodexpenses))) { |
| | | totalFee += parseFloat(this.rbDetails[i].foodexpenses); |
| | | } |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].foodallowance))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].foodallowance); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].foodallowance))) { |
| | | totalFee += parseFloat(this.rbDetails[i].foodallowance); |
| | | } |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].otherfeeamount))) { |
| | | totalFee += parseFloat(this.applicationDetailArr[i].otherfeeamount); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].otherfeeamount))) { |
| | | totalFee += parseFloat(this.rbDetails[i].otherfeeamount); |
| | | } |
| | | this.applicationDetailArr[i].total = parseFloat(totalFee).toFixed(2); |
| | | this.rbDetails[i].total = parseFloat(totalFee).toFixed(2); |
| | | this.$set( |
| | | this.applicationDetailArr, |
| | | this.rbDetails, |
| | | scope.$index, |
| | | this.applicationDetailArr[i] |
| | | this.rbDetails[i] |
| | | ); |
| | | if (!isNaN(parseFloat(this.applicationDetailArr[i].total))) { |
| | | allSum += parseFloat(this.applicationDetailArr[i].total); |
| | | if (!isNaN(parseFloat(this.rbDetails[i].total))) { |
| | | allSum += parseFloat(this.rbDetails[i].total); |
| | | } |
| | | } |
| | | this.form.amountrequested = allSum.toFixed(2); |