|
|
|
@ -104,7 +104,8 @@ |
|
|
|
<el-button class="commonbutton" @click="btnCopyGroupAsbitem">复制</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px;"> |
|
|
|
<el-button class="commonbutton" @click="btnPastGroupAsbitem" :disabled="dataTransOpts.copyGroupAsbitem.length == 0 ? true:false" >粘贴</el-button> |
|
|
|
<el-button class="commonbutton" @click="btnPastGroupAsbitem" |
|
|
|
:disabled="dataTransOpts.copyGroupAsbitem.length == 0 ? true : false">粘贴</el-button> |
|
|
|
</div> |
|
|
|
<div v-show="checkPagePriv(pagePriv.privs, '保存')" style="margin-top: 10px;"> |
|
|
|
<el-button class="commonbutton" @click="btnSave">保存</el-button> |
|
|
|
@ -172,9 +173,9 @@ |
|
|
|
<div style="display: flex"> |
|
|
|
<div> |
|
|
|
<span>体检单位:</span> |
|
|
|
<el-select v-model="customerOrgId" placeholder="请选择体检单位" :filter-method="filterMethodOrg" default-first-option |
|
|
|
clearable filterable @clear="customerOrgDisp = deepCopy(customerOrgAll)" style="margin-left: 10px" |
|
|
|
@change="changeCustomerOrg" size="small"> |
|
|
|
<el-select v-model="customerOrgId" placeholder="请选择体检单位" :filter-method="filterMethodOrg" |
|
|
|
default-first-option clearable filterable @clear="customerOrgDisp = deepCopy(customerOrgAll)" |
|
|
|
style="margin-left: 10px" @change="changeCustomerOrg" size="small"> |
|
|
|
<el-option v-for="item in customerOrgDisp" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
{{ item.displayName }} |
|
|
|
</el-option> |
|
|
|
@ -239,10 +240,10 @@ |
|
|
|
import moment from 'moment'; |
|
|
|
import { mapState } from "vuex"; |
|
|
|
import { getapi, postapi, putapi } from "@/api/api"; |
|
|
|
import { getPagePriv, checkPagePriv, arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy, objCopy,dddw } from "../../utlis/proFunc"; |
|
|
|
import { getPagePriv, checkPagePriv, arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy, objCopy, dddw } from "../../utlis/proFunc"; |
|
|
|
|
|
|
|
export default { |
|
|
|
props: ['customerOrgGroup', 'curOrgGroups','customerOrgAll','curOrgRegister','curOrgRegisterList','refreshMoney'], |
|
|
|
props: ['customerOrgGroup', 'curOrgGroups', 'customerOrgAll', 'curOrgRegister', 'curOrgRegisterList', 'refreshMoney'], |
|
|
|
data() { |
|
|
|
return { |
|
|
|
pagePriv: { |
|
|
|
@ -268,10 +269,10 @@ export default { |
|
|
|
customerOrgGroups: [], //历次分组 |
|
|
|
curGroupId: '', //当前选中套餐ID |
|
|
|
groupAsbitems: [], //选中分组包含组合项目 |
|
|
|
customerOrgId:'', // 当前选中企业ID |
|
|
|
customerOrgDisp:[], // 显示单位 |
|
|
|
customerOrgRegisterList:[], //当前体检次数集合 |
|
|
|
customerOrgRegister:{}, // 当前选择体检次数 |
|
|
|
customerOrgId: '', // 当前选中企业ID |
|
|
|
customerOrgDisp: [], // 显示单位 |
|
|
|
customerOrgRegisterList: [], //当前体检次数集合 |
|
|
|
customerOrgRegister: {}, // 当前选择体检次数 |
|
|
|
|
|
|
|
|
|
|
|
dialogVisible: false, |
|
|
|
@ -283,6 +284,8 @@ export default { |
|
|
|
addrulst: [], //添加保存的Id |
|
|
|
price: "", //价格 |
|
|
|
title: 1, |
|
|
|
|
|
|
|
hc_warn_mode: '1', //0-仅提醒;1-提醒并决择;2-有互斥项目时不允许保存 |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
@ -549,16 +552,33 @@ export default { |
|
|
|
arrayReduce(asbItemChoosed, this.customerOrgGroupAsbitems, "id=asbitemId") |
|
|
|
|
|
|
|
for (let i = asbItemChoosed.length - 1; i > - 1; i--) { |
|
|
|
if (this.customerOrgGroup.forSexId == 'A') break //未选性别时,无需判断组合项目性别限制 |
|
|
|
if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue |
|
|
|
//未选性别时,无需判断组合项目性别限制 |
|
|
|
if (this.customerOrgGroup.forSexId == 'A' && this.customerOrgGroup.maritalStatusId == 'A') { |
|
|
|
break; |
|
|
|
} else { |
|
|
|
if (this.customerOrgGroup.forSexId != 'A'){ |
|
|
|
if (!(asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U')) { |
|
|
|
if (asbItemChoosed[i].forSexId != this.customerOrgGroup.forSexId) { |
|
|
|
message.push(asbItemChoosed[i].displayName) //.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
checked = false |
|
|
|
asbItemChoosed.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再判断婚姻 |
|
|
|
if (!(checked || asbItemChoosed[i].maritalStatusId == 'A' || asbItemChoosed[i].maritalStatusId == 'U')) { |
|
|
|
if (asbItemChoosed[i].maritalStatusId != this.customerOrgGroup.maritalStatusId) { |
|
|
|
message.push(asbItemChoosed[i].displayName) //.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
checked = false |
|
|
|
asbItemChoosed.splice(i, 1) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
//console.log(222,checked) |
|
|
|
if (!checked) this.$message.warning(`所选项目【${JSON.stringify(message)}】不适合当前人员性别`) |
|
|
|
if (!checked) this.$message.warning(`所选项目【${JSON.stringify(message)}】不适合当前人员性别或婚姻状态`) |
|
|
|
|
|
|
|
for (let i = 0; i < asbItemChoosed.length; i++) { |
|
|
|
let pojo = { |
|
|
|
@ -702,7 +722,7 @@ export default { |
|
|
|
lfind = arrayExistObj(this.customerOrgGroupAsbitems, 'asbitemId', absForDel[i].asbitemId) |
|
|
|
if (lfind > -1) this.customerOrgGroupAsbitems.splice(lfind, 1) |
|
|
|
|
|
|
|
lfind = arrayExistObj(this.dict.asbItemAll,'id',absForDel[i].asbitemId) |
|
|
|
lfind = arrayExistObj(this.dict.asbItemAll, 'id', absForDel[i].asbitemId) |
|
|
|
if (lfind > -1) this.dict.asbItem.push(this.dict.asbItemAll[lfind]) |
|
|
|
|
|
|
|
absForDel.splice(i, 1) |
|
|
|
@ -710,7 +730,7 @@ export default { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if(Array.isArray(this.itemTypeIds) && this.itemTypeIds.length > 0 ) this.changeItemTypeIds(this.itemTypeIds) |
|
|
|
if (Array.isArray(this.itemTypeIds) && this.itemTypeIds.length > 0) this.changeItemTypeIds(this.itemTypeIds) |
|
|
|
|
|
|
|
//按项目类别显示组合项目,并过滤已选择的组合项目 // 刷新快速选择数据集 |
|
|
|
this.refAsbItemByChoosed() |
|
|
|
@ -984,19 +1004,10 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
let group = deepCopy(this.customerOrgGroup); |
|
|
|
postapi('/api/app/customerorggroupdetail/createcustomerorggroupdetailmany', body |
|
|
|
) |
|
|
|
// .then(res => { |
|
|
|
// if(res.code != -1){ |
|
|
|
// delete group.id; |
|
|
|
// delete group.customerOrgId; |
|
|
|
// delete group.isComplete; |
|
|
|
// group.price = this.groupPrice |
|
|
|
// // console.log('this.customerOrgGroup',this.customerOrgGroup) |
|
|
|
// // console.log('group',group) |
|
|
|
// return putapi(`/api/app/customer-org-group/${this.customerOrgGroup.id}`, group) |
|
|
|
// } |
|
|
|
// }) 后台合并事务 |
|
|
|
this.checkAsbItemHC() |
|
|
|
.then(() => { |
|
|
|
return postapi('/api/app/customerorggroupdetail/createcustomerorggroupdetailmany', body) |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (res && res.code != -1) { |
|
|
|
console.log("操作成功"); |
|
|
|
@ -1042,36 +1053,126 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 快速复制/粘贴 分组项目 |
|
|
|
btnCopyGroupAsbitem(){ |
|
|
|
if(this.customerOrgGroupAsbitems.length == 0){ |
|
|
|
this.$message.warning({showClose:true,message:'没有可复制的项目,请先选择分组'}) |
|
|
|
btnCopyGroupAsbitem() { |
|
|
|
if (this.customerOrgGroupAsbitems.length == 0) { |
|
|
|
this.$message.warning({ showClose: true, message: '没有可复制的项目,请先选择分组' }) |
|
|
|
return |
|
|
|
} |
|
|
|
this.dataTransOpts.copyGroupAsbitem = deepCopy(this.customerOrgGroupAsbitems) |
|
|
|
this.$message.success({showClose:true,message:'操作成功!'}) |
|
|
|
this.$message.success({ showClose: true, message: '操作成功!' }) |
|
|
|
}, |
|
|
|
|
|
|
|
// 快速复制/粘贴 分组项目 |
|
|
|
btnPastGroupAsbitem(){ |
|
|
|
let lfind = -1 |
|
|
|
btnPastGroupAsbitem() { |
|
|
|
let lfind = -1, lfind2 = -1 |
|
|
|
|
|
|
|
this.dataTransOpts.copyGroupAsbitem.forEach(e => { |
|
|
|
lfind = arrayExistObj(this.customerOrgGroupAsbitems,'asbitemId',e.asbitemId) |
|
|
|
if(lfind == -1){ |
|
|
|
let pojo = Object.assign({},e,{id:Date.now(),}) |
|
|
|
lfind = arrayExistObj(this.customerOrgGroupAsbitems, 'asbitemId', e.asbitemId) |
|
|
|
if (lfind == -1) { |
|
|
|
|
|
|
|
lfind2 = arrayExistObj(this.dict.asbItemAll, 'id', e.asbitemId) |
|
|
|
if (lfind2 > -1) { |
|
|
|
let pojo = Object.assign({}, e, { id: Date.now(), }) |
|
|
|
if (this.customerOrgGroup.forSexId == 'A' && this.customerOrgGroup.maritalStatusId == 'A') { |
|
|
|
this.customerOrgGroupAsbitems.push(pojo) |
|
|
|
} else { |
|
|
|
let pasteAble = true // 默认可复制 |
|
|
|
if (this.customerOrgGroup.forSexId != 'A'){ |
|
|
|
if (!(this.dict.asbItemAll[lfind2].forSexId == 'A' || this.dict.asbItemAll[lfind2].forSexId == 'U')) { |
|
|
|
if (this.dict.asbItemAll[lfind2].forSexId != this.customerOrgGroup.forSexId) { |
|
|
|
this.$message.warning({showClose:true,message:`${this.dict.asbItemAll[lfind2].displayName} 不适合当前性别`}) |
|
|
|
pasteAble = false |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
// 再判断婚姻 |
|
|
|
if (!(checked || this.dict.asbItemAll[lfind2].maritalStatusId == 'A' || this.dict.asbItemAll[lfind2].maritalStatusId == 'U')) { |
|
|
|
if (this.dict.asbItemAll[lfind2].maritalStatusId != this.customerOrgGroup.maritalStatusId) { |
|
|
|
this.$message.warning({showClose:true,message:`${this.dict.asbItemAll[lfind2].displayName} 不适合当前婚姻状态`}) |
|
|
|
pasteAble = false |
|
|
|
} |
|
|
|
} |
|
|
|
if(pasteAble) this.customerOrgGroupAsbitems.push(pojo) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
this.dataTransOpts.copyGroupAsbitem = [] |
|
|
|
this.refAsbItemByChoosed() |
|
|
|
this.$message.success({showClose:true,message:'操作成功!'}) |
|
|
|
this.$message.success({ showClose: true, message: '操作成功!' }) |
|
|
|
}, |
|
|
|
|
|
|
|
// 检查项目互斥 |
|
|
|
checkAsbItemHC() { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
let asbitemIds = [] |
|
|
|
//console.log('this.dataTransOpts.tableM.register_check_asbitem',this.dataTransOpts.tableM.register_check_asbitem) |
|
|
|
this.customerOrgGroupAsbitems.forEach(e => { |
|
|
|
asbitemIds.push(e.asbitemId) |
|
|
|
}); |
|
|
|
|
|
|
|
let message = '' |
|
|
|
if (asbitemIds.length == 0) { |
|
|
|
resolve() |
|
|
|
} else { |
|
|
|
postapi('/api/app/AsbitemMutualExclusion/GetAsbitemIsMutualExclusion', { asbitemIds }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
if (res?.data?.message) message = res.data.message |
|
|
|
} |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
if (message) { |
|
|
|
switch (this.hc_warn_mode) { |
|
|
|
case '1': '' |
|
|
|
this.$confirm(`${message} 是否继续?`, "提示", { |
|
|
|
confirmButtonText: "是", |
|
|
|
cancelButtonText: " 否 ", |
|
|
|
type: "warning", |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
resolve() |
|
|
|
}) |
|
|
|
.catch((err) => { |
|
|
|
reject(message) |
|
|
|
// if (err == "cancel") { |
|
|
|
// console.log("已取消删除"); |
|
|
|
// } |
|
|
|
}); |
|
|
|
break; |
|
|
|
case '2': |
|
|
|
this.$message.error({ showClose: true, message }) |
|
|
|
reject(message) |
|
|
|
break; |
|
|
|
default: |
|
|
|
this.$message.warning({ showClose: true, message }) |
|
|
|
resolve() |
|
|
|
break; |
|
|
|
} |
|
|
|
} else { |
|
|
|
resolve() |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//监听事件 |
|
|
|
watch: { |
|
|
|
// 切换分组时,如果未选项目类别,则清空 左侧待选的项目 |
|
|
|
"dataTransOpts.tableS.customer_org_group.id": { |
|
|
|
handler(newVal, oldVal) { |
|
|
|
if (newVal != oldVal) { |
|
|
|
if (!(Array.isArray(this.itemTypeIds) && this.itemTypeIds.length > 0)) { |
|
|
|
this.dict.asbItem = [] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
// 体检分组ID未切换换时 也可以强制刷新数据 |
|
|
|
"dataTransOpts.refresh.customer_org_group_detail.M": { |
|
|
|
// immediate:true, |
|
|
|
@ -1082,10 +1183,10 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// 显示复制分组页面时,刷单位与体检次数数据 |
|
|
|
"groupVisble":{ |
|
|
|
"groupVisble": { |
|
|
|
handler(newVal, oldVal) { |
|
|
|
if(newVal){ |
|
|
|
console.log('customerOrgGroup',this.customerOrgGroup,this.customerOrgAll,this.curOrgRegisterList) |
|
|
|
if (newVal) { |
|
|
|
console.log('customerOrgGroup', this.customerOrgGroup, this.customerOrgAll, this.curOrgRegisterList) |
|
|
|
this.customerOrgDisp = deepCopy(this.customerOrgAll) |
|
|
|
this.customerOrgRegisterList = deepCopy(this.curOrgRegisterList) |
|
|
|
this.customerOrgRegister = deepCopy(this.curOrgRegister) |
|
|
|
|