master
wangxubin@yeah.net 3 years ago
parent 592d02c7ed
commit 32dc230c07

@ -15,7 +15,7 @@
{{ scope.row.ratio }}
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
</div>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)" :disabled="scope.$index==0"></el-input>
</template>
</el-table-column>
</el-table>

@ -15,7 +15,7 @@
{{ scope.row.ratio }}
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
</div>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)" :disabled="scope.$index==0"></el-input>
</template>
</el-table-column>
</el-table>

@ -15,7 +15,7 @@
{{ scope.row.ratio }}
<i class="el-icon-edit text-cyan" v-if="scope.$index!=0"></i>
</div>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)"></el-input>
<el-input v-focus class="form-input-width-xs" size="samll" type="number" v-else v-model="scope.row.ratio" @blur="endStaffRatio(scope.row, scope.$index)" :disabled="scope.$index==0"></el-input>
</template>
</el-table-column>
</el-table>

@ -237,13 +237,13 @@
<el-table-column align="center" fixed="right" label="明细" width="76">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="detail(scope.row)" plain>明细</el-button>
</el-button>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="作废" width="76">
<template slot-scope="scope">
<el-button @click.stop="abolish(scope.row)" size="mini" :disabled="scope.row.isCancel === 1" type="primary" v-role="5004003"></el-button>
</el-button>
</template>
</el-table-column>
<el-table-column align="center" fixed="right" label="打印" width="76">

@ -213,7 +213,7 @@
<!-- 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-tooltip>
<!-- </el-tooltip> -->
</template>
</el-table-column>
</el-table>
@ -367,6 +367,7 @@ export default {
console.log(text);
let form = { ...row };
form[text] = [];
console.log(form);
this.list.splice(row.index, 1, form);
},
@ -730,8 +731,10 @@ export default {
form.texts = item.label;
}
});
console.log(form);
}
this.list.splice(row.index, 1, form);
console.log(this.list)
},
goPayDebt() {
this.$refs.repayment.show(this.memberForm);
@ -1138,7 +1141,9 @@ export default {
},
openStaffRatio(row, index, text) {
this.editIndex = index;
// row.text.ratio=100;
this.$refs.staffratio.show(row, text);
},
staffratioData(v) {
let form = this.list[this.editIndex];

@ -19,9 +19,13 @@
</template>
</el-table-column>
</el-table-column>
</el-table>
</div>
<span slot="footer" class="dialog-footer">
<!-- -->
<el-button size="mini" type="primary" plain @click="handleClose"> </el-button>
<el-button size="mini" type="primary" @click="confirms()">
</el-button>
@ -31,42 +35,31 @@
<script>
import { selectList, selectListType, QuerCompetent } from "@/api/eashier.js";
import { create } from "domain";
export default {
data() {
return {
dialogVisible: false, //
staffList: [],
ratios:100,
list: [], //
form: {}, //
openList: [],
staffText: "",
staffTitle: "",
staffListCopy: [],
ratioscontent:0,
len:0,
};
},
methods: {
handleClose() {
Object.assign(this.$data, this.$options.data.call(this));
},
add() {
this.list.push({});
this.changeStaff();
},
endEdit(row, index) {
if (row.ratio || row.ratio * 1 < 101) {
row.ratio = row.ratio * 1;
} else {
row.ratio = 0;
}
let number = 0;
this.list.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
});
this.list[0].ratio = 100 - number;
this.changeStaff();
},
editChange(e, index) {
let row = this.list[index];
let form = {};
@ -80,8 +73,29 @@ export default {
}
this.list.splice(index, 1, form);
console.log(this.openList);
// console.log(this.openList);
this.changeStaff();
// this.openList.forEach((item) => {
// if (item.id == e) {
// item.ratio = this.staffLists[index].ratio;
// item.staffNames = item.brandNumber + "--" + item.staffName;
// this.staffLists.splice(index, 1, item);
// }
// });
// this.staffLists.forEach((item, indexs) => {
// if (index != indexs && v == item.id) {
// this.staffLists.splice(index, 1, { ratio: 0 });
// this.setRatio();
// this.$message.warning({ message: "" });
// }
// });
// let length = this.staffLists.length - 1;
// if (this.staffLists[length].id) {
// this.staffLists.push({ ratio: 0 });
// }
// this.confirms();
// this.changeStaff();
},
del() {
let index = this.list.length - 1;
@ -94,6 +108,7 @@ export default {
this.$nextTick(() => {
this.list = JSON.parse(JSON.stringify([]));
this.form = { ...form };
console.log(this.form)
this.staffText = text;
if (text == "zhonggongList") {
this.staffTitle = "美发师";
@ -121,18 +136,41 @@ export default {
});
this.dialogVisible = true;
this.getData();
this.changeStaff();
let number = 0;
this.list.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
});
if (this.list.length > 0) {
this.list[0].ratio = (100 - number).toFixed(2) * 1;
this.list.push({});
console.log(this.list)
if(this.list.length==1){
this.list[0].ratio=100;
}
// else{
// this.list[0].ratio=this.ratioscontents;
// }
// this.len=this.list.length;
// else{
// this.list[0].ratio=this.ratioscontent
// }
// console.log(this.list)
// this.endEdit();
// console.log(form)
// this.endEdits();
this.changeStaff();
// console.log(this.list)
// this.list.push({});
// let number = 0;
// this.list.forEach((item, index) => {
// if (index != 0) {
// number += item.ratio * 1;
// }
// });
// if (this.list.length > 0) {
// this.list[0].ratio = (100 - number).toFixed(2) * 1;
// }
});
console.log(this.list);
// console.log(this.list);
}, 300);
},
changeStaff() {
@ -228,13 +266,39 @@ export default {
}
return true;
},
endEdit(row, index) {
if (row.ratio < 101 || row.ratio * 1 < 101) {
row.ratio = row.ratio * 1;
} else {
row.ratio = 0;
}
// console.log(row.ratio)
let number = 0;
this.list.forEach((item, index) => {
if (index != 0) {
number += item.ratio * 1;
}
});
this.list[0].ratio = 100 - number;
this.ratioscontent=this.list[0].ratio
this.changeStaff();
},
confirms() {
this.list.forEach((item, index) => {
var objectlength=Object.keys(item)
if (objectlength.length<= 1) {
this.list.splice(index, 1);
}
});
let flag = this.isRepeat(this.list, "brandNumber");
let form = {
text: this.staffText,
list: this.list,
};
console.log(flag);
this.ratioscontents=this.list[0].ratio
// console.log(flag);
if (flag) {
this.$emit("staffratioData", form);
this.dialogVisible = false;
@ -248,8 +312,20 @@ export default {
});
}
},
handleClose() {
//
this.list.forEach((item, index) => {
var objectlength=Object.keys(item)
if (objectlength.length<= 1) {
this.list.splice(index, 1);
}
});
// this.list.splice(this.len+1),
this.dialogVisible = false;
},
},
};
</script>
<style>

