From 648ddd53f3f0cc84d5fba81944b976d51e0c1372 Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期三, 02 八月 2023 16:41:59 +0800 Subject: [PATCH] yxh --- src/views/project/funddetail/index.vue | 287 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 155 insertions(+), 132 deletions(-) diff --git a/src/views/project/funddetail/index.vue b/src/views/project/funddetail/index.vue index 6807d23..734cebc 100644 --- a/src/views/project/funddetail/index.vue +++ b/src/views/project/funddetail/index.vue @@ -46,7 +46,7 @@ --> <el-col :span="5"> <el-form-item label="璐圭敤绫诲瀷"> - <el-radio v-model="form.applytype" label="4">鏉傞」璐圭敤鐢宠</el-radio> + <el-radio v-model="form.applytype" label="1">鏉傞」璐圭敤鐢宠</el-radio> </el-form-item> </el-col> <el-col :span="10"> @@ -125,7 +125,7 @@ <template slot-scope="scope"> <el-select v-model="scope.row.itemid" placeholder="鏈嶅姟椤圭洰鍚嶇О" filterable @change="verifyFeeItem(scope.row)" :filter-method="(val) => searchItemType(val, scope)"> - <el-option v-for="dict in scope.row.itemArr" :key="dict.index" :label="dict.itemName" + <el-option v-for="dict in scope.row.itemlist" :key="dict.index" :label="dict.itemName" :value="dict.id"></el-option> </el-select> </template> @@ -199,7 +199,7 @@ </el-select> --> </template> </el-table-column> - <el-table-column prop="quantity" align="center" label="鏁伴噺" width="120" v-if="form.applytype == '3'"> + <el-table-column prop="quantity" align="center" label="鏁伴噺" width="120" v-if="form.applytype == '4'"> <template slot-scope="scope"> <el-input v-model="scope.row.quantity" placeholder="鏁伴噺" @blur="(val) => { sumTotalFee(scope.row); @@ -207,7 +207,7 @@ " /> </template> </el-table-column> - <el-table-column prop="price" align="center" label="浠锋牸" width="120" v-if="form.applytype == '3'"> + <el-table-column prop="price" align="center" label="浠锋牸" width="120" v-if="form.applytype == '4'"> <template slot-scope="scope"> <el-input v-model="scope.row.price" placeholder="浠锋牸" @blur="(val) => { sumTotalFee(scope.row); @@ -215,7 +215,7 @@ " /> </template> </el-table-column> - <el-table-column prop="remark" align="center" label="澶囨敞" width="210" v-if="form.applytype == '3'"> + <el-table-column prop="remark" align="center" label="澶囨敞" width="210" v-if="form.applytype == '4'"> <template slot-scope="scope"> <el-input v-model="scope.row.remark" placeholder="澶囨敞" /> </template> @@ -241,7 +241,7 @@ <el-input v-model="scope.row.bankcardno" placeholder="閾惰鍗″彿" /> </template> </el-table-column> - <el-table-column fixed="right" align="center" label="鎿嶄綔" width="180" v-if="dialogType == 'edit'"> + <el-table-column fixed="right" align="center" label="鎿嶄綔" width="180" v-if="operationtype == 'edit'"> <template slot-scope="scope"> <el-button type="text" size="mini" @click="addRow(scope.$index)">鏂板</el-button> <el-button @click.native.prevent=" @@ -300,14 +300,14 @@ <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileList" multiple :limit="20" :headers="headers" :on-success="(response, file, fileList) => uploadSccess(response, file, fileList) - " :on-preview="downFile" :disabled='dialogType == "detail"' :on-error="handleUploadError" + " :on-preview="downFile" :disabled='operationtype == "detail"' :on-error="handleUploadError" :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf"> - <el-button :disabled='dialogType == "detail"' size="small" type="primary">涓婁紶</el-button> + <el-button :disabled='operationtype == "detail"' size="small" type="primary">涓婁紶</el-button> </el-upload> </el-form-item> </el-col> </el-row> - <el-row v-if="dialogType == 'detail'"> + <el-row v-if="operationtype == 'detail'"> <el-table :data="fundflowList" border> <el-table-column label="瀹℃牳浜�" align="center" width="120" prop="checkusername" /> <el-table-column label="瀹℃牳鏃ユ湡" align="center" width="160" prop="createTime" /> @@ -320,7 +320,7 @@ </el-row> </el-form> <div slot="footer" class="dialog-footer"> - <el-button type="primary" @click="submitForm" v-if="dialogType == 'edit'">淇� 瀛�</el-button> + <el-button type="primary" @click="submitForm" v-if="operationtype == 'edit'">淇� 瀛�</el-button> <!-- <el-button type="success" @click="print">鎵� 鍗�</el-button> --> <el-button @click="cancel">鍙� 娑�</el-button> </div> @@ -524,7 +524,8 @@ loading: false, // 瀵煎嚭閬僵灞� exportLoading: false, - total: 0, + + //鏌ヨ鍙傛暟 queryParams: { organizationname: null, organizationtype: null, @@ -541,6 +542,7 @@ reportername: null, reporttime: null, }, + fundQueryParam: { pageNum: 1, pageSize: 100, @@ -548,10 +550,7 @@ applytype: "4", createBy: null, }, - // 琛ㄥ崟鍙傛暟 - form: {}, - //鎵�鏈変汉鍛樿〃 - personlist: [], + expertQueryParam: { pageNum: 1, pageSize: 10000, @@ -560,21 +559,30 @@ usertype: null, }, - // - amount: 0.00, - - //鐢宠鍗曠被鍨� - currentApplyType: "4", - //涓撳鍒楄〃 - expertlist: [], - //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧� - expertfrom: "1", //璁$畻涓◣鍙傛暟 taxParam: { beneficiaryNo: '', money: '0', startTime: '', }, + + // 琛ㄥ崟鍙傛暟 + form: {}, + + total: 0, + + //鐢宠鍗曠被鍨� + businesstype: "4", + //鎿嶄綔绫诲瀷 + operationtype: "edit", + //鎵�鏈変汉鍛樿〃 + personlist: [], + // + amount: 0.00, + //涓撳鍒楄〃 + expertlist: [], + //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧� + expertfrom: "1", // 琛ㄥ崟鏍¢獙 rules: { username: [ @@ -592,15 +600,9 @@ }, //鎹愮尞妗堜緥鍒楄〃鏁版嵁 - // donationCaseTableData:[], donatebaseinfoList: [], //褰撳墠閫変腑鎹愮尞妗堜緥 curCase: {}, - //鏄惁鏄剧ず璐圭敤鐢宠寮圭獥 - dialogOpen: false, - // title: "", - //璐圭敤鐢宠琛ㄥ崟title - applyFormTitle: "", // 鎹愮尞浜洪亾鎱伴棶閲戣〃鏍兼暟鎹� donateconsolationfundList: [], @@ -611,10 +613,10 @@ totalAfterTaxAmount: 0.0, totalAmount: 0.0, - // 寮瑰嚭灞傛爣棰� + //璐圭敤鐢宠琛ㄥ崟title title: "", userlist: [], - itemArr: [], + itemlist: [], reporters: [], //琛岃褰曠殑璐圭敤绫诲瀷鏁扮粍 @@ -623,12 +625,11 @@ feeItemTypes: [], //璐圭敤璇存槑 rowfeeblocks: [], - defaultperson: {}, + userprofile: {}, //鏄惁鏄笓瀹惰垂鐨凮PO瀹℃壒浜哄憳 ismanager: false, unitList: [], - dialogType: "edit", fundflowList: [], showDetailInfoDialog: false, @@ -679,7 +680,7 @@ fileList: [], //涓婁紶闄勪欢璺緞 uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", - + //鏂囦欢涓婁紶token headers: { Authorization: "Bearer " + getToken(), }, @@ -692,22 +693,23 @@ watch: {}, //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛� created() { - this.getList(); - this.getBaseInfoList(); + //鑾峰彇鍗曟嵁绫诲瀷鍜屾搷浣滆姹� this.getCurFundType(); - this.getUserList(); - this.getUnitList(); - + this.getUserProfile(); + this.getroute(); }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛� - mounted() { + mounted() { + this.getUserList(); + this.getUnitList(); this.selectReporters(); - this.getUsermsg(); this.getExternalpersonList(); + this.getBaseInfoList(); }, - beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 + beforeCreate() { + }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 @@ -717,11 +719,52 @@ //鏂规硶闆嗗悎 methods: { + /** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */ + getroute() { + //閫夋嫨涓氬姟绫诲瀷:1銆佹柊澧烇紱2銆佷慨鏀癸紱3銆佹煡鐪� + let ids = this.$route.query.id; + let tempbusinesstype = this.$route.query.businesstype; + let tempoperationtype = this.$route.query.operationtype; + // this.userprofile = this.$route.query.routerparam; + if (tempbusinesstype == 1) { + this.businesstype = tempbusinesstype; + this.title = '涓撳鍔冲姟璐圭敵璇峰崟'; + this.handleAdd(ids); + } else if (tempbusinesstype == 2) { + this.businesstype = tempbusinesstype; + this.title = '浼︾悊涓撳鍔冲姟璐圭敵璇峰崟'; + this.handleUpdate(ids); + } + else if (tempbusinesstype == 3) { + this.businesstype = tempbusinesstype; + this.title = '鍖诲鎴愭湰鎶ラ攢鍗�'; + this.handleDetail(ids); + } + else if (tempbusinesstype == 4) { + this.businesstype = tempbusinesstype; + this.title = '鏉傝薄璐圭敤鎶ラ攢鍗�'; + // this.handleCheck(ids); + } - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); + if (tempoperationtype == 1) { + this.operationtype = 'add'; + this.title += '鏂板缓' + this.handleAdd(ids); + } else if (tempoperationtype == 2) { + this.operationtype = 'update'; + this.title += '淇敼' + this.handleUpdate(ids); + } + else if (tempoperationtype == 3) { + this.operationtype = 'detail'; + this.title += '鏌ョ湅' + this.handleDetail(ids); + } else if (tempoperationtype == 4) { + this.title += '瀹℃牳' + this.handleCheck(ids); + } + console.log( + this.businesstype = tempbusinesstype, this.title); }, /** 閲嶇疆鎸夐挳鎿嶄綔 */ @@ -733,35 +776,40 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { - if (this.curCase.id) { - this.istrue += 2; - this.reset(); - this.queryParams.params = {}; - this.form.donorno = this.curCase.donorno; - this.form.name = this.curCase.name; - this.form.infoid = this.curCase.id; - console.log("defaultperson", this.defaultperson); - this.form.username = this.defaultperson.nickName; - this.form.userno = this.defaultperson.userName; - this.form.phone = this.defaultperson.phonenumber; - this.form.deptmentname = this.defaultperson.dept.deptName; - this.form.deptmentno = this.defaultperson.dept.deptId; - this.form.managername = this.defaultperson.dept.leader; + this.reset(); + this.queryParams.params = {}; - // this.form.createTime = nowdate; - //this.open = true; - //this.initFundApplyForm(); - this.fundDetails = []; - this.addRow(); - this.dialogOpen = true; - this.dialogType = "edit"; - this.title = "璐圭敤鐢宠"; - } else { - const h = this.$createElement; - this.$message({ - message: h("p", null, [h("span", null, "璇峰厛閫夋嫨宸︽柟鎹愮尞妗堜緥 ")]), - }); + /** businesstype锛�4锛氭潅椤硅垂鐢ㄦ姤閿�鐢宠 */ + if (this.businesstype != "4") { + if (this.curCase.id) { + this.istrue += 2; + this.form.donorno = this.curCase.donorno; + this.form.name = this.curCase.name; + this.form.infoid = this.curCase.id; + + // this.form.createTime = nowdate; + //this.open = true; + //this.initFundApplyForm(); + } else { + const h = this.$createElement; + this.$message({ + message: h("p", null, [h("span", null, "璇峰厛閫夋嫨宸︽柟鎹愮尞妗堜緥 ")]), + }); + return; + } } + + this.form.username = this.userprofile.nickName; + this.form.userno = this.userprofile.userName; + this.form.phone = this.userprofile.phonenumber; + this.form.deptmentname = this.userprofile.dept.deptName; + this.form.deptmentno = this.userprofile.dept.deptId; + this.form.managername = this.userprofile.dept.leader; + +//鍒濆鍖栨槑缁� + this.fundDetails = []; + this.addRow(); + }, /** 淇敼鎸夐挳鎿嶄綔 */ @@ -771,9 +819,8 @@ this.queryParams.params = {}; this.form.donorno = this.curCase.donorno; this.form.infoid = this.curCase.id; - this.dialogOpen = true; this.title = "淇敼璐圭敤鐢宠"; - this.dialogType = "edit"; + this.operationtype = "edit"; const id = row.id || this.ids; getFund(id).then((response) => { @@ -786,8 +833,8 @@ getownFundDetail(id).then((res) => { this.fundDetails = res.data; for (let m = 0; m < this.fundDetails.length; m++) { - this.fundDetails[m].itemArr = []; - this.getItemArr(m, this.fundDetails[m]); + this.fundDetails[m].itemlist = []; + this.getitemlist(m, this.fundDetails[m]); //鑾峰彇璐圭敤椤圭洰鐨勮缁嗕俊鎭� this.fundDetails[m].rowfeeblocks = []; @@ -825,9 +872,8 @@ this.queryParams.params = {}; this.form.donorno = this.curCase.donorno; this.form.infoid = this.curCase.id; - this.dialogOpen = true; this.title = "鏌ョ湅璐圭敤鐢宠"; - this.dialogType = "detail"; + this.operationtype = "detail"; const id = row.id || this.ids; getFund(id).then((response) => { @@ -846,8 +892,8 @@ getownFundDetail(id).then((res) => { this.fundDetails = res.data; for (let m = 0; m < this.fundDetails.length; m++) { - this.fundDetails[m].itemArr = []; - this.getItemArr(m, this.fundDetails[m]); + this.fundDetails[m].itemlist = []; + this.getitemlist(m, this.fundDetails[m]); this.fundDetails[m].rowfeeblocks = []; this.fundDetails[m].rowfeeblocks.push({ expense: this.fundDetails[m].expense, @@ -878,7 +924,6 @@ delFunddetail(listdetails[i].id); } }); - // this.getList(); this.getfundList(); this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }) @@ -972,13 +1017,13 @@ for (let i = 0; i < this.fundDetails.length; i++) { let tempDetail = this.fundDetails[i]; //鑾峰彇鏈嶅姟椤圭洰鏄庣粏 - let tempItemArr = tempDetail.itemArr; - let itemIndex = tempItemArr.findIndex( + let tempitemlist = tempDetail.itemlist; + let itemIndex = tempitemlist.findIndex( (item) => tempDetail.itemid == item.id ); if (itemIndex > -1) { - tempDetail.itemname = tempItemArr[itemIndex].itemName; - tempDetail.itemid = tempItemArr[itemIndex].id; + tempDetail.itemname = tempitemlist[itemIndex].itemName; + tempDetail.itemid = tempitemlist[itemIndex].id; } //鑾峰彇applytypename銆佹湇鍔¤垂鐢ㄥぇ绫� @@ -1006,13 +1051,13 @@ tempDetail.taxamount = res.data; tempDetail.taxedamount = tempDetail.amount - tempDetail.taxamount; this.fundDetails[k] = tempDetail; - + this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); this.totalAmount += parseFloat(tempDetail.amount); } }); } - + // 璁$畻绋庡墠閲戦 if (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') { //鑾峰彇鍙傛暟 @@ -1022,7 +1067,7 @@ tempDetail.taxamount = res.data.nowTax; tempDetail.amount = parseFloat(res.data.nowTaxBeforeMoney); this.fundDetails[k] = tempDetail; - + this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); this.totalAmount += parseFloat(tempDetail.amount); console.log("1", this.amount); @@ -1087,9 +1132,7 @@ //鍏抽棴绐楀彛 this.loading = false; - this.dialogOpen = false; // this.getfundList(); - this.getList(); this.selectDonotor(this.curCase); } @@ -1098,7 +1141,6 @@ // 鍙栨秷鎸夐挳 cancel() { - this.dialogOpen = false; this.reset(); }, @@ -1277,12 +1319,11 @@ }, //鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 - getUsermsg() { + getUserProfile() { getUserProfile().then((response) => { - this.defaultperson = response.data; - console.log("this.defaultperson", this.defaultperson); + this.userprofile = response.data; this.standardlevel = response.data.standardlevel; - if (this.defaultperson.createBy == "admin" || this.defaultperson.createBy == "001" || this.defaultperson.createBy == "002") { + if (this.userprofile.createBy == "admin" || this.userprofile.createBy == "001" || this.userprofile.createBy == "002") { this.ismanager = true; } else { this.ismanager = false; @@ -1315,7 +1356,7 @@ //鏍¢獙鏀惰垂椤圭洰鏄惁閲嶅 verifyFeeItem(row) { - row.itemArr.map((res) => { + row.itemlist.map((res) => { if (row.itemid === res.id) { row.remark = res.itemDescribe; row.itemcode = res.itemCode; @@ -1357,24 +1398,6 @@ if (item.expense === row.amount) { row.remark = item.expensedescribe; } - }); - }, - - /** 鏌ヨ鎹愮尞浜洪亾鎱伴棶閲戝垪琛� */ - getList() { - console.log("getList", "getList"); - this.loading = true; - this.queryParams.params = {}; - if (null != this.daterangeReporttime && "" != this.daterangeReporttime) { - this.queryParams.params["beginReporttime"] = - this.daterangeReporttime[0]; - this.queryParams.params["endReporttime"] = this.daterangeReporttime[1]; - } - // this.queryParams.residencetown = this.$refs.areaSelect.getQu(); - listDonatebaseinfo(this.queryParams).then((response) => { - this.donatebaseinfoList = response.rows; - this.total = response.total; - this.loading = false; }); }, @@ -1441,7 +1464,7 @@ recordstatus: "-1", beneficiaryname: "鐐瑰嚮閫夋嫨", unitname: "鐐瑰嚮閫夋嫨", - itemArr: this.feeItemTypes[i].itemDetails, + itemlist: this.feeItemTypes[i].itemDetails, rowfeeblocks: null, servicesscope: null, servicesscopename: "" @@ -1484,11 +1507,11 @@ }, addAll(row, i, arr) { - row.itemArr.map((res) => { + row.itemlist.map((res) => { if (res.id !== row.itemid) { let a = arr.length; this.addRow(); - arr[a].itemArr = row.itemArr; + arr[a].itemlist = row.itemlist; arr[a].applytype = row.applytype; arr[a].itemid = res.id; @@ -1550,7 +1573,7 @@ updateTime: null, uploadflag: null, uploadtime: null, - itemArr: [], + itemlist: [], servicesscope: null, rowfeeblocks: [], }; @@ -1567,14 +1590,14 @@ //鍔犺浇鏈嶅姟椤圭洰 loadItemType(row) { let list = this.feeItemTypes.filter((r) => r.itemType == row.applytype); - row.itemArr = list[0].itemDetails; + row.itemlist = list[0].itemDetails; row.itemid = null; this.$forceUpdate(); //this.loading = true; // getItemNames(row.applytype).then((res) => { // this.loading = false; // row.itemid = null; - // row.itemArr = res.data; + // row.itemlist = res.data; // this.$forceUpdate(); // }); }, @@ -1635,19 +1658,19 @@ searchItemType(val, scope) { let result = []; if (val != "") { - let tempItemArr = scope.row.itemArr; - for (let i = 0; i < tempItemArr.length; i++) { - let pym = tempItemArr[i].itempinyin; + let tempitemlist = scope.row.itemlist; + for (let i = 0; i < tempitemlist.length; i++) { + let pym = tempitemlist[i].itempinyin; if (pym != null && pym != undefined && pym != "") { if (pym.indexOf(val) != -1) { - result.push(tempItemArr[i]); + result.push(tempitemlist[i]); } } } - scope.row.itemArr = result; + scope.row.itemlist = result; } else { getItemNames(scope.row.applytype).then((res) => { - scope.row.itemArr = res.data; + scope.row.itemlist = res.data; //this.$set(this.fundDetails, rowindex, row); }); } @@ -1736,7 +1759,7 @@ //鑾峰彇璐圭敤绫诲瀷 getCurFundType() { - getFundTypeAll(this.currentApplyType).then((res) => { + getFundTypeAll(this.businesstype).then((res) => { let dataList = res.data; this.feeItemTypes = dataList; this.rowfeeItemTypes = []; @@ -1751,14 +1774,14 @@ }); }, - getItemArr(rowindex, row) { + getitemlist(rowindex, row) { let list = this.feeItemTypes.filter((r) => r.itemType == row.applytype); - row.itemArr = list[0].itemDetails; + row.itemlist = list[0].itemDetails; this.$set(this.fundDetails, rowindex, row); //this.loading = true; // getItemNames(row.applytype).then((res) => { // this.loading = false; - // row.itemArr = res.data; + // row.itemlist = res.data; // this.$set(this.fundDetails, rowindex, row); // }); }, -- Gitblit v1.9.3