From 1f1d4ef71d7d2290893686e54f54bf7ae0a0b4da Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期二, 09 五月 2023 13:55:28 +0800 Subject: [PATCH] 修改了报销单录入 --- vue.config.js | 5 src/views/project/travelexpenseslist/index.vue | 696 +++++++++++++++++++++++------------------------- src/views/project/travelexpenseslistrecord/index.vue | 106 +++--- 3 files changed, 389 insertions(+), 418 deletions(-) diff --git a/src/views/project/travelexpenseslist/index.vue b/src/views/project/travelexpenseslist/index.vue index 8479778..5b40667 100644 --- a/src/views/project/travelexpenseslist/index.vue +++ b/src/views/project/travelexpenseslist/index.vue @@ -11,8 +11,8 @@ </el-col> <el-col :span="6"> - <el-form-item label="鎶ラ攢浜�" prop="username"> - <el-input v-model="queryParams.username" placeholder="璇疯緭鍏ユ姤閿�浜�" clearable size="small" + <el-form-item label="缁忓姙浜�" prop="username"> + <el-input v-model="queryParams.username" placeholder="璇疯緭鍏ョ粡鍔炰汉" clearable size="small" @keyup.enter.native="handleQuery" /> </el-form-item> </el-col> @@ -95,7 +95,7 @@ <!-- <el-table-column label="璐㈠姟瀹℃牳" width="120" align="center" prop="financechecher" /> --> <el-table-column label="鎹愮尞鑰�" width="120" align="center" prop="donorname"> </el-table-column> - <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width" width="270"> + <el-table-column label="鎿嶄綔" align="center" fixed="right" class-name="small-padding fixed-width" width="250"> <template slot-scope="scope"> <el-button v-if="scope.row.recordstatus == -1 || scope.row.recordstatus == 1" size="mini" type="text" icon="el-icon-upload2" @click="handleup(scope.row)">涓婃姤</el-button> @@ -103,9 +103,7 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)">淇敼</el-button> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)">鏌ョ湅</el-button> <!-- v-hasPermi="['project:funddetail:edit']" --> - <el-button size="mini" type="text" icon="el-icon-download" @click="gettable(scope.row)"> - 涓嬭浇 - </el-button> + <el-button size="mini" type="text" icon="el-icon-download" @click="gettable(scope.row)"> 涓嬭浇 </el-button> <!-- v-hasPermi="['project:funddetail:edit']" --> <el-button v-if="scope.row.recordstatus == -1 || scope.row.recordstatus == 1" size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">鍒犻櫎</el-button> @@ -133,7 +131,7 @@ <el-form-item label="缁忓姙浜�" prop="username"> <el-select v-model="form.username" clearable filterable allow-create ref="getReportname" default-first-option placeholder="璇烽�夋嫨"> - <el-option v-for="item in personList" :key="item.reportNo" :label="item.reportName" + <el-option v-for="item in personsList" :key="item.reportNo" :label="item.reportName" :value="item.reportName"> </el-option> </el-select> @@ -188,9 +186,9 @@ </el-form-item> </el-col> <el-col :span="5"> - <el-form-item label="鎶ラ攢浜�" prop="travelers"> + <el-form-item label="鍑哄樊浜�" prop="travelers"> <el-select v-model="form.travelers" clearable filterable allow-create ref="getReportname" - default-first-option placeholder="璇烽�夋嫨" @change="selectedTraveler"> + default-first-option placeholder="璇烽�夋嫨" @change="getAccountinfo()"> <el-option v-for="item in travelers" :key="item.reportNo" :label="item.reportName" :value="item.reportName"> </el-option> @@ -263,14 +261,17 @@ plain icon="el-icon-plus" size="mini" - @click="addRow" + @click="adddetailRow" >鏂板涓�琛�</el-button > </el-col> </el-row> - --> + --> <el-row> - <el-table :data="applicationDetailArr" border highlight-current-row> + <el-col :span="20">鎶ラ攢鏄庣粏褰曞叆锛�</el-col> + </el-row> + <el-row> + <el-table :data="rbDetails" border highlight-current-row> <el-table-column prop="orderno" slot="" label="搴忓彿" align="center" fixed width="65"> <template slot-scope="scope"> <el-input v-model="scope.row.orderno" placeholder="搴忓彿" /> @@ -291,21 +292,18 @@ <el-table-column prop="persontype" slot="" label="浜哄憳绫诲埆" align="center" fixed width="120"> <template slot-scope="scope"> <el-select v-model="scope.row.persontype" value-key="value" placeholder="浜哄憳绫诲埆" - @change="getTravelers(scope.row)"> + @change="getPersons(scope.row)"> <el-option v-for="dict in dict.type.sys_travelexpensebelong" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> </el-select> </template> </el-table-column> - <el-table-column prop="personname2" slot="" label="璐圭敤浜哄憳" align="center" fixed width="120"> - <!-- <template slot-scope="scope"> - <el-input v-model="scope.row.personname" placeholder="鍑哄樊浜�" /> - </template> --> + <el-table-column prop="personname" slot="" label="璐圭敤浜哄憳" align="center" fixed width="120"> <template slot-scope="scope"> <el-select v-model="scope.row.personname" clearable filterable allow-create default-first-option - placeholder="璇烽�夋嫨" @focus="filterPersonList(scope.row)"> - <el-option v-for="item in scope.row.personname2" :key="item.reportNo" :label="item.reportName" + placeholder="璇烽�夋嫨" @focus1="getPersons(scope.row)"> + <el-option v-for="item in personsSel" :key="item.reportNo" :label="item.reportName" :value="item.reportName"> </el-option> </el-select> @@ -314,10 +312,10 @@ <el-table-column prop="starttime" slot="" label="寮�濮嬫棩鏈�" fixed align="center" width="150"> <template slot-scope="scope"> <el-date-picker :picker-options="{ - disabledDate: time => { - if (scope.row.endtime) { return time.getTime() > new Date(scope.row.endtime.replace(/-/g, '/')) } - } - }" clearable size="small" style="width: 100%" v-model="scope.row.starttime" type="date" + disabledDate: time => { + if (scope.row.endtime) { return time.getTime() > new Date(scope.row.endtime.replace(/-/g, '/')) } + } + }" clearable size="small" style="width: 100%" v-model="scope.row.starttime" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="寮�濮嬫棩鏈�" @blur="getallowance(scope.row)"> </el-date-picker> </template> @@ -325,20 +323,20 @@ <el-table-column prop="endtime" slot="" label="缁撴潫鏃ユ湡" align="center" fixed width="150"> <template slot-scope="scope"> <el-date-picker :picker-options="{ - disabledDate: time => { - if (scope.row.starttime) { return time.getTime() < new Date(scope.row.starttime.replace(/-/g, '/')) } - } - }" clearable size="small" style="width: 100%" v-model="scope.row.endtime" type="date" + disabledDate: time => { + if (scope.row.starttime) { return time.getTime() < new Date(scope.row.starttime.replace(/-/g, '/')) } + } + }" clearable size="small" style="width: 100%" v-model="scope.row.endtime" type="date" value-format="yyyy-MM-dd HH:mm:ss" placeholder="缁撴潫鏃ユ湡" @blur="getallowance(scope.row)"> </el-date-picker> </template> </el-table-column> - <el-table-column prop="departure" slot="" label="鍑哄彂鍦�" align="center" fixed width="100"> + <el-table-column prop="departure" slot="" label="鍑哄彂鍦�" align="center" width="100"> <template slot-scope="scope"> <el-input v-model="scope.row.departure" placeholder="鍑哄彂鍦�" /> </template> </el-table-column> - <el-table-column label="鍒拌揪鍦�" prop="destination2" align="center" fixed width="100"> + <el-table-column label="鍒拌揪鍦�" prop="destination2" align="center" width="120"> <template slot-scope="scope"> <!-- <el-input v-model="scope.row.destination" placeholder="鍒拌揪鍦�" @blur="getallowance(scope.row)" /> --> @@ -374,8 +372,8 @@ <el-table-column prop="trafficexpense" label="浜ら�氳垂" align="center" width="80"> <template slot-scope="scope"> <el-input v-model="scope.row.trafficexpense" placeholder="浜ら�氳垂" @blur="(val) => { - sumTotalFee(); - } + sumTotalFee(); + } " /> </template> </el-table-column> @@ -394,8 +392,8 @@ <el-table-column prop="hotelexpense" label="浣忓璐�" align="center" width="80"> <template slot-scope="scope"> <el-input v-model="scope.row.hotelexpense" placeholder="浣忓璐�" @blur="(val) => { - sumTotalFee(); - } + sumTotalFee(); + } " /> </template> </el-table-column> @@ -403,24 +401,24 @@ <el-table-column prop="foodexpenses" label="椁愯垂鎶ラ攢" align="center" width="80"> <template slot-scope="scope"> <el-input v-model="scope.row.foodexpenses" placeholder="浼欓璐规姤閿�" @blur="(val) => { - sumTotalFee(); - } + sumTotalFee(); + } " /> </template> </el-table-column> <el-table-column prop="foodallowance" label="浼欓琛ュ姪" align="center" width="80"> <template slot-scope="scope"> <el-input v-model="scope.row.foodallowance" placeholder="浼欓璐硅ˉ鍔�" @blur="(val) => { - sumTotalFee(); - } + sumTotalFee(); + } " /> </template> </el-table-column> <el-table-column prop="otherexpense" label="鍏潅璐硅ˉ鍔�" align="center" width="80"> <template slot-scope="scope"> <el-input v-model="scope.row.otherexpense" placeholder="鏉傝垂" @blur="(val) => { - sumTotalFee(); - } + sumTotalFee(); + } " /> </template> </el-table-column> @@ -428,8 +426,8 @@ <el-table-column prop="otherfeeamount" label="鍏朵粬璐圭敤" align="center" width="90"> <template slot-scope="scope"> <el-input v-model="scope.row.otherfeeamount" placeholder="鍏朵粬璐圭敤" @blur="(val) => { - sumTotalFee(); - } + sumTotalFee(); + } " /> </template> </el-table-column> @@ -446,8 +444,8 @@ </el-table-column> <el-table-column fixed="right" label="鎿嶄綔" align="center" width="120" v-if="dialogType == 'edit'"> <template slot-scope="scope"> - <el-button type="text" size="mini" @click="addRow(scope.$index)">鏂板</el-button> - <el-button @click.native.prevent="deleteRow(scope.$index, applicationDetailArr, scope.row) + <el-button type="text" size="mini" @click="adddetailRow(scope.$index)">鏂板</el-button> + <el-button @click.native.prevent="deleteRow(scope.$index, rbDetails, scope.row) " type="text" size="small"> 鍒犻櫎 </el-button> @@ -455,16 +453,18 @@ </el-table-column> </el-table> </el-row> - + <el-row> + <el-col :span="20">鎶ラ攢璇锋鏄庣粏锛�</el-col> + </el-row> <el-row style="margin-top: 30px"> - <el-table :data="applicationDetailArr2" border highlight-current-row> - <el-table-column prop="col_orderno" slot="" label="搴忓彿" align="center" fixed width="65"> + <el-table :data="rbPayees" border highlight-current-row> + <el-table-column prop="orderno" slot="" label="搴忓彿" align="center" fixed width="65"> <template slot-scope="scope"> - <el-input v-model="scope.row.col_orderno" placeholder="搴忓彿" /> + <el-input v-model="scope.row.orderno" placeholder="搴忓彿" /> </template> </el-table-column> - <!--涓婚敭銆佸涓嶅睍绀�--> + <!--涓婚敭銆佸閿笉灞曠ず--> <el-table-column prop="id" slot="" label="涓婚敭" align="center" fixed width="95" v-if="false"> <template slot-scope="scope"> <el-input v-model="scope.row.id" placeholder="id" /> @@ -476,56 +476,55 @@ </template> </el-table-column> - <el-table-column prop="col_personType" slot="" label="浜哄憳绫诲埆" align="center" fixed width="120"> + <el-table-column prop="persontype" slot="" label="浜哄憳绫诲埆" align="center" fixed width="120"> <template slot-scope="scope"> - <el-select v-model="scope.row.col_personType" value-key="value" placeholder="浜哄憳绫诲埆" - @change="getColTravelers(scope.row, scope.row.col_personType)"> + <el-select v-model="scope.row.persontype" value-key="value" placeholder="浜哄憳绫诲埆" + @change="getPersons(scope.row)"> <el-option v-for="dict in dict.type.sys_travelexpensebelong" :key="dict.value" :label="dict.label" :value="dict.value"></el-option> </el-select> </template> </el-table-column> - <el-table-column prop="col_personname2" slot="" label="鏀舵浜�" align="center" fixed width="130"> + <el-table-column prop="personname" slot="" label="鏀舵浜�" align="center" fixed width="130"> <template slot-scope="scope"> - <el-select v-model="scope.row.col_personname" clearable filterable allow-create ref="getReportname" - default-first-option placeholder="璇烽�夋嫨" @change="selectedColTraveler(scope.row)"> - <el-option v-for="item in scope.row.col_personname2" :key="item.reportNo" :label="item.reportName" + <el-select v-model="scope.row.personname" clearable filterable allow-create ref="getReportname" + default-first-option placeholder="璇烽�夋嫨" @change="getAccountinfo2(scope.row, scope.row.persontype)"> + <el-option v-for="item in personsSel" :key="item.reportNo" :label="item.reportName" :value="item.reportName"> </el-option> </el-select> </template> </el-table-column> - <el-table-column prop="col_bank" slot="" label="鏀舵閾惰" align="center" fixed width="200"> + <el-table-column prop="bankname" slot="" label="閾惰鍚嶇О" align="center" fixed width="200"> <template slot-scope="scope"> - <el-input v-model="scope.row.col_bank" placeholder="鏀舵閾惰" /> + <el-input v-model="scope.row.bankname" placeholder="閾惰鍚嶇О" /> </template> </el-table-column> - <el-table-column prop="col_accounts" slot="" label="鏀舵甯愬彿" align="center" fixed width="200"> + <el-table-column prop="bankcardno" slot="" label="閾惰鍗″彿" align="center" fixed width="200"> <template slot-scope="scope"> - <el-input v-model="scope.row.col_accounts" placeholder="鏀舵甯愬彿" /> - </template> + <el-input v-model="scope.row.bankcardno" placeholder="閾惰鍗″彿" /> + </template> </el-table-column> - <el-table-column prop="col_money" slot="" label="鏀舵閲戦" align="center" fixed width="130"> + <el-table-column prop="amount" slot="" label="鎵撴閲戦" align="center" fixed width="130"> <template slot-scope="scope"> - <el-input v-model="scope.row.col_money" placeholder="鏀舵閲戦" /> - </template> + <el-input v-model="scope.row.amount" placeholder="鎵撴閲戦" /> + </template> </el-table-column> - <el-table-column prop="col_date" slot="" label="浠樻鏃ユ湡" fixed align="center" width="150"> + <el-table-column prop="remark" slot="" label="璇锋璇存槑" align="center" fixed width="280"> <template slot-scope="scope"> - <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.col_date" type="date" - value-format="yyyy-MM-dd HH:mm:ss" placeholder="浠樻鏃ユ湡" @blur="getallowance(scope.row)"> + <el-input v-model="scope.row.remark" placeholder="璇存槑" /> + </template> + </el-table-column><el-table-column prop="paiddate" slot="" label="鎵撴鏃ユ湡" fixed align="center" width="150"> + <template slot-scope="scope"> + <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.paiddate" type="date" + value-format="yyyy-MM-dd HH:mm:ss" placeholder="鎵撴鏃ユ湡" :disabled="true" @blur="getallowance(scope.row)"> </el-date-picker> - </template> - </el-table-column> - <el-table-column prop="col_illustrate" slot="" label="璇存槑" align="center" fixed width="280"> - <template slot-scope="scope"> - <el-input v-model="scope.row.col_illustrate" placeholder="璇存槑" /> </template> </el-table-column> <el-table-column label="鎿嶄綔" align="center" width="100" v-if="dialogType == 'edit'"> <template slot-scope="scope"> - <el-button type="text" size="mini" @click="col_addRow(scope.$index)">鏂板</el-button> - <el-button @click.native.prevent="deleteRow2(scope.$index, applicationDetailArr2, scope.row) + <el-button type="text" size="mini" @click="addpayeeRow(scope.$index)">鏂板</el-button> + <el-button @click.native.prevent="deleteRow2(scope.$index, rbPayees, scope.row) " type="text" size="small"> 鍒犻櫎 </el-button> @@ -577,7 +576,7 @@ <!-- <file-upload ref="fileUpload" :fileType=fileType :limit="1" :on-success="handleUploadSuccess"></file-upload> --> <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileList" multiple :limit="5" :headers="headers" :on-success="(response, file, fileList) => - uploadSccess(response, file, fileList) + uploadSccess(response, file, fileList) " :on-preview="downFile" :disabled='dialogType == "detail"' :on-error="handleUploadError" :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf"> <el-button :disabled='dialogType == "detail"' size="small" type="primary">涓婁紶</el-button> @@ -607,7 +606,7 @@ <script> import { listDonatebaseinfo } from "@/api/project/donatebaseinfo"; -import { addOrUpdateRBpayee, listReimbursementpayee } from "@/api/project/reimbursementpayee"; +import { addOrUpdateRBpayee, listReimbursementpayee, addReimbursementpayee, updateReimbursementpayee } from "@/api/project/reimbursementpayee"; import { listReimbursement, getReimbursement, @@ -653,14 +652,24 @@ ], data() { return { - personList: [], - travelers: [], - coltravelers: [], + //OPO鍗忚皟鍛� + personsXty: [], + //OPO涓撹亴浜哄憳 + personsZzry: [], + //OPO绠$悊浜哄憳 + personsManager: [], + //OPO涓撳 + personsExpert: [], + //鍏ㄩ儴浜哄憳 + personsList: [], + //涓嬫媺鍙互閫夋嫨浜哄憳鍒楄〃 + personsSel: [], + costtypeobj: { value: 0, label: "", }, - userlist: [], + options: regionDataPlus, selectedOptions: [], searchAddress: { @@ -702,8 +711,8 @@ destination2: null, uploadFlag: null, uploadTime: null, - // orderByColumn: "createTime", - orderByColumn: "id", + // orderByColumn: "createTime", + orderByColumn: "id", isAsc: "desc", }, queryParams2: { @@ -735,11 +744,12 @@ donorname: null, bigstrmoney: null, }, - applicationDetailArr: [], - applicationDetailArr2: [], + + rbDetails: [], + rbPayees: [], arrr2: [], baselist: [], - balist: [], + donatorList: [], standardlevel: 0, defaultperson: {}, fundflowList: [], @@ -760,42 +770,48 @@ }, }; }, + created() { + //鑾峰彇璁板綍鍒楄〃 this.getList(); - this.getUserList(); + + //鑾峰彇鎶ラ攢涓殑浜哄憳淇℃伅 this.getPersonList(); }, + mounted() { + //鑾峰彇鎹愮尞鑰呭鍚� listDonatebaseinfo().then((res) => { - // console.log("base鍩虹琛ㄦ暟鎹�", res.rows); let list = res.rows; let baseinfolist = []; - this.balist = list; + this.donatorList = list; list.forEach((element) => { baseinfolist.push({ infoid: element.id, name: element.name, }); }); - // console.log("缁勫悎鐨勬柊鏁扮粍", baseinfolist); + if (baseinfolist != 0) { this.baselist = baseinfolist; } }); + + //鑾峰彇鐧诲綍鑰呬俊鎭� this.getUsermsg(); }, - methods: { - alertMessage(row) { - debugger - }, + methods: { handleUploadError() { }, + remove(file) { this.fileList.splice(this.fileList.indexOf(file), 1) }, + handleExceed() { this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${5} 涓�!`); }, + //鏂囦欢涓婁紶鎴愬姛鍥炶皟 uploadSccess(response, file, fileList) { //鑾峰彇闄勪欢淇℃伅浣嶇疆 @@ -809,73 +825,7 @@ } }, - //鑾峰彇浜哄憳鍒楄〃 - getPersonList() { - //鑾峰彇鍚勭被鍒殑浜哄憳锛氬崗璋冨憳銆佷笓鑱屼汉鍛樸�佽礋璐d汉銆佷笓瀹� - let persontypeArr = ["xty1", "zzry", "fzr", "expert"]; - for (let i = 0; i < persontypeArr.length; i++) { - this.tempArrr = []; - listReportname(persontypeArr[i]).then((res) => { - console.log(res); - this.tempArrr = res.data; - this.personList = this.personList.concat(this.tempArrr); - }); - } - }, - //鑾峰彇涓�涓被鍒殑浜哄憳鍒楄〃 - filterPersonList(row) { - let travelertype = row.persontype; - }, - - //鑾峰彇鍑哄樊浜哄垪琛� - getTravelers(row, val) { - //涓撹亴浜哄憳-1,鍗忚皟鍛�-2,涓撳-3,瀹跺睘-4,鍏朵粬浜哄憳-5 - let travelertype = ""; - if (row.persontype == "1") { - travelertype = "zzry"; - } else if (row.persontype == "2") { - travelertype = "xty1"; - } else if (row.persontype == "3") { - travelertype = "expert"; - } else if (row.persontype == "4") { - travelertype = "jiashu"; - } else if (row.persontype == "5") { - travelertype = "fzr"; - } - listReportname(travelertype).then((res) => { - this.travelers = res.data; - row.personname2 = res.data; - }); - this.form.persontype = val; - }, - //鑾峰彇鏀舵浜哄垪琛� - getColTravelers(row, val2) { - debugger; - //涓撹亴浜哄憳-1,鍗忚皟鍛�-2,涓撳-3,瀹跺睘-4,鍏朵粬浜哄憳-5 - let travelertype = ""; - if (val2 == 1) { - travelertype = "zzry"; - } else if (val2 == 2) { - travelertype = "xty1"; - } else if (val2 == 3) { - travelertype = "expert"; - } else if (val2e == 4) { - travelertype = "jiashu"; - } else if (val2 == 5) { - travelertype = "fzr"; - } - listReportname(travelertype).then((res) => { - this.travelers = res.data; - row.col_personname2 = res.data; - }); - this.col_personType = val2; - }, - - selectcosttype() { - this.form.costtype = this.costtypeobj.value; - this.form.costtypename = this.costtypeobj.label; - }, - + //鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅 getUsermsg() { getUserProfile().then((response) => { this.defaultperson = response.data; @@ -883,15 +833,53 @@ }); }, - getUserList() { - listUser().then((res) => { - this.userlist = res.data; - - + //鑾峰彇浜哄憳鍒楄〃 + getPersonList() { + //鑾峰彇OPO鍗忚皟鍛樺悕鍗� + listReportname("xty1").then((res) => { + this.personsXty = res.data; + this.personsList = this.personsXty; + + //OPO涓撹亴浜哄憳鍚嶅崟 + listReportname("zzry").then((res) => { + this.personsZzry = res.data; + this.personsList = this.personsList.concat(this.personsZzry); + + //OPO绠$悊浜哄憳鍚嶅崟 + listReportname("fzr").then((res) => { + this.personsManager = res.data; + this.personsList = this.personsList.concat(this.personsManager); + + //OPO涓撳鍚嶅崟 + listReportname("expert").then((res) => { + this.personsExpert = res.data; + this.personsList = this.personsList.concat(this.personsExpert); + }); + }); + }); }); }, - selectedTraveler() { - this.travelers.map((res) => { + + //鑾峰彇涓�涓被鍒殑浜哄憳鍒楄〃 + getPersons(row) { + //涓撹亴浜哄憳-1,鍗忚皟鍛�-2,涓撳-3,瀹跺睘-4,鍏朵粬浜哄憳-5 + let tmpList = null; + if (row.persontype == "1") { + this.personsSel = this.personsZzry; + } else if (row.persontype == "2") { + this.personsSel = this.personsXty; + } else if (row.persontype == "3") { + this.personsSel = this.personsExpert; + } else if (row.persontype == "4") { + this.personsSel = tmpList; + } else if (row.persontype == "5") { + this.personsSel = this.personsManager; + } + }, + + //鑾峰彇璁剧疆浜哄憳璐﹀彿淇℃伅 + getAccountinfo() { + this.coltravelers.map((res) => { if (res.reportName == this.form.travelers) { getInfoBytheUserNo(res.reportNo).then((res) => { this.form.depositbank = res.data.depositbank; @@ -901,40 +889,28 @@ } }); }, - //鑾峰彇鏀舵浜洪摱琛屽崱鍜屽笎鍙� - selectedColTraveler(row) { - let travelertype = ""; - if (row.col_personType == 1) { - travelertype = "zzry"; - } else if (row.col_personType == 2) { - travelertype = "xty1"; - } else if (row.col_personType == 3) { - travelertype = "expert"; - } else if (row.col_personType == 4) { - travelertype = "jiashu"; - } else if (row.col_personType == 5) { - travelertype = "fzr"; + + //鑾峰彇璁剧疆浜哄憳璐﹀彿淇℃伅 + getAccountinfo2(row, personType) { + let dataArr = []; + if (personType == 1) { + dataArr = this.personsZzry; + } else if (personType == 2) { + dataArr = this.personsXty; + } else if (personType == 3) { + dataArr = this.personsExpert; + } else if (personType == 5) { + dataArr = this.personsManager; } - listReportname(travelertype).then((res) => { - let dataArr = res.data; - for (let m = 0; m < dataArr.length; m++) { - if (dataArr[m].reportName == row.col_personname) { - row.col_bank = dataArr[m].depositbank; - row.col_accounts = dataArr[m].bankcardno; - }; - } - }); - // this.coltravelers.map((res) => { - // console.log("-----------------------------"); - // if (res.reportName == this.form.travelers) { - // getInfoBytheUserNo(res.reportNo).then((res) => { - // this.form.depositbank = res.data.depositbank; - // this.form.bankcardno = res.data.bankcardno; - // this.form.phone = res.data.telephone; - // }); - // } - // }); + + for (let m = 0; m < dataArr.length; m++) { + if (dataArr[m].reportName == row.personname) { + row.bankname = dataArr[m].depositbank; + row.bankcardno = dataArr[m].bankcardno; + }; + } }, + //璁$畻琛ュ姪 getallowance(row) { if ( @@ -976,20 +952,15 @@ //璁$畻鍚堣 this.sumTotalFee(); }, + getallowance2(row, val2) { - debugger; // this.getallowance(row); this.arriveAddr = val2; this.queryParams2.arriveAddr; this.queryParams2.personType = row; - console.log(row.persontype); - console.log(this.arriveAddr); if (row.persontype != undefined && row.persontype == "2" || row.persontype == "5") { - console.log(this.arriveAddr); this.loading = true; - debugger; getSubsidy(val2).then((response) => { - debugger this.loading = false; row.otherexpense = response.data.others; row.foodallowance = response.data.food; @@ -997,6 +968,7 @@ } }, + getStandard(row) { if ( row.searchAddress.sheng != "" && @@ -1030,6 +1002,7 @@ }); } }, + selcetdestination(row) { console.log("鐩殑鍦伴�夋嫨浜嬩欢", row, row.searchAddress); //row.searchAddress = this.searchAddress; @@ -1083,8 +1056,9 @@ return area; }, + //鑾峰彇鎹愮尞鑰呭熀鏈俊鎭細鎹愮尞缂栧彿銆佹崘鐚�呭鍚� selectbaseinfo() { - let list = this.balist; + let list = this.donatorList; list.forEach((item) => { if (item.id == this.form.infoid) { this.form.donorno = item.donorno; @@ -1130,11 +1104,10 @@ getList() { this.loading = true; listReimbursement(this.queryParams).then((response) => { - console.log("宸梾璐规暟鎹垪琛�:", response); this.reimbursementList = response.rows; this.total = response.total; this.loading = false; - + }); }, // 鍙栨秷鎸夐挳 @@ -1144,7 +1117,6 @@ }, // 琛ㄥ崟閲嶇疆 reset() { - this.fileList = [] this.form = { ceshi: {}, @@ -1190,14 +1162,15 @@ costtype: null, costtypename: null, }; - this.applicationDetailArr = []; - this.applicationDetailArr2 = []; + this.rbDetails = []; + this.rbPayees = []; this.resetForm("form"); }, // handup(e) { console.log("涓婃姤", e); }, + // 涓嬭浇鏂囦欢 downFile(item) { const url = process.env.VUE_APP_BASE_API + item.url @@ -1207,6 +1180,7 @@ a.href = url; a.dispatchEvent(event); }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ handleQuery() { // console.log('pop',this.value1) @@ -1221,6 +1195,7 @@ this.queryParams.pageNum = 1; this.getList(); }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ resetQuery() { this.resetForm("queryForm"); @@ -1232,6 +1207,7 @@ this.single = selection.length !== 1; this.multiple = !selection.length; }, + /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.reset(); @@ -1239,15 +1215,18 @@ this.fundflowList = []; this.form.username = this.defaultperson.nickName; this.form.userno = this.defaultperson.userName; - this.addRow(); - this.col_addRow(); + this.adddetailRow(); + this.addpayeeRow(); this.open = true; this.title = "娣诲姞鎶ラ攢鐢宠"; }, + /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.dialogType = "edit"; this.reset(); + + //鑾峰彇鎶ラ攢涓讳俊鎭� const id = row.id || this.ids; getReimbursement(id).then((response) => { this.form = response.data; @@ -1257,42 +1236,44 @@ this.title = "淇敼鎶ラ攢鐢宠"; let ids = response.data.id; + //鑾峰彇鎶ラ攢鏄庣粏淇℃伅 getReimbursementdetaillist(ids).then((res) => { if (res.data.length == 0) { return; } - - this.applicationDetailArr = res.data; - for (let i = 0; i < this.applicationDetailArr.length; i++) { - debugger; - // this.applicationDetailArr[i].personname2 = res.data[i].personname; + + this.rbDetails = res.data; + for (let i = 0; i < this.rbDetails.length; i++) { + // this.rbDetails[i].personname2 = res.data[i].personname; } - for (let i = 0; i < this.applicationDetailArr.length; i++) { - debugger; - this.applicationDetailArr[i].index = i; - this.applicationDetailArr[i].searchAddress = { - sheng: this.applicationDetailArr[i].travelprovincename, - shi: this.applicationDetailArr[i].travelcityname, - qu: this.applicationDetailArr[i].traveltownname, + 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(); - }); - let obj = { rbid: ids }; - listReimbursementpayee(obj).then((res) => { - if (res.rows.length == 0) { - return; - } - this.applicationDetailArr2 = res.rows; - // this.sumTotalFee(); + + //鑾峰彇鎶ラ攢鎵撴淇℃伅 + let obj = { rbid: ids }; + listReimbursementpayee(obj).then((res) => { + if (res.rows.length == 0) { + return; + } + this.rbPayees = res.rows; + console.log("listReimbursementpayee", res.rows); + }); }); }); //榛樿瀛樺湪涓�琛� - this.addRow(); - this.col_addRow(); - this.selectedTraveler(); + this.adddetailRow(); + this.addpayeeRow(); }, + /** 鏌ョ湅鎸夐挳鎿嶄綔 */ handleDetail(row) { this.dialogType = "detail"; @@ -1314,31 +1295,27 @@ this.fundflowList = res.rows; }); 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() { - debugger; this.$refs["form"].validate((valid) => { - debugger; if (valid) { - let indexErrTime = this.applicationDetailArr.findIndex((item) => { + let indexErrTime = this.rbDetails.findIndex((item) => { if (item.endtime && item.starttime) { - let d = this.$moment(item.endtime).diff( - this.$moment(item.starttime), - "d" - ); + let d = this.$moment(item.endtime).diff(this.$moment(item.starttime), "d"); if (d < 0) { return true; } else { @@ -1357,11 +1334,8 @@ return; } - let emptyStartTimeindex = this.applicationDetailArr.findIndex( - (item) => - item.starttime == null || - item.starttime == undefined || - item.starttime == "" + let emptyStartTimeindex = this.rbDetails.findIndex( + (item) => item.starttime == null || item.starttime == undefined || item.starttime == "" ); if (emptyStartTimeindex > -1) { @@ -1372,11 +1346,8 @@ return; } - let emptyEndTimeindex = this.applicationDetailArr.findIndex( - (item) => - item.endtime == null || - item.endtime == undefined || - item.endtime == "" + let emptyEndTimeindex = this.rbDetails.findIndex( + (item) => item.endtime == null || item.endtime == undefined || item.endtime == "" ); if (emptyEndTimeindex > -1) { @@ -1398,68 +1369,76 @@ if (costtypeindex > -1) { this.form.costtypename = belongArr[costtypeindex].label; } + + //鏍¢獙璇锋閲戦鍚堣鏄惁绛変簬鎶ラ攢鍗曢噾棰� + if (this.form.amountrequested != this.rbPayees.reduce((amount, item) => amount + Number(item.amount), 0.0)) { + this.$message({ + message: "鎶ラ攢璇锋琛ㄤ腑鍚堣閲戦涓嶇瓑浜庢姤閿�鍗曠殑鎶ラ攢閲戦锛岃鏇存鍚庡啀淇濆瓨锛�", + type: "warning", + }); + return; + } + + if (this.form.id != null) { //rbid涓昏〃Id,鏂逛究鍚庨潰鍏宠仈涓昏〃 let rbid = this.form.id; - for (let i = 0; i < this.applicationDetailArr.length; i++) { - this.applicationDetailArr[i].rbid = rbid; + for (let i = 0; i < this.rbDetails.length; i++) { + this.rbDetails[i].rbid = rbid; } updateReimbursement(this.form).then((response) => { - addOrupdateReimbursementdetaillist(this.applicationDetailArr).then((response) => { + addOrupdateReimbursementdetaillist(this.rbDetails).then((response) => { //鏇存柊鏀粯琛ㄤ俊鎭� - for (let i = 0; i < this.applicationDetailArr2.length; i++) { - this.applicationDetailArr2[i].rbid = rbid; + for (let i = 0; i < this.rbPayees.length; i++) { + this.rbPayees[i].rbid = rbid; } - addOrUpdateRBpayee(this.applicationDetailArr2); - // for (let i = 0; i < this.applicationDetailArr.length; i++) { - // if (this.applicationDetailArr[i].rbid != null) { - // updateReimbursementdetail(this.applicationDetailArr[i]); - // } else { - // this.applicationDetailArr[i].rbid = this.form.id; - // addReimbursementdetail(this.applicationDetailArr[i]); - // } - // } + //addOrUpdateRBpayee(this.rbPayees); + for (let i = 0; i < this.rbPayees.length; i++) { + if (this.rbPayees[i].rbid != null) { + updateReimbursementpayee(this.rbPayees[i]); + } else { + addReimbursementpayee(this.rbPayees[i]); + } + } this.$modal.msgSuccess("淇敼鎴愬姛"); this.open = false; this.getList(); }); - }).catch(err=>{ + }).catch(err => { console.log(err); }) } else { this.form.recordstatus = -1; - const applicationDetailArr = [...this.applicationDetailArr] - const applicationDetailArr2 = [...this.applicationDetailArr2] + const rbDetails = [...this.rbDetails] + const rbPayees = [...this.rbPayees] addReimbursement(this.form).then((response) => { - for (let i = 0; i < applicationDetailArr.length; i++) { - applicationDetailArr[i].rbid = response.data; - } - addOrupdateReimbursementdetaillist(applicationDetailArr).then((response) => { - this.$modal.msgSuccess("鏂板鎴愬姛"); - this.open = false; - this.getList(); - console.log( - "涓昏〃鏂板鎴愬姛浜嗭細", - response, - this.applicationDetailArr - ); - listReimbursementdetailid().then((res) => { - let id = res.data; - for (let i = 0; i < applicationDetailArr.length; i++) { - applicationDetailArr[i].rbid = id; - addReimbursementdetail(applicationDetailArr[i]); - } - for (let i = 0; i < applicationDetailArr2.length; i++) { - applicationDetailArr2[i].rbid = id; - } - addOrUpdateRBpayee(applicationDetailArr2); + for (let i = 0; i < rbDetails.length; i++) { + rbDetails[i].rbid = response.data; + } + addOrupdateReimbursementdetaillist(rbDetails).then((response) => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + listReimbursementdetailid().then((res) => { + let id = res.data; + for (let i = 0; i < rbDetails.length; i++) { + rbDetails[i].rbid = id; + addReimbursementdetail(rbDetails[i]); + } + + for (let i = 0; i < rbPayees.length; i++) { + rbPayees[i].rbid = id; + } + //addOrUpdateRBpayee(rbPayees); + addReimbursementpayee(rbPayees); + }) }) }) - }) } } }); }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { const ids = row.id || this.ids; @@ -1476,6 +1455,7 @@ }) .catch(() => { }); }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ handleExport() { const queryParams = this.queryParams; @@ -1493,9 +1473,9 @@ }, //鏂板涓�琛� - addRow(rowIndex) { + adddetailRow(rowIndex) { let rowData = { - //index: this.applicationDetailArr.length, + //index: this.rbDetails.length, searchAddress: { sheng: "", shi: "", @@ -1534,35 +1514,35 @@ destination: null, }; if (rowIndex == undefined || rowIndex == null || rowIndex < 0) { - this.applicationDetailArr.push(rowData); + this.rbDetails.push(rowData); } else { - this.applicationDetailArr.splice(rowIndex + 1, 0, rowData); + this.rbDetails.splice(rowIndex + 1, 0, rowData); } - for (let i = 0; i < this.applicationDetailArr.length; i++) { - this.applicationDetailArr[i].orderno = i + 1; + for (let i = 0; i < this.rbDetails.length; i++) { + this.rbDetails[i].orderno = i + 1; } }, - col_addRow(rowIndex) { + addpayeeRow(rowIndex) { let rowData = { id: null, - col_personType: null, - col_personname: null, - col_bank: null, - col_accounts: null, - col_date: null, - col_illustrate: null, - col_orderno: null, - col_personname2: null, - col_money : null, + personType: null, + personname: null, + bankname: null, + bankcardno: null, + paiddate: null, + remark: null, + orderno: null, + personname: null, + amount: null, }; if (rowIndex == undefined || rowIndex == null || rowIndex < 0) { - this.applicationDetailArr2.push(rowData); + this.rbPayees.push(rowData); } else { - this.applicationDetailArr2.splice(rowIndex + 1, 0, rowData); + this.rbPayees.splice(rowIndex + 1, 0, rowData); } - for (let i = 0; i < this.applicationDetailArr2.length; i++) { - this.applicationDetailArr2[i].col_orderno = i + 1; + for (let i = 0; i < this.rbPayees.length; i++) { + this.rbPayees[i].orderno = i + 1; } }, @@ -1619,14 +1599,16 @@ //鍑犵偣鍙栨秷鐨勬彁绀� }); }, + //閲嶆柊璁$畻鎺掑簭 recountOrderNo() { - for (let i = 0; i < this.applicationDetailArr.length; i++) { - this.applicationDetailArr[i].orderno = i + 1; + for (let i = 0; i < this.rbDetails.length; i++) { + this.rbDetails[i].orderno = i + 1; } }, + //閲嶆柊璁$畻鎺掑簭 recountOrderNo2() { - for (let i = 0; i < this.applicationDetailArr2.length; i++) { - this.applicationDetailArr2[i].orderno = i + 1; + for (let i = 0; i < this.rbPayees.length; i++) { + this.rbPayees[i].orderno = i + 1; } }, @@ -1668,7 +1650,6 @@ //璁$畻璐圭敤鍚堣 sumTotalFee() { - // debugger; let allSum = 0; //鎹愮尞鑰呭灞炶垂鐢� if (!isNaN(parseFloat(this.form.donoramount))) { @@ -1677,34 +1658,34 @@ //鎶ラ攢鏄庣粏璐圭敤 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.$set(this.applicationDetailArr, i, this.applicationDetailArr[i]); - if (!isNaN(parseFloat(this.applicationDetailArr[i].total))) { - allSum += parseFloat(this.applicationDetailArr[i].total); + this.rbDetails[i].total = parseFloat(totalFee).toFixed(2); + this.$set(this.rbDetails, i, this.rbDetails[i]); + if (!isNaN(parseFloat(this.rbDetails[i].total))) { + allSum += parseFloat(this.rbDetails[i].total); } } @@ -1715,34 +1696,23 @@ getDetailArr(rbid) { getReimbursementdetaillist(rbid).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(); }); }, - //閲戦澶у啓 + //閲戦鏁板瓧杞崲鎴愬ぇ鍐� convertCurrency(money) { //姹夊瓧鐨勬暟瀛� - var cnNums = new Array( - "闆�", - "澹�", - "璐�", - "鍙�", - "鑲�", - "浼�", - "闄�", - "鏌�", - "鎹�", - "鐜�" - ); + var cnNums = new Array("闆�", "澹�", "璐�", "鍙�", "鑲�", "浼�", "闄�", "鏌�", "鎹�", "鐜�"); //鍩烘湰鍗曚綅 var cnIntRadice = new Array("", "鎷�", "浣�", "浠�"); //瀵瑰簲鏁存暟閮ㄥ垎鎵╁睍鍗曚綅 diff --git a/src/views/project/travelexpenseslistrecord/index.vue b/src/views/project/travelexpenseslistrecord/index.vue index ae31fab..653e8be 100644 --- a/src/views/project/travelexpenseslistrecord/index.vue +++ b/src/views/project/travelexpenseslistrecord/index.vue @@ -194,7 +194,7 @@ </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" @@ -310,11 +310,11 @@ </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> @@ -544,7 +544,7 @@ donorname: null, bigstrmoney: null, }, - applicationDetailArr: [], + rbDetails: [], baselist: [], balist: [], standardlevel: 0, @@ -783,7 +783,7 @@ uploadflag: null, uploadtime: null, }; - this.applicationDetailArr = [ + this.rbDetails = [ { index: 0, searchAddress: { @@ -889,13 +889,13 @@ let ids = response1.data.id; getReimbursementdetaillist(ids).then((res2) => { console.log("淇敼鐨刣etails鏁版嵁", 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(); @@ -919,13 +919,13 @@ 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(); @@ -936,7 +936,7 @@ submitForm() { this.$refs["form"].validate((valid) => { if (valid) { - // this.applicationDetailArr.forEach(item=>{ + // this.rbDetails.forEach(item=>{ // item.destination = this.searchAddress.sheng // }) @@ -944,14 +944,14 @@ 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("淇敼鎴愬姛"); @@ -966,19 +966,19 @@ 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 }); } } @@ -1019,7 +1019,7 @@ //鏂板涓�琛� addRow() { let rowData = { - index: this.applicationDetailArr.length, + index: this.rbDetails.length, searchAddress: { sheng: "", shi: "", @@ -1052,7 +1052,7 @@ uploadTime: null, total: 0, }; - this.applicationDetailArr.push(rowData); + this.rbDetails.push(rowData); }, deleteRow(index, rows, row) { @@ -1077,38 +1077,38 @@ // 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); diff --git a/vue.config.js b/vue.config.js index c0ca227..67affe1 100644 --- a/vue.config.js +++ b/vue.config.js @@ -32,10 +32,11 @@ open: true, proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy - [process.env.VUE_APP_BASE_API]: { + [process.env.VUE_APP_BASE_API]: { + target:`http://localhost:8080`, //target: `http://192.168.2.3:8080`, + //target:`http://116.62.18.175:8080`, //target: `https://slb.hospitalstar.com:9093`, - target:`http://116.62.18.175:8080`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' -- Gitblit v1.9.3