@ -6,24 +6,63 @@
</div>
<br>
<div class="div_content">
<div style="width: 48%; margin-left: 2%;">
<el-table :data="tableDate" show-summary :summary-method="getSummaries"
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }"
style="margin-bottom: 10%;">
<!-- 充值表格 -->
<div>
<el-table :data="tableDate"
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }" style="margin-bottom: 10%;width: 90%;
margin-left: 5%;">
<el-table-column align="center" label="充值">
<el-table-column align="center" prop="type" label="类别">
<el-table-column align="center" prop="openning" label="期初"></el-table-column>
<el-table-column align="center" label="收入">
<el-table-column align="center" prop="rechargeMoney" label="充值开卡" min-width="50"></el-table-column>
<el-table-column align="center" prop="rechargeRepay" label="充值还款" min-width="50"></el-table-column>
<el-table-column align="center" prop="courseTurnRecharge" label="疗程转充值" min-width="50"></el-table-column>
<el-table-column align="center" prop="cashRefund" label="消费退" min-width="50"></el-table-column>
<el-table-column align="center" prop="groupPurchase" label="团购卡" min-width="50"></el-table-column>
<el-table-column align="center" prop="init" label="初始化" min-width="50"></el-table-column>
</el-table-column>
<el-table-column align="center" label="支出">
<el-table-column align="center" prop="courseMoney" label="疗程开卡" min-width="50"></el-table-column>
<el-table-column align="center" prop="rechargeRepayMoney" label="充值还款" min-width="50"></el-table-column>
<el-table-column align="center" prop="cashMoney" label="收银" min-width="50"></el-table-column>
<el-table-column align="center" prop="coursePromotion" label="疗程促销" min-width="50"></el-table-column>
<el-table-column align="center" prop="rechargeRefundMoney" label="充值退" min-width="50"></el-table-column>
</el-table-column>
<el-table-column align="center" prop="beginning" label="期初" min-width="50"></el-table-column>
<el-table-column align="center" prop="earnings" label="收入" min-width="50"></el-table-column>
<el-table-column align="center" prop="expenditure" label="支出" min-width="50"></el-table-column>
<el-table-column align="center" prop="balance" label="结存" min-width="50"></el-table-column>
</el-table-column>
</el-table>
</div>
<div style="width: 48%; margin-left: 2%;">
<!-- 疗程表格 -->
<div>
<el-table :data="tableDate1"
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }" style="margin-bottom: 10%; width: 90%;
margin-left: 5%;">
<el-table-column align="center" label="疗程">
<el-table-column align="center" prop="openning" label="期初"></el-table-column>
<el-table-column align="center" label="收入">
<el-table-column align="center" prop="courseMoney" label="疗程开卡" min-width="50"></el-table-column>
<el-table-column align="center" prop="courseRepay" label="还款" min-width="50"></el-table-column>
<el-table-column align="center" prop="cashRefund" label="消费退" min-width="50"></el-table-column>
<el-table-column align="center" prop="coursePromotion" label="疗程促销" min-width="50"></el-table-column>
<el-table-column align="center" prop="init" label="初始化" min-width="50"></el-table-column>
<el-table-column align="center" prop="courseTurnStore" label="疗程转门店" min-width="50"></el-table-column>
<el-table-column align="center" prop="cardChange" label="加价转疗程" min-width="50"></el-table-column>
</el-table-column>
<el-table-column align="center" label="支出">
<el-table-column align="center" prop="courseRepayMoney" label="还款" min-width="50"></el-table-column>
<el-table-column align="center" prop="cashMoney" label="收银" min-width="50"></el-table-column>
<el-table-column align="center" prop="courseRefundMoney" label="疗程退" min-width="50"></el-table-column>
<el-table-column align="center" prop="courseTurnCharge" label="疗程转充值" min-width="50"></el-table-column>
<el-table-column align="center" prop="courseTurnStoreMoney" label="疗程转门店" min-width="50">
</el-table-column>
</el-table-column>
<el-table-column align="center" prop="balance" label="结存" min-width="50"></el-table-column>
</el-table-column>
</el-table>
</div>
<!-- <div style="width: 48%; margin-left: 2%;">
<el-table :data="tableDate1" show-summary :summary-method="getSummaries"
<el-table :data="tableDate1" show-summary
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }"
style="margin-bottom: 10%;">
<el-table-column align="center" label="疗程">
@ -34,7 +73,7 @@
<el-table-column align="center" prop="balance" label="结存" min-width="50"></el-table-column>
</el-table-column>
</el-table>
</div>
</div> -->
</div>
</div>
@ -55,7 +94,9 @@ export default {
dayStatisticRecharge() {
dayStatisticRecharge({ date: partten.dayStatisticDate }).then((res) => {
if (res.code == "000000") {
this.tableDate = res.rows;
var arr=[];
arr.push(res.data)
this.tableDate = arr;
} else {
this.$alert(res.message, "提示", {
confirmButtonText: "确定",
@ -70,7 +111,9 @@ export default {
dayStatisticTreatment() {
dayStatisticTreatment({ date: partten.dayStatisticDate }).then((res) => {
if (res.code == "000000") {
this.tableDate1 = res.rows;
var arr=[];
arr.push(res.data)
this.tableDate1 = arr;
} else {
this.$alert(res.message, "提示", {
confirmButtonText: "确定",
@ -107,35 +150,35 @@ export default {
this.dayStatisticRecharge();
},
//
getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '';
return;
}
// getSummaries(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 (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
// const values = data.map(item => Number(item[column.property]));
// if (!values.every(value => isNaN(value))) {
// sums[index] = values.reduce((prev, curr) => {
// const value = Number(curr);
// if (!isNaN(value)) {
// return prev + curr;
// } else {
// return prev;
// }
}, 0);
sums[index] += ' 元';
} else {
sums[index] = 'N/A';
}
});
// }, 0);
// sums[index] += ' ';
// } else {
// sums[index] = 'N/A';
// }
// });
return sums;
}
// return sums;
// }
};
@ -143,7 +186,7 @@ export default {
<style>
.div_content {
display: flex;
/* display: flex; */
width: 100%;
}
</style>

Loading…
Cancel
Save