From 3cbb8936b9f9f977741bb9e465fb1f904836b71b Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期一, 07 八月 2023 16:39:17 +0800 Subject: [PATCH] yxh --- src/views/project/funddetail/index.vue | 300 ++++++++++++++++++++++++++++++----------------------------- 1 files changed, 153 insertions(+), 147 deletions(-) diff --git a/src/views/project/funddetail/index.vue b/src/views/project/funddetail/index.vue index 6807d23..08cca9d 100644 --- a/src/views/project/funddetail/index.vue +++ b/src/views/project/funddetail/index.vue @@ -32,12 +32,7 @@ </el-col> </el-row> <el-row style="text-align: left"> - <!-- - <el-col :span="7"> - <el-form-item label="鑱旂郴鐢佃瘽" prop="phone"> - <el-input v-model="form.phone" placeholder="璇疯緭鍏ョ敵璇疯�呯殑鑱旂郴鏂瑰紡" clearable /> - </el-form-item> - </el-col> + <!-- <el-col :span="7"> <el-form-item label="宸ヤ綔鍗曚綅" prop="unitno"> <org-selecter ref="orgSelecter" :org-type="'3'" v-model="form.unitno" /> @@ -46,7 +41,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="true">鏉傞」璐圭敤鐢宠</el-radio> </el-form-item> </el-col> <el-col :span="10"> @@ -78,7 +73,8 @@ <el-form-item label="搴旂即绋�" prop="taxcost"> <el-input v-model="form.taxcost" placeholder="搴旂即绋庨噾棰濆悎璁�" :disabled="true" /> </el-form-item> - </el-col><!-- + </el-col> + <!-- <el-col :span="5"> <el-form-item label="绋庡悗閲戦" prop="pretaxcost"> <el-input v-model="form.taxedcost" placeholder="绋庡悗閲戦鍚堣" :disabled="true" /> @@ -125,7 +121,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 +195,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 +203,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 +211,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 +237,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 +296,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 +316,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 +520,8 @@ loading: false, // 瀵煎嚭閬僵灞� exportLoading: false, - total: 0, + + //鏌ヨ鍙傛暟 queryParams: { organizationname: null, organizationtype: null, @@ -541,6 +538,7 @@ reportername: null, reporttime: null, }, + fundQueryParam: { pageNum: 1, pageSize: 100, @@ -548,10 +546,7 @@ applytype: "4", createBy: null, }, - // 琛ㄥ崟鍙傛暟 - form: {}, - //鎵�鏈変汉鍛樿〃 - personlist: [], + expertQueryParam: { pageNum: 1, pageSize: 10000, @@ -560,21 +555,30 @@ usertype: null, }, - // - amount: 0.00, - - //鐢宠鍗曠被鍨� - currentApplyType: "4", - //涓撳鍒楄〃 - expertlist: [], - //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧� - expertfrom: "1", //璁$畻涓◣鍙傛暟 taxParam: { beneficiaryNo: '', money: '0', startTime: '', }, + + // 琛ㄥ崟鍙傛暟 + form: {}, + + total: 0, + + //鐢宠鍗曠被鍨� + businesstype: null, + //鎿嶄綔绫诲瀷 + operationtype: "edit", + //鎵�鏈変汉鍛樿〃 + personlist: [], + // + amount: 0.00, + //涓撳鍒楄〃 + expertlist: [], + //涓撳璐归�夋嫨锛�1鏄笓瀹跺簱锛�2鏄柊澧� + expertfrom: "1", // 琛ㄥ崟鏍¢獙 rules: { username: [ @@ -592,15 +596,9 @@ }, //鎹愮尞妗堜緥鍒楄〃鏁版嵁 - // donationCaseTableData:[], donatebaseinfoList: [], //褰撳墠閫変腑鎹愮尞妗堜緥 curCase: {}, - //鏄惁鏄剧ず璐圭敤鐢宠寮圭獥 - dialogOpen: false, - // title: "", - //璐圭敤鐢宠琛ㄥ崟title - applyFormTitle: "", // 鎹愮尞浜洪亾鎱伴棶閲戣〃鏍兼暟鎹� donateconsolationfundList: [], @@ -611,10 +609,10 @@ totalAfterTaxAmount: 0.0, totalAmount: 0.0, - // 寮瑰嚭灞傛爣棰� + //璐圭敤鐢宠琛ㄥ崟title title: "", userlist: [], - itemArr: [], + itemlist: [], reporters: [], //琛岃褰曠殑璐圭敤绫诲瀷鏁扮粍 @@ -623,12 +621,11 @@ feeItemTypes: [], //璐圭敤璇存槑 rowfeeblocks: [], - defaultperson: {}, + userprofile: {}, //鏄惁鏄笓瀹惰垂鐨凮PO瀹℃壒浜哄憳 ismanager: false, unitList: [], - dialogType: "edit", fundflowList: [], showDetailInfoDialog: false, @@ -679,7 +676,7 @@ fileList: [], //涓婁紶闄勪欢璺緞 uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", - + //鏂囦欢涓婁紶token headers: { Authorization: "Bearer " + getToken(), }, @@ -692,22 +689,23 @@ watch: {}, //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛� created() { - this.getList(); - this.getBaseInfoList(); + //鑾峰彇鍗曟嵁绫诲瀷鍜屾搷浣滆姹� this.getCurFundType(); - this.getUserList(); - this.getUnitList(); - + this.getroute(); + this.getUserProfile(); }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛� mounted() { + this.getUserList(); + this.getUnitList(); this.selectReporters(); - this.getUsermsg(); this.getExternalpersonList(); + this.getBaseInfoList(); }, - beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 + beforeCreate() { + }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 @@ -717,51 +715,75 @@ //鏂规硶闆嗗悎 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; - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, + this.businesstype = tempbusinesstype; + if (tempbusinesstype == "1") { + this.title = '涓撳鍔冲姟璐圭敵璇峰崟'; + } else if (tempbusinesstype == "2") { + this.title = '浼︾悊涓撳鍔冲姟璐圭敵璇峰崟'; + } + else if (tempbusinesstype == "3") { + this.title = '鍖诲鎴愭湰鎶ラ攢鍗�'; + } + else if (tempbusinesstype == "4") { + this.title = '鏉傞」璐圭敤鎶ラ攢鍗�'; + } - /** 閲嶇疆鎸夐挳鎿嶄綔 */ - resetQuery() { - this.daterangeReporttime = []; - this.resetForm("queryForm"); - this.handleQuery(); + this.operationtype = tempoperationtype; + if (tempoperationtype == 'add') { + this.title += '鏂板缓' + this.handleAdd(); + } else if (tempoperationtype == 'update') { + this.title += '淇敼' + this.handleUpdate(ids); + } + else if (tempoperationtype == 'detail') { + this.title += '鏌ョ湅' + this.handleDetail(ids); + } else if (tempoperationtype == 'check') { + this.title += '瀹℃牳' + this.handleCheck(ids); + } }, /** 鏂板鎸夐挳鎿嶄綔 */ 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锛�1:涓撳璐癸紱2锛氫鸡鐞嗕笓瀹惰垂 */ + if (this.businesstype == "1" && this.businesstype == "2") { + 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.applytype = this.businesstype; + this.form.createTime = new Date(); + this.fundDetails = []; + this.addRow(); + }, /** 淇敼鎸夐挳鎿嶄綔 */ @@ -771,9 +793,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 +807,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 +846,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 +866,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 +898,6 @@ delFunddetail(listdetails[i].id); } }); - // this.getList(); this.getfundList(); this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }) @@ -972,13 +991,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 +1025,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 +1041,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 +1106,7 @@ //鍏抽棴绐楀彛 this.loading = false; - this.dialogOpen = false; // this.getfundList(); - this.getList(); this.selectDonotor(this.curCase); } @@ -1098,7 +1115,6 @@ // 鍙栨秷鎸夐挳 cancel() { - this.dialogOpen = false; this.reset(); }, @@ -1276,16 +1292,24 @@ this.showDetailInfoDialog = false; }, - //鑾峰彇褰撳墠鐢ㄦ埛淇℃伅 - getUsermsg() { - getUserProfile().then((response) => { - this.defaultperson = response.data; - console.log("this.defaultperson", this.defaultperson); - this.standardlevel = response.data.standardlevel; - if (this.defaultperson.createBy == "admin" || this.defaultperson.createBy == "001" || this.defaultperson.createBy == "002") { + //鑾峰彇褰撳墠鐢ㄦ埛淇℃伅锛屽苟鍒濆鍖栫粡鍔炰汉淇℃伅 + getUserProfile() { + getUserProfile().then((res) => { + this.userprofile = res.data; + this.standardlevel = res.data.standardlevel; + if (this.userprofile.createBy == "admin" || this.userprofile.createBy == "001" || this.userprofile.createBy == "002") { this.ismanager = true; } else { this.ismanager = false; + } + + if (this.operationtype = "add") { + 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; } }); }, @@ -1315,7 +1339,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 +1381,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 +1447,7 @@ recordstatus: "-1", beneficiaryname: "鐐瑰嚮閫夋嫨", unitname: "鐐瑰嚮閫夋嫨", - itemArr: this.feeItemTypes[i].itemDetails, + itemlist: this.feeItemTypes[i].itemDetails, rowfeeblocks: null, servicesscope: null, servicesscopename: "" @@ -1484,11 +1490,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 +1556,7 @@ updateTime: null, uploadflag: null, uploadtime: null, - itemArr: [], + itemlist: [], servicesscope: null, rowfeeblocks: [], }; @@ -1567,14 +1573,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 +1641,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 +1742,7 @@ //鑾峰彇璐圭敤绫诲瀷 getCurFundType() { - getFundTypeAll(this.currentApplyType).then((res) => { + getFundTypeAll(this.businesstype).then((res) => { let dataList = res.data; this.feeItemTypes = dataList; this.rowfeeItemTypes = []; @@ -1751,14 +1757,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