You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
842 lines
29 KiB
Vue
842 lines
29 KiB
Vue
<template>
|
|
<!-- 转入 0 转出 1 -->
|
|
<div>
|
|
<el-form inline>
|
|
<el-form-item label="手机号码:" :label-width="labelWidth">
|
|
<div class="form-width-ms">
|
|
<el-input oninput="this.value=this.value.replace(/\D/g,'')" pattern="[0-9]*" maxlength="11"
|
|
v-model="proForm.mobilePhone" @blur="memberOne" @change="memberOne">
|
|
<el-button size="mini" slot="append" icon="el-icon-search" @click="openMember"></el-button>
|
|
</el-input>
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item label="会员名字:" :label-width="labelWidth">
|
|
<div class="form-width-ms">
|
|
{{ proForm.memberName }}
|
|
</div>
|
|
</el-form-item>
|
|
<el-form-item label="待付金额:" :label-width="labelWidth">
|
|
<div class="form-width-ms">
|
|
{{ debtMoney < 0 ? '超出 ' + (debtMoney * -1) : debtMoney }} </div>
|
|
</el-form-item>
|
|
<el-form-item label="业务时间:" :label-width="labelWidth" v-show="isAddition == 1">
|
|
<div class="form-width-ms">
|
|
<span style="cursor: pointer;" @click="(recDateShow = true)" v-show="!recDateShow">{{ proForm.additionDate }}
|
|
<i class="el-icon-edit"></i> </span>
|
|
<el-date-picker size="medium" @blur='(recDateShow = false)' v-show="recDateShow" ref="recDate"
|
|
v-model="proForm.additionDate" :picker-options="pickerOptions" format="yyyy-MM-dd" value-format="yyyy-MM-dd"
|
|
placeholder="选择日期">
|
|
</el-date-picker>
|
|
</div>
|
|
</el-form-item>
|
|
<div class="flex justify-center align-start flex-wrap padding-top">
|
|
<div class="into-table-width margin-right-xs padding-left-lg">
|
|
<div class="raisetable bg-white margin-bottom-xs">
|
|
<div class="raisetable-sum">
|
|
<div>转出疗程 <el-button v-if="proForm.memberName" :disabled="!proForm.memberId" size="mini" type="primary"
|
|
@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' }"
|
|
style="margin-top: 5px;">
|
|
<el-table-column label="项目编码" align="center" prop="courseProjectNum" min-width="80"></el-table-column>
|
|
<el-table-column label="账户名称" align="center" prop="courseProjectName" min-width="140"></el-table-column>
|
|
<el-table-column label="可用次数" align="center" prop="courseConsumeCount" min-width="80"></el-table-column>
|
|
<el-table-column label="可用金额" align="center" prop="courseConsumePrice" min-width="80"></el-table-column>
|
|
<!-- <el-table-column label="疗程单价" align="center" prop="unitMoney" min-width="80"></el-table-column> -->
|
|
<el-table-column label="疗程单价" align="center" prop="price" min-width="80"></el-table-column>
|
|
<el-table-column label="转出次数" align="center" prop="changeOutTime" min-width="100">
|
|
<template slot-scope='scope'>
|
|
<div class="form-input-width" v-if="!scope.row.changeOutTimeShow"
|
|
@click="openEditOut(scope.row, scope.$index, scope.row.changeOutTimeShow = true)">
|
|
{{ scope.row.changeOutTime }}
|
|
<i class="el-icon-edit text-cyan"></i>
|
|
</div>
|
|
<el-input v-else v-focus class="form-input-width-xs" type='number' v-model="scope.row.changeOutTime"
|
|
@blur="endChangeOutTime(scope.row, scope.$index, scope.row.changeOutTime, scope.row.price)">
|
|
</el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="转出金额" align="center" prop="changeOutMoney" min-width="100">
|
|
<template slot-scope='scope'>
|
|
<div class="form-input-width" v-if="outMoneyIndex != scope.$index"
|
|
@click="openOutMoney(scope.row, scope.$index)">
|
|
{{ scope.row.changeOutMoney }}
|
|
<i class="el-icon-edit text-cyan"></i>
|
|
</div>
|
|
<el-input v-else v-focus class="form-input-width-xs" type='number' v-model="scope.row.changeOutMoney"
|
|
@blur="endOutMoney(scope.row)"></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column align="center" fixed="right" min-width="80">
|
|
<template slot-scope='scope'>
|
|
<div @click="delOldPro(scope.$index)" class="el-icon-delete"></div>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
<div class="raisetable bg-white ">
|
|
<div class="raisetable-sum">
|
|
<div>转入疗程 <el-button v-if="proForm.memberName" size="mini" type="primary" @click='openPro(0)'>添加
|
|
</el-button>
|
|
<el-button v-if="proForm.memberName" size="mini" type="warning" @click='backout'>撤销</el-button>
|
|
</div>
|
|
<div style="width: 150px;">总金额 : {{ inMoneys }}</div>
|
|
</div>
|
|
<el-table :data="inList" max-height="150" empty-text='暂无数据 , 点击添加疗程'
|
|
:header-cell-style="{ background: 'linear-gradient(#6cb3ff, #1873d4)', color: '#eeeeee' }"
|
|
style="margin-top: 5px;">
|
|
<el-table-column label="项目编码" show-overflow-tooltip align="center" prop="projectNum" min-width="90">
|
|
</el-table-column>
|
|
<el-table-column label="账户名称" show-overflow-tooltip align="center" prop="projectName" min-width="110">
|
|
</el-table-column>
|
|
<el-table-column label="标准单价" align="center" prop="priceMember" min-width="70"></el-table-column>
|
|
<el-table-column label="最低单价" align="center" prop="minumumPriceMember" min-width="70"></el-table-column>
|
|
<el-table-column label="单价" align="center" prop="prices" min-width="90">
|
|
<template slot-scope='scope'>
|
|
<div class="form-input-width" v-if="inNumberIndexs != scope.$index"
|
|
@click="openEdit(scope.row, scope.$index, inNumberIndexs = scope.$index)">
|
|
{{ scope.row.prices }}
|
|
<i class="el-icon-edit text-cyan"></i>
|
|
</div>
|
|
<el-input v-focus class="form-input-width-xs" type="number" v-else v-model="scope.row.prices"
|
|
@blur="endEditprices(scope.row)"></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="转入次数" align="center" prop="changeInTime" min-width="90">
|
|
<template slot-scope='scope'>
|
|
<div class="form-input-width" v-if="inNumberIndex != scope.$index"
|
|
@click="openEdit(scope.row, scope.$index, inNumberIndex = scope.$index)">
|
|
{{ scope.row.changeInTime }}
|
|
<i class="el-icon-edit text-cyan"></i>
|
|
</div>
|
|
<el-input v-focus class="form-input-width-xs" type="number" v-else v-model="scope.row.changeInTime"
|
|
@blur="endEditTimes(scope.row)"></el-input>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column label="转入金额" align="center" min-width="90">
|
|
<template >
|
|
<div>{{outMoneys}}</div>
|
|
</template>
|
|
</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>
|
|
</div>
|
|
|
|
</div>
|
|
<div style="width:280px;" class="border-radius-10 border bg-white padding-xs">
|
|
<el-table :data="proForm.payLists" max-height="350">
|
|
<el-table-column align="center" prop="payName" label="支付方式" min-width="100"></el-table-column>
|
|
<el-table-column align="center" prop="payMoney" fixed="right" label="本次支付" min-width="80">
|
|
<template slot-scope="scope">
|
|
<div class="form-input-width" v-if="!scope.row.isShow" @click="editPay(scope.row, scope.$index)">
|
|
{{ 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>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="into-table-width flex justify-center align-start flex-wrap padding-top padding-left-lg">
|
|
<staffsles ref="staffsles" @staffslesData="staffslesData"></staffsles>
|
|
<admin ref="admin" @adminData="adminData"></admin>
|
|
<manager ref="manager" @managerData="managerData"></manager>
|
|
</div>
|
|
<div class="into-table-width padding-top text-center padding-left-lg">
|
|
<el-button size="mini" type="info" @click='empty()' plain>清空</el-button>
|
|
<el-button size="mini" v-if="isAddition == 0" type="primary" @click="isAddition = 1">补单</el-button>
|
|
<el-button size="mini" v-else type="success" @click="isAddition = 0">加价</el-button>
|
|
<el-button size="mini" type="primary" @click='raiseProList()' plain>列表</el-button>
|
|
<el-button size="mini" type="primary" @click='submit(true, loading = true)' :loading="loading"
|
|
:disabled="outList.length == 0 && inList.length == 0">提交</el-button>
|
|
</div>
|
|
</el-form>
|
|
<member ref="member" @memberData="memberData"></member>
|
|
<project ref="project" @projectData="projectData"></project>
|
|
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { propage } from "@/api/storeManage.js";
|
|
import {
|
|
ctlist,
|
|
selectList,
|
|
storeMemberOne,
|
|
couAccountList,
|
|
addCardChange,
|
|
} from "@/api/eashier.js";
|
|
import member from "@/components/member/index";
|
|
import project from "@/components/project/index";
|
|
import admin from "@/components/staffList/admin/index";
|
|
import manager from "@/components/staffList/manager/index";
|
|
import staffsles from "@/components/staffList/staff/index";
|
|
export default {
|
|
components: {
|
|
staffsles,
|
|
manager,
|
|
admin,
|
|
member,
|
|
project,
|
|
},
|
|
data() {
|
|
return {
|
|
pickerOptions: {
|
|
disabledDate(time) {
|
|
return time.getTime() > Date.now();
|
|
},
|
|
},
|
|
nums,
|
|
projectDialogVisible: false,
|
|
recDateShow: false,
|
|
activeName: "现付",
|
|
outMoneyIndex: -1,
|
|
inNumberIndex: -1,
|
|
inNumberIndexs: -1,
|
|
proForm: {
|
|
additionDate: null,
|
|
manageStaffName: null,
|
|
mobilePhone: null,
|
|
staffLists: [{ ratio: 100 }], //员工占比初始化
|
|
managerLists: [{ ratio: 100 }], //员工占比初始化
|
|
adminList: [{ ratio: 100 }], //员工占比初始化
|
|
payLists: [], //现付列表
|
|
},
|
|
outList: [],
|
|
inList: [],
|
|
staffList: [],
|
|
labelWidth: "100px",
|
|
proPageInfo: {
|
|
total: 0, //分页总条数
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
list: [], //主数组
|
|
},
|
|
proRadio: null,
|
|
proRadioForm: null,
|
|
projectName: null,
|
|
openProText: 0,
|
|
couAccountList: [],
|
|
inMoneys: 0,
|
|
outMoneys: 0,
|
|
sessionStorageData: null,
|
|
debtMoney: 0,
|
|
isAddition: 0,
|
|
loading: false,
|
|
TransactionNum: 0
|
|
};
|
|
},
|
|
methods: {
|
|
setStaffRatio() {
|
|
var that = this;
|
|
setTimeout(() => {
|
|
that.$refs.staffsles.show(that.proForm.staffLists);
|
|
that.$refs.manager.show(that.proForm.managerLists);
|
|
that.$refs.admin.show(that.proForm.adminList);
|
|
}, 800);
|
|
},
|
|
//员工占比返回方法
|
|
staffslesData(v) {
|
|
this.proForm.staffLists = [...v];
|
|
},
|
|
//高管占比返回方法
|
|
managerData(v) {
|
|
this.proForm.managerLists = [...v];
|
|
},
|
|
//管理员占比返回方法
|
|
adminData(v) {
|
|
this.proForm.adminList = [...v];
|
|
},
|
|
|
|
//打开选择会员弹窗
|
|
openMember() {
|
|
this.$refs.member.show();
|
|
},
|
|
//选中会员返回方法
|
|
memberData(v) {
|
|
this.proForm.mobilePhone = v.mobilePhone;
|
|
this.memberOne();
|
|
},
|
|
//提交信息
|
|
submit() {
|
|
let payMoneys = 0;
|
|
let payLists = [];
|
|
this.proForm.payLists.forEach((item) => {
|
|
payMoneys += item.payMoney * 1;
|
|
if (item.payMoney > 0) {
|
|
let items = {
|
|
payId: item.payId,
|
|
payMoney: item.payMoney,
|
|
payName: item.payName,
|
|
};
|
|
payLists.push(items);
|
|
}
|
|
});
|
|
|
|
let salesmens = [];
|
|
this.proForm.managerLists.forEach((item) => {
|
|
if (item.id) {
|
|
item.staffType = 0;
|
|
|
|
salesmens.push(item);
|
|
}
|
|
});
|
|
this.proForm.adminList.forEach((item) => {
|
|
if (item.id) {
|
|
item.staffType = 1;
|
|
|
|
salesmens.push(item);
|
|
}
|
|
});
|
|
|
|
this.proForm.changeInPayMoney = payMoneys;
|
|
this.proForm.changeInMoney = this.inMoneys.toFixed(2) * 1;
|
|
this.proForm.changeOutMoney = this.outMoneys.toFixed(2) * 1;
|
|
// if (this.debtMoney < 0) {
|
|
// this.proForm.differenceMoney = this.debtMoney * -1;
|
|
// this.proForm.debtMoney = 0;
|
|
// } else {
|
|
// this.proForm.debtMoney = this.debtMoney;
|
|
// }
|
|
this.proForm.isAddition = this.isAddition;
|
|
this.proForm.payLists = payLists;
|
|
this.proForm.cardChangeOutProjectRequests = this.outList;
|
|
this.proForm.cardChangeInProjectRequest = this.inList[0];
|
|
this.proForm.cardChangeInProjectRequest.salesmens = salesmens;
|
|
this.proForm.cardChangeInProjectRequest.staffLists =
|
|
this.proForm.staffLists;
|
|
if (this.proForm.cardChangeInProjectRequest.debtMoney != 0) {
|
|
this.proForm.debtMoney =
|
|
this.proForm.cardChangeInProjectRequest.debtMoney;
|
|
this.proForm.debtMoney =
|
|
this.proForm.cardChangeInProjectRequest.debtMoney;
|
|
this.proForm.cardChangeInProjectRequest.isDebt = 1;
|
|
this.proForm.isDebt = 1;
|
|
} else {
|
|
this.proForm.debtMoney = 0;
|
|
this.proForm.isDebt = 0;
|
|
|
|
this.proForm.cardChangeInProjectRequest.isDebt = 0;
|
|
}
|
|
let falg = true;
|
|
if (this.isAddition == 1) {
|
|
if (this.proForm.additionDate) {
|
|
} else {
|
|
falg = false;
|
|
this.$alert("请选择补单业务时间", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
this.loading = false;
|
|
}
|
|
} else {
|
|
if (this.debtMoney * 1 != 0) {
|
|
this.$alert("转入金额和转出加支付金额不相等", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
this.loading = false;
|
|
falg = false;
|
|
}
|
|
}
|
|
if (falg) {
|
|
this.addCardChange();
|
|
}
|
|
},
|
|
addCardChange() {
|
|
var that = this;
|
|
addCardChange(this.proForm).then((res) => {
|
|
this.loading = false;
|
|
if (res.code == "000000") {
|
|
this.$message.success({
|
|
message: res.message,
|
|
});
|
|
this.empty();
|
|
} else {
|
|
this.$alert(res.message, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => {
|
|
that.ctlist();
|
|
},
|
|
});
|
|
}
|
|
});
|
|
},
|
|
//返回当前行的下标
|
|
tableRowClassName({ row, rowIndex }) {
|
|
row.index = rowIndex;
|
|
},
|
|
projectData(form) {
|
|
console.log(form)
|
|
form.memberId = this.proForm.memberId;
|
|
form.memberName = this.proForm.memberName;
|
|
form.mobilePhone = this.proForm.mobilePhone;
|
|
form.storeId = this.proForm.storeId;
|
|
form.storeName = this.proForm.storeName;
|
|
form.memberIdentityCard = this.proForm.identityCard;
|
|
|
|
if (this.openProText == 0) {
|
|
(form.priceMember * form.minumumTimes).toFixed(2) * 1;
|
|
form.prices = form.priceMember
|
|
form.changeInTime = form.minumumTimes;
|
|
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);
|
|
} else {
|
|
this.$alert("只能选择一个项目进行转入", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
}
|
|
}
|
|
if (this.openProText == 1) {
|
|
form.unitMoney =
|
|
(form.courseProjectMoney / form.courseCount).toFixed(2) * 1;
|
|
// form.changeOutMoney =
|
|
// (form.courseConsumeCount * form.unitMoney).toFixed(2) * 1;
|
|
form.changeOutMoney = 0;
|
|
form.changeOutTime = 1;
|
|
form.changeOutTimeShow = false;
|
|
form.accountId = form.id;
|
|
this.outList.push(form);
|
|
}
|
|
this.sumMoney();
|
|
},
|
|
//查询会员信息
|
|
memberOne() {
|
|
let row = { ...this.proForm };
|
|
var mobilePhone = this.proForm.mobilePhone;
|
|
this.empty();
|
|
if (mobilePhone) {
|
|
let form = {
|
|
mobilePhone: mobilePhone,
|
|
storeId: sessionStorage.getItem("parentId"),
|
|
};
|
|
storeMemberOne(form).then((res) => {
|
|
this.proForm.mobilePhone = mobilePhone;
|
|
if (res.code == "000000") {
|
|
row.memberId = res.data.id;
|
|
row.id = res.data.id;
|
|
row.memberName = res.data.memberName;
|
|
row.mobilePhone = res.data.mobilePhone;
|
|
row.storeId = res.data.storeId;
|
|
row.storeName = res.data.storeName;
|
|
row.memberIdentityCard = res.data.identityCard;
|
|
this.proForm = {};
|
|
this.proForm = row;
|
|
console.log(this.proForm);
|
|
} else {
|
|
this.$alert(res.message, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
}
|
|
});
|
|
} else {
|
|
this.$message.warning({ message: "请输入正确手机号" });
|
|
}
|
|
},
|
|
|
|
//选择金额.
|
|
editPay(row, index) {
|
|
// if (this.debtMoney < 0) {
|
|
// this.$message.error({
|
|
// message: "支付金额已超出 , 无需进行现付 !",
|
|
// });
|
|
// } else {
|
|
|
|
console.log(row)
|
|
var form = {
|
|
...row,
|
|
};
|
|
console.log()
|
|
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;
|
|
this.sumMoney()
|
|
// }
|
|
},
|
|
endEdit(row) {
|
|
console.log(row);
|
|
console.log(this.inList);
|
|
if (row.payMoney) {
|
|
row.payMoney = row.payMoney * 1;
|
|
} else {
|
|
row.payMoney = 0;
|
|
}
|
|
row.isShow = false;
|
|
},
|
|
openPro(num) {
|
|
this.openProText = num;
|
|
if (num == 0) {
|
|
this.$refs.project.show(0);
|
|
|
|
this.TransactionNum = this.inList.transactionMoney;
|
|
|
|
}
|
|
if (num == 1) {
|
|
this.$refs.project.show(this.proForm);
|
|
console.log(this.inList)
|
|
}
|
|
},
|
|
delOldPro(index) {
|
|
this.outList.splice(index, 1);
|
|
this.sumMoney();
|
|
},
|
|
backout() {
|
|
this.inList.splice(0, 1);
|
|
this.sumMoney();
|
|
},
|
|
openEdit(row, index) {
|
|
let form = {
|
|
...row,
|
|
};
|
|
if (row.debtMoneyShow) {
|
|
form.debtMoney = (this.inMoneys - this.outMoneys).toFixed(2);
|
|
if (form.debtMoney < 0) {
|
|
form.debtMoney = 0;
|
|
}
|
|
}
|
|
this.inList.splice(index, 1, form);
|
|
},
|
|
openEditOut(row, index) {
|
|
let form = {
|
|
...row,
|
|
};
|
|
this.outList.splice(index, 1, form);
|
|
},
|
|
endEditPrice(row, index) {
|
|
let minMoney = row.minumumPriceMember * row.changeInTime;
|
|
let topMoney = row.topPriceMember * row.changeInTime;
|
|
let changeInMoney = (row.priceMember * row.changeInTime).toFixed(2) * 1;
|
|
if (
|
|
minMoney > row.changeInMoney * 1 ||
|
|
topMoney < row.changeInMoney * 1
|
|
) {
|
|
this.$message.warning({
|
|
message:
|
|
"转入金额不能低于项目最低价: " +
|
|
minMoney +
|
|
"高于最高价: " +
|
|
topMoney,
|
|
});
|
|
row.changeInMoney = changeInMoney;
|
|
row.transactionMoney = row.changeInMoney;
|
|
}
|
|
row.transactionMoney = row.changeInMoney;
|
|
row.changeInMoneyShow = false;
|
|
this.sumMoney();
|
|
},
|
|
endDebtMoney(row, index) {
|
|
row.debtMoneyShow = false;
|
|
this.sumMoney();
|
|
},
|
|
endChangeOutTime(row, index, time, price) {
|
|
row.changeOutTimeShow = false;
|
|
if (this.outList[index].courseConsumeCount < time) {
|
|
this.$alert("次数不可以大于可用次数", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
this.outList[index].changeOutTime = this.outList[index].courseConsumeCount
|
|
this.outList[index].changeOutMoney = this.outList[index].changeOutTime * price
|
|
} else if (time < 1) {
|
|
this.$alert("次数不可以小于1", "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
this.outList[index].changeOutTime = 1
|
|
this.outList[index].changeOutMoney = this.outList[index].changeOutTime * price
|
|
} else {
|
|
this.outList[index].changeOutMoney = time * price
|
|
}
|
|
let num = 0;
|
|
this.outList.forEach((item) => {
|
|
num = num + item.changeOutMoney
|
|
});
|
|
this.outMoneys = num;
|
|
if(this.outList.length!=0){
|
|
this.inList[0].changeInMoney=num
|
|
}
|
|
|
|
},
|
|
openOutMoney(row, index) {
|
|
let form = { ...row };
|
|
this.outMoneyIndex = index;
|
|
this.outList.splice(index, 1, form);
|
|
},
|
|
endOutMoney(row) {
|
|
console.log(row);
|
|
let money = row.changeOutTime * row.price;
|
|
if (row.changeOutMoney) {
|
|
row.changeOutMoney = row.changeOutMoney * 1;
|
|
} else {
|
|
row.changeOutMoney = 0;
|
|
}
|
|
// if (row.changeOutMoney > money) {
|
|
// this.$alert("转出金额不能大于" + money, "提示", {
|
|
// confirmButtonText: "确定",
|
|
// confirmButtonClass: "confirmbtnFalses",
|
|
// type: "warning",
|
|
// center: true,
|
|
// callback: (action) => {},
|
|
// });
|
|
// } else {
|
|
// }
|
|
this.outMoneyIndex = -1;
|
|
this.sumMoney();
|
|
},
|
|
endEditTimes(row, index) {
|
|
// if (row.changeInTime < row.minumumTimes) {
|
|
// this.$message.info({
|
|
// message: "最低不能少于" + row.minumumTimes + "次",
|
|
// });
|
|
// row.changeInTime = row.minumumTimes;
|
|
// }
|
|
row.changeInMoney = (row.prices * row.changeInTime).toFixed(2) * 1;
|
|
row.transactionMoney = row.changeInMoney;
|
|
this.inNumberIndex = -1;
|
|
this.sumMoney();
|
|
},
|
|
endEditprices(row, index) {
|
|
// if (row.changeInTime < row.minumumTimes) {
|
|
// this.$message.info({
|
|
// message: "最低不能少于" + row.minumumTimes + "次",
|
|
// });
|
|
// row.changeInTime = row.minumumTimes;
|
|
// }
|
|
row.changeInMoney = (row.prices * row.changeInTime).toFixed(2) * 1;
|
|
row.transactionMoney = row.changeInMoney;
|
|
this.inNumberIndexs = -1;
|
|
this.sumMoney();
|
|
},
|
|
projectRadio(row) {
|
|
if (row) {
|
|
this.proRadio = row.id;
|
|
this.proRadioForm = row;
|
|
}
|
|
},
|
|
sumMoney() {
|
|
let inMoneys = 0;
|
|
let outMoneys = 0;
|
|
let payMoneys = 0;
|
|
let debtMoney = 0;
|
|
this.inList.forEach((item) => {
|
|
inMoneys += item.transactionMoney * 1;
|
|
debtMoney = item.debtMoney * 1;
|
|
});
|
|
this.outList.forEach((item) => {
|
|
outMoneys += item.changeOutMoney * 1;
|
|
});
|
|
this.proForm.payLists.forEach((item) => {
|
|
payMoneys += item.payMoney * 1;
|
|
});
|
|
this.outMoneys = outMoneys.toFixed(2) * 1;
|
|
this.inMoneys = inMoneys.toFixed(2) * 1;
|
|
if (inMoneys != 0) {
|
|
this.debtMoney =
|
|
(inMoneys - outMoneys - payMoneys - debtMoney).toFixed(2) * 1;
|
|
} else {
|
|
this.debtMoney = inMoneys;
|
|
}
|
|
},
|
|
empty() {
|
|
this.proForm = JSON.parse(JSON.stringify({}));
|
|
this.outList = [];
|
|
this.inList = [];
|
|
this.$forceUpdate();
|
|
|
|
Object.assign(this.$data, this.$options.data.call(this));
|
|
this.setPage();
|
|
},
|
|
|
|
raiseProList() {
|
|
this.$emit("proData");
|
|
},
|
|
|
|
//------------------------------------------------------分页方法
|
|
handleSizeChange(val) {
|
|
this.proPageInfo.pageSize = val;
|
|
},
|
|
handleCurrentChange(val) {
|
|
this.proPageInfo.pageNum = val;
|
|
},
|
|
//------------------------------------------------------ 门店项目 搜索 page
|
|
//搜索方法
|
|
search() {
|
|
var page = {
|
|
pageSize: this.proPageInfo.pageSize,
|
|
pageNum: this.proPageInfo.pageNum,
|
|
projectName: this.input,
|
|
state: 1,
|
|
directConsumption: 0,
|
|
storeIds: JSON.parse(sessionStorage.getItem("storeIdLists")),
|
|
isCooperation: 0,
|
|
};
|
|
propage(page).then((res) => {
|
|
if (res.code == "000000") {
|
|
this.proPageInfo = res.pageInfo;
|
|
} else {
|
|
this.$alert(res.message, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
}
|
|
});
|
|
},
|
|
propage() {
|
|
var page = {
|
|
pageNum: this.proPageInfo.pageNum,
|
|
pageSize: this.proPageInfo.pageSize,
|
|
state: 1,
|
|
directConsumption: 0,
|
|
storeIds: JSON.parse(sessionStorage.getItem("storeIdLists")),
|
|
};
|
|
propage(page).then((res) => {
|
|
if (res.code == "000000") {
|
|
this.proPageInfo = res.pageInfo;
|
|
} else {
|
|
this.$alert(res.message, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
}
|
|
});
|
|
},
|
|
ctlist() {
|
|
ctlist({
|
|
id: null,
|
|
}).then((res) => {
|
|
if (res.code == "000000") {
|
|
var payLists = [];
|
|
res.rows.forEach((item) => {
|
|
item.payMoney = 0;
|
|
item.isShow = false;
|
|
item.payName = item.collectionTypeName;
|
|
item.payId = item.id;
|
|
payLists.push(item);
|
|
});
|
|
this.proForm.payLists = payLists;
|
|
} else {
|
|
this.$alert("加载现付列表: " + res.message, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
}
|
|
});
|
|
},
|
|
selectList() {
|
|
selectList({
|
|
id: null,
|
|
}).then((res) => {
|
|
if (res.code == "000000") {
|
|
this.staffList = res.rows;
|
|
} else {
|
|
this.$alert("加载员工列表: " + res.message, "提示", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonClass: "confirmbtnFalses",
|
|
type: "warning",
|
|
center: true,
|
|
callback: (action) => { },
|
|
});
|
|
}
|
|
});
|
|
},
|
|
setPage() {
|
|
this.selectList();
|
|
this.ctlist();
|
|
this.setStaffRatio();
|
|
this.sessionStorageData = JSON.parse(
|
|
sessionStorage.getItem("sessionStorageData")
|
|
);
|
|
this.proForm.additionDate = this.formatTime(new Date(), "YYYY-MM-DD");
|
|
},
|
|
},
|
|
created() {
|
|
this.setPage();
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style>
|
|
.raisetable {
|
|
border: 1px solid #ccc;
|
|
border-radius: 15px;
|
|
padding: 10px;
|
|
min-width: 500px;
|
|
}
|
|
|
|
.inputdiv {
|
|
cursor: pointer;
|
|
line-height: 35px;
|
|
}
|
|
|
|
.inputinput {
|
|
line-height: 35px;
|
|
margin: 0 auto;
|
|
width: 60%;
|
|
text-align: center;
|
|
}
|
|
|
|
.raisetable-sum {
|
|
width: 100%;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
}
|
|
</style>
|