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

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

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

@ -1,15 +1,17 @@
<template> <template>
<div class="flex"> <div class="flex">
<div style="width:100%"> <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="payName" min-width="100" label="支付方式"></el-table-column>
<el-table-column align="center" prop="payMoney" min-width="80" label="本次支付 "> <el-table-column align="center" prop="payMoney" min-width="80" label="本次支付 ">
<template slot-scope="scope"> <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 }} {{ scope.row.payMoney }}
<i class="text-cyan el-icon-edit"></i> <i class="text-cyan el-icon-edit"></i>
</div> </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> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -32,22 +34,55 @@ export default {
methods: { methods: {
// //
show(form, list) { show(form, list) {
console.log(form);
var that = this; var that = this;
that.form = JSON.parse(JSON.stringify(form)); that.form = JSON.parse(JSON.stringify(form));
that.payLists = []; that.payLists = [];
that.payLists = JSON.parse(JSON.stringify(list)); that.payLists = JSON.parse(JSON.stringify(list));
console.log(that.payLists)
}, },
//. //.
editPay(row, index) { editPay(row, index) {
this.payIndex = 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) { endEdit(row, index) {
this.payIndex = -1; this.payIndex = -1;
let money = 0;
var that = this;
this.payLists.forEach((item) => {
money += item.payMoney * 1;
});
if (!row.payMoney) { if (!row.payMoney) {
row.payMoney = 0; 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 { } else {
row.payMoney = row.payMoney * 1; row.payMoney = row.payMoney * 1;
} }
@ -62,31 +97,31 @@ export default {
let form = { form: this.form, list: this.payLists }; let form = { form: this.form, list: this.payLists };
this.$emit("paymentData", form); this.$emit("paymentData", form);
}, },
getSummariesPay(param) { // getSummariesPay(param) {
const { columns, data } = param; // const { columns, data } = param;
const sums = []; // const sums = [];
columns.forEach((column, index) => { // columns.forEach((column, index) => {
if (index === 0) { // if (index === 0) {
sums[index] = "合计"; // sums[index] = "";
return; // return;
} // }
const values = data.map((item) => Number(item[column.property])); // const values = data.map((item) => Number(item[column.property]));
if (column.property == "payMoney") { // if (column.property == "payMoney") {
sums[index] = values.reduce((prev, curr) => { // sums[index] = values.reduce((prev, curr) => {
const value = Number(curr); // const value = Number(curr);
if (!isNaN(value)) { // if (!isNaN(value)) {
return prev + curr; // return prev + curr;
} else { // } else {
sums[index] = "--"; // sums[index] = "--";
} // }
}, 0); // }, 0);
sums[index] += " "; // sums[index] += " ";
} else { // } else {
sums[index] = "--"; // sums[index] = "--";
} // }
}); // });
return sums; // return sums;
}, // },
}, },
}; };
</script> </script>

File diff suppressed because it is too large Load Diff

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