-
+
-
- 收费设置 /
- 会员卡管理
-
+
+ 收费设置 /
+ 会员卡管理
+
-
-
-
-
-
-
-
- --
-
-
-
- 卡类别:
-
-
-
-
-
- 卡状态:
-
-
-
-
-
-
-
- 卡号:
-
-
-
- 卡主姓名:
-
-
-
- 身份证号:
-
-
-
- 电话:
-
-
-
- 查询
-
+
+
+
+
+
+
+ 卡号:
+
+
+
+ 卡主姓名:
+
+
+
+ 身份证号:
+
+
+
+ 电话:
+
+
+
+ 查询
+
-
-
+
+
- {{ dddw(dict.cardType, "id", scope.row.cardTypeId, "displayName") }}
+
+ {{
+ dddw(
+ dict.cardType,
+ "id",
+ scope.row.cardTypeId,
+ "displayName"
+ )
+ }}
+
-
+
@@ -88,10 +172,14 @@
-
+
- {{ scope.row.isActive == 'N' ? '否' : '是' }}
+ {{ scope.row.isActive == "N" ? "否" : "是" }}
@@ -103,32 +191,57 @@
-
-
+
+
- {{ moment(scope.row.lastModificationTime).format("yyyy-MM-DD") }}
+ {{
+ moment(scope.row.lastModificationTime).format("yyyy-MM-DD")
+ }}
-
+
-
-
+
+
- {{ dddw(dict.payMode, "id", scope.row.payModeId, "displayName") }}
+
+ {{
+ dddw(dict.payMode, "id", scope.row.payModeId, "displayName")
+ }}
+
- {{ dddw(dict.billFlag, "id", scope.row.billFlag, "displayName") }}
+
+ {{
+ dddw(dict.billFlag, "id", scope.row.billFlag, "displayName")
+ }}
+
@@ -140,44 +253,82 @@
-
+
- {{ moment(scope.row.lastModificationTime).format("yyyy-MM-DD") }}
+ {{
+ moment(scope.row.lastModificationTime).format("yyyy-MM-DD")
+ }}
-
+
-
-
- 新增
-
-
- 编辑
-
-
-
- 启用
-
-
- 禁用
-
-
- 充值
-
+
+ 启用
+
+
+ 禁用
+
+
+ 充值
+
+
+ 退费
+
-
-
+
+
-
-
+
+
@@ -195,7 +346,13 @@
-
+
@@ -205,7 +362,7 @@
-
+
@@ -230,9 +387,18 @@
-
-
+
+
@@ -252,8 +418,14 @@
-
+
@@ -263,40 +435,147 @@
-
+
-
-
+
+
-
+
-
-
+
+
-
-
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -305,28 +584,30 @@
import moment from "moment";
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
-import { dddw, objCopy, arrayReduce, arrayExistObj,deepCopy } from "@/utlis/proFunc";
-
+import {
+ dddw,
+ objCopy,
+ arrayReduce,
+ arrayExistObj,
+ deepCopy,
+} from "@/utlis/proFunc";
export default {
- components: {
-
- },
+ components: {},
data() {
return {
- peisid:null,
+ peisid: null,
query: {
- dateType: 'createDate',
- cardModeId: '',
- cardTypeId:null,
- cardNo:'',
- customerName:'',
- isActive:'',
- startDate:'',
- endDate:'',
- mobileTelephone:'',
- }, //查询条件
-
+ dateType: "createDate",
+ cardModeId: "",
+ cardTypeId: null,
+ cardNo: "",
+ customerName: "",
+ isActive: "",
+ startDate: "",
+ endDate: "",
+ mobileTelephone: "",
+ }, //查询条件
dataList: [], //列表数据
cardBillList: [], //卡记账数据
@@ -335,36 +616,42 @@ export default {
form: {
id: null,
cardTypeId: null,
- cardNo: '',
+ cardNo: "",
discount: 100,
expiryDate: null,
- customerName: '',
- idNo: '',
- telephone: '',
- mobileTelephone: '',
- isActive: 'N',
- remark: '',
- organizationUnitId:null,
- },
+ customerName: "",
+ idNo: "",
+ telephone: "",
+ mobileTelephone: "",
+ isActive: "N",
+ remark: "",
+ organizationUnitId: null,
+ },
formInit: {},
dialogOrder: false,
- order:{
- id:'',
- cardRegisterId:null,
- cardNo:'', //仅显示用
- payModeId:'',
- rechargeAmount:0,
- billFlag:'2',
+ refundOrder: false,
+ order: {
+ id: "",
+ cardRegisterId: null,
+ cardNo: "", //仅显示用
+ payModeId: "",
+ billMoney: null,
+ billFlag: "0",
+ },
+ refundorder: {
+ id: "",
+ cardRegisterId: null,
+ cardNo: "", //仅显示用
+ payModeId: "",
+ billMoney: null,
+ billFlag: "2",
},
-
rules: {
cardTypeId: [
{ required: true, message: "请填写卡类别", trigger: "blur" },
],
- cardNo: [
- { required: true, message: "请填写卡号", trigger: "blur" },
- ],
+ cardNo: [{ required: true, message: "请填写卡号", trigger: "blur" }],
discount: [
{ required: true, message: "请填写卡折扣", trigger: "blur" },
],
@@ -395,28 +682,39 @@ export default {
payModeId: [
{ required: true, message: "请填写充值方式", trigger: "blur" },
],
- rechargeAmount: [
+ billMoney: [
{ required: true, message: "请填写充值金额", trigger: "blur" },
],
},
+ refundRules: {
+ cardRegisterId: [
+ { required: true, message: "请填写会员卡", trigger: "blur" },
+ ],
+ payModeId: [
+ { required: true, message: "请填写退费方式", trigger: "blur" },
+ ],
+ billMoney: [
+ { required: true, message: "请填写退费金额", trigger: "blur" },
+ ],
+ },
curChoosedRow: {}, //当前选择的行数据
- curChoosedId:'', //当前选择的行ID
+ curChoosedId: "", //当前选择的行ID
};
},
created() {
- this.peisid = window.sessionStorage.getItem('peisid');
- if(!this.form.id){
+ this.peisid = window.sessionStorage.getItem("peisid");
+ if (!this.form.id) {
this.form.organizationUnitId = this.peisid;
}
- this.query.startDate = new Date();
+ this.query.startDate = new Date();
this.query.endDate = this.query.startDate;
this.formInit = deepCopy(this.form);
},
//挂载完成
- mounted() {
+ mounted() {
this.dictInit();
this.btnQuery();
},
@@ -425,17 +723,18 @@ export default {
},
methods: {
...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
- dddw, moment,
+ dddw,
+ moment,
//初始化字典数据
- dictInit(){
+ dictInit() {
//获取卡类别
- getapi('/api/app/cardtype/getcardtypelist')
- .then((res) => {
- if(res.code != -1){
- this.dict.cardType = res.data;
- }
- });
+ getapi("/api/app/cardtype/getcardtypelist").then((res) => {
+ if (res.code != -1) {
+ console.log(res.data);
+ this.dict.cardType = res.data;
+ }
+ });
//体检中心
getapi("/api/app/organization-units/organization-unit-by-is-peis").then(
@@ -449,10 +748,9 @@ export default {
//支付方式
getapi("/api/app/pay-mode").then((res) => {
if (res.code != -1) {
- this.dict.payMode = res.data;
+ this.dict.payMode = res.data;
}
});
-
},
handleSelectionChange(val) {
@@ -462,18 +760,33 @@ export default {
rowClick(row) {
this.curChoosedRow = row;
this.curChoosedId = row.id;
- this.getCardBill(row.id);
+ this.getCardBill(row.id);
},
//获取卡记账记录
- getCardBill(cardId){
- postapi(`/api/app/cardbill/getcardbilllistincardregisterid?CardRegisterId=${cardId}`).then(res =>{
- if(res.code != -1){
+ getCardBill(cardId) {
+ postapi(
+ `/api/app/cardbill/getcardbilllistincardregisterid?CardRegisterId=${cardId}`
+ ).then((res) => {
+ if (res.code != -1) {
this.cardBillList = res.data;
}
});
- },
-
+ },
+ category(e) {
+ if (!this.form.id) {
+ this.dict.cardType.forEach((item) => {
+ if (item.id == e) {
+ console.log(item);
+ this.form.discount = item.discount;
+ this.form.expiryDate = moment()
+ .subtract(-item.expiryDay, "days")
+ .format("YYYY-MM-DD");
+ // this.form.expiryDate=item.expiryDay
+ }
+ });
+ }
+ },
add() {
this.form = deepCopy(this.formInit);
this.dialogVisible = true;
@@ -484,44 +797,44 @@ export default {
this.$message.warning("请先选择要操作的数据!");
return;
}
- objCopy(this.curChoosedRow,this.form);
+ objCopy(this.curChoosedRow, this.form);
this.dialogVisible = true;
},
- enable(){
+ enable() {
if (!this.curChoosedId) {
this.$message.warning("请先选择要操作的数据!");
return;
}
- postapi(`/api/app/cardregister/updateactive?id=${this.curChoosedId}`,{
- "isActive": "Y"
-}).then(res =>{
- if(res.code != - 1){
- this.dataList.forEach(item=>{
- if(item.id==this.curChoosedId){
- item.isActive="Y"
- }
- })
- this.$message.success('操作成功!')
- }
- });
+ postapi(`/api/app/cardregister/updateactive?id=${this.curChoosedId}`, {
+ isActive: "Y",
+ }).then((res) => {
+ if (res.code != -1) {
+ this.dataList.forEach((item) => {
+ if (item.id == this.curChoosedId) {
+ item.isActive = "Y";
+ }
+ });
+ this.$message.success("操作成功!");
+ }
+ });
},
- disable(){
+ disable() {
if (!this.curChoosedId) {
this.$message.warning("请先选择要操作的数据!");
return;
}
- postapi(`/api/app/cardregister/updateactive?id=${this.curChoosedId}`,{
- "isActive": "N"
-}).then(res =>{
- if(res.code != - 1){
- this.dataList.forEach(item=>{
- if(item.id==this.curChoosedId){
- item.isActive="N"
- }
- })
- this.$message.success('操作成功!')
- }
- });
+ postapi(`/api/app/cardregister/updateactive?id=${this.curChoosedId}`, {
+ isActive: "N",
+ }).then((res) => {
+ if (res.code != -1) {
+ this.dataList.forEach((item) => {
+ if (item.id == this.curChoosedId) {
+ item.isActive = "N";
+ }
+ });
+ this.$message.success("操作成功!");
+ }
+ });
},
del() {
let lfind = -1;
@@ -534,74 +847,100 @@ export default {
confirmButtonText: "是",
cancelButtonText: "否",
type: "warning",
- cancelButtonClass:"difference",
- confirmButtonClass:"commonbutton"
- }).then(() => {
- //console.log('{patientRegisterIds}',{patientRegisterIds})
- return postapi(`/api/app/cardregister/delete?id=${this.curChoosedId}`);
- }).then(res =>{
- if(res.code != -1){
- lfind = arrayExistObj(this.dataList, 'id', this.curChoosedId);
- if (lfind > - 1) this.dataList.splice(lfind, 1);
- this.curChoosedId = null;
- this.$message.success('操作成功!')
- }
- });
-
+ cancelButtonClass: "difference",
+ confirmButtonClass: "commonbutton",
+ })
+ .then(() => {
+ //console.log('{patientRegisterIds}',{patientRegisterIds})
+ return postapi(
+ `/api/app/cardregister/delete?id=${this.curChoosedId}`
+ );
+ })
+ .then((res) => {
+ if (res.code != -1) {
+ lfind = arrayExistObj(this.dataList, "id", this.curChoosedId);
+ if (lfind > -1) this.dataList.splice(lfind, 1);
+ this.curChoosedId = null;
+ this.$message.success("操作成功!");
+ }
+ });
+ },
+ refund() {
+ if (!this.curChoosedId) {
+ this.$message.warning("请先选择要充值的会员卡!");
+ return;
+ }
+ this.refundorder = {
+ id: "",
+ cardRegisterId: this.curChoosedId,
+ cardNo: this.curChoosedRow.cardNo,
+ payModeId: "",
+ billMoney: null,
+ billFlag: "2",
+ };
+ this.refundOrder = true;
},
-
bntOrder() {
if (!this.curChoosedId) {
this.$message.warning("请先选择要充值的会员卡!");
return;
}
this.order = {
- id:'',
- cardRegisterId:this.curChoosedId,
- cardNo:this.curChoosedRow.cardNo,
- payModeId:'',
- billMoney:0,
- billFlag:'2',
+ id: "",
+ cardRegisterId: this.curChoosedId,
+ cardNo: this.curChoosedRow.cardNo,
+ payModeId: "",
+ billMoney: null,
+ billFlag: "0",
};
this.dialogOrder = true;
},
//充值提交
orderSubmit(formName) {
- let body = {},lfind=-1;
+ let body = {},
+ lfind = -1;
this.$refs[formName].validate((valid, fields) => {
if (!valid) {
//console.log('fields',fields,Object.keys(fields));
this.$message.error(fields[Object.keys(fields)[0]][0].message);
return;
}
-
- body = deepCopy(this.order);
+ if (formName === "refundorder") {
+ body = deepCopy(this.refundorder);
+ body.billMoney = -body.billMoney;
+ } else if (formName === "order") {
+ body = deepCopy(this.order);
+ }
delete body.id;
delete body.cardNo;
//delete body.billFlag;
-
//充值 /api/app/cardregister/cardregisterrecharge
- postapi('/api/app/cardregister/cardregisterrecharge',body).then(res =>{
- if(res.code != - 1){
- this.getCardBill(this.curChoosedId);
+ postapi("/api/app/cardregister/addcardbill", body).then((res) => {
+ if (res.code != -1) {
+ this.getCardBill(this.curChoosedId);
this.dialogOrder = false;
- this.dataList.forEach(item=>{
- if(item.id==this.curChoosedId){
- item.cardBalance+=Number(this.order.rechargeAmount)
+ this.refundOrder = false;
+ this.dataList.forEach((item) => {
+ if (item.id == this.curChoosedId) {
+ if (formName === "refundorder") {
+ item.cardBalance -= Number(this.refundorder.billMoney);
+ } else if (formName === "order") {
+ item.cardBalance += Number(this.order.billMoney);
+ }
}
- })
- this.$message.success('操作成功!')
+ });
+ this.$message.success("操作成功!");
}
});
-
});
},
//提交
onSubmit(formName) {
- let body = {},lfind=-1;
+ let body = {},
+ lfind = -1;
this.$refs[formName].validate((valid, fields) => {
if (!valid) {
//console.log('fields',fields,Object.keys(fields));
@@ -624,66 +963,69 @@ export default {
// }
body = deepCopy(this.form);
delete body.id;
- body.expiryDate = moment(this.form.expiryDate).format('yyyy-MM-DD');
+ body.expiryDate = moment(this.form.expiryDate).format("yyyy-MM-DD");
//编辑
if (this.form.id) {
- postapi(`/api/app/cardregister/update?id=${this.form.id}`,body).then(res =>{
- if(res.code != -1){
- lfind = arrayExistObj(this.dataList,'id',this.form.id);
- if(lfind > -1) objCopy(this.form,this.dataList[lfind]);
- this.dialogVisible=false
- this.$message.success('操作成功!')
+ postapi(`/api/app/cardregister/update?id=${this.form.id}`, body).then(
+ (res) => {
+ if (res.code != -1) {
+ lfind = arrayExistObj(this.dataList, "id", this.form.id);
+ if (lfind > -1) objCopy(this.form, this.dataList[lfind]);
+ this.dialogVisible = false;
+ this.$message.success("操作成功!");
+ }
}
- });
+ );
} else {
//新增
- postapi('/api/app/cardregister/create',body).then(res =>{
- if(res.code != - 1){
- objCopy(res.data,this.form);
+ postapi("/api/app/cardregister/create", body).then((res) => {
+ if (res.code != -1) {
+ objCopy(res.data, this.form);
this.dataList.push(deepCopy(this.form));
- this.dialogVisible=false
- this.$message.success('操作成功!')
+ this.dialogVisible = false;
+ this.$message.success("操作成功!");
}
});
}
});
},
-
//查询
btnQuery(queryType) {
- let body = {}
+ let body = {};
switch (queryType) {
- case 'idNo':
- if(!this.query.idNo) return;
+ case "idNo":
+ if (!this.query.idNo) return;
body = { idNo: this.query.idNo };
break;
- case 'cardNo':
- if(!this.query.cardNo) return;
+ case "cardNo":
+ if (!this.query.cardNo) return;
body = { cardNo: this.query.cardNo };
break;
default:
- if(this.query.idNo){
+ if (this.query.idNo) {
body = { idNo: this.query.idNo };
- }else if(this.query.cardNo){
+ } else if (this.query.cardNo) {
body = { cardNo: this.query.cardNo };
- }else{
+ } else {
// if(!this.query.startDate) this.query.startDate = moment(new Date()).format('yyyy-MM-DD');
// if(!this.query.endDate) this.query.endDate = moment(new Date()).format('yyyy-MM-DD');
- if(this.query.startDate > this.query.endDate){
+ if (this.query.startDate > this.query.endDate) {
this.$message.error("数据不合法,起始日期不能大于截止日期!");
return;
}
- body.startDate = moment(this.query.startDate).format('yyyy-MM-DD');
- body.endDate = moment(this.query.endDate).format('yyyy-MM-DD');
+ body.startDate = moment(this.query.startDate).format("yyyy-MM-DD");
+ body.endDate = moment(this.query.endDate).format("yyyy-MM-DD");
- if(this.query.cardModeId) body.cardModeId = this.query.cardModeId;
- if(this.query.cardTypeId) body.cardTypeId = this.query.cardTypeId;
- if(this.query.customerName) body.customerName = this.query.customerName;
- if(this.query.isActive) body.isActive = this.query.isActive;
- if(this.query.mobileTelephone) body.mobileTelephone = this.query.mobileTelephone;
+ if (this.query.cardModeId) body.cardModeId = this.query.cardModeId;
+ if (this.query.cardTypeId) body.cardTypeId = this.query.cardTypeId;
+ if (this.query.customerName)
+ body.customerName = this.query.customerName;
+ if (this.query.isActive) body.isActive = this.query.isActive;
+ if (this.query.mobileTelephone)
+ body.mobileTelephone = this.query.mobileTelephone;
}
break;
}
@@ -698,12 +1040,11 @@ export default {
// "endDate": "string"
// }
- postapi('/api/app/cardregister/getcardregisterlist', body)
- .then((res) => {
- if (res.code != -1) {
- this.dataList = res.data;
- }
- });
+ postapi("/api/app/cardregister/getcardregisterlist", body).then((res) => {
+ if (res.code != -1) {
+ this.dataList = res.data;
+ }
+ });
},
},
@@ -716,7 +1057,6 @@ export default {
this.query();
}
},
-
},
};
@@ -733,17 +1073,17 @@ export default {
padding-right: 25px;
}
::v-deep .el-icon-date:before {
- content: ""
+ content: "";
}
-.query{
- margin-right: 25px;
- display: flex;
- justify-content: center;
- align-items: center;
- font-size: 14px;
- color: #232748;
- font-size: 400;
- font-family: "NotoSansSC-Regular";
+.query {
+ margin-right: 25px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ font-size: 14px;
+ color: #232748;
+ font-size: 400;
+ font-family: "NotoSansSC-Regular";
}
.box {
display: flex;
diff --git a/src/views/login/Login.vue b/src/views/login/Login.vue
index a7f08a6..68854e7 100644
--- a/src/views/login/Login.vue
+++ b/src/views/login/Login.vue
@@ -238,4 +238,13 @@ export default {
height: 40px;
width: 100%;
}
+:deep .el-input--prefix .el-input__inner {
+ padding-left: 30px;
+}
+:deep .el-form-item {
+ margin-bottom: 22px;
+}
+:deep .el-button{
+ color: #fff;
+}