master
wangxubin@yeah.net 3 years ago
parent 0b0213fcf6
commit 16a89ed918

@ -37,7 +37,6 @@
@click='openPro(1)'>添加
</el-button>
</div>
<div style="width: 150px;">总金额 : {{ outMoneys }}</div>
</div>
<el-table :data="outList" empty-text=' , ' max-height="200"
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }"
@ -84,7 +83,10 @@
</el-button>
<el-button v-if="proForm.memberName" size="mini" type="warning" @click='backout'>撤销</el-button>
</div>
<div style="width: 150px;">总金额 : {{ inMoneys }}</div>
<div style="width: 150px;">成交金额 : {{ inMoneys }}</div>
<div style="width: 150px;">转入金额 : {{ outMoneys }}</div>
<div style="width: 150px;">现付金额 : {{ payMoneys }}</div>
<div style="width: 150px;">欠款金额金额 : {{ debtMoney }}</div>
</div>
<el-table :data="inList" max-height="150" empty-text=' , '
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }"
@ -117,9 +119,8 @@
@blur="endEditTimes(scope.row)"></el-input>
</template>
</el-table-column>
<el-table-column label="转入金额" align="center" prop="changeInMoney" min-width="90"></el-table-column>
<el-table-column label="欠款金额" v-if="sessionStorageData.allowdebt" align="center" prop="debtMoney"
min-width="90"></el-table-column>
<!-- <el-table-column label="欠款金额" v-if="sessionStorageData.allowdebt" align="center" prop="debtMoney"
min-width="90"></el-table-column> -->
<el-table-column label="成交金额" align="center" prop="transactionMoney" min-width="80">
</el-table-column>
</el-table>
@ -135,12 +136,20 @@
{{ scope.row.payMoney }}
<i class="el-icon-edit text-cyan"></i>
</div>
<el-input v-else v-focus @blur="endEdit(scope.row)" @change="endEdit(scope.row)"
@keydown.enter="endEdit(scope.row)" v-model="scope.row.payMoney" type="number"
class="form-input-wdith-xs"></el-input>
<el-input v-else v-focus @click="endEdit(scope.row)" @blur="endEdit(scope.row)"
@change="endEdit(scope.row)" @keydown.enter="endEdit(scope.row)" v-model="scope.row.payMoney"
type="number" class="form-input-wdith-xs"></el-input>
</template>
</el-table-column>
</el-table>
<div style="text-align:center;width: 100%;" @click="endEdits()" v-if="!shows"></div>
<div style="display:flex" v-if="shows">
<div style="margin-left:30%">现付金额为:</div>
<div style="margin-left: 20%;">{{ payMoneys }}</div>
</div>
</div>
</div>
@ -194,11 +203,13 @@ export default {
},
},
projectDialogVisible: false,
shows: false,
recDateShow: false,
activeName: "现付",
outMoneyIndex: -1,
inNumberIndex: -1,
inNumberIndexs: -1,
payMoneys: 0,
proForm: {
additionDate: null,
manageStaffName: null,
@ -393,21 +404,16 @@ export default {
if (this.openProText == 0) {
(form.priceMember * form.minumumTimes).toFixed(2) * 1;
form.prices = form.priceMember
form.changeInTime = form.minumumTimes;
form.changeInTime = 0;
form.projectId = form.id;
form.debtMoney = 0;
form.transactionMoney = form.changeInMoney;
form.changeInMoneyShow = false;
form.debtMoneyShow = false;
form.changeInCaseTimeShow = false;
let num = 0;
this.outList.forEach((item) => {
num = num + item.changeOutMoney
});
form.changeInMoney = num
form.changeInMoney
if (this.inList.length < 1) {
this.inList.push(form);
this.inMoneys = 0;
} else {
this.$alert("只能选择一个项目进行转入", "提示", {
confirmButtonText: "确定",
@ -428,8 +434,9 @@ export default {
form.changeOutTimeShow = false;
form.accountId = form.id;
this.outList.push(form);
this.sumMoney();
}
this.sumMoney();
//
},
//
memberOne() {
@ -471,12 +478,6 @@ export default {
//.
editPay(row, index) {
// if (this.debtMoney < 0) {
// this.$message.error({
// message: " , !",
// });
// } else {
console.log(row)
var form = {
...row,
@ -485,21 +486,36 @@ export default {
var payLists = [...this.proForm.payLists];
payLists[index] = form;
form.isShow = true;
form.payMoney = (this.debtMoney + form.payMoney).toFixed(2) * 1;
this.proForm.payLists = [];
this.proForm.payLists = payLists;
console.log(this.proForm.payLists)
this.sumMoney()
// }
},
endEdit(row) {
console.log(row);
console.log(this.inList);
if (row.payMoney) {
if (row.payMoney && row.payMoney <= this.debtMoney) {
row.payMoney = row.payMoney * 1;
} else {
row.payMoney = 0;
if (row.payMoney > this.debtMoney) {
this.$alert("现付金额大于需付金额,已将金额调整适合金额", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
}
row.payMoney = this.debtMoney;
}
row.isShow = false;
this.shows = false;
// this.endEditTimes()
this.sumMoney()
},
endEdits() {
this.shows = true,
this.sumMoney()
},
openPro(num) {
this.openProText = num;
@ -596,9 +612,9 @@ export default {
num = num + item.changeOutMoney
});
this.outMoneys = num;
if(this.outList.length!=0){
this.inList[0].changeInMoney=num
}
// if(this.outList.length!=0){
// this.inList[0].changeInMoney=num
// }
},
openOutMoney(row, index) {
@ -638,6 +654,19 @@ export default {
row.transactionMoney = row.changeInMoney;
this.inNumberIndex = -1;
this.sumMoney();
if (this.outMoneys > row.changeInMoney) {
this.$alert("成交金额不能小于转入金额: ", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
this.inList[0].changeInTime = 0
this.inList[0].transactionMoney = 0
this.sumMoney();
}
},
endEditprices(row, index) {
// if (row.changeInTime < row.minumumTimes) {
@ -646,10 +675,41 @@ export default {
// });
// row.changeInTime = row.minumumTimes;
// }
if (row.minumumPriceMember > row.prices) {
this.$alert("单价不可以低于最低单价: ", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
row.prices = row.minumumPriceMember
} else if (row.priceMember < row.prices) {
this.$alert("单价不可以高于标准单价: ", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
row.prices = row.priceMember
}
row.changeInMoney = (row.prices * row.changeInTime).toFixed(2) * 1;
row.transactionMoney = row.changeInMoney;
this.inNumberIndexs = -1;
this.sumMoney();
if (this.outMoneys > row.changeInMoney) {
this.$alert("成交金额不能小于转入金额,请修改单价或者转入次数: ", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
this.sumMoney();
}
},
projectRadio(row) {
if (row) {
@ -674,6 +734,7 @@ export default {
});
this.outMoneys = outMoneys.toFixed(2) * 1;
this.inMoneys = inMoneys.toFixed(2) * 1;
this.payMoneys = payMoneys.toFixed(2) * 1;
if (inMoneys != 0) {
this.debtMoney =
(inMoneys - outMoneys - payMoneys - debtMoney).toFixed(2) * 1;

@ -133,6 +133,7 @@ export default {
if (res.data == true) {
this.$message.success({ message: "密码正确!" });
this.$emit("passcodeData", this.file);
console.log(this.file)
this.paymentcodeDialog = false;
} else {
this.$alert("密码错误", "提示", {

@ -1,15 +1,17 @@
<template>
<div class="flex">
<div style="width:100%">
<el-table :data="payLists" style="width:280px" class='border' :summary-method="getSummariesPay" show-summary :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
<el-table :data="payLists" style="width:280px" class='border' show-summary
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }">
<el-table-column align="center" prop="payName" min-width="100" label="支付方式"></el-table-column>
<el-table-column align="center" prop="payMoney" min-width="80" label="本次支付 ">
<template slot-scope="scope">
<div v-if="payIndex != scope.$index" @click="editPay(scope.row,scope.$index)">
<div v-if="payIndex != scope.$index" @click="editPay(scope.row, scope.$index)">
{{ scope.row.payMoney }}
<i class="text-cyan el-icon-edit"></i>
</div>
<el-input class="form-input-xs" v-else v-focus type="number" @blur="endEdit(scope.row, scope.$index,)" v-model="scope.row.payMoney" size="samll"></el-input>
<el-input class="form-input-xs" v-else v-focus type="number" @blur="endEdit(scope.row, scope.$index,)"
v-model="scope.row.payMoney" size="samll"></el-input>
</template>
</el-table-column>
</el-table>
@ -32,22 +34,55 @@ export default {
methods: {
//
show(form, list) {
console.log(form);
var that = this;
that.form = JSON.parse(JSON.stringify(form));
that.payLists = [];
that.payLists = JSON.parse(JSON.stringify(list));
console.log(that.payLists)
},
//.
editPay(row, index) {
this.payIndex = index;
row.payMoney = (this.form.debtMoney + row.payMoney).toFixed(2) * 1;
if (index = 0) {
row.payMoney = (this.form.collectionCashAmounts + row.payMoney).toFixed(2) * 1;
}
else {
let money = 0;
var that = this;
this.payLists.forEach((item) => {
money += item.payMoney * 1;
});
row.payMoney = (this.form.collectionCashAmounts - money).toFixed(2) * 1;
}
},
endEdit(row, index) {
this.payIndex = -1;
let money = 0;
var that = this;
this.payLists.forEach((item) => {
money += item.payMoney * 1;
});
if (!row.payMoney) {
row.payMoney = 0;
} else if (money > this.form.collectionCashAmounts) {
this.$alert("输入之和不能大于现付金额", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
row.payMoney = 0;
} else if (row.payMoney < 0) {
this.$alert("输入值不能小于0", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
row.payMoney = 0;
} else {
row.payMoney = row.payMoney * 1;
}
@ -62,31 +97,31 @@ export default {
let form = { form: this.form, list: this.payLists };
this.$emit("paymentData", form);
},
getSummariesPay(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "合计";
return;
}
const values = data.map((item) => Number(item[column.property]));
if (column.property == "payMoney") {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
sums[index] = "--";
}
}, 0);
sums[index] += " ";
} else {
sums[index] = "--";
}
});
return sums;
},
// getSummariesPay(param) {
// const { columns, data } = param;
// const sums = [];
// columns.forEach((column, index) => {
// if (index === 0) {
// sums[index] = "";
// return;
// }
// const values = data.map((item) => Number(item[column.property]));
// if (column.property == "payMoney") {
// sums[index] = values.reduce((prev, curr) => {
// const value = Number(curr);
// if (!isNaN(value)) {
// return prev + curr;
// } else {
// sums[index] = "--";
// }
// }, 0);
// sums[index] += " ";
// } else {
// sums[index] = "--";
// }
// });
// return sums;
// },
},
};
</script>

File diff suppressed because it is too large Load Diff

@ -33,7 +33,7 @@
<el-form-item label="所属门店:" prop="storeNames">
<el-select filterable default-first-option v-model="form.storeNames" placeholder="请选择" @change="radioChange">
<el-option v-for="item in options" :key="item.id" :label="item.label" :value="item.id">
</el-option>
</el-option>
</el-select>
</el-form-item>
<br>
@ -144,8 +144,13 @@ export default {
//
handleClose() {
this.form = {};
this.staffLists= [{ brandNumber: "", staffName: "", ratio: 100 }],
this.managerLists= [{ brandNumber: "", staffName: "", ratio: 100 }],
this.adminList=[{ brandNumber: "", staffName: "", ratio: 100 }],
this.dialogFormVisible = false;
this.$refs.form.clearValidate();
this.$refs.uploads.clearFiles();
console.log(this.form)
},
radioChange(v) {
this.form.storeId = v;
@ -307,6 +312,7 @@ export default {
});
this.fileData.append("salesmens", JSON.stringify(salesmens));
this.fileData.append("staffLists", JSON.stringify(this.staffLists));
this.fileData.append("rechargeTypeNum", this.form.rechargeTypeNum);
this.fileData.append("storeId", this.form.storeId);
this.fileData.append("storeName", this.form.storeName);
@ -319,6 +325,7 @@ export default {
this.fileData.append("order", this.form.order);
}
console.log(this.form)
if (this.form.id) {
this.fileData.append("id", this.form.id);
}
@ -330,6 +337,7 @@ export default {
}
if (this.title == "添加") {
console.log(this.fileData)
addBaseGrouponCard(this.fileData)
.then((res) => {
if (res.code == "000000") {
@ -370,6 +378,10 @@ export default {
}
});
}
this.$refs.uploads.clearFiles();
this.staffLists= [{ brandNumber: "", staffName: "", ratio: 100 }];
this.managerLists= [{ brandNumber: "", staffName: "", ratio: 100 }];
this.adminList=[{ brandNumber: "", staffName: "", ratio: 100 }];
},
},
};

Loading…
Cancel
Save