|
|
@@ -88,8 +88,8 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-col :span="24" >
|
|
|
- <el-form-item label="辅助核算:" >
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="辅助核算:">
|
|
|
<el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isItem" :disabled="!isDetail">项目</el-checkbox>
|
|
|
<el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isCorp" :disabled="!isDetail">客户</el-checkbox>
|
|
|
<el-checkbox size="medium" :true-label="1" :false-label="0" v-model="form.isDept" :disabled="!isDetail">部门</el-checkbox>
|
|
|
@@ -139,7 +139,7 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountOpenDr')"
|
|
|
+ @change="amountChange(form, 'amountOpenDr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
@@ -158,14 +158,24 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountOpenCr')"
|
|
|
+ @change="amountChange(form, 'amountOpenCr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="年初余额" prop="amountOpenBlc" label-width="60px">
|
|
|
- <el-input-number style="width: 100%;" v-model="form.amountOpenBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false" >
|
|
|
+ <el-input-number
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.amountOpenBlc"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ placeholder=""
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -183,7 +193,7 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountDr')"
|
|
|
+ @change="amountChange(form, 'amountDr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
@@ -202,14 +212,24 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountCr')"
|
|
|
+ @change="amountChange(form, 'amountCr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="当前余额" prop="amountBlc" label-width="60px">
|
|
|
- <el-input-number style="width: 100%" v-model="form.amountBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.amountBlc"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ placeholder=""
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -232,7 +252,7 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountOpenDrUsd')"
|
|
|
+ @change="amountChange(form, 'amountOpenDrUsd')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
@@ -251,14 +271,24 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountOpenCrUsd')"
|
|
|
+ @change="amountChange(form, 'amountOpenCrUsd')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="年初余额" prop="amountOpenUsdBlc" label-width="60px">
|
|
|
- <el-input-number style="width: 100%" v-model="form.amountOpenUsdBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.amountOpenUsdBlc"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ placeholder=""
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -276,7 +306,7 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountDrUsd')"
|
|
|
+ @change="amountChange(form, 'amountDrUsd')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
@@ -295,14 +325,24 @@
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
align="right"
|
|
|
- @change="amountChange(row, 'amountCrUsd')"
|
|
|
+ @change="amountChange(form, 'amountCrUsd')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="当前余额" prop="amountUsdBlc" label-width="60px">
|
|
|
- <el-input-number style="width: 100%" v-model="form.amountUsdBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.amountUsdBlc"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ placeholder=""
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -324,7 +364,7 @@
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
- @change="amountChange(row, 'quantityOpenDr')"
|
|
|
+ @change="amountChange(form, 'quantityOpenDr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
@@ -342,14 +382,24 @@
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
- @change="amountChange(row, 'quantityOpenCr')"
|
|
|
+ @change="amountChange(form, 'quantityOpenCr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="年初余额" prop="quantityOpenBlc" label-width="60px">
|
|
|
- <el-input-number style="width: 100%" v-model="form.quantityOpenBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.quantityOpenBlc"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ placeholder=""
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -366,7 +416,7 @@
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
- @change="amountChange(row, 'quantityDr')"
|
|
|
+ @change="amountChange(form, 'quantityDr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
@@ -384,14 +434,24 @@
|
|
|
:precision="2"
|
|
|
:controls="false"
|
|
|
value-on-clear="0"
|
|
|
- @change="amountChange(row, 'quantityCr')"
|
|
|
+ @change="amountChange(form, 'quantityCr')"
|
|
|
>
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
<el-form-item label="当前余额" prop="quantityBlc" label-width="60px">
|
|
|
- <el-input-number style="width: 100%" v-model="form.quantityBlc" size="small" autocomplete="off" :disabled="true" clearable placeholder="" :precision="2" :controls="false">
|
|
|
+ <el-input-number
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="form.quantityBlc"
|
|
|
+ size="small"
|
|
|
+ autocomplete="off"
|
|
|
+ :disabled="true"
|
|
|
+ clearable
|
|
|
+ placeholder=""
|
|
|
+ :precision="2"
|
|
|
+ :controls="false"
|
|
|
+ >
|
|
|
</el-input-number>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -403,142 +463,190 @@
|
|
|
|
|
|
<script>
|
|
|
import SearchQuery from "@/components/iosbasic-data/searchquery.vue";
|
|
|
-import {getRateList} from "@/api/iosBasicData/rateManagement";
|
|
|
-import {getBunitsPage} from "@/api/iosBasicData/bunits";
|
|
|
-import {baccitemstypeList} from "@/api/iosBasicData/baccitemstype";
|
|
|
-import {getWorkDicts} from "@/api/system/dictbiz";
|
|
|
-import {regularInteger} from "@/util/regularJudgment";
|
|
|
+import { getRateList } from "@/api/iosBasicData/rateManagement";
|
|
|
+import { getBunitsPage } from "@/api/iosBasicData/bunits";
|
|
|
+import { baccitemstypeList } from "@/api/iosBasicData/baccitemstype";
|
|
|
+import { getWorkDicts } from "@/api/system/dictbiz";
|
|
|
+import { regularInteger } from "@/util/regularJudgment";
|
|
|
|
|
|
export default {
|
|
|
- components: {SearchQuery},
|
|
|
- props:{
|
|
|
- form:{
|
|
|
- type:Object,
|
|
|
- default:{}
|
|
|
+ components: { SearchQuery },
|
|
|
+ props: {
|
|
|
+ form: {
|
|
|
+ type: Object,
|
|
|
+ default: {},
|
|
|
+ },
|
|
|
+ itemClassifyList: {
|
|
|
+ type: Object,
|
|
|
+ default: [],
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 方向数据
|
|
|
+ dcData: [
|
|
|
+ {
|
|
|
+ label: "借方",
|
|
|
+ value: "D",
|
|
|
},
|
|
|
- itemClassifyList:{
|
|
|
- type: Object,
|
|
|
- default:[]
|
|
|
+ {
|
|
|
+ label: "贷方",
|
|
|
+ value: "C",
|
|
|
},
|
|
|
+ ],
|
|
|
+ curData: [], // 币别数据
|
|
|
+ unitNoData: [], // 单位
|
|
|
+ propertyData: [], // 核算项目数据
|
|
|
+ itemClassifyList: [], // 核算大类
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {},
|
|
|
+ computed: {
|
|
|
+ isCalc() {
|
|
|
+ return this.form && (this.form.isCorp == 1 || this.form.isDept == 1 || this.form.isEmpl == 1 || this.form.isItem == 1);
|
|
|
},
|
|
|
- data(){
|
|
|
- return {
|
|
|
- // 方向数据
|
|
|
- dcData:[
|
|
|
- {
|
|
|
- label:'借方',
|
|
|
- value:'D',
|
|
|
- },
|
|
|
- {
|
|
|
- label:'贷方',
|
|
|
- value:'C',
|
|
|
- }
|
|
|
- ],
|
|
|
- curData:[], // 币别数据
|
|
|
- unitNoData:[], // 单位
|
|
|
- propertyData:[], // 核算项目数据
|
|
|
- itemClassifyList:[], // 核算大类
|
|
|
-
|
|
|
+ isDetail() {
|
|
|
+ return this.form && this.form.isDetail == 1;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 科目代码只能输入整数数字
|
|
|
+ numinput(val) {
|
|
|
+ this.$set(this.form, "code", regularInteger(val));
|
|
|
+ },
|
|
|
+ forceAmt(val) {
|
|
|
+ let amt = Number(val);
|
|
|
+ return isNaN(amt) ? 0.0 : Number(amt.toFixed(2));
|
|
|
+ },
|
|
|
+ amountChange(row, fieldName) {
|
|
|
+ if (fieldName === "amountOpenDr" || fieldName === "amountOpenCr") {
|
|
|
+ if (row.dc === "D") {
|
|
|
+ this.$set(row, "amountOpenBlc", this.forceAmt(row.amountOpenDr) - this.forceAmt(row.amountOpenCr));
|
|
|
+ this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountDr) - this.forceAmt(row.amountCr));
|
|
|
+ }else{
|
|
|
+ this.$set(row, "amountOpenBlc", this.forceAmt(row.amountOpenCr) - this.forceAmt(row.amountOpenDr));
|
|
|
+ this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountCr) - this.forceAmt(row.amountDr));
|
|
|
}
|
|
|
+ }
|
|
|
+ if (fieldName === "amountDr" || fieldName === "amountCr") {
|
|
|
+ if (row.dc === "D") {
|
|
|
+ this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountDr) - this.forceAmt(row.amountCr));
|
|
|
+ }else{
|
|
|
+ this.$set(row, "amountBlc", this.forceAmt(row.amountOpenBlc) + this.forceAmt(row.amountCr) - this.forceAmt(row.amountDr));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (fieldName === "amountOpenDrUsd" || fieldName === "amountOpenCrUsd") {
|
|
|
+ if (row.dc === "D") {
|
|
|
+ this.$set(row, "amountOpenUsdBlc", this.forceAmt(row.amountOpenDrUsd) - this.forceAmt(row.amountOpenCrUsd));
|
|
|
+ this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountDrUsd) - this.forceAmt(row.amountCrUsd));
|
|
|
+ }else{
|
|
|
+ this.$set(row, "amountOpenUsdBlc", this.forceAmt(row.amountOpenCrUsd) - this.forceAmt(row.amountOpenDrUsd));
|
|
|
+ this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountCrUsd) - this.forceAmt(row.amountDrUsd));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (fieldName === "amountDrUsd" || fieldName === "amountCrUsd") {
|
|
|
+ if (row.dc === "D") {
|
|
|
+ this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountDrUsd) - this.forceAmt(row.amountCrUsd));
|
|
|
+ }else{
|
|
|
+ this.$set(row, "amountUsdBlc", this.forceAmt(row.amountOpenUsdBlc) + this.forceAmt(row.amountCrUsd) - this.forceAmt(row.amountDrUsd));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (fieldName === "quantityOpenDr" || fieldName === "quantityOpenCr") {
|
|
|
+ if (row.dc === "D") {
|
|
|
+ this.$set(row, "quantityOpenBlc", this.forceAmt(row.quantityOpenDr) - this.forceAmt(row.quantityOpenCr));
|
|
|
+ this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityDr) - this.forceAmt(row.quantityCr));
|
|
|
+ }else{
|
|
|
+ this.$set(row, "quantityOpenBlc", this.forceAmt(row.quantityOpenCr) - this.forceAmt(row.quantityOpenDr));
|
|
|
+ this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityCr) - this.forceAmt(row.quantityDr));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (fieldName === "quantityDr" || fieldName === "quantityCr") {
|
|
|
+ if (row.dc === "D") {
|
|
|
+ this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityDr) - this.forceAmt(row.quantityCr));
|
|
|
+ }else{
|
|
|
+ this.$set(row, "quantityBlc", this.forceAmt(row.quantityOpenBlc) + this.forceAmt(row.quantityCr) - this.forceAmt(row.quantityDr));
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
- mounted() {
|
|
|
+ // 金额计算
|
|
|
+ countBlur() {
|
|
|
+ this.$set(this.form, "price", this.form.price ? Number(this.form.price) : 0); // 单价
|
|
|
+ this.$set(this.form, "quantityOpenDr", this.form.quantityOpenDr ? Number(this.form.quantityOpenDr) : 0); // 期初借方数量
|
|
|
+ this.$set(this.form, "quantityOpenCr", this.form.quantityOpenCr ? Number(this.form.quantityOpenCr) : 0); // 期初贷方数量
|
|
|
+ this.$set(this.form, "quantityDr", this.form.quantityDr ? Number(this.form.quantityDr) : 0); // 本期借方数量
|
|
|
+ this.$set(this.form, "quantityCr", this.form.quantityCr ? Number(this.form.quantityCr) : 0); // 本期贷方数量
|
|
|
+ if (this.form.curCode == "USD") {
|
|
|
+ // 期初借方外币金额 = 单价 * 期初借方数量
|
|
|
+ this.$set(this.form, "amountOpenDrUsd", Number(this.form.price) * Number(this.form.quantityOpenDr));
|
|
|
+ // 期初贷方外币金额 = 单价 * 期初贷方数量
|
|
|
+ this.$set(this.form, "amountOpenCrUsd", Number(this.form.price) * Number(this.form.quantityOpenCr));
|
|
|
+ // 期初外币余额 = 期初贷方外币金额 - 期初借方外币金额
|
|
|
+ this.$set(this.form, "amountOpenUsdBlc", Number(this.form.amountOpenCrUsd) - Number(this.form.amountOpenDrUsd));
|
|
|
+ // 本期借方外币金额 = 单价 * 本期借方数量
|
|
|
+ this.$set(this.form, "amountDrUsd", Number(this.form.price) * Number(this.form.quantityDr));
|
|
|
+ // 本期贷方外币金额 = 单价 * 本期贷方数量
|
|
|
+ this.$set(this.form, "amountCrUsd", Number(this.form.price) * Number(this.form.quantityCr));
|
|
|
+ // 本期外币余额 = 本期贷方外币金额 - 本期借方外币金额
|
|
|
+ this.$set(this.form, "amountUsdBlc", Number(this.form.amountCrUsd) - Number(this.form.amountDrUsd));
|
|
|
+ } else {
|
|
|
+ // 期初借方本币金额 = 单价 * 期初借方数量
|
|
|
+ this.$set(this.form, "amountOpenDr", Number(this.form.price) * Number(this.form.quantityOpenDr));
|
|
|
+ // 期初贷方本币金额 = 单价 * 期初贷方数量
|
|
|
+ this.$set(this.form, "amountOpenCr", Number(this.form.price) * Number(this.form.quantityOpenCr));
|
|
|
+ // 期初本币余额 = 期初贷方本币金额 - 期初借方本币金额
|
|
|
+ this.$set(this.form, "amountOpenBlc", Number(this.form.amountOpenCr) - Number(this.form.amountOpenDr));
|
|
|
+ // 本期借方本币金额 = 单价 * 本期借方数量
|
|
|
+ this.$set(this.form, "amountDr", Number(this.form.price) * Number(this.form.quantityDr));
|
|
|
+ // 本期贷方本币金额 = 单价 * 本期贷方数量
|
|
|
+ this.$set(this.form, "amountCr", Number(this.form.price) * Number(this.form.quantityCr));
|
|
|
+ // 本期本币余额 = 本期贷方本币金额 - 本期借方本币金额
|
|
|
+ this.$set(this.form, "amountBlc", Number(this.form.amountCr) - Number(this.form.amountDr));
|
|
|
+ }
|
|
|
+ // 期初余额数量 = 期初贷方数量 - 期初借方数量
|
|
|
+ this.$set(this.form, "quantityOpenBlc", Number(this.form.quantityOpenCr) - Number(this.form.quantityOpenDr));
|
|
|
+ // 本期余额数量 = 本期贷方数量 - 本期借方数量
|
|
|
+ this.$set(this.form, "quantityBlc", Number(this.form.quantityCr) - Number(this.form.quantityDr));
|
|
|
},
|
|
|
- computed: {
|
|
|
- isCalc(){
|
|
|
- return this.form && (this.form.isCorp == 1 || this.form.isDept == 1 || this.form.isEmpl == 1 || this.form.isItem == 1 );
|
|
|
- },
|
|
|
- isDetail(){
|
|
|
- return this.form && this.form.isDetail == 1;
|
|
|
- },
|
|
|
+ // 下拉回调
|
|
|
+ corpChange(value, name) {
|
|
|
+ if (name === "curCode") {
|
|
|
+ for (let item of this.curData) {
|
|
|
+ if (item.code == value) {
|
|
|
+ this.$set(this.form, "curCode", item.code);
|
|
|
+ this.$set(this.form, "exrate", item.exrate);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if (name === "itemClassifyId") {
|
|
|
+ this.$set(this.form, name, value);
|
|
|
+ let cl = this.itemClassifyList.find((item) => item.id == value);
|
|
|
+ if (cl) {
|
|
|
+ this.$set(this.form, "itemClassify", cl.cnName);
|
|
|
+ }
|
|
|
+ console.log(this.form);
|
|
|
+ } else {
|
|
|
+ this.$set(this.form, name, value);
|
|
|
+ }
|
|
|
},
|
|
|
- methods:{
|
|
|
- // 科目代码只能输入整数数字
|
|
|
- numinput(val){
|
|
|
- this.$set(this.form,'code',regularInteger(val))
|
|
|
- },
|
|
|
- amountChange(row, fieldName){
|
|
|
-
|
|
|
- },
|
|
|
- // 金额计算
|
|
|
- countBlur(){
|
|
|
- this.$set(this.form,'price',this.form.price?Number(this.form.price):0) // 单价
|
|
|
- this.$set(this.form,'quantityOpenDr',this.form.quantityOpenDr?Number(this.form.quantityOpenDr):0) // 期初借方数量
|
|
|
- this.$set(this.form,'quantityOpenCr',this.form.quantityOpenCr?Number(this.form.quantityOpenCr):0) // 期初贷方数量
|
|
|
- this.$set(this.form,'quantityDr',this.form.quantityDr?Number(this.form.quantityDr):0) // 本期借方数量
|
|
|
- this.$set(this.form,'quantityCr',this.form.quantityCr?Number(this.form.quantityCr):0) // 本期贷方数量
|
|
|
- if (this.form.curCode == 'USD') {
|
|
|
- // 期初借方外币金额 = 单价 * 期初借方数量
|
|
|
- this.$set(this.form,'amountOpenDrUsd',Number(this.form.price) * Number(this.form.quantityOpenDr))
|
|
|
- // 期初贷方外币金额 = 单价 * 期初贷方数量
|
|
|
- this.$set(this.form,'amountOpenCrUsd',Number(this.form.price) * Number(this.form.quantityOpenCr))
|
|
|
- // 期初外币余额 = 期初贷方外币金额 - 期初借方外币金额
|
|
|
- this.$set(this.form,'amountOpenUsdBlc',Number(this.form.amountOpenCrUsd) - Number(this.form.amountOpenDrUsd))
|
|
|
- // 本期借方外币金额 = 单价 * 本期借方数量
|
|
|
- this.$set(this.form,'amountDrUsd',Number(this.form.price) * Number(this.form.quantityDr))
|
|
|
- // 本期贷方外币金额 = 单价 * 本期贷方数量
|
|
|
- this.$set(this.form,'amountCrUsd',Number(this.form.price) * Number(this.form.quantityCr))
|
|
|
- // 本期外币余额 = 本期贷方外币金额 - 本期借方外币金额
|
|
|
- this.$set(this.form,'amountUsdBlc',Number(this.form.amountCrUsd) - Number(this.form.amountDrUsd))
|
|
|
- }else {
|
|
|
- // 期初借方本币金额 = 单价 * 期初借方数量
|
|
|
- this.$set(this.form,'amountOpenDr',Number(this.form.price) * Number(this.form.quantityOpenDr))
|
|
|
- // 期初贷方本币金额 = 单价 * 期初贷方数量
|
|
|
- this.$set(this.form,'amountOpenCr',Number(this.form.price) * Number(this.form.quantityOpenCr))
|
|
|
- // 期初本币余额 = 期初贷方本币金额 - 期初借方本币金额
|
|
|
- this.$set(this.form,'amountOpenBlc',Number(this.form.amountOpenCr) - Number(this.form.amountOpenDr))
|
|
|
- // 本期借方本币金额 = 单价 * 本期借方数量
|
|
|
- this.$set(this.form,'amountDr',Number(this.form.price) * Number(this.form.quantityDr))
|
|
|
- // 本期贷方本币金额 = 单价 * 本期贷方数量
|
|
|
- this.$set(this.form,'amountCr',Number(this.form.price) * Number(this.form.quantityCr))
|
|
|
- // 本期本币余额 = 本期贷方本币金额 - 本期借方本币金额
|
|
|
- this.$set(this.form,'amountBlc',Number(this.form.amountCr) - Number(this.form.amountDr))
|
|
|
- }
|
|
|
- // 期初余额数量 = 期初贷方数量 - 期初借方数量
|
|
|
- this.$set(this.form,'quantityOpenBlc',Number(this.form.quantityOpenCr) - Number(this.form.quantityOpenDr))
|
|
|
- // 本期余额数量 = 本期贷方数量 - 本期借方数量
|
|
|
- this.$set(this.form,'quantityBlc',Number(this.form.quantityCr) - Number(this.form.quantityDr))
|
|
|
- },
|
|
|
- // 下拉回调
|
|
|
- corpChange(value,name){
|
|
|
- if (name === 'curCode') {
|
|
|
- for (let item of this.curData) {
|
|
|
- if (item.code == value) {
|
|
|
- this.$set(this.form,'curCode',item.code)
|
|
|
- this.$set(this.form,'exrate',item.exrate)
|
|
|
- }
|
|
|
- }
|
|
|
- }else if (name === 'itemClassifyId') {
|
|
|
- this.$set(this.form, name, value)
|
|
|
- let cl = this.itemClassifyList.find(item=>item.id == value)
|
|
|
- if(cl){
|
|
|
- this.$set(this.form, "itemClassify", cl.cnName)
|
|
|
- }
|
|
|
- console.log(this.form)
|
|
|
- }else {
|
|
|
- this.$set(this.form, name, value)
|
|
|
- }
|
|
|
- },
|
|
|
- // 获取币别数据
|
|
|
- getRateListfun(cnName){
|
|
|
- getRateList({current:1,size:10,cnName}).then(res=>{
|
|
|
- this.curData = res.data.data.records
|
|
|
- })
|
|
|
- },
|
|
|
- // 获取计算属性
|
|
|
- getBunitsPagefun(){
|
|
|
- getBunitsPage().then(res=>{
|
|
|
- this.unitNoData = res.data.data
|
|
|
- })
|
|
|
- },
|
|
|
- // 核算项目数据
|
|
|
- propertyWorkDictsfun(cnName){
|
|
|
- getWorkDicts('account_propertys').then((res) => {
|
|
|
- this.propertyData = res.data.data
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
+ // 获取币别数据
|
|
|
+ getRateListfun(cnName) {
|
|
|
+ getRateList({ current: 1, size: 10, cnName }).then((res) => {
|
|
|
+ this.curData = res.data.data.records;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 获取计算属性
|
|
|
+ getBunitsPagefun() {
|
|
|
+ getBunitsPage().then((res) => {
|
|
|
+ this.unitNoData = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 核算项目数据
|
|
|
+ propertyWorkDictsfun(cnName) {
|
|
|
+ getWorkDicts("account_propertys").then((res) => {
|
|
|
+ this.propertyData = res.data.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|