| | |
| | | }, |
| | | handleQuery() {}, |
| | | resetQuery() { |
| | | this.patientqueryParams.donorname = null; |
| | | this.patientqueryParams.donorno = null; |
| | | this.patientqueryParams.donorchargeid = null; |
| | | this.handleAddpatient(); |
| | | }, |
| | |
| | | item.taXmoney = item.taXmoney.toFixed(2); |
| | | this.accumulation(); |
| | | }); |
| | | this.$modal.msgSuccess("添加成功!"); |
| | | if (this.form.id) { |
| | | this.form.istax = 0; |
| | | this.form.taxedtime = ""; |
| | | this.$modal.confirm("添加成功!,需要重新保存并计算单据!").then(() => { |
| | | this.submitForm(); |
| | | }); |
| | | } else { |
| | | this.$modal.msgSuccess("添加成功!"); |
| | | } |
| | | |
| | | this.dialogVisiblepatient = false; |
| | | }, |
| | |
| | | if (res1.code == 200) { |
| | | this.$modal.msgSuccess("计算成功"); |
| | | this.$modal.closeLoading(); |
| | | getFundtax(this.form.id).then(response => { |
| | | this.form = response.data; |
| | | if (this.form.serviceFunds[0]) { |
| | | this.donorchargeorgans = this.form.serviceFunds; |
| | | this.donorchargeorgans.forEach(item => { |
| | | item.taXmoney = item.pretaxcost - item.taxedcost; |
| | | item.taXmoney = item.taXmoney.toFixed(2); |
| | | this.accumulation();//计算 |
| | | this.form.istax = 1; |
| | | this.submitForm(); |
| | | }); |
| | | } |
| | | }); |
| | | this.form.istax = 1; |
| | | this.form.taxedtime = this.$moment().format( |
| | | "YYYY-MM-DD HH:mm:ss" |
| | | ); |
| | | this.submitForm(); |
| | | } else { |
| | | this.$modal.closeLoading(); |
| | | this.$modal.msgError(res1.msg); |
| | |
| | | // 金额合计 |
| | | accumulation() { |
| | | this.form.pretaxamount = this.donorchargeorgans.reduce( |
| | | (acc, obj) => acc + obj.pretaxcost, |
| | | (acc, obj) => acc + Number(obj.pretaxcost), |
| | | 0 |
| | | ); |
| | | this.form.taxMoney = this.donorchargeorgans.reduce( |
| | |
| | | 0 |
| | | ); |
| | | this.form.taxedamount = this.donorchargeorgans.reduce( |
| | | (acc, obj) => acc + obj.taxedcost, |
| | | (acc, obj) => acc + Number(obj.taxedcost), |
| | | 0 |
| | | ); |
| | | }, |
| | |
| | | if (valid) { |
| | | this.$modal.loading("正在提交,请稍候!"); |
| | | //保存 |
| | | console.log(1); |
| | | this.form.serviceFunds = this.donorchargeorgans; |
| | | console.log(2); |
| | | if (this.form.id != null) { |
| | | updateFundtax(this.form).then(res1 => { |
| | | if (res1.code == 200) { |
| | | console.log(3); |
| | | this.$modal.msgSuccess("保存成功!"); |
| | | getFundtax(this.form.id).then(response => { |
| | | this.form = response.data; |
| | | if (this.form.serviceFunds[0]) { |
| | | this.donorchargeorgans = this.form.serviceFunds; |
| | | this.donorchargeorgans.forEach(item => { |
| | | item.taXmoney = item.pretaxcost - item.taxedcost; |
| | | item.taXmoney = item.taXmoney.toFixed(2); |
| | | this.accumulation(); |
| | | }); |
| | | } |
| | | }); |
| | | this.$modal.closeLoading(); |
| | | } else { |
| | | this.$modal.closeLoading(); |
| | |
| | | } else { |
| | | addFundtax(this.form).then(response => { |
| | | if (response.code == 200) { |
| | | this.form.id = response.data.fundTaxId; |
| | | this.$modal.msgSuccess("新增成功!"); |
| | | getFundtax(response.data.fundTaxId).then(res => { |
| | | this.form = res.data; |
| | | if (this.form.serviceFunds[0]) { |
| | | this.donorchargeorgans = this.form.serviceFunds; |
| | | this.donorchargeorgans.forEach(item => { |
| | | item.taXmoney = item.pretaxcost - item.taxedcost; |
| | | item.taXmoney = item.taXmoney.toFixed(2); |
| | | this.accumulation(); |
| | | }); |
| | | } |
| | | }); |
| | | this.$modal.closeLoading(); |
| | | } else { |
| | | this.$modal.msgError(response.msg); |
| | |
| | | .then(() => { |
| | | CalculationDetail({ id: row.id }).then(res2 => { |
| | | if (res2.code == 200) { |
| | | this.$modal.msgSuccess("删除成功!"); |
| | | getFundtax(this.curId).then(response => { |
| | | this.form = response.data; |
| | | if (this.form.serviceFunds[0]) { |
| | | this.donorchargeorgans = this.form.serviceFunds; |
| | | this.donorchargeorgans.forEach(item => { |
| | | item.taXmoney = item.pretaxcost - item.taxedcost; |
| | | item.taXmoney = item.taXmoney.toFixed(2); |
| | | this.accumulation(); |
| | | }); |
| | | } |
| | | }); |
| | | this.form.istax = 0; |
| | | this.form.taxedtime = ""; |
| | | this.$modal |
| | | .confirm("删除成功,需要重新保存并计算单据!") |
| | | .then(() => { |
| | | this.submitForm(); |
| | | }); |
| | | } |
| | | }); |
| | | }) |