| | |
| | | atpresent: "", |
| | | Savereminder: false, //提醒保存弹框 |
| | | Reminderquantity: 0, //提醒数量 |
| | | totalquantity: 0 //总数量 |
| | | totalquantity: 0, //总数量 |
| | | Modifyornot: 0 //是否修改 |
| | | }; |
| | | }, |
| | | // vue路由控制页面关闭提示 |
| | | beforeRouteLeave(to, from, next) { |
| | | if ( |
| | | JSON.stringify(this.form) == sessionStorage.getItem("apiform") && |
| | | JSON.stringify(this.rbDetails) == sessionStorage.getItem("apifunddetail") |
| | | ) { |
| | | console.log("cg1"); |
| | | sessionStorage.removeItem("apiform"); |
| | | sessionStorage.removeItem("apifunddetail"); |
| | | |
| | | //就是上面的状态 如果是true , 则不询问是否保存, 当然这个方法比较笨, 大家可以使用更优雅的方式 |
| | | next(); |
| | | } else { |
| | | console.log("cg2"); |
| | | this.$confirm("离开页面 , 更新数据将不做保存, 请确认已经保存", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning" |
| | | }) |
| | | .then(() => { |
| | | sessionStorage.removeItem("apiform"); |
| | | sessionStorage.removeItem("apifunddetail"); |
| | | this.$router.go(-1); |
| | | next(); |
| | | }) |
| | | .catch(() => { |
| | | // alert("router") |
| | | }); |
| | | } |
| | | }, |
| | | //监听属性 类似于data概念 |
| | | computed: {}, |
| | |
| | | watch: {}, |
| | | //方法集合 |
| | | methods: { |
| | | // 浏览器页面关闭或刷新提示 |
| | | beforeunloadHandler(e) { |
| | | if ( |
| | | (JSON.stringify(this.form) == sessionStorage.getItem("apiform") && |
| | | JSON.stringify(this.rbDetails) == |
| | | sessionStorage.getItem("apifunddetail")) || |
| | | !sessionStorage.getItem("apifunddetail") |
| | | ) { |
| | | console.log(cg); |
| | | } else { |
| | | this._beforeUnload_time = new Date().getTime(); |
| | | e = e || window.event; |
| | | if (e) { |
| | | e.returnValue = "关闭提示"; |
| | | } |
| | | return "关闭提示"; |
| | | } |
| | | }, |
| | | |
| | | // 表单重置 |
| | | reset() { |
| | | this.form = { |
| | |
| | | }, |
| | | // 获取请求头 |
| | | Getnetworkheader() { |
| | | console.log(window.location.href); |
| | | let string = window.location.href; |
| | | if (string.includes("9091")) { |
| | | const index = string.indexOf("9091"); |
| | | this.Networkheader = string.slice(0, index + 4); // 截取9091及其前部字符 |
| | | console.log(this.Networkheader); |
| | | // console.log(this.Networkheader); |
| | | } else { |
| | | const index = string.indexOf("8032"); |
| | | this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符 |
| | | console.log(this.Networkheader); |
| | | } |
| | | }, |
| | | /** 通过参数获取业务类型 */ |
| | |
| | | |
| | | getFund(this.curId).then(response => { |
| | | this.form = response.data; |
| | | sessionStorage.removeItem("apiform"); |
| | | |
| | | sessionStorage.setItem("apiform", JSON.stringify(this.form)); |
| | | |
| | | // this.form.recordstate =-1; |
| | | // this.form.recordstatus = response.data.recordstatus + ""; |
| | | //附件处理 |
| | |
| | | //明细处理 |
| | | getownFundDetail(this.curId).then(res => { |
| | | this.rbDetails = res.data; |
| | | |
| | | if (this.rbDetails.length > 0) { |
| | | for (let m = 0; m < this.rbDetails.length; m++) { |
| | | this.rbDetails[m].itemlist = []; |
| | |
| | | // }); |
| | | // }); |
| | | } |
| | | console.log("yeil"); |
| | | sessionStorage.removeItem("apifunddetail"); |
| | | sessionStorage.setItem( |
| | | "apifunddetail", |
| | | JSON.stringify(this.rbDetails) |
| | | ); |
| | | } else { |
| | | this.addRow(0); |
| | | } |
| | |
| | | |
| | | getFund(this.curId).then(response => { |
| | | this.form = response.data; |
| | | sessionStorage.removeItem("apiform"); |
| | | |
| | | sessionStorage.setItem("apiform", JSON.stringify(this.form)); |
| | | |
| | | console.log("response.data", response.data); |
| | | //附件处理 |
| | | // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : [] |
| | |
| | | |
| | | getFund(this.curId).then(response => { |
| | | this.form = response.data; |
| | | sessionStorage.removeItem("apiform"); |
| | | |
| | | sessionStorage.setItem("apiform", JSON.stringify(this.form)); |
| | | |
| | | //附件处理 |
| | | // this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : [] |
| | | |
| | |
| | | } |
| | | this.rbDetails[i] = tempDetail; |
| | | /* |
| | | //计算个税 |
| | | //计算个税 |
| | | //if (isNaN(parseFloat(tempDetail.taxedamount))) |
| | | //获取参数 |
| | | this.taxParam.beneficiaryNo = tempDetail.beneficiaryno; |
| | |
| | | tempDetail.taxamount = res.data; |
| | | tempDetail.taxedamount = tempDetail.amount - tempDetail.taxamount; |
| | | this.rbDetails[k] = tempDetail; |
| | | |
| | | |
| | | this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); |
| | | this.totalAmount += parseFloat(tempDetail.amount); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 计算税前、税费、税后金额 |
| | | if (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') { |
| | | //获取参数 |
| | |
| | | tempDetail.taxamount = res.data.nowTax; |
| | | tempDetail.amount = parseFloat(res.data.nowTaxBeforeMoney); |
| | | this.rbDetails[k] = tempDetail; |
| | | |
| | | |
| | | this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); |
| | | this.totalAmount += parseFloat(tempDetail.amount); |
| | | } |
| | |
| | | this.$modal.msgError("申请单保存失败:" + response.msg); |
| | | } |
| | | }); |
| | | sessionStorage.setItem( |
| | | "apifunddetail", |
| | | JSON.stringify(this.rbDetails) |
| | | ); |
| | | sessionStorage.setItem("apiform", JSON.stringify(this.form)); |
| | | |
| | | //关闭窗口 |
| | | this.loading = false; |
| | |
| | | } |
| | | this.rbDetails[i] = tempDetail; |
| | | /* |
| | | //计算个税 |
| | | //计算个税 |
| | | //if (isNaN(parseFloat(tempDetail.taxedamount))) |
| | | //获取参数 |
| | | this.taxParam.beneficiaryNo = tempDetail.beneficiaryno; |
| | |
| | | tempDetail.taxamount = res.data; |
| | | tempDetail.taxedamount = tempDetail.amount - tempDetail.taxamount; |
| | | this.rbDetails[k] = tempDetail; |
| | | |
| | | |
| | | this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); |
| | | this.totalAmount += parseFloat(tempDetail.amount); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | // 计算税前、税费、税后金额 |
| | | if (tempDetail.amount == undefined || tempDetail.amount == null || tempDetail.amount == 0 || tempDetail.amount == '') { |
| | | //获取参数 |
| | |
| | | tempDetail.taxamount = res.data.nowTax; |
| | | tempDetail.amount = parseFloat(res.data.nowTaxBeforeMoney); |
| | | this.rbDetails[k] = tempDetail; |
| | | |
| | | |
| | | this.totalAfterTaxAmount += parseFloat(tempDetail.taxedamount); |
| | | this.totalAmount += parseFloat(tempDetail.amount); |
| | | } |
| | |
| | | addorupdateFund(this.form).then(response => { |
| | | if (response.code === 200) { |
| | | this.$modal.msgSuccess("申请单保存成功!"); |
| | | this.Getnetworkheader(); |
| | | this.getroute(); |
| | | this.getExternalList(); |
| | | this.getUserList(); |
| | | this.getUserProfile(); |
| | | } else { |
| | | this.$modal.msgError("申请单保存失败:" + response.msg); |
| | | } |
| | |
| | | this.form.filename = file.raw.name; |
| | | |
| | | this.$modal.msgSuccess(response.msg); |
| | | this.fileListto.push({ name: file.name, url: response.fileName }); |
| | | // this.fileListto.push({ name: file.name, url: response.fileName }); |
| | | this.fileListto.push({ name: file.name, url: response.url }); |
| | | this.rbDetails[this.atpresent].annexfilesList = this.fileListto; |
| | | } else { |
| | | console.log(response.msg); |
| | |
| | | this.pdfVisible = true; |
| | | if (this.rbDetails[index].annexfilesList) { |
| | | this.fileListto = this.rbDetails[index].annexfilesList; |
| | | this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url; |
| | | // this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url; |
| | | this.pdfimg = this.fileListto[0].url; |
| | | this.pdfimgsrcList = []; |
| | | this.pdfimgsrcList.push(this.pdfimg); |
| | | console.log(this.pdfimg); |
| | |
| | | |
| | | //生命周期 - 挂载完成(可以访问DOM元素) |
| | | mounted() { |
| | | window.addEventListener("beforeunload", e => this.beforeunloadHandler(e)); |
| | | this.getUserList(); |
| | | this.getUserProfile(); |
| | | let apifunddetailForm = this.funddetailForm; |
| | | let apiform = this.form; |
| | | console.log(apiform); |
| | | console.log(apifunddetailForm); |
| | | |
| | | // this.getFeeUnitList(); |
| | | }, |
| | | |
| | | beforeCreate() {}, //生命周期 - 创建之前 |
| | | beforeMount() {}, //生命周期 - 挂载之前 |
| | | beforeUpdate() {}, //生命周期 - 更新之前 |
| | | beforeUpdate() { |
| | | console.log("beforeUpdate"); |
| | | }, //生命周期 - 更新之前 |
| | | updated() {}, //生命周期 - 更新之后 |
| | | beforeDestroy() {}, //生命周期 - 销毁之前 |
| | | destroyed() {}, //生命周期 - 销毁完成 |