Sigo 4 years ago
commit dc14c2a3d2

@ -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();
}
//
},
//
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;

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

@ -1,5 +1,6 @@
<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 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.cashNum }} </el-form-item><br>
<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 label="收银:">
<div>{{ staffName }} </div>
@ -32,7 +34,8 @@
<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: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 style="height:8px"></div>
<hr class="text-grey">
@ -45,9 +48,11 @@
</div>
<div style="height:15px"></div>
<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>
<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 class="text-left" style="width:25%"> <span class="text-red text-price">{{ item.cardRestMoney }}</span>
</div>
</div>
</div>
<div v-if="printForm.payLists.length != 0">
@ -128,7 +133,13 @@ export default {
form.projectList.forEach((item) => {
recList = recList.concat(item.rechargeConsumeList);
});
this.printForm.projectList.forEach((item) => {
item.discountmoney = ((item.collectionAmount * 1) + (item.collectionRechargeAmount * 1)).toFixed(2) * 1;
})
this.recList = recList;
console.log(form.projectList)
// console.log(this.recList)
this.printDialogVisible = true;
},
},

@ -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,7 +1,8 @@
<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">
@ -9,7 +10,8 @@
{{ 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>

@ -43,76 +43,100 @@
</el-popover>
<el-form-item label="补单日期:" v-if="isAddition == 1">
<div class="activeFormDiv">
<el-date-picker v-model="additionDate" type="date" :picker-options="pickerOptions" format="yyyy-MM-dd" placeholder="选择日期">
<el-date-picker v-model="additionDate" type="date" :picker-options="pickerOptions" format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
</div>
</el-form-item>
</el-form>
<div class="flex justify-start align-start ">
<div class="into-table-width">
<el-table style="margin-top:3px;" :data="list" max-height="650" ref="list" @row-click="rowClick" :row-class-name="rowClassName" :row-key='getRowKeys' @expand-change="expandSelect" :expand-row-keys="expand" row-key="index" stripe :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee',}">
<el-table style="margin-top:3px;" :data="list" max-height="650" ref="list" @row-click="rowClick"
:row-class-name="rowClassName" :row-key='getRowKeys' @expand-change="expandSelect" :expand-row-keys="expand"
row-key="index" stripe
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee', }">
<el-table-column type="expand">
<template slot-scope="scope">
<div class="flex justify-start align-center flex-wrap ">
<el-form inline class="margin-top-xs margin-left-xs">
<el-form-item label='美发师'>
<div class="flex align-center form-width-m">
<el-select filterable default-first-option clearable @clear="clear(scope.row,'zhonggongList')" v-model="scope.row.zhonggongLists" placeholder="请选择" @change="handleChange($event,scope.row,'zhonggongList')">
<el-select filterable default-first-option clearable @clear="clear(scope.row, 'zhonggongList')"
v-model="scope.row.zhonggongLists" placeholder="请选择"
@change="handleChange($event, scope.row, 'zhonggongList')">
<el-option v-for="(item, index) in options" :key="index" :label="item.label" :value="item.id">
</el-option>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.zhonggongLists=null,scope.row.zhonggongList.splice(0,1)"></div> -->
<div class="el-icon-edit-outline text-xs text-cyan" @click.stop="openStaffRatio(scope.row,scope.$index,'zhonggongList')"></div>
<div class="el-icon-edit-outline text-xs text-cyan"
@click.stop="openStaffRatio(scope.row, scope.$index, 'zhonggongList')"></div>
</div>
</el-form-item>
<el-form-item label='美容师'>
<div class="flex align-center form-width-m">
<el-select filterable default-first-option clearable @clear="clear(scope.row,'largeList')" v-model="scope.row.largeLists" placeholder="请选择" @change="handleChange($event,scope.row,'largeList')">
<el-select filterable default-first-option clearable @clear="clear(scope.row, 'largeList')"
v-model="scope.row.largeLists" placeholder="请选择"
@change="handleChange($event, scope.row, 'largeList')">
<el-option v-for="(item, index) in options" :key="index" :label="item.label" :value="item.id">
</el-option>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.largeLists=null,scope.row.largeList.splice(0,1)"></div> -->
<div class="el-icon-edit-outline text-xs text-cyan" @click.stop="openStaffRatio(scope.row,scope.$index,'largeList')"></div>
<div class="el-icon-edit-outline text-xs text-cyan"
@click.stop="openStaffRatio(scope.row, scope.$index, 'largeList')"></div>
</div>
</el-form-item>
<el-form-item label='技师'>
<div class="flex align-center form-width-m">
<el-select filterable default-first-option clearable @clear="clear(scope.row,'technicianLists')" v-model="scope.row.technicianLists" placeholder="请选择" @change="handleChange($event,scope.row,'technicianList')">
<el-select filterable default-first-option clearable @clear="clear(scope.row, 'technicianLists')"
v-model="scope.row.technicianLists" placeholder="请选择"
@change="handleChange($event, scope.row, 'technicianList')">
<el-option v-for="(item, index) in options" :key="index" :label="item.label" :value="item.id">
</el-option>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.technicianLists=null,scope.row.technicianList.splice(0,1)"></div> -->
<div class="el-icon-edit-outline text-xs text-cyan" @click.stop="openStaffRatio(scope.row,scope.$index,'technicianList')"></div>
<div class="el-icon-edit-outline text-xs text-cyan"
@click.stop="openStaffRatio(scope.row, scope.$index, 'technicianList')"></div>
</div>
</el-form-item>
<el-form-item label='助理'>
<div class="flex align-center form-width-m">
<el-select filterable default-first-option clearable @clear="clear(scope.row,'smallLists')" v-model="scope.row.smallLists" placeholder="请选择" @change="handleChange($event,scope.row,'smallList')">
<el-select filterable default-first-option clearable @clear="clear(scope.row, 'smallLists')"
v-model="scope.row.smallLists" placeholder="请选择"
@change="handleChange($event, scope.row, 'smallList')">
<el-option v-for="(item, index) in options" :key="index" :label="item.label" :value="item.id">
</el-option>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.smallLists=null,scope.row.smallList.splice(0,1)"></div> -->
<div class="el-icon-edit-outline text-xs text-cyan" @click.stop="openStaffRatio(scope.row,scope.$index,'smallList')"></div>
<div class="el-icon-edit-outline text-xs text-cyan"
@click.stop="openStaffRatio(scope.row, scope.$index, 'smallList')"></div>
</div>
</el-form-item>
<el-form-item label='高管'>
<div class="flex align-center form-width-m">
<el-select filterable default-first-option clearable @clear="clear(scope.row,'managerLists')" v-model="scope.row.managerLists" placeholder="请选择" @change="handleChange($event,scope.row,'managerList')">
<el-option v-for="(item,index) in managerOptions" :key="index" :label="item.label" :value="item.id">
<el-select filterable default-first-option clearable @clear="clear(scope.row, 'managerLists')"
v-model="scope.row.managerLists" placeholder="请选择"
@change="handleChange($event, scope.row, 'managerList')">
<el-option v-for="(item, index) in managerOptions" :key="index" :label="item.label"
:value="item.id">
</el-option>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.managerLists=null,scope.row.managerList.splice(0,1)"></div> -->
<div class="el-icon-edit-outline text-xs text-cyan" @click.stop="openStaffRatio(scope.row,scope.$index,'managerList')"></div>
<div class="el-icon-edit-outline text-xs text-cyan"
@click.stop="openStaffRatio(scope.row, scope.$index, 'managerList')"></div>
</div>
</el-form-item>
<el-form-item label='管理层'>
<div class="flex align-center form-width-m">
<el-select filterable default-first-option clearable @clear="clear(scope.row,'adminLists')" v-model="scope.row.adminLists" placeholder="请选择" @change="handleChange($event,scope.row,'adminList')">
<el-option v-for="(item,index) in adminOptions" :key="index" :label="item.label" :value="item.id">
<el-select filterable default-first-option clearable @clear="clear(scope.row, 'adminLists')"
v-model="scope.row.adminLists" placeholder="请选择"
@change="handleChange($event, scope.row, 'adminList')">
<el-option v-for="(item, index) in adminOptions" :key="index" :label="item.label"
:value="item.id">
</el-option>
</el-select>
<!-- <div class="el-icon-circle-close text-xs text-cyan" @click.stop="scope.row.adminLists=null,scope.row.adminList.splice(0,1)"></div> -->
<div class="el-icon-edit-outline text-xs text-cyan" @click.stop="openStaffRatio(scope.row,scope.$index,'adminList')"></div>
<div class="el-icon-edit-outline text-xs text-cyan"
@click.stop="openStaffRatio(scope.row, scope.$index, 'adminList')"></div>
</div>
</el-form-item>
<br>
@ -123,13 +147,17 @@
<el-table-column show-overflow-tooltip min-width="140" align="center" label="项目选项">
<template slot-scope="scope">
<div class="flex justify-between align-center" @click.stop="">
<el-input v-model="scope.row.projectNum" placeholder="编码" @blur="proBlur(scope.row,proIndex=scope.$index)" @change="proBlur(scope.row,proIndex=scope.$index)">
<el-button title="门店项目" size="mini" slot="append" icon="el-icon-tickets" @click.stop="openPro(proIndex=scope.$index)"></el-button>
<el-input v-model="scope.row.projectNum" placeholder="编码"
@blur="proBlur(scope.row, proIndex = scope.$index)"
@change="proBlur(scope.row, proIndex = scope.$index)">
<el-button title="门店项目" size="mini" slot="append" icon="el-icon-tickets"
@click.stop="openPro(proIndex = scope.$index)"></el-button>
</el-input>
</div>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="center" prop="projectName" label="项目名称"></el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="center" prop="projectName" label="项目名称">
</el-table-column>
<el-table-column align="center" prop="noDiscount" label="卡付打折" width="50">
<template slot-scope="scope">{{
scope.row.noDiscount == 0 ? "是" : scope.row.noDiscount == 1 ? '否' : "未设"
@ -138,7 +166,8 @@
<el-table-column show-overflow-tooltip min-width="80" align="center" prop="transactionPrice" label="项目金额">
<template slot-scope="scope">
<div @click.stop="transactionPrice = scope.row.transactionPrice" v-if="scope.row.courseAccountId == null">
<el-input @focus="transactionPrice=scope.row.transactionPrice" type="number" v-model="scope.row.transactionPrice" @blur="endEditMoney(scope.row)" placeholder="¥"></el-input>
<el-input @focus="transactionPrice = scope.row.transactionPrice" type="number"
v-model="scope.row.transactionPrice" @blur="endEditMoney(scope.row)" placeholder="¥"></el-input>
</div>
<div v-else>{{ scope.row.transactionPrice }}</div>
</template>
@ -153,8 +182,11 @@
<div @click.stop="" v-if="props.row.isCardPay == 0">
<el-popover placement="bottom" width="900" @show="openRec(props.row)">
<div v-if="props.row.courseAccountId == null">
<el-table class=" border" v-if="props.row.cashNumber==1" style="max-width:900px" :data="rowRecList" :summary-method="getSummaries" show-summary max-height="400" :header-cell-style="{background: 'linear-gradient(#6cb3ff, #1873d4)',color:'#eeeeee'}">
<el-table-column align="center" prop="rechargeTypeName" show-overflow-tooltip label="卡付名称" width="110"></el-table-column>
<el-table class=" border" v-if="props.row.cashNumber == 1" style="max-width:900px"
:data="rowRecList" :summary-method="getSummaries" show-summary max-height="400"
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }">
<el-table-column align="center" prop="rechargeTypeName" show-overflow-tooltip label="卡付名称"
width="110"></el-table-column>
<el-table-column align="center" label="类别" width="60">
<template slot-scope="scope">
<span v-if="scope.row.type == 1"></span>
@ -163,36 +195,44 @@
</template>
</el-table-column>
<el-table-column align="center" prop="cardOver" label="可用金额" width="70"></el-table-column>
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="discount" label="折扣(%)"></el-table-column>
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="discount"
label="折扣(%)"></el-table-column>
<!-- <el-table-column align="center" prop="offsetMoney" label="可抵扣额" width="100"></el-table-column> -->
<el-table-column align="center" prop="spendMoney" label="本次支付" width="90">
<template slot-scope="scope">
<div class="form-input-width" v-if="recIndex!=scope.$index" @click="editcard(scope.row, scope.$index)">
<div class="form-input-width" v-if="recIndex != scope.$index"
@click="editcard(scope.row, scope.$index)">
{{ scope.row.spendMoney }}
<i class="text-cyan el-icon-edit"></i>
</div>
<el-input v-else v-focus type="number" size="samll" class="form-input-width" @blur="endEditcard(scope.row, scope.$index)" v-model="scope.row.spendMoney"></el-input>
<el-input v-else v-focus type="number" size="samll" class="form-input-width"
@blur="endEditcard(scope.row, scope.$index)" v-model="scope.row.spendMoney"></el-input>
</template>
</el-table-column>
<!-- <el-table-column align="center" prop="discoutMoney" label="抵扣支付" width="100"></el-table-column> -->
<el-table-column align="center" prop="cardOvers" label="可用余额" width="70"></el-table-column>
<el-table-column align="center" prop="giftConsumeMoney" label="赠送可用" width="70"></el-table-column>
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="discountFreeAmount" label="折扣(%)"></el-table-column>
<el-table-column show-overflow-tooltip min-width="70" align="center" prop="discountFreeAmount"
label="折扣(%)"></el-table-column>
<el-table-column align="center" prop="giftSpendMoney" label="赠送支付" width="70"></el-table-column>
<el-table-column align="center" prop="cardGiftOvers" label="赠送剩余" width="70"></el-table-column>
<el-table-column align="center" prop="storeName" label="所属门店" width="110" show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="storeName" label="所属门店" width="110" show-overflow-tooltip>
</el-table-column>
</el-table>
</div>
<!-- <recash ref="recash" @recashData="recashData"></recash> -->
<el-button slot="reference">充值卡</el-button>
<el-button slot="reference" @click="selectindex(props.row)"></el-button>
</el-popover>
</div>
<div v-else></div>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="collectionAmount" label="实付金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="collectionRechargeAmount" label="卡付金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="collectionCashAmount" label="现付金额"></el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="collectionAmounts" label="卡付抵扣金额">
</el-table-column>
<el-table-column show-overflow-tooltip min-width="75" align="center" prop="collectionRechargeAmount"
label="卡付金额"></el-table-column>
<!-- <el-table-column show-overflow-tooltip min-width="75" align="center" prop="collectionCashAmount" label="现付金额">
</el-table-column> -->
<el-table-column show-overflow-tooltip width="75" align="center" prop="sex" label="性别">
<template slot-scope="scope">
<el-select v-model="scope.row.sex" placeholder="">
@ -208,11 +248,13 @@
</div>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="center" prop="storeName" label="所属门店"></el-table-column>
<el-table-column show-overflow-tooltip min-width="120" align="center" prop="storeName" label="所属门店">
</el-table-column>
<el-table-column width="80" align="center" label="操作">
<!-- fixed="right" -->
<template slot-scope="scope">
<el-button :disabled="scope.row.editNumber==1" icon="el-icon-delete" circle size="mini" type="primary" @click.stop="delPro(scope.row)"></el-button>
<el-button :disabled="scope.row.editNumber == 1" icon="el-icon-delete" circle size="mini" type="primary"
@click.stop="delPro(scope.row)"></el-button>
</template>
</el-table-column>
@ -221,15 +263,15 @@
<div class="border-radius-10 border margin-left-xs bg-white padding-xs" style="margin-right:2%">
<div class="flex justify-center align-center text-bold padding-bottom-xs">
<div class="form-width-m ">
<span class=" ">付金额:</span>
<span class=" ">付金额:</span>
<span class="text-red text-price">
{{ form.cashAmount }}
</span>
</div>
<div class="form-width-m">
<span class=" ">付金额:</span>
<span class=" ">付金额:</span>
<span class="text-red text-price">
{{form.collectionCashAmount}}
{{ form.collectionCashAmounts }}
</span>
</div>
</div>
@ -317,6 +359,7 @@ export default {
rowList: [],
form: {
collectionCashAmount: 0,
collectionCashAmounts: 0,
cashAmount: 0,
debtMoney: 0,
},
@ -350,6 +393,9 @@ export default {
};
},
methods: {
selectindex(row) {
console.log(row)
},
changeMember() {
if (this.cashNumber == 1) {
Object.assign(this.$data, this.$options.data.call(this));
@ -364,30 +410,26 @@ export default {
},
clear(row, text) {
console.log(text);
//console.log(text);
let form = { ...row };
form[text] = [];
console.log(form);
//console.log(form);
this.list.splice(row.index, 1, form);
},
//
editcard(row, index) {
this.recIndex = index;
console.log(index)
},
endEditcard(row, index) {
console.log(index)
let debtMoney =
(this.recForm.amount * 1 - this.recForm.cashAmount * 1).toFixed(2) * 1;
console.log(this.recForm)
let form = { ...row };
console.log(debtMoney);
console.log(form)
//console.log(debtMoney);//
if (debtMoney > 0) {
// let cardMoney =
// (form.offsetMoney + form.offsetGiftMoney).toFixed(2) * 1;
// if (cardMoney < debtMoney) {
// form.spendMoney = form.cardOver;
// form.giftSpendMoney = form.giftConsumeMoney;
// form.discoutMoney = form.offsetMoney;
// form.discoutGiftMoney = form.offsetGiftMoney;
// } else {
console.log(form.type);
console.log(this.useRecharge);
if (form.type == 2 || form.type == 0) {
if (this.useRecharge == 2) {
//
@ -423,47 +465,35 @@ export default {
} else {
//使
let sunRatio =
(form.cardRestMoney + form.cardGiftOvers).toFixed(2) * 1;
let recRatio = (form.cardRestMoney / sunRatio).toFixed(2) * 1;
let recGiftRatio = (form.cardGiftOvers / sunRatio).toFixed(2) * 1;
console.log(form.cardRestMoney);
console.log(form.cardGiftOvers);
console.log(sunRatio);
if (form.offsetMoney > debtMoney * recRatio) {
(form.cardRestMoney + form.cardGiftOvers).toFixed(2) * 1;///+
let recRatio = (form.cardRestMoney / sunRatio).toFixed(2) * 1;//
let recGiftRatio = (form.cardGiftOvers / sunRatio).toFixed(2) * 1;//
if (form.offsetMoney > debtMoney * recRatio) {//
if (this.recForm.noDiscount == 0) {
form.spendMoney =
(debtMoney * recRatio * (form.discount / 100)).toFixed(2) * 1;
form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1;
form.giftSpendMoney =
(
debtMoney *
recGiftRatio *
(form.discountFreeAmount / 100)
).toFixed(2) * 1;
form.discoutGiftMoney =
(debtMoney * recGiftRatio).toFixed(2) * 1;
form.discoutMoney =//
((form.spendMoney * 1) / (form.discount / 100)).toFixed(2) * 1;
form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1;
console.log("这个是赠送金额" + form.giftSpendMoney)
form.discoutGiftMoney =//
(form.giftSpendMoney / (form.discountFreeAmount / 100)).toFixed(2) * 1;
//console.log(form.discoutGiftMoney)
} else {
console.log(debtMoney);
//console.log(debtMoney);
form.spendMoney = (debtMoney * recRatio).toFixed(2) * 1;
form.discoutMoney = (debtMoney * recRatio).toFixed(2) * 1;
form.giftSpendMoney = (debtMoney * recGiftRatio).toFixed(2) * 1;
form.discoutGiftMoney =
(debtMoney * recGiftRatio).toFixed(2) * 1;
}
} else {
form.spendMoney = form.cardOver;
form.discoutMoney =
(form.cardOver / (form.discount / 100)).toFixed(2) * 1;
form.giftSpendMoney =
debtMoney * recRatio -
form.discoutMoney +
(debtMoney * recGiftRatio).toFixed(2) * 1;
form.discoutGiftMoney =
(
debtMoney * recRatio -
form.discoutMoney +
(debtMoney * recGiftRatio) / (form.discountFreeAmount / 100)
).toFixed(2) * 1;
((form.spendMoney * 1) * (form.discount / 100)).toFixed(2) * 1;
form.giftSpendMoney = ((form.spendMoney * 1) / recRatio * recGiftRatio).toFixed(2) * 1;
console.log("这个是赠送金额" + form.giftSpendMoney)
form.discoutGiftMoney =//
(form.giftSpendMoney * (form.discount / 100)).toFixed(2) * 1;
}
}
if (form.spendMoney == 0) {
@ -474,71 +504,100 @@ export default {
} else {
if (this.recForm.noDiscount == 0) {
//
form.spendMoney =
((debtMoney * form.discount) / 100).toFixed(2) * 1;
form.discoutMoney =
((form.spendMoney * form.discount) / 100).toFixed(2) * 1;
} else {
//
form.spendMoney = debtMoney;
不可以打
form.discoutMoney = form.spendMoney;
}
form.discoutMoney = debtMoney;
form.discoutGiftMoney=0
}
if (form.discoutGiftMoney + form.discoutMoney > this.list[this.editProIndex].amount) {
this.$message.info({
message: "卡付金额不能大于套餐金额",
});
form.spendMoney = 0
form.discoutMoney = 0
form.discoutGiftMoney = 0
form.giftSpendMoney = 0
}
} else {
form.spendMoney = 0;
form.giftSpendMoney = 0;
}
if (form.spendMoney > form.cardOver) {
form.spendMoney = form.cardOver;
form.giftSpendMoney = form.cardGiftOvers;
}
this.rowRecList.splice(index, 1, form);
},
endEditcard(row, index) {
if (!row.spendMoney) {
row.spendMoney = 0;
}
row.spendMoney = row.spendMoney * 1;
if (0 <= row.spendMoney * 1 > row.cardOver * 1) {
this.$message.info({
message: "支付金额不能大于可用金额!",
});
} else {
this.recIndex = -1;
if (row.spendMoney * 1 < 0) {
} else {
if (this.recForm.noDiscount == 0) {
row.discoutMoney =
((row.spendMoney * 1) / ((row.discount * 1) / 100)).toFixed(2) *
1;
} else {
row.discoutMoney = row.spendMoney;
}
row.cardOvers =
(row.cardOver * 1 - row.spendMoney * 1).toFixed(2) * 1;
row.cardGiftOvers =
(row.giftConsumeMoney * 1 - row.giftSpendMoney * 1).toFixed(2) * 1;
}
if (row.spendMoney == 0) {
row.discoutGiftMoney = 0;
}
if (form.spendMoney > form.cardOver) {
form.spendMoney = form.cardOver;
form.giftSpendMoney = form.cardGiftOvers;
}
let res = { ...row };
this.rowRecList.splice(index, 1, res);
this.rowRecList.splice(index, 1, form);
this.list[this.editProIndex].collectionCashAmounts = this.list[this.editProIndex].amount - (form.discoutMoney + form.discoutGiftMoney)
//console.log(this.list)
//console.log('index'+index)
let num = 0;
this.list.forEach((item) => {
// //console.log(""+item.collectionCashAmounts)
num = num + item.collectionCashAmounts
});
//console.log(num)
this.form.collectionCashAmounts = num;
this.sumNum();
// this.rowRecList.splice(index, 1, form);
// ---------------------------------------------------------------------------------------------------------------
// if (!row.spendMoney) {
// row.spendMoney = 0;
// }
// row.spendMoney = row.spendMoney * 1;
// if (0 <= row.spendMoney * 1 > row.cardOver * 1) {
// this.$message.info({
// message: "!",
// });
// } else {
// this.recIndex = -1;
// if (row.spendMoney * 1 < 0) {
// } else {
// if (this.recForm.noDiscount == 0) {
// row.discoutMoney =
// ((row.spendMoney * 1) / ((row.discount * 1) / 100)).toFixed(2) * 1;
// } else {
// row.discoutMoney = row.spendMoney;
// }
// row.cardOvers =
// (row.cardOver * 1 - row.spendMoney * 1).toFixed(2) * 1;
// row.cardGiftOvers =
// (row.giftConsumeMoney * 1 - row.giftSpendMoney * 1).toFixed(2) * 1;
// }
// if (row.spendMoney == 0) {
// row.discoutGiftMoney = 0;
// }
// }
// let res = { ...row };
// this.rowRecList.splice(index, 1, res);
// this.sumNum();
},
sumNum() {
let spendMoney = 0;
let spendNumber = 0;
//console.log(this.rowRecList)
this.rowRecList.forEach((item) => {
console.log(item.discoutMoney);
console.log(item.discoutGiftMoney);
spendMoney += (item.discoutMoney + item.discoutGiftMoney) * 1;
spendNumber += (item.spendMoney * 1 + item.giftSpendMoney) * 1;
//console.log(item.discoutMoney);
//console.log(item.discoutGiftMoney);
});
console.log(spendMoney);
//console.log(spendMoney);
this.recForm.collectionRechargeAmount = spendNumber.toFixed(2) * 1;
this.recForm.collRecAmonnt = spendMoney.toFixed(2) * 1;
//console.log(this.recForm.collectionRechargeAmount)
this.recForm.cashAmount =
(
this.recForm.collectionCashAmount +
@ -555,6 +614,11 @@ export default {
this.recForm.collectionCashAmount +
this.recForm.collectionIntegralAmount
).toFixed(2) * 1;
this.recForm.collectionAmounts =
(
spendMoney
).toFixed(2) * 1;
//console.log(this.recForm.collectionAmount)
this.recForm.rechargeAmount = spendNumber;
this.list.splice(this.recForm.index, 1, this.recForm);
let rList = [];
@ -564,7 +628,7 @@ export default {
JSON.stringify(item.rechargeAccountList)
);
rechargeAccountList.forEach((item) => {
console.log(item);
//console.log(item);
item.cardOver = item.cardOvers;
item.giftConsumeMoney = item.cardGiftOvers;
item.giftSpendMoney = 0;
@ -578,12 +642,13 @@ export default {
this.list.forEach((item) => {
if (item.index != this.editProIndex) {
console.log(this.setRecList(item));
//console.log(this.setRecList(item));
let recArr = this.setRecList(item);
item.rechargeAccountList.forEach((item, index) => {
if (item.spendMoney > 0) {
this.sumAmont();
} else {
console.log(item);
//console.log(item);
item.cardOver = recArr[index].cardOvers;
item.cardOvers = recArr[index].cardOvers;
item.giftConsumeMoney = recArr[index].cardGiftOvers;
@ -592,14 +657,15 @@ export default {
});
}
});
console.log(rList);
console.log(this.list);
//console.log(rList);
//console.log(this.list);
this.sumAmont();
},
openRec(row) {
this.recForm = JSON.parse(JSON.stringify(row));
this.rowRecList = JSON.parse(JSON.stringify(row.rechargeAccountList));
this.editProIndex = row.index;
console.log( this.editProIndex)
},
recashData(v) {
this.list = v.list;
@ -607,7 +673,7 @@ export default {
let recList = v.form.rechargeAccountList;
this.list.forEach((item, index) => {
if (Vindex < index) {
console.log("大于当前, 卡包变");
//console.log(", ");
recList.forEach((rec, recIndex) => {
if (rec.spendMoney > 0) {
item.rechargeAccountList[recIndex].cardOver = rec.cardOvers;
@ -665,7 +731,7 @@ export default {
endEditMoney(row) {
let form = { ...row };
console.log(row);
//console.log(row);
if (this.cashNumber == 1) {
if (
form.topPriceMember < form.transactionPrice * 1 ||
@ -700,7 +766,7 @@ export default {
this.sumAmont();
},
handleChange(data, row, text) {
console.log("行号", row.index);
//console.log("", row.index);
let form = { ...row };
if (text == "managerList") {
this.managerOptions.forEach((item, index) => {
@ -723,7 +789,7 @@ export default {
} else {
this.options.forEach((item, index) => {
if (item.id == data) {
console.log("返回数据:", item);
//console.log(":", item);
item.ratio = 100;
form[text] = [];
form[text].push(item);
@ -772,6 +838,7 @@ export default {
},
passcodeData(v) {
if (v != null) {
console.log(v)
this.formData.append("file", v);
}
this.addCashConfirm();
@ -788,7 +855,7 @@ export default {
this.$refs.project.show(this.memberForm);
},
projectData(v) {
console.log(v);
//console.log(v);
if (!v.courseAccountId) {
v.courseAccountId = null;
v.courseProjectId = v.id;
@ -861,7 +928,7 @@ export default {
numberTimes: 1,
minumumTimes: res.data.minumumTimes,
};
console.log(form);
//console.log(form);
this.setRecList(form);
if (this.cashNumber == 1) {
if (row.courseAccountId == null) {
@ -892,9 +959,10 @@ export default {
} else {
form.cashAmount = form.amount;
form.collectionAmount = form.cashAmount;
//console.log("1")
}
if (this.list.length > 0) {
console.log(this.list.length);
//console.log(this.list.length);
if (!this.list[0].projectName) {
this.proIndex = 0;
}
@ -956,7 +1024,7 @@ export default {
2
) * 1;
}
console.log(item);
//console.log(item);
} else {
item.offsetMoney = item.giftConsumeMoney + item.cardConsumeMoney;
item.offsetGiftMoney = 0;
@ -1001,8 +1069,8 @@ export default {
if (
this.balance <=
(this.form.collectionCashAmount - sumMoney).toFixed(2) * 1 ||
(this.form.collectionCashAmount - sumMoney).toFixed(2) * 1 < 0
(this.form.collectionCashAmounts - sumMoney).toFixed(2) * 1 ||
(this.form.collectionCashAmounts - sumMoney).toFixed(2) * 1 < 0
) {
flag = false;
this.$alert("实付金额不等于项目金额", "提示", {
@ -1109,17 +1177,26 @@ export default {
item.rechargeAccountList = rechargeAccountList;
if (item.courseAccountId != null) {
item.collectionAmount = item.amount;
//console.log("2")
}
if (item.projectId) {
list.push(item);
}
});
console.log(list)
list.forEach((item) => {
item.collectionAmount = item.collectionAmounts
})
console.log(list)
this.formData.append("cashListRequestList", JSON.stringify(list));
addCash(this.formData).then((res) => {
if (res.code == "000000") {
this.$message.success({
message: "验证成功 , 收银" + res.message,
});
this.formData = new FormData()
this.notData();
} else {
this.payLists = this.payListsCopy;
@ -1133,14 +1210,20 @@ export default {
center: true,
callback: (action) => { },
});
this.formData = new FormData()
}
});
},
openStaffRatio(row, index, text) {
this.editIndex = index;
console.log(row)
this.$refs.staffratio.show(row, text);
this.$refs.staffratio.showdetele();
localStorage.setItem("row",JSON.stringify(row))
localStorage.setItem("text",text)
},
staffratioData(v) {
console.log(v)
let form = this.list[this.editIndex];
let texts = v.text + "s";
form[v.text] = v.list;
@ -1163,32 +1246,40 @@ export default {
this.list.push(list);
},
delPro(row) {
this.czRecList(row);
// this.czRecList(row);
this.list.splice(row.index, 1);
},
czRecList(row) {
let list = [];
row.rechargeAccountList.forEach((item) => {
if (item.spendMoney > 0) {
list.push(item);
}
});
this.recListCopy.forEach((item) => {
list.forEach((items) => {
if (item.id == items.id) {
console.log(item);
console.log(item.giftConsumeMoney);
console.log(item.giftSpendMoney);
item.cardOver = (item.cardOver + items.spendMoney).toFixed(2) * 1;
item.cardOvers = (item.cardOvers + items.spendMoney).toFixed(2) * 1;
item.cardGiftOvers =
(item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1;
item.giftConsumeMoney =
(item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1;
}
});
//console.log(row)
this.form.cashAmount = this.form.cashAmount - row.amount + row.cashAmount
this.form.collectionCashAmounts = this.form.cashAmount - row.amount + row.cashAmount
this.form.collectionCashAmount = this.form.collectionCashAmounts
this.payLists.forEach((item) => {
item.payMoney = 0
});
this.sumAmont()
},
// czRecList(row) {
// let list = [];
// row.rechargeAccountList.forEach((item) => {
// if (item.spendMoney > 0) {
// list.push(item);
// }
// });
// this.recListCopy.forEach((item) => {
// list.forEach((items) => {
// if (item.id == items.id) {
// //console.log(item);
// //console.log(item.giftConsumeMoney);
// //console.log(item.giftSpendMoney);
// item.cardOver = (item.cardOver + items.spendMoney).toFixed(2) * 1;
// item.cardOvers = (item.cardOvers + items.spendMoney).toFixed(2) * 1;
// item.cardGiftOvers =
// (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1;
// item.giftConsumeMoney =
// (item.giftConsumeMoney + items.giftSpendMoney).toFixed(2) * 1;
// }
// });
// });
// },
//
openMember() {
this.cashNumber = 1;
@ -1196,7 +1287,7 @@ export default {
},
//
memberData(v) {
console.log(v);
//console.log(v);
this.memberForm.mobilePhone = v.mobilePhone;
this.inputMember();
},
@ -1205,7 +1296,7 @@ export default {
this.setProOne(v);
},
paymentData(v) {
console.log(v);
//console.log(v);
this.form = v.form;
this.payLists = v.list;
this.sumAmont();
@ -1228,7 +1319,7 @@ export default {
},
//
rowClick(row) {
console.log(row);
//console.log(row);
this.$refs.list.toggleRowExpansion(row);
},
close() {
@ -1382,6 +1473,7 @@ export default {
} else {
itemLists.cashAmount = itemLists.amount;
itemLists.collectionAmount = itemLists.amount;
//console.log(3)
itemLists.courseMoney = itemLists.transactionPrice;
}
list.push(itemLists);
@ -1654,17 +1746,22 @@ export default {
item.collectionIntegralAmount +
item.collectionCashAmount
).toFixed(2) * 1;
//console.log(4)
} else {
item.collectionAmount =
(
item.collectionIntegralAmount + item.collectionCashAmount
).toFixed(2) * 1;
}
//console.log(5)
});
}
let collectionRechargeAmountg = 0;
this.list.forEach((item) => {
let debtMoney = 0;
if (item.amount && item.courseAccountId == null) {
debtMoney =
(
item.amount -
@ -1674,8 +1771,13 @@ export default {
).toFixed(2) * 1;
money += debtMoney;
}
collectionRechargeAmountg += (item.collectionRechargeAmount).toFixed(2) * 1;
});
this.form.cashAmount = money.toFixed(2) * 1;
this.form.cashAmount = (money.toFixed(2) * 1) + (collectionRechargeAmountg.toFixed(2) * 1)
this.form.collectionCashAmounts = (money.toFixed(2) * 1)
console.log(this.form.collectionCashAmounts)
console.log(this.form.cashAmount)
this.list.forEach((item) => {
if (
this.form.cashAmount == this.form.collectionCashAmount &&
@ -1695,11 +1797,15 @@ export default {
item.collectionIntegralAmount +
item.collectionCashAmount
).toFixed(2) * 1;
//console.log(6)
//console.log( item.collectionAmount)
} else {
item.collectionAmount =
(item.collectionIntegralAmount + item.collectionCashAmount).toFixed(
2
) * 1;
//console.log(7)
}
});
this.form.debtMoney =
@ -1707,6 +1813,7 @@ export default {
var that = this;
setTimeout(() => {
that.$nextTick(() => {
console.log(that.form)
that.$refs.payment.show(that.form, that.payLists);
});
}, 500);
@ -1778,14 +1885,17 @@ export default {
.el-icon-edit-outline {
padding-left: 5px;
}
.imgss {
width: 160px;
height: 60px;
border: 1px solid #333;
}
.esign {
border: #333 1px solid;
}
.el-form-item {
margin-bottom: 5px;
}

@ -1,5 +1,6 @@
<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="del()"></el-button>
<div class="flex">
@ -7,7 +8,8 @@
<el-table-column align="center" :label="staffTitle">
<el-table-column min-width="140" align="center" label="员工">
<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>
</el-select>
@ -15,7 +17,8 @@
</el-table-column>
<el-table-column min-width="100" align="center" label="占比">
<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>
</el-table-column>
</el-table-column>
@ -40,24 +43,54 @@ export default {
form: {}, //
openList: [],
staffText: "",
staffTexts: "",
staffTitle: "",
staffTitles: "",
staffListCopy: [],
lists: [],
len: 0
};
},
methods: {
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() {
this.list.push({});
this.list.push({ label: "", ratio: 0 });
this.changeStaff();
},
endEdit(row, index) {
if (row.ratio || row.ratio * 1 < 101) {
row.ratio = row.ratio * 1;
} else {
console.log(row)
if (row.ratio * 1 > 100) {
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;
}
else {
row.ratio = row.ratio * 1;
}
let number = 0;
this.list.forEach((item, index) => {
if (index != 0) {
@ -65,30 +98,94 @@ export default {
}
});
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();
},
editChange(e, index) {
let number = 0;
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 = {};
this.openList.forEach((item) => {
if (e == item.id) {
form = { ...item };
}
});
if (row.ratio > 0) {
})
form.ratio = row.ratio;
}
this.list.splice(index, 1, form);
console.log(this.openList);
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() {
let index = this.list.length - 1;
this.list[0].ratio += this.list[index].ratio;
this.list.splice(index, 1);
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) {
setTimeout(() => {
this.$nextTick(() => {
@ -131,8 +228,8 @@ export default {
if (this.list.length > 0) {
this.list[0].ratio = (100 - number).toFixed(2) * 1;
}
this.list.push({ label: "", ratio: 0 });
});
console.log(this.list);
}, 300);
},
changeStaff() {
@ -230,6 +327,13 @@ export default {
},
confirms() {
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 = {
text: this.staffText,
list: this.list,
@ -237,6 +341,7 @@ export default {
console.log(flag);
if (flag) {
this.$emit("staffratioData", form);
console.log(form)
this.dialogVisible = false;
} else {
this.$alert("选择员工存在重复", "提示", {

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

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

Loading…
Cancel
Save