pengjun 4 weeks ago
parent
commit
510a19cfa9
  1. 128
      src/components/customerOrg/customerOrgEdit.vue
  2. 123
      src/utlis/proFunc.js
  3. 77
      src/views/charge/charge.vue

128
src/components/customerOrg/customerOrgEdit.vue

@ -19,12 +19,30 @@
:disabled="customerOrg.oprStatus ? false : true" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-col :span="4">
<el-form-item label="单位简称" prop="shortName">
<el-input class="enterToTab" v-model="form.shortName" placeholder="请输入单位简称"
:disabled="customerOrg.oprStatus ? false : true" />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="加锁" prop="isLock" label-width="56px">
<!--
<el-radio v-model="form.isLock" label="Y" ></el-radio>
<el-radio v-model="form.isLock" label="N" ></el-radio>
-->
<el-checkbox v-model="form.isLock" true-label="Y" false-label="N" />
</el-form-item>
</el-col>
<el-col :span="2">
<el-form-item label="启用" prop="isActive" label-width="56px">
<!--
<el-radio v-model="form.isActive" label="Y">启用</el-radio>
<el-radio v-model="form.isActive" label="N">停用</el-radio>
-->
<el-checkbox v-model="form.isActive" true-label="Y" false-label="N" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
@ -45,7 +63,14 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="体检类别" prop="medicalTypeId">
<el-select v-model="form.medicalTypeId" placeholder="请选择" filterable clearable
:style="'width:' + Math.floor((window.pageWidth - 585) / 3) + 'px;'" size="small">
<el-option v-for="item in dict.medicalType" :key="item.id" :label="item.displayName" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<!--
<el-form-item label="显示顺序" prop="displayOrder">
<el-input type="number" v-model="form.displayOrder" />
@ -58,13 +83,14 @@
</el-form-item>
-->
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="联系电话" prop="telephone">
<el-input class="enterToTab" v-model="form.telephone" placeholder="请输入联系电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
<el-form-item label="传真" prop="fax">
<el-input class="enterToTab" v-model="form.fax" placeholder="请输入传真" />
@ -75,24 +101,6 @@
<el-input class="enterToTab" v-model="form.postalCode" placeholder="请输入邮政编码" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="加锁" prop="isLock" label-width="56px">
<!--
<el-radio v-model="form.isLock" label="Y" ></el-radio>
<el-radio v-model="form.isLock" label="N" ></el-radio>
-->
<el-checkbox v-model="form.isLockBox" @change="changeBox" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="启用" prop="isActive" label-width="56px">
<!--
<el-radio v-model="form.isActive" label="Y">启用</el-radio>
<el-radio v-model="form.isActive" label="N">停用</el-radio>
-->
<el-checkbox v-model="form.isActiveBox" @change="changeBox('isActive')" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="8">
@ -210,7 +218,7 @@ export default {
routeUrlorPageName: 'customerOrg', //
privs: [] //
},
isActiveBox: false,
customerOrgEditStyle: "height:400px;",
data: {
organizationdata: [], //
@ -235,15 +243,13 @@ export default {
remark: "",
isLock: "N",
isActive: "Y",
isLockBox: false,
isActiveBox: true,
medicalCenterId: null,
creatorName: "",
creationTime: null,
lastModifierName: "",
lastModificationTime: null,
salesPerson:"",
salesPersonPhone:""
salesPerson: "",
salesPersonPhone: ""
}, //
formInit: {},
rules: {
@ -282,19 +288,19 @@ export default {
},
computed: {
...mapState(["customerOrg", "window", "dataTransOpts"]),
...mapState(["customerOrg", "dict", "window", "dataTransOpts"]),
},
methods: {
...mapMutations(["setData"]), checkPagePriv,
changeBox(type) {
//
if (this.form[type + "Box"]) {
this.form[type] = "Y";
} else {
this.form[type] = "N";
}
},
// changeBox(type) {
// //
// if (this.form[type + "Box"]) {
// this.form[type] = "Y";
// } else {
// this.form[type] = "N";
// }
// },
//
getCustomerOrgRd(id) {
@ -307,16 +313,16 @@ export default {
this.dataTransOpts.tableS.customer_org.id = res.data.id
objCopy(res.data, this.form);
if (res.data.isActive == "Y") {
this.form.isActiveBox = true;
} else {
this.form.isActiveBox = false;
}
if (res.data.isLock == "Y") {
this.form.isLockBox = true;
} else {
this.form.isLockBox = false;
}
// if (res.data.isActive == "Y") {
// this.form.isActiveBox = true;
// } else {
// this.form.isActiveBox = false;
// }
// if (res.data.isLock == "Y") {
// this.form.isLockBox = true;
// } else {
// this.form.isLockBox = false;
// }
}
});
},
@ -332,6 +338,14 @@ export default {
getapi("/api/app/customer-org-type/get-all").then((res) => {
this.data.customerOrgType = res.data;
});
//
getapi("/api/app/medical-type/in-filter").then((res) => {
if (res.code > -1) {
this.dict.medicalType = res.data;
}
});
},
//()
@ -347,7 +361,7 @@ export default {
let node = {
id: body.id,
displayName: body.displayName,
label:(body.customerOrgCode ? body.customerOrgCode + ' ':'') + body.displayName,
label: (body.customerOrgCode ? body.customerOrgCode + ' ' : '') + body.displayName,
parentId: body.parentId,
};
@ -383,7 +397,7 @@ export default {
body.id
);
node2.displayName = body.displayName;
node2.label = (body.customerOrgCode ? body.customerOrgCode + ' ':'') + body.displayName
node2.label = (body.customerOrgCode ? body.customerOrgCode + ' ' : '') + body.displayName
break;
case "delete":
@ -410,10 +424,10 @@ export default {
pids[pids.length - 1]
);
//console.log('node3',node3)
if(node3){
if (node3) {
lfind = arrayExistObj(node3.treeChildren, "id", body);
if (lfind > -1) node3.treeChildren.splice(lfind, 1);
}
}
}
break;
default:
@ -461,7 +475,7 @@ export default {
//id
postapi(`/api/app/customerorg/create`, body).then(async (res) => {
if (res.code == 1) {
this.$message.success({showClose:true,message:'操作成功!'})
this.$message.success({ showClose: true, message: '操作成功!' })
//console.log(" ");
//this.setData({ key: "customerOrg.customerOrgRd", value: res });
this.form = res.data
@ -481,7 +495,7 @@ export default {
putapi(`/api/app/customer-org/${this.form.id}`, body).then(
(res) => {
if (res.code == 1) {
this.$message.success({showClose:true,message:'操作成功!'})
this.$message.success({ showClose: true, message: '操作成功!' })
let lbody = { ...deepCopy(body), id: this.form.id };
this.getCustomerOrgTree("update", lbody);
this.customerOrg.oprStatus = 'edit'
@ -495,7 +509,7 @@ export default {
}
});
},
// ID
async getParentCustomerOrgId(customerOrgId) {
let customerOrgParentId = null
@ -517,16 +531,16 @@ export default {
async btnAdd(formName, child) {
switch (child) {
case 'newCopy':
if(!this.form.id) return
if (!this.form.id) return
//let copyForm = deepCopy(this.form)
//this.from = deepCopy(copyForm)
this.form.displayName = ''
this.form.shortName = ''
this.form.id = ''
this.$message.warning({showClose:true,message:'复制新增,请记得要点击【保存】!'})
break;
this.$message.warning({ showClose: true, message: '复制新增,请记得要点击【保存】!' })
break;
default:
let formPre = deepCopy(this.form)
let formPre = deepCopy(this.form)
await this.$refs[formName].resetFields();
//console.log('this.peisid',this.peisid)
if (!this.peisid || this.peisid == 'null') {

123
src/utlis/proFunc.js

@ -4,7 +4,7 @@ function tcdate(date) {
for (var i = 0; i < date.length; i++) {
if (date[i].treeChildren && Array.isArray(date[i].treeChildren) && date[i].treeChildren.length > 0) {
tcdate(date[i].treeChildren);
}else{
} else {
delete date[i].treeChildren
}
}
@ -12,17 +12,17 @@ function tcdate(date) {
exports.tcdate = tcdate;
// 单位树节点,重新组装
function reMadeOrgTree(treeData,dispCustomerOrgCode){
function reMadeOrgTree(treeData, dispCustomerOrgCode) {
treeData.forEach(e => {
if(dispCustomerOrgCode == 'Y'){
e.label = (e.customerOrgCode ? e.customerOrgCode + '--':'') + e.displayName
}else{
if (dispCustomerOrgCode == 'Y') {
e.label = (e.customerOrgCode ? e.customerOrgCode + '--' : '') + e.displayName
} else {
e.label = e.displayName
}
}
if (e.treeChildren && Array.isArray(e.treeChildren) && e.treeChildren.length > 0) {
e.treeChildren = reMadeOrgTree(e.treeChildren,dispCustomerOrgCode)
e.treeChildren = reMadeOrgTree(e.treeChildren, dispCustomerOrgCode)
//e.isLeaf = false
}else{
} else {
delete e.treeChildren
//e.isLeaf = true
}
@ -52,7 +52,7 @@ function deepCopy(obj) {
let copy = null;
try {
// 日期数据直接返回
if(obj instanceof Date) return obj
if (obj instanceof Date) return obj
if (Array.isArray(obj)) {
copy = [];
@ -66,8 +66,8 @@ function deepCopy(obj) {
}
}
} catch (error) {
console.log('deepCopy',error)
}
console.log('deepCopy', error)
}
return copy;
};
exports.deepCopy = deepCopy;
@ -179,6 +179,33 @@ function arrayExistObj(arr, key, value) {
};
exports.arrayExistObj = arrayExistObj;
//判断数组中 是否存在 某个值的对象记录 如不存在返回 - 1,存在返回相应的 序列
function arrayExistObjPos(arr, key, value, pos) {
let ret = - 1
for (let i = pos; i < arr.length; i++) {
if (arr[i][key] == value) {
ret = i
break
}
}
return ret
};
exports.arrayExistObjPos = arrayExistObjPos;
//判断数组中 是否存在 某个值的对象记录 如不存在返回 - 1,存在返回相应的 序列
function arrayExistObjByKeys(arr, keys, values) {
let ret = - 1
for (let i = 0; i < arr.length; i++) {
ret = i
keys.forEach((key, index) => {
if (arr[i][key] !== values[index]) ret = -1
});
if (ret == i) break
}
return ret
};
exports.arrayExistObjByKeys = arrayExistObjByKeys;
//判断身份证是否合法
function checkIDCode(IDCode) {
// 身份证号码为15位或者18位,15位时全为数字,18位前17位为数字,最后一位是校验位,可能为数字或字符X
@ -206,7 +233,7 @@ function parseID(id) {
age: -1,
sex: 'U',
}
if(!id) return ret
if (!id) return ret
if (!checkIDCode(id)) return ret
let yearInMs = 1000 * 60 * 60 * 24 * 365.2425;
@ -342,12 +369,12 @@ exports.setData = setData;
function getColorStr(intColor) {
let color = '000000'
try {
if(intColor){
if (intColor) {
color += Number(intColor).toString(16)
color = color.substring(color.length - 6)
}
}
} catch (error) {
console.log('getColorStr',error)
console.log('getColorStr', error)
}
return '#' + color
}
@ -404,46 +431,46 @@ function listOrderBy(arr, keyObjs) {
lKeyObjs = []
let colNames = keyObjs.split(',')
colNames.forEach(colName => {
lKeyObjs.push({colName,sortType})
lKeyObjs.push({ colName, sortType })
});
}
if (!(Array.isArray(lKeyObjs) && lKeyObjs.length > 0)) return arr
let temp = null
let temp = null
try {
for (let i = 0; i < arrCount; i++) {
for (let j = 0; j < arrCount - 1; j++) {
for (let k = 0; k < lKeyObjs.length; k++) {
sortType = (lKeyObjs[k]['sortType'] || 'A').toUpperCase()
if (sortType == 'A'){
if (arr[j][lKeyObjs[k]['colName']] > arr[j + 1][lKeyObjs[k]['colName']]) {
temp = deepCopy(arr[j])
arr[j] = deepCopy(arr[j + 1])
arr[j + 1] = deepCopy(temp)
break;
}else if(arr[j][lKeyObjs[k]['colName']] < arr[j + 1][lKeyObjs[k]['colName']]){
break;
}else{
continue
}
}else{
if (arr[j][lKeyObjs[k]['colName']] < arr[j + 1][lKeyObjs[k]['colName']]) {
temp = deepCopy(arr[j])
arr[j] = deepCopy(arr[j + 1])
arr[j + 1] = deepCopy(temp)
break;
}else if(arr[j][lKeyObjs[k]['colName']] > arr[j + 1][lKeyObjs[k]['colName']]){
break;
}else{
continue
}
}
}
for (let i = 0; i < arrCount; i++) {
for (let j = 0; j < arrCount - 1; j++) {
for (let k = 0; k < lKeyObjs.length; k++) {
sortType = (lKeyObjs[k]['sortType'] || 'A').toUpperCase()
if (sortType == 'A') {
if (arr[j][lKeyObjs[k]['colName']] > arr[j + 1][lKeyObjs[k]['colName']]) {
temp = deepCopy(arr[j])
arr[j] = deepCopy(arr[j + 1])
arr[j + 1] = deepCopy(temp)
break;
} else if (arr[j][lKeyObjs[k]['colName']] < arr[j + 1][lKeyObjs[k]['colName']]) {
break;
} else {
continue
}
} else {
if (arr[j][lKeyObjs[k]['colName']] < arr[j + 1][lKeyObjs[k]['colName']]) {
temp = deepCopy(arr[j])
arr[j] = deepCopy(arr[j + 1])
arr[j + 1] = deepCopy(temp)
break;
} else if (arr[j][lKeyObjs[k]['colName']] > arr[j + 1][lKeyObjs[k]['colName']]) {
break;
} else {
continue
}
}
}
}
}
}
} catch (error) {
console.log(`listOrderBy error: ${error}`);
console.log(`listOrderBy error: ${error}`);
}
return arr;
}

77
src/views/charge/charge.vue

@ -75,7 +75,6 @@
<el-table-column prop="mobileTelephone" label="手机" width="100" />
<el-table-column prop="telephone" label="电话" width="100" />
<el-table-column prop="address" label="地址" width="300" />
</el-table>
</div>
</div>
@ -178,10 +177,12 @@
<el-input v-model="scope.row.cardNo" size="small" disabled />
</template>
</el-table-column>
<el-table-column v-if="query.chargeFlag == 'N'" width="30" align="center">
<el-table-column v-if="query.chargeFlag == 'N'" width="60" align="center">
<template slot-scope="scope">
<i class="el-icon-search" @click="getCardId(scope.$index)" v-if="scope.row.payModeId == '05'"
style="font-size: 24px;color: blue;cursor:pointer;"></i>
<i class="el-icon-s-open" @click="brushCard(scope.$index)" v-if="scope.row.payModeId == '05'"
style="font-size: 24px;color: red;cursor:pointer;"></i>
</template>
</el-table-column>
</el-table>
@ -332,7 +333,7 @@
import moment from 'moment';
import { mapState, mapActions } from "vuex";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { tcdate, dddw, arrayExistObj, deepCopy } from "../../utlis/proFunc";
import { tcdate, dddw, arrayExistObj,arrayExistObjPos, deepCopy } from "../../utlis/proFunc";
import PatientRegisterQuery from "../../components/patientRegister/patientRegisterQuery.vue";
import PatientRegisterRefuseList from "../../components/patientRegister/PatientRegisterRefuseList.vue";
@ -622,7 +623,7 @@ export default {
this.asbItemsForFee = res.data;
for (let i = this.asbItemsForFee.length - 1; i >= 0; i--) {
if (this.asbItemsForFee[i].isCharge == 'Y' || this.asbItemsForFee[i].payTypeFlag == '1') {
if (this.asbItemsForFee[i].isCharge == 'Y' || this.asbItemsForFee[i].payTypeFlag !== '0' ) {
this.asbItemsForFee.splice(i, 1);
continue;
}
@ -668,6 +669,21 @@ export default {
});
},
//
brushCard(index){
this.chargePays[index].cardNo = ''
this.chargePays[index].cardRegisterId = ''
this.chargePays[index].chargeMoney = 0
delete this.chargePays[index].discount
delete this.chargePays[index].cardBalance
//
this.inputMoney()
},
//
getCardId(index) {
console.log('index', index)
@ -705,10 +721,36 @@ export default {
//
btnOkCard() {
this.chargePays[this.cardSeq].cardNo = this.cardChoosed.cardNo + ' 余:' + this.cardChoosed.cardBalance
//
let lfind = arrayExistObj(this.chargePays,'cardRegisterId',this.cardChoosed.id)
if(lfind > -1){
this.$message.warning({showClose:true,message:'单次收费不允重复同一张卡!'})
return
}
//
let diffDiscount = false //
let preDiscount = 100
let curDiscount = this.cardChoosed.discount||100
this.chargePays.forEach(e => {
if(e.payModeId == '05' && e.discount){
if(Number(e.discount) !== Number(curDiscount)){
preDiscount = e.discount
diffDiscount = true
}
}
});
//
if(diffDiscount){
this.$message.warning({showClose:true,message:`当前所选卡折扣 ${curDiscount} 与 上次所选卡折扣 ${preDiscount} 不同,不可执行此操作`})
return
}
this.chargePays[this.cardSeq].cardNo = this.cardChoosed.cardNo + ' 余:' + this.cardChoosed.cardBalance + ' 折:' + curDiscount
this.chargePays[this.cardSeq].discount = curDiscount
this.chargePays[this.cardSeq].cardBalance = this.cardChoosed.cardBalance
this.chargePays[this.cardSeq].cardRegisterId = this.cardChoosed.id
//
this.form.discount = this.cardChoosed.discount || 100
this.form.discount = curDiscount
this.discountToDetails()
this.winDialog.queryCard = false
@ -746,16 +788,21 @@ export default {
//
getChargePayByChargeId(ChargeId) {
let curPayModeId = ''
let lfind = -1;
getapi(`/api/app/chargepay/getchargepayinchargeid?ChargeId=${ChargeId}`).then(res => {
if (res.code != - 1) {
res.data.forEach(e => {
lfind = arrayExistObj(this.chargePays, 'payModeId', e.payModeId);
if(curPayModeId != e.payModeId) lfind = -1
lfind++
console.log('lfind',lfind)
lfind = arrayExistObjPos(this.chargePays, 'payModeId', e.payModeId,lfind);
if (lfind > - 1) {
this.chargePays[lfind].chargeMoney = e.chargeMoney;
this.chargePays[lfind].cardRegisterId = e.cardRegisterId;
this.chargePays[lfind].cardNo = e.cardNo;
}
curPayModeId = e.payModeId
});
}
});
@ -888,6 +935,7 @@ export default {
//
inputMoney() {
// id = 01
let err = ''
let cashTotal = Number(0), unCashTotal = Number(0);
this.chargePays.forEach(e => {
console.log('e', e)
@ -896,7 +944,17 @@ export default {
} else {
unCashTotal += Number(e.chargeMoney);
}
if(e.payModeId == '05'){
if(Number(e.cardBalance) < Number(e.chargeMoney)){
err = `会员卡【${e.cardNo}】 余额不足`
}
}
});
if(err){
this.$message.warning({showClose:true,message:err})
return
}
this.form.preTotal = cashTotal + unCashTotal
this.findBalance()
if (unCashTotal > this.form.total) this.$message.warning(`数据校验失败:输入的非现金金额${unCashTotal}不能超过应收金额${this.form.total}`);
@ -968,11 +1026,13 @@ export default {
if (e.payModeId == '05' && e.chargeMoney) {
//console.log(e.payModeId,e.chargeMoney,e.cardRegisterId);
if (!e.cardRegisterId) msg = dddw(this.dict.payMode, "id", e.payModeId, "displayName") + '付费,必需选择会员卡号';
if(Number(e.cardBalance) < Number(e.chargeMoney)) msg = `会员卡【${e.cardNo}】 余额不足`
} else {
e.cardRegisterId = null;
}
});
/**/
if (msg) {
this.$message.warning(msg);
return;
@ -988,8 +1048,7 @@ export default {
this.$message.warning("收费方式合计收款不可小于应收金额!");
return;
}
this.chargePays.forEach(e => {
if (e.chargeMoney) {
if (e.payModeId == '01') {

Loading…
Cancel
Save