|
@@ -183,7 +183,7 @@
|
|
|
<template slot-scope="scope">
|
|
|
<el-select
|
|
|
filterable
|
|
|
- v-model="scope.row.walletId"
|
|
|
+ v-model="scope.row.customerWalletId"
|
|
|
placeholder="请选择"
|
|
|
>
|
|
|
<el-option
|
|
@@ -221,16 +221,13 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- label="*不含税金额"
|
|
|
+ label="不含税金额"
|
|
|
prop="afterTaxAmount"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
- @input="
|
|
|
- changeAfterTaxAmount($event, scope.$index, scope.row.taxRate)
|
|
|
- "
|
|
|
v-model="scope.row.afterTaxAmount"
|
|
|
type="number"
|
|
|
></el-input>
|
|
@@ -244,26 +241,19 @@
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-input
|
|
|
- disabled
|
|
|
- :min="0"
|
|
|
- oninput="if(value<0)value=0"
|
|
|
- v-model="scope.row.tax"
|
|
|
- ></el-input>
|
|
|
+ <el-input type="number" v-model="scope.row.tax"></el-input>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- label="总金额"
|
|
|
+ label="*总金额"
|
|
|
prop="tax"
|
|
|
min-width="160"
|
|
|
show-overflow-tooltip
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
<el-input
|
|
|
- disabled
|
|
|
- :min="0"
|
|
|
- oninput="if(value<0)value=0"
|
|
|
+ type="number"
|
|
|
v-model="scope.row.totalAmount"
|
|
|
></el-input>
|
|
|
</template>
|
|
@@ -277,13 +267,6 @@
|
|
|
>
|
|
|
<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"
|
|
@@ -322,6 +305,17 @@
|
|
|
>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 提示 -->
|
|
|
+ <el-dialog title="提示" :visible.sync="dialogVisible" width="30%">
|
|
|
+ <ul class="ulStyle" v-for="(v, i) in messageList" :key="i">
|
|
|
+ <li>{{ v }},现金钱包余额不足,请确认是否继续提交此单据</li>
|
|
|
+ </ul>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisibleCancel">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="dialogVisibleOK">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -336,6 +330,8 @@ import {
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
+ messageList: [],
|
|
|
+ dialogVisible: false,
|
|
|
searchForm: {
|
|
|
source: "",
|
|
|
billType: "其他应收单",
|
|
@@ -365,25 +361,44 @@ 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);
|
|
|
+ //取消
|
|
|
+ async dialogVisibleCancel() {
|
|
|
+ this.dialogVisible = false;
|
|
|
},
|
|
|
+ //确定
|
|
|
+ async dialogVisibleOK() {
|
|
|
+ this.dialogVisible = false;
|
|
|
+ await getFinanceOtherReceAdd({
|
|
|
+ items: this.dataList,
|
|
|
+ ...this.searchForm,
|
|
|
+ isContinue: true,
|
|
|
+ });
|
|
|
+ const res = await getFinanceOtherReceList({ pageSize: 1, pageNum: 1 });
|
|
|
+ await getFinanceOtherReceApply({ id: res.data.records[0].id });
|
|
|
+ this.$message.success("提审成功");
|
|
|
+ this.$emit("updateList");
|
|
|
+ this.$parent.showPage = 1;
|
|
|
+ this.resetFn();
|
|
|
+ },
|
|
|
+ // // 不含税金额改变事件
|
|
|
+ // 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 = {};
|
|
@@ -416,12 +431,12 @@ export default {
|
|
|
this.$message.error("请输入费用承担部门");
|
|
|
return v;
|
|
|
}
|
|
|
- if (!v.walletId) {
|
|
|
+ if (!v.customerWalletId) {
|
|
|
this.$message.error("请选择现金钱包");
|
|
|
return v;
|
|
|
}
|
|
|
- if (v.afterTaxAmount == "") {
|
|
|
- this.$message.error("请输入不含税金额");
|
|
|
+ if (v.totalAmount == "") {
|
|
|
+ this.$message.error("请输入总金额");
|
|
|
return v;
|
|
|
}
|
|
|
});
|
|
@@ -429,25 +444,37 @@ export default {
|
|
|
if (aaa != undefined) {
|
|
|
return;
|
|
|
}
|
|
|
+ // console.log(this.dataList, 7777);
|
|
|
this.dataList.forEach((v) => {
|
|
|
let res = this.customerList.filter((i) => i.id == v.customerId);
|
|
|
console.log(res);
|
|
|
v.customerName = res[0].name;
|
|
|
v.customerNumber = res[0].number;
|
|
|
- let res2 = v.walletList.filter((j) => j.customerWalletId == v.walletId);
|
|
|
- v.customerWalletId = res2[0].customerWalletId;
|
|
|
+ let res2 = v.walletList.filter(
|
|
|
+ (j) => j.customerWalletId == v.customerWalletId
|
|
|
+ );
|
|
|
+ // console.log(res2, "res2");
|
|
|
+ // v.customerWalletId = res2[0].customerWalletId;
|
|
|
v.walletId = res2[0].walletRebateId;
|
|
|
});
|
|
|
- await getFinanceOtherReceAdd({
|
|
|
+ // console.log(this.dataList, 888888);
|
|
|
+
|
|
|
+ let res = await getFinanceOtherReceAdd({
|
|
|
items: this.dataList,
|
|
|
...this.searchForm,
|
|
|
});
|
|
|
- const res = await getFinanceOtherReceList({ pageSize: 1, pageNum: 1 });
|
|
|
- await getFinanceOtherReceApply({ id: res.data.records[0].id });
|
|
|
- this.$message.success("提审成功");
|
|
|
- this.$emit("updateList");
|
|
|
- this.$parent.showPage = 1;
|
|
|
- this.resetFn();
|
|
|
+ if (res.code == 201) {
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.messageList = res.data;
|
|
|
+ }
|
|
|
+ if (res.code == 200) {
|
|
|
+ const res = await getFinanceOtherReceList({ pageSize: 1, pageNum: 1 });
|
|
|
+ await getFinanceOtherReceApply({ id: res.data.records[0].id });
|
|
|
+ this.$message.success("提审成功");
|
|
|
+ this.$emit("updateList");
|
|
|
+ this.$parent.showPage = 1;
|
|
|
+ this.resetFn();
|
|
|
+ }
|
|
|
},
|
|
|
//选择经销商名称事件
|
|
|
async changeCustomerFn(v, index) {
|
|
@@ -472,11 +499,11 @@ export default {
|
|
|
projectCode: "CI004",
|
|
|
projectName: "收差价",
|
|
|
departmentId: "",
|
|
|
- walletId: "",
|
|
|
+ customerWalletId: "",
|
|
|
invoiceType: "",
|
|
|
afterTaxAmount: "",
|
|
|
- // tax: "",
|
|
|
- // totalAmount: "",
|
|
|
+ tax: "",
|
|
|
+ totalAmount: "",
|
|
|
taxRate: 13,
|
|
|
});
|
|
|
},
|
|
@@ -488,10 +515,20 @@ export default {
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
+::v-deep .el-dialog__body {
|
|
|
+ padding: 0 20px;
|
|
|
+}
|
|
|
.selectStyle {
|
|
|
width: 100%;
|
|
|
}
|
|
|
.mar {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
+.ulStyle {
|
|
|
+ list-style: simp-chinese-informal;
|
|
|
+ li {
|
|
|
+ height: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|