mch 2 years ago
parent
commit
3a9dc0a244
  1. 2
      src/utlis/proFunc.js
  2. 241
      src/views/fee-settings/cardRegister.vue

2
src/utlis/proFunc.js

@ -23,7 +23,7 @@ exports.objCopy = (from, to) => {
//对象深拷贝 //对象深拷贝
function deepCopy(obj) { function deepCopy(obj) {
if (typeof obj != 'object' || obj == null) {
if (obj == null || typeof obj != 'object') {
return obj; return obj;
} }
let copy; let copy;

241
src/views/fee-settings/cardRegister.vue

@ -3,42 +3,57 @@
<el-card> <el-card>
<div class="publiccss">会员卡登记</div> <div class="publiccss">会员卡登记</div>
<div style="display: flex;margin-top:20px"> <div style="display: flex;margin-top:20px">
<div :style="'display: block; width:' + (window.pageWidth - 120 - 70) + 'px;'">
<div style="display: flex; flex-wrap: wrap; height:80px;">
<div :style="'display: block; width:' + (window.pageWidth - 120 - 80) + 'px;'">
<div style="display: flex; flex-wrap: wrap; height:70px;">
<div class="query"> <div class="query">
<el-select v-model="query.dateType" placeholder="请选择" filterable clearable size="small" style="width: 100px">
<el-select v-model="query.dateType" placeholder="请选择" filterable size="small"
style="width: 90px">
<el-option label="登记日期" value="createDate" /> <el-option label="登记日期" value="createDate" />
<el-option label="有效日期" value="expiryDate" /> <el-option label="有效日期" value="expiryDate" />
</el-select> </el-select>
<el-date-picker v-model="query.dateRange" type="daterange" align="right" unlink-panels range-separator=""
start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions" size="small"
style="width: 240px">
</el-date-picker>
<el-date-picker v-model="query.startDate" type="date" placeholder="起始日期" size="small" style="width: 100px" />
<span>--</span>
<el-date-picker v-model="query.endDate" type="date" placeholder="截止日期" size="small" style="width: 100px"/>
</div> </div>
<div class="query"> <div class="query">
<span>卡类别</span> <span>卡类别</span>
<el-select v-model="query.cardTypeId" placeholder="请选择" filterable clearable size="small" style="width: 100px">
<el-select v-model="query.cardTypeId" placeholder="请选择" clearable size="small"
style="width: 80px">
<el-option v-for="item in dict.cardType" :key="item.id" :label="item.displayName" :value="item.id" /> <el-option v-for="item in dict.cardType" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select> </el-select>
</div> </div>
<div class="query">
<span>卡状态</span>
<!--
<el-radio-group v-model="query.cardFlag">
<el-radio :label="1">启用</el-radio>
<el-radio :label="0">停用</el-radio>
</el-radio-group>
-->
<el-select v-model="query.cardFlag" placeholder="请选择" clearable size="small"
style="width: 80px">
<el-option label="启用" value="1" />
<el-option label="停用" value="0" />
</el-select>
</div>
<div class="query"> <div class="query">
<span>卡号</span> <span>卡号</span>
<el-input placeholder="卡号" v-model="query.cardNo" size="small" clearable style="width: 150px" />
<el-input placeholder="卡号" v-model="query.cardNo" size="small" clearable style="width: 120px" />
</div> </div>
<div class="query"> <div class="query">
<span>卡主姓名</span> <span>卡主姓名</span>
<el-input placeholder="卡主姓名" v-model="query.customerName" size="small" clearable style="width: 100px" />
<el-input placeholder="卡主姓名" v-model="query.customerName" size="small" clearable style="width: 80px" />
</div> </div>
<div class="query"> <div class="query">
<span>身份证号</span> <span>身份证号</span>
<el-input placeholder="身份证号" v-model="query.idNo" size="small" clearable style="width: 200px" />
<el-input placeholder="身份证号" v-model="query.idNo" size="small" clearable style="width: 180px" />
</div> </div>
<div class="query"> <div class="query">
<span>手机号</span>
<el-input placeholder="手机号" v-model="query.mobileTelephone" size="small" clearable style="width: 150px" />
<span>电话</span>
<el-input placeholder="手机号/电话" v-model="query.mobileTelephone" size="small" clearable style="width: 120px" />
</div> </div>
</div> </div>
<el-table :data="dataList" border width="100%" :height="window.pageHeight < 600 ? 200 : window.pageHeight - 400"
<el-table :data="dataList" border width="100%" :height="window.pageHeight < 600 ? 160 : window.pageHeight - 440"
row-key="id" size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange" row-key="id" size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange"
@row-click="rowClick"> @row-click="rowClick">
<el-table-column prop="cardTypeId" label="卡类别" width="100"> <el-table-column prop="cardTypeId" label="卡类别" width="100">
@ -65,7 +80,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="remark" label="备注" width="200" /> <el-table-column prop="remark" label="备注" width="200" />
<el-table-column prop="creatorId" label="创建人员" width="100" />
<el-table-column prop="creatorName" label="创建人员" width="100" />
<el-table-column prop="creationTime" label="创建日期" width="150"> <el-table-column prop="creationTime" label="创建日期" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.creationTime"> <div v-if="scope.row.creationTime">
@ -73,7 +88,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModifierId" label="修改人员" width="100" />
<el-table-column prop="lastModifierName" label="修改人员" width="100" />
<el-table-column prop="lastModificationTime" label="修改日期" width="150"> <el-table-column prop="lastModificationTime" label="修改日期" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.lastModificationTime"> <div v-if="scope.row.lastModificationTime">
@ -82,9 +97,8 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-table :data="cardBillList" border width="100%" height="170"
row-key="id" size="small" highlight-current-row ref="dataList" @selection-change="handleSelectionChange"
@row-click="rowClick">
<el-table :data="cardBillList" border width="100%" height="170" row-key="id" size="small" highlight-current-row
ref="dataList" @selection-change="handleSelectionChange" @row-click="rowClick">
<el-table-column prop="cardNo" label="会员卡号" width="150" /> <el-table-column prop="cardNo" label="会员卡号" width="150" />
<el-table-column prop="customerName" label="卡主姓名" width="80" /> <el-table-column prop="customerName" label="卡主姓名" width="80" />
<el-table-column prop="mobileTelephone" label="手机号" width="150" /> <el-table-column prop="mobileTelephone" label="手机号" width="150" />
@ -99,7 +113,7 @@
<div>{{ dddw(dict.billFlag, "id", scope.row.billFlag, "displayName") }}</div> <div>{{ dddw(dict.billFlag, "id", scope.row.billFlag, "displayName") }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creatorId" label="创建人员" width="100" />
<el-table-column prop="creatorName" label="创建人员" width="100" />
<el-table-column prop="creationTime" label="创建日期" width="150"> <el-table-column prop="creationTime" label="创建日期" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.creationTime"> <div v-if="scope.row.creationTime">
@ -107,7 +121,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="lastModifierId" label="修改人员" width="100" />
<el-table-column prop="lastModifierName" label="修改人员" width="100" />
<el-table-column prop="lastModificationTime" label="修改日期" width="150"> <el-table-column prop="lastModificationTime" label="修改日期" width="150">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.lastModificationTime"> <div v-if="scope.row.lastModificationTime">
@ -233,7 +247,7 @@
import moment from "moment"; import moment from "moment";
import { mapState, mapActions } from "vuex"; import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api"; import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { dddw, objCopy, arrayReduce, arrayExistObj } from "@/utlis/proFunc";
import { dddw, objCopy, arrayReduce, arrayExistObj,deepCopy } from "@/utlis/proFunc";
export default { export default {
@ -243,11 +257,20 @@ export default {
data() { data() {
return { return {
query: { query: {
dateType:'createDate',
dateType:'createDate',
dateType: 'createDate',
cardModeId: '',
cardTypeId:null,
cardNo:'',
customerName:'',
cardFlag:'',
startDate:'',
endDate:'',
mobileTelephone:'',
}, // }, //
dataList: [], // dataList: [], //
cardBillList:[], //
cardBillList: [], //
multipleSelection: [], // multipleSelection: [], //
dialogVisible: false, dialogVisible: false,
form: { form: {
@ -294,46 +317,21 @@ export default {
}, },
curChoosedRow: {}, // curChoosedRow: {}, //
pickerOptions: {
shortcuts: [
{
text: "最近一周",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近一个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit("pick", [start, end]);
},
},
{
text: "最近三个月",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit("pick", [start, end]);
},
},
],
},
curChoosedId:'', //ID
}; };
}, },
created() { created() {
this.formInit = { ...this.form };
this.query.startDate = new Date();
this.query.endDate = this.query.startDate;
this.formInit = deepCopy(this.form);
}, },
// //
mounted() { },
mounted() {
this.dictInit();
this.btnQuery();
},
computed: { computed: {
...mapState(["window", "dict"]), ...mapState(["window", "dict"]),
}, },
@ -341,31 +339,44 @@ export default {
...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), ...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]),
dddw, moment, dddw, moment,
//
dictInit(){
//
getapi('/api/app/cardtype/getcardtypelist')
.then((res) => {
if(res.code != -1){
this.dict.cardType = res.data;
}
});
},
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
rowClick(row) { rowClick(row) {
this.curChoosedRow = row; this.curChoosedRow = row;
this.curChoosedId = row.id;
}, },
add() { add() {
this.form = { ...this.formInit };
this.form = deepCopy(this.formInit);
this.dialogVisible = true; this.dialogVisible = true;
}, },
edit() { edit() {
if (!this.curChoosedRow.id) {
if (!this.curChoosedId) {
this.$message.warning("请先选择要操作的数据!"); this.$message.warning("请先选择要操作的数据!");
return; return;
} }
this.form = { ...this.curChoosedRow };
objCopy(this.curChoosedRow,this.form);
console.log('this.form',this.form);
this.dialogVisible = true; this.dialogVisible = true;
}, },
del() { del() {
let lfind = -1; let lfind = -1;
if (!this.curChoosedRow.id) {
if (!this.curChoosedId) {
this.$message.warning("请先选择要操作的数据!"); this.$message.warning("请先选择要操作的数据!");
return; return;
} }
@ -377,21 +388,6 @@ export default {
//
signByPatientRegisterNo() {
let val = this.form.patientRegisterNo
console.log(`/api/app/patient-register/patient-register-or-patient?SType=1&PatientRegisterNo=${val}`)
getapi(`/api/app/patient-register/patient-register-or-patient?SType=1&PatientRegisterNo=${val}`)
.then((res) => {
if (res.code != -1) {
if (res.data) {
this.signCore([res.data.id])
this.form.patientRegisterNo = ''
}
}
});
},
// //
onSubmit(formName) { onSubmit(formName) {
this.$refs[formName].validate((valid, fields) => { this.$refs[formName].validate((valid, fields) => {
@ -411,42 +407,60 @@ export default {
// //
btnQuery() {
btnQuery(queryType) {
let body = {} let body = {}
console.log(`this.patientRegister.query`, this.patientRegister.query)
if (this.patientRegister.query.customerOrgFlag) {
if (this.patientRegister.query.CustomerOrgParentId) {
body.customerOrgId = this.patientRegister.query.CustomerOrgParentId
} else {
if (this.patientRegister.query.customerOrgId) body.customerOrgId = this.patientRegister.query.customerOrgId
}
}
if (this.patientRegister.query.sex) body.sexId = this.patientRegister.query.sex
if (this.patientRegister.query.patientName) body.patientName = this.patientRegister.query.patientName
if (this.patientRegister.query.completeFlag) body.completeFlag = this.patientRegister.query.completeFlag
//StartDate EndDate
if (this.patientRegister.query.dateRange) {
body.startDate = moment(new Date(this.patientRegister.query.dateRange[0])).format("yyyy-MM-DD")
body.endDate = moment(new Date(this.patientRegister.query.dateRange[1])).format("yyyy-MM-DD")
console.log('this.query',this.query);
switch (queryType) {
case 'idNo':
if(!this.query.idNo) return;
body = { idNo: this.query.idNo };
break;
case 'cardNo':
if(!this.query.cardNo) return;
body = { cardNo: this.query.cardNo };
break;
default:
if(this.query.idNo){
body = { idNo: this.query.idNo };
}else if(this.query.cardNo){
body = { cardNo: this.query.cardNo };
}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){
this.$message.error("数据不合法,起始日期不能大于截止日期!");
return;
}
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.cardFlag) body.cardFlag = this.query.cardFlag;
if(this.query.mobileTelephone) body.mobileTelephone = this.query.mobileTelephone;
}
break;
} }
if (this.patientRegister.query.idCardNo) body = { idNo: this.patientRegister.query.idCardNo }
if (this.patientRegister.query.patientNo) body = { patientNo: this.patientRegister.query.patientNo }
if (this.patientRegister.query.patientRegisterNo) body = { patientRegisterNo: this.patientRegister.query.patientRegisterNo }
console.log('/api/app/patientregister/getlistinfilter', body)
postapi('/api/app/patientregister/getlistinfilter', body)
// {
// "cardModeId": "string",
// "cardTypeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
// "cardNo": "string",
// "customerName": "string",
// "idNo": "string",
// "cardFlag": "string",
// "startDate": "string",
// "endDate": "string"
// }
console.log('/api/app/cardregister/getcardregisterlist', body)
postapi('/api/app/cardregister/getcardregisterlist', body)
.then((res) => { .then((res) => {
this.dataList = res.data;
if (res.code != -1) {
this.dataList = res.data;
}
}); });
}, },
}, },
@ -465,6 +479,15 @@ export default {
}; };
</script> </script>
<style scoped> <style scoped>
::v-deep .el-input__inner {
/*text-align: center;*/
padding-left: 5px;
padding-right: 25px;
}
::v-deep .el-icon-date:before {
content: ""
}
.query { .query {
margin-left: 10px; margin-left: 10px;
} }

Loading…
Cancel
Save