Sigo 3 years ago
commit dc14c2a3d2

@ -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;

@ -135,6 +135,7 @@ export default {
partten.https + res.data.filePath + "/" + res.data.fileName; partten.https + res.data.filePath + "/" + res.data.fileName;
} }
this.$refs.printform.show(this.printForm); this.$refs.printform.show(this.printForm);
console.log(this.printForm)
}); });
}, },
handleSizeChange(v) { handleSizeChange(v) {

@ -1,5 +1,6 @@
<template> <template>
<el-dialog :close-on-click-modal="false" v-dialogDrag title="打印" append-to-body :visible.sync="printDialogVisible" width="60%"> <el-dialog :close-on-click-modal="false" v-dialogDrag title="打印" append-to-body :visible.sync="printDialogVisible"
width="60%">
<div id="printService" class="printDiv"> <div id="printService" class="printDiv">
<div class="text-center text-grey padding-xs"> <div class="text-center text-grey padding-xs">
服务 服务
@ -11,7 +12,8 @@
<el-form-item label="时间:"> {{ printForm.cashDate }} </el-form-item><br> <el-form-item label="时间:"> {{ printForm.cashDate }} </el-form-item><br>
<el-form-item label="单号:">{{ printForm.cashNum }} </el-form-item><br> <el-form-item label="单号:">{{ printForm.cashNum }} </el-form-item><br>
<el-form-item label="顾客:"> <el-form-item label="顾客:">
{{ printForm.memberName?printForm.memberName:'散客' }}/{{ printForm.mobilePhone?printForm.mobilePhone:'******' }} {{ printForm.memberName ? printForm.memberName : '散客' }}/{{ printForm.mobilePhone ? printForm.mobilePhone : '******'
}}
</el-form-item><br> </el-form-item><br>
<el-form-item label="收银:"> <el-form-item label="收银:">
<div>{{ staffName }} </div> <div>{{ staffName }} </div>
@ -29,36 +31,39 @@
<div class="text-left" style="width:25%">折后 </div> <div class="text-left" style="width:25%">折后 </div>
</div> </div>
<div style="height:15px"></div> <div style="height:15px"></div>
<div class="print-table flex justify-center align-center" v-for="(item,index) in printForm.projectList"> <div class="print-table flex justify-center align-center" v-for="(item, index) in printForm.projectList">
<div class="text-left" style="width:50%"> <span class="text-cyan text-out">{{item.projectName}}</span></div> <div class="text-left" style="width:50%"> <span class="text-cyan text-out">{{ item.projectName }}</span></div>
<div class="text-left" style="width:25%"> <span class="text-red text-price">{{item.priceMember}}</span></div> <div class="text-left" style="width:25%"> <span class="text-red text-price">{{ item.priceMember }}</span></div>
<div class="text-left" style="width:25%"> <span class="text-red text-price">{{item.transactionPrice}}</span></div> <div class="text-left" style="width:25%"> <span class="text-red text-price">{{ item.discountmoney }}</span>
</div>
</div> </div>
<div style="height:8px"></div> <div style="height:8px"></div>
<hr class="text-grey"> <hr class="text-grey">
<div style="height:8px"></div> <div style="height:8px"></div>
<div v-if="recList.length!=0"> <div v-if="recList.length != 0">
<div class="print-table flex justify-center align-center"> <div class="print-table flex justify-center align-center">
<div class="text-left" style="width:50%">充值帐户 </div> <div class="text-left" style="width:50%">充值帐户 </div>
<div class="text-left" style="width:25%;padding-right:5px">支付 </div> <div class="text-left" style="width:25%;padding-right:5px">支付 </div>
<div class="text-left" style="width:25%;padding-right:5px">剩余 </div> <div class="text-left" style="width:25%;padding-right:5px">剩余 </div>
</div> </div>
<div style="height:15px"></div> <div style="height:15px"></div>
<div class="print-table flex justify-center align-center" v-for="(item,index) in recList"> <div class="print-table flex justify-center align-center" v-for="(item, index) in recList">
<div class="text-left" style="width:50%"> <span class="text-cyan text-out">{{item.rechargeTypeName}}</span></div> <div class="text-left" style="width:50%"> <span class="text-cyan text-out">{{ item.rechargeTypeName }}</span>
<div class="text-left" style="width:25%"> <span class="text-red text-price">{{item.spendMoney}}</span></div> </div>
<div class="text-left" style="width:25%"> <span class="text-red text-price">{{item.cardRestMoney}}</span></div> <div class="text-left" style="width:25%"> <span class="text-red text-price">{{ item.spendMoney }}</span></div>
<div class="text-left" style="width:25%"> <span class="text-red text-price">{{ item.cardRestMoney }}</span>
</div> </div>
</div> </div>
<div v-if="printForm.payLists.length!=0"> </div>
<div v-if="printForm.payLists.length != 0">
<div class="print-table flex justify-center align-center"> <div class="print-table flex justify-center align-center">
<div class="text-left" style="width:50%">支付方式 </div> <div class="text-left" style="width:50%">支付方式 </div>
<div class="text-left" style="width:50%;">支付 </div> <div class="text-left" style="width:50%;">支付 </div>
</div> </div>
<div style="height:15px"></div> <div style="height:15px"></div>
<div class="print-table flex justify-center align-center" v-for="(item,index) in printForm.payLists"> <div class="print-table flex justify-center align-center" v-for="(item, index) in printForm.payLists">
<div class="text-left" style="width:50%"> <span class="text-cyan text-out">{{item.payName}}</span></div> <div class="text-left" style="width:50%"> <span class="text-cyan text-out">{{ item.payName }}</span></div>
<div class="text-left" style="width:50%"> <span class="text-red text-price">{{item.payMoney}}</span></div> <div class="text-left" style="width:50%"> <span class="text-red text-price">{{ item.payMoney }}</span></div>
</div> </div>
</div> </div>
<!-- <div class="flex justify-start align-center padding-top-xs padding-bottom-xs"> <!-- <div class="flex justify-start align-center padding-top-xs padding-bottom-xs">
@ -128,7 +133,13 @@ export default {
form.projectList.forEach((item) => { form.projectList.forEach((item) => {
recList = recList.concat(item.rechargeConsumeList); recList = recList.concat(item.rechargeConsumeList);
}); });
this.printForm.projectList.forEach((item) => {
item.discountmoney = ((item.collectionAmount * 1) + (item.collectionRechargeAmount * 1)).toFixed(2) * 1;
})
this.recList = recList; this.recList = recList;
console.log(form.projectList)
// console.log(this.recList)
this.printDialogVisible = true; this.printDialogVisible = true;
}, },
}, },

