|
@@ -10,6 +10,7 @@
|
|
|
<div>
|
|
|
<el-form
|
|
|
ref="searchForm"
|
|
|
+ :rules="rulesForm"
|
|
|
:model="searchForm"
|
|
|
label-width="100px"
|
|
|
size="small"
|
|
@@ -23,7 +24,7 @@
|
|
|
</el-col>
|
|
|
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="单据来源" prop="">
|
|
|
+ <el-form-item label="单据来源" prop="source">
|
|
|
<el-select
|
|
|
class="selectStyle"
|
|
|
v-model="searchForm.source"
|
|
@@ -50,7 +51,7 @@
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="到期日" prop="">
|
|
|
+ <el-form-item label="到期日" prop="endTime">
|
|
|
<el-date-picker
|
|
|
class="selectStyle"
|
|
|
v-model="searchForm.endTime"
|
|
@@ -62,7 +63,7 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
+ <!-- <el-col :xs="24" :sm="12" :lg="6">
|
|
|
<el-form-item label="总金额" prop="">
|
|
|
<el-input
|
|
|
disabled
|
|
@@ -70,10 +71,10 @@
|
|
|
placeholder=""
|
|
|
></el-input>
|
|
|
</el-form-item>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
|
|
|
<el-col :xs="24" :sm="12" :lg="6">
|
|
|
- <el-form-item label="单据状态" prop="">
|
|
|
+ <el-form-item label="单据状态" prop="examineStatus">
|
|
|
<el-select
|
|
|
class="selectStyle"
|
|
|
v-model="searchForm.examineStatus"
|
|
@@ -203,21 +204,35 @@
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input v-model="scope.row.invoiceType"></el-input>
|
|
|
+ <!-- <el-input v-model="scope.row.invoiceType"></el-input> -->
|
|
|
+ <el-select
|
|
|
+ filterable
|
|
|
+ v-model="scope.row.invoiceType"
|
|
|
+ placeholder="请选择"
|
|
|
+ >
|
|
|
+ <el-option label="普通发票" value=""> </el-option>
|
|
|
+ <el-option label="增值税发票" value="1"> </el-option>
|
|
|
+ <el-option label="机票" value="P"> </el-option>
|
|
|
+ <el-option label="火车票" value="R"> </el-option>
|
|
|
+ <el-option label="其他运输票" value="O"> </el-option>
|
|
|
+ <el-option label="其他" value="E"> </el-option>
|
|
|
+ </el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- label="不含税金额"
|
|
|
+ label="*不含税金额"
|
|
|
prop="afterTaxAmount"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
- :min="0"
|
|
|
- oninput="if(value<0)value=0"
|
|
|
+ @input="
|
|
|
+ changeAfterTaxAmount($event, scope.$index, scope.row.taxRate)
|
|
|
+ "
|
|
|
v-model="scope.row.afterTaxAmount"
|
|
|
+ type="number"
|
|
|
></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
@@ -230,6 +245,7 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
+ disabled
|
|
|
:min="0"
|
|
|
oninput="if(value<0)value=0"
|
|
|
v-model="scope.row.tax"
|
|
@@ -245,6 +261,7 @@
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
+ disabled
|
|
|
:min="0"
|
|
|
oninput="if(value<0)value=0"
|
|
|
v-model="scope.row.totalAmount"
|
|
@@ -253,6 +270,29 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
+ label="税率%"
|
|
|
+ prop=""
|
|
|
+ min-width="160"
|
|
|
+ show-overflow-tooltip
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-input
|
|
|
+ @input="
|
|
|
+ changeAfterTaxAmount(
|
|
|
+ scope.row.afterTaxAmount,
|
|
|
+ scope.$index,
|
|
|
+ scope.row.taxRate
|
|
|
+ )
|
|
|
+ "
|
|
|
+ type="number"
|
|
|
+ :min="0"
|
|
|
+ oninput="if(value>100)value=100;if(value<0)value=0"
|
|
|
+ v-model="scope.row.taxRate"
|
|
|
+ ></el-input>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ align="center"
|
|
|
label="备注"
|
|
|
prop="remark"
|
|
|
min-width="160"
|
|
@@ -298,9 +338,21 @@ export default {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
source: "",
|
|
|
-
|
|
|
billType: "其他应收单",
|
|
|
- examineStatus: "",
|
|
|
+ examineStatus: "SAVE",
|
|
|
+ endTime: "",
|
|
|
+ remark: "",
|
|
|
+ },
|
|
|
+ rulesForm: {
|
|
|
+ source: [
|
|
|
+ { required: true, trigger: "change", message: "请选择单据来源" },
|
|
|
+ ],
|
|
|
+ examineStatus: [
|
|
|
+ { required: true, trigger: "change", message: "请选择单据状态" },
|
|
|
+ ],
|
|
|
+ endTime: [
|
|
|
+ { required: true, trigger: "change", message: "请选择到期日期" },
|
|
|
+ ],
|
|
|
},
|
|
|
dataList: [],
|
|
|
customerList: [], //经销商数据
|
|
@@ -313,6 +365,25 @@ export default {
|
|
|
this.getCustomerList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 不含税金额改变事件
|
|
|
+ changeAfterTaxAmount(v, i, sl) {
|
|
|
+ // console.log(v, i);
|
|
|
+ // let rule = /(^-?[1-9](\d+)?(\.\d{1,2})?$)|(^-?0$)|(^-?\d\.\d{1,2}$)/;
|
|
|
+ // console.log();
|
|
|
+ // if (!rule.test(v)) {
|
|
|
+ // this.$message.error("请输入正确的不含税金额");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ //税额
|
|
|
+ let tax = (v * (sl / 100)).toFixed(2);
|
|
|
+ // console.log(tax, "税额");
|
|
|
+ //总金额
|
|
|
+ let totalAmount = (v * 1 + tax * 1).toFixed(2);
|
|
|
+ // console.log(totalAmount, "总金额");
|
|
|
+
|
|
|
+ this.$set(this.dataList[i], "tax", tax);
|
|
|
+ this.$set(this.dataList[i], "totalAmount", totalAmount);
|
|
|
+ },
|
|
|
//重置
|
|
|
resetFn() {
|
|
|
this.searchForm = {};
|
|
@@ -331,29 +402,26 @@ export default {
|
|
|
|
|
|
//新增
|
|
|
async addFn() {
|
|
|
+ await this.$refs.searchForm.validate();
|
|
|
if (this.dataList.length == 0) {
|
|
|
this.$message.error("请添加数据");
|
|
|
return;
|
|
|
}
|
|
|
let aaa = this.dataList.find((v) => {
|
|
|
- if (v.afterTaxAmount == "") {
|
|
|
- this.$message.error("请输入不含税金额");
|
|
|
- return v;
|
|
|
- }
|
|
|
if (v.customerId == "") {
|
|
|
this.$message.error("请选择经销商");
|
|
|
return v;
|
|
|
}
|
|
|
- if (!v.walletId) {
|
|
|
- this.$message.error("请选择现金钱包");
|
|
|
+ if (v.departmentId == "") {
|
|
|
+ this.$message.error("请输入费用承担部门");
|
|
|
return v;
|
|
|
}
|
|
|
- if (v.tax == "") {
|
|
|
- this.$message.error("请输入税额");
|
|
|
+ if (!v.walletId) {
|
|
|
+ this.$message.error("请选择现金钱包");
|
|
|
return v;
|
|
|
}
|
|
|
- if (v.totalAmount == "") {
|
|
|
- this.$message.error("请输入总金额");
|
|
|
+ if (v.afterTaxAmount == "") {
|
|
|
+ this.$message.error("请输入不含税金额");
|
|
|
return v;
|
|
|
}
|
|
|
});
|
|
@@ -361,7 +429,6 @@ export default {
|
|
|
if (aaa != undefined) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
this.dataList.forEach((v) => {
|
|
|
let res = this.customerList.filter((i) => i.id == v.customerId);
|
|
|
console.log(res);
|
|
@@ -371,7 +438,6 @@ export default {
|
|
|
v.customerWalletId = res2[0].customerWalletId;
|
|
|
v.walletId = res2[0].walletRebateId;
|
|
|
});
|
|
|
-
|
|
|
await getFinanceOtherReceAdd({
|
|
|
items: this.dataList,
|
|
|
...this.searchForm,
|
|
@@ -403,14 +469,15 @@ export default {
|
|
|
addRowFn() {
|
|
|
this.dataList.push({
|
|
|
customerId: "",
|
|
|
- projectCode: "",
|
|
|
- projectName: "",
|
|
|
+ projectCode: "CI004",
|
|
|
+ projectName: "收差价",
|
|
|
departmentId: "",
|
|
|
walletId: "",
|
|
|
invoiceType: "",
|
|
|
afterTaxAmount: "",
|
|
|
- tax: "",
|
|
|
- totalAmount: "",
|
|
|
+ // tax: "",
|
|
|
+ // totalAmount: "",
|
|
|
+ taxRate: 13,
|
|
|
});
|
|
|
},
|
|
|
goBack() {
|