@ -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

@ -1,5 +1,6 @@
<template> <template>
<el-dialog :close-on-click-model="false" v-dialogDrag :title="staffTitle" :visible.sync="dialogVisible" width="500px" append-to-body :before-close="handleClose"> <el-dialog :close-on-click-model="false" v-dialogDrag :title="staffTitle" :visible.sync="dialogVisible" width="500px"
append-to-body :before-close="handleClose">
<el-button size="mini" type="primary" @click="add()"></el-button> <el-button size="mini" type="primary" @click="add()"></el-button>
<el-button size="mini" type="primary" @click="del()"></el-button> <el-button size="mini" type="primary" @click="del()"></el-button>
<div class="flex"> <div class="flex">
@ -7,7 +8,8 @@
<el-table-column align="center" :label="staffTitle"> <el-table-column align="center" :label="staffTitle">
<el-table-column min-width="140" align="center" label="员工"> <el-table-column min-width="140" align="center" label="员工">
<template slot-scope="scope"> <template slot-scope="scope">
<el-select filterable default-first-option v-model="scope.row.label" placeholder="请选择" @change="editChange($event,scope.$index)"> <el-select filterable default-first-option v-model="scope.row.label" placeholder="请选择"
@click="editclick($event, scope.$index)" @change="editChange($event, scope.$index)">
<el-option v-for="item in openList" :key="item.id" :label="item.label" :value="item.id"> <el-option v-for="item in openList" :key="item.id" :label="item.label" :value="item.id">
</el-option> </el-option>
</el-select> </el-select>
@ -15,7 +17,8 @@
</el-table-column> </el-table-column>
<el-table-column min-width="100" align="center" label="占比"> <el-table-column min-width="100" align="center" label="占比">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-focus type="number" @blur="endEdit(scope.row,scope.$index)" :disabled="scope.$index==0" size="samll" v-model="scope.row.ratio"></el-input> <el-input v-focus type="number" @blur="endEdit(scope.row, scope.$index)" :disabled="scope.$index == 0"
size="samll" v-model="scope.row.ratio"></el-input>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -40,24 +43,54 @@ export default {
form: {}, // form: {}, //
openList: [], openList: [],
staffText: "", staffText: "",
staffTexts: "",
staffTitle: "", staffTitle: "",
staffTitles: "",
staffListCopy: [], staffListCopy: [],
lists: [],
len: 0
}; };
}, },
methods: { methods: {
handleClose() { handleClose() {
Object.assign(this.$data, this.$options.data.call(this)); console.log(this.lists)
let forms = {
text: this.staffTexts,
list: this.lists
};
console.log(this.lists)
this.$emit("staffratioData", forms);
this.dialogVisible = false;
}, },
add() { add() {
this.list.push({}); this.list.push({ label: "", ratio: 0 });
this.changeStaff(); this.changeStaff();
}, },
endEdit(row, index) { endEdit(row, index) {
if (row.ratio || row.ratio * 1 < 101) { console.log(row)
row.ratio = row.ratio * 1; if (row.ratio * 1 > 100) {
} else { this.$alert("输入值不能大于100", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
row.ratio = 0;
} else if (row.ratio * 1 < 0) {
this.$alert("输入值不能小于0", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
row.ratio = 0; row.ratio = 0;
} }
else {
row.ratio = row.ratio * 1;
}
let number = 0; let number = 0;
this.list.forEach((item, index) => { this.list.forEach((item, index) => {
if (index != 0) { if (index != 0) {
@ -65,30 +98,94 @@ export default {
} }
}); });
this.list[0].ratio = 100 - number; this.list[0].ratio = 100 - number;
if (this.list[0].ratio < 0) {
this.$alert("第一个人员占比过低", "提示", {
confirmButtonText: "确定",
confirmButtonClass: "confirmbtnFalses",
type: "warning",
center: true,
callback: (action) => { },
});
this.list[0].ratio = this.list[0].ratio + row.ratio
row.ratio = 0;
}
this.changeStaff(); this.changeStaff();
}, },
editChange(e, index) { editChange(e, index) {
let number = 0;
let row = this.list[index]; let row = this.list[index];
if (this.list.length == 1) {
row.ratio = 100;
} else {
row.ratio = 0
this.list.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
this.list[0].ratio = 100 - number;
})
console.log(this.list[0].ratio)
}
let form = {}; let form = {};
this.openList.forEach((item) => { this.openList.forEach((item) => {
if (e == item.id) { if (e == item.id) {
form = { ...item }; form = { ...item };
} }
}); })
if (row.ratio > 0) {
form.ratio = row.ratio; form.ratio = row.ratio;
}
this.list.splice(index, 1, form); this.list.splice(index, 1, form);
console.log(this.openList); console.log(this.openList);
this.changeStaff(); this.changeStaff();
}, },
editclick(index) {
let row = this.list[index];
row.ratio=0
let number = 0;
this.list.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
this.list[0].ratio = 100 - number;
})
console.log(this.list[0].ratio)
},
del() { del() {
let index = this.list.length - 1; let index = this.list.length - 1;
this.list[0].ratio += this.list[index].ratio; this.list[0].ratio += this.list[index].ratio;
this.list.splice(index, 1); this.list.splice(index, 1);
this.changeStaff(); this.changeStaff();
}, },
showdetele() {
setTimeout(() => {
this.$nextTick(() => {
let row = JSON.parse(localStorage.getItem('row'));
let text = localStorage.getItem('text')
this.lists = JSON.parse(JSON.stringify([]));
this.staffTexts = text;
this.lists = row[text];
this.len = this.lists.length
this.lists.forEach((item) => {
if (item.id) {
item.label = item.brandNumber + "-" + item.staffName;
}
});
this.dialogVisible = true;
this.getData();
this.changeStaff();
let number = 0;
this.lists.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
});
if (this.lists.length > 0) {
this.lists[0].ratio = (100 - number).toFixed(2) * 1;
}
});
}, 300);
},
show(form, text) { show(form, text) {
setTimeout(() => { setTimeout(() => {
this.$nextTick(() => { this.$nextTick(() => {
@ -131,8 +228,8 @@ export default {
if (this.list.length > 0) { if (this.list.length > 0) {
this.list[0].ratio = (100 - number).toFixed(2) * 1; this.list[0].ratio = (100 - number).toFixed(2) * 1;
} }
this.list.push({ label: "", ratio: 0 });
}); });
console.log(this.list);
}, 300); }, 300);
}, },
changeStaff() { changeStaff() {
@ -168,7 +265,7 @@ export default {
confirmButtonClass: "confirmbtnFalses", confirmButtonClass: "confirmbtnFalses",
type: "warning", type: "warning",
center: true, center: true,
callback: (action) => {}, callback: (action) => { },
}); });
} }
}); });
@ -188,7 +285,7 @@ export default {
confirmButtonClass: "confirmbtnFalses", confirmButtonClass: "confirmbtnFalses",
type: "warning", type: "warning",
center: true, center: true,
callback: (action) => {}, callback: (action) => { },
}); });
} }
}); });
@ -211,7 +308,7 @@ export default {
confirmButtonClass: "confirmbtnFalses", confirmButtonClass: "confirmbtnFalses",
type: "warning", type: "warning",
center: true, center: true,
callback: (action) => {}, callback: (action) => { },
}); });
} }
}); });
@ -230,6 +327,13 @@ export default {
}, },
confirms() { confirms() {
let flag = this.isRepeat(this.list, "brandNumber"); let flag = this.isRepeat(this.list, "brandNumber");
console.log(this.list)
this.list.forEach((item,index)=>{
if(item.label==""){
this.list.splice(index,1)
}
})
let form = { let form = {
text: this.staffText, text: this.staffText,
list: this.list, list: this.list,
@ -237,6 +341,7 @@ export default {
console.log(flag); console.log(flag);
if (flag) { if (flag) {
this.$emit("staffratioData", form); this.$emit("staffratioData", form);
console.log(form)
this.dialogVisible = false; this.dialogVisible = false;
} else { } else {
this.$alert("选择员工存在重复", "提示", { this.$alert("选择员工存在重复", "提示", {
@ -244,7 +349,7 @@ export default {
confirmButtonClass: "confirmbtnFalses", confirmButtonClass: "confirmbtnFalses",
type: "warning", type: "warning",
center: true, center: true,
callback: (action) => {}, callback: (action) => { },
}); });
} }
}, },

@ -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 }];
}, },
}, },
}; };

@ -311,6 +311,8 @@ export default {
if (res.code == "000000") { if (res.code == "000000") {
this.list = res.pageInfo.list; this.list = res.pageInfo.list;
this.total = res.pageInfo.total; this.total = res.pageInfo.total;
this.list=this.list.reverse()
console.log(this.list)
} else { } else {
this.$alert(res.message, "提示", { this.$alert(res.message, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",

Loading…
Cancel
Save