|
|
|
@ -5,11 +5,9 @@ |
|
|
|
<div style="display: flex;"> |
|
|
|
<div> |
|
|
|
<div :style="'width:' + (window.pageWidth < 750 ? 595: window.pageWidth - 45 - 110) +'px;'"> |
|
|
|
<el-table :data="tableData" |
|
|
|
<el-table :data="tableData" row-key="id" |
|
|
|
width="100%" border |
|
|
|
height="240px" |
|
|
|
v-loading="loading" |
|
|
|
row-key="id" |
|
|
|
class="el-table__body-wrapper tbody" |
|
|
|
border:stripe="true" |
|
|
|
@row-click="rowick" |
|
|
|
@ -66,8 +64,7 @@ |
|
|
|
<div class="box"> |
|
|
|
<el-table :data="dict.asbItem" |
|
|
|
width="160" border |
|
|
|
:height="window.pageHeight < 600 ? 165:window.pageHeight - 150 - 240 - 45" |
|
|
|
row-key="id" |
|
|
|
:height="window.pageHeight < 600 ? 165:window.pageHeight - 150 - 240 - 45" |
|
|
|
highlight-current-row |
|
|
|
@row-dblclick="dbClickChoosedAsb" |
|
|
|
@selection-change="handleSelectionChange" :row-class-name="handleRowClassName" |
|
|
|
@ -110,10 +107,10 @@ |
|
|
|
<div class="box"> |
|
|
|
<el-table :data="sampleGroupAsbitems" |
|
|
|
width="160" border |
|
|
|
:height="window.pageHeight < 600 ? 165:window.pageHeight - 150 - 240 - 45" |
|
|
|
row-key="id" |
|
|
|
highlight-current-row |
|
|
|
> |
|
|
|
:height="window.pageHeight < 600 ? 165:window.pageHeight - 150 - 240 - 45" |
|
|
|
@selection-change="selecteditems" highlight-current-row |
|
|
|
:row-class-name="handleRowClassName" @row-dblclick="removeAbs" |
|
|
|
@row-click="removeAsbItem"> |
|
|
|
<el-table-column prop="displayName" label="已选组合项目" /> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
@ -256,8 +253,9 @@ import { arrayExistObj, tcdate, arrayFilter, arrayReduce, deepCopy,dddw } from " |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
itemTypeIds:[], //项目类别 |
|
|
|
asbItemId:'', //当前快速选到的给合项目ID |
|
|
|
|
|
|
|
quickAsb:[], //过滤显示的组合项目 |
|
|
|
rules: { |
|
|
|
displayName: [ |
|
|
|
{ required: true, message: "请输入活动名称", trigger: "blur" }, |
|
|
|
@ -397,10 +395,11 @@ export default { |
|
|
|
|
|
|
|
//按项目类别显示组合项目,并过滤已选择的组合项目 |
|
|
|
getAsbItemByItemType() { |
|
|
|
this.getAsbItemByItemTypeAll() |
|
|
|
this.getAsbItemByItemTypeAll() |
|
|
|
//刷新显示 未选组合项目 |
|
|
|
arrayReduce(this.dict.asbItem, [...this.sampleGroupAsbitems], "id=asbitemId"); |
|
|
|
arrayReduce(this.dict.asbItemQuick, [...this.sampleGroupAsbitems], "id=asbitemId"); |
|
|
|
arrayReduce(this.dict.asbItem, [...this.sampleGroupAsbitems], "id=id"); |
|
|
|
arrayReduce(this.dict.asbItemQuick, [...this.sampleGroupAsbitems], "id=id"); |
|
|
|
this.quickAsb = deepCopy(this.dict.asbItemQuick) |
|
|
|
}, |
|
|
|
|
|
|
|
//快速选择组合项目时,调整可按拼间简码及简称查找 |
|
|
|
@ -425,20 +424,18 @@ export default { |
|
|
|
async addAbs(asbItemChoosed,oprType) { |
|
|
|
// console.log('this.customerOrgGroup',this.customerOrgGroup) |
|
|
|
// console.log('asbItemChoosed', asbItemChoosed) |
|
|
|
if(!this.customerOrgGroup.id){ |
|
|
|
this.$message.warning("请先选中单位分组") |
|
|
|
return |
|
|
|
} |
|
|
|
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){ |
|
|
|
this.$message.warning("体检次数已完成,不允许操作") |
|
|
|
if(!this.form.id){ |
|
|
|
this.$message.warning("请先选中条码分组") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let message = [] |
|
|
|
let checked = true |
|
|
|
let lfind = -1 |
|
|
|
|
|
|
|
//oprType 不传值时,兼容勾选方式 |
|
|
|
//勾选时不需要此操作 start |
|
|
|
//勾选时不需要此操作 start |
|
|
|
if(oprType && oprType == 'all'){ |
|
|
|
asbItemChoosed = deepCopy(this.dict.asbItem) |
|
|
|
}else if(oprType && oprType == 'choosed'){ |
|
|
|
@ -457,28 +454,9 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//性别、年龄判断 |
|
|
|
// "displayName": "身高体重", |
|
|
|
// "shortName": "哈f哈", |
|
|
|
// "forSexId": "F", |
|
|
|
// "itemTypeId": "3a0b16de-75b9-c910-c61b-844709a88940", |
|
|
|
// "price": 0, |
|
|
|
|
|
|
|
// for (let i = 0; i < asbItemChoosed.length; i++) { |
|
|
|
// if (this.customerOrgGroup.forSexId == 'A') break //未选性别时,无需判断组合项目性别限制 |
|
|
|
// if (asbItemChoosed[i].forSexId == 'A' || asbItemChoosed[i].forSexId == 'U') continue |
|
|
|
// if (asbItemChoosed[i].forSexId != this.customerOrgGroup.sexId) { |
|
|
|
// this.$message.warning(`所选项目:${asbItemChoosed[i].displayName},不适合当前人员性别`) |
|
|
|
// checked = false |
|
|
|
// break |
|
|
|
// } |
|
|
|
// } |
|
|
|
// //console.log(222,checked) |
|
|
|
// if (!checked) return |
|
|
|
|
|
|
|
// 去掉重复的项目 |
|
|
|
arrayReduce(asbItemChoosed, this.sampleGroupAsbitems, "id=asbitemId") |
|
|
|
|
|
|
|
arrayReduce(asbItemChoosed, this.sampleGroupAsbitems, "id=id") |
|
|
|
/* |
|
|
|
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 |
|
|
|
@ -490,30 +468,17 @@ export default { |
|
|
|
} |
|
|
|
//console.log(222,checked) |
|
|
|
if (!checked) this.$message.warning(`所选项目【${JSON.stringify(message)}】不适合当前人员性别`) |
|
|
|
*/ |
|
|
|
|
|
|
|
for (let i = 0; i < asbItemChoosed.length; i++) { |
|
|
|
let pojo = { |
|
|
|
asbitemId: asbItemChoosed[i].id, |
|
|
|
displayName:asbItemChoosed[i].displayName, |
|
|
|
discount:100, |
|
|
|
customerOrgGroupDetailAmount:1, |
|
|
|
price:asbItemChoosed[i].price, |
|
|
|
customerOrgGroupDetailPrice:asbItemChoosed[i].price, |
|
|
|
customerOrgGroupDetailMoney: asbItemChoosed[i].price, |
|
|
|
asbitemMoney: asbItemChoosed[i].price, |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
asbItemChoosed.forEach(e =>{ |
|
|
|
this.sampleGroupAsbitems.push(deepCopy(e)) |
|
|
|
}) |
|
|
|
|
|
|
|
this.sampleGroupAsbitems.push(pojo) |
|
|
|
//this.sampleGroupAsbitems.push({ ...pojo, asbitemName: asbItemChoosed[i].displayName }) |
|
|
|
|
|
|
|
lfind = arrayExistObj(this.dict.asbItem, 'id', asbItemChoosed[i].id) |
|
|
|
if (lfind > -1) this.dict.asbItem.splice(lfind, 1) |
|
|
|
//刷新 |
|
|
|
this.getAsbItemByItemType() |
|
|
|
|
|
|
|
lfind = arrayExistObj(this.dict.asbItemQuick, 'id', asbItemChoosed[i].id) |
|
|
|
if (lfind > -1) this.dict.asbItemQuick.splice(lfind, 1) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
@ -597,15 +562,11 @@ export default { |
|
|
|
//删除 人员已选中的组合项目 |
|
|
|
///api/app/register-asbitem/many?RegisterAsbitemIds=3fa85f64-5717-4562-b3fc-2c963f66afa6 |
|
|
|
delAbs(absForDel,oprType) { |
|
|
|
if(!this.customerOrgGroup.id){ |
|
|
|
if(!this.form.id){ |
|
|
|
this.$message.warning("请先选中单位分组") |
|
|
|
return |
|
|
|
} |
|
|
|
if(this.customerOrgGroup.isComplete && this.customerOrgGroup.isComplete.toUpperCase() == 'Y'){ |
|
|
|
this.$message.warning("体检次数已完成,不允许操作") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let lfind = -1 |
|
|
|
|
|
|
|
@ -630,7 +591,7 @@ export default { |
|
|
|
|
|
|
|
for (let i = 0; i < absForDel.length; i++) { |
|
|
|
|
|
|
|
lfind = arrayExistObj(this.sampleGroupAsbitems, 'asbitemId', absForDel[i].asbitemId) |
|
|
|
lfind = arrayExistObj(this.sampleGroupAsbitems, 'id', absForDel[i].id) |
|
|
|
if (lfind > -1) this.sampleGroupAsbitems.splice(lfind, 1) |
|
|
|
|
|
|
|
absForDel.splice(i, 1) |
|
|
|
@ -707,35 +668,28 @@ export default { |
|
|
|
// console.log(v); |
|
|
|
}, |
|
|
|
saveAsb() { |
|
|
|
let sampleGroupId = this.form.id; |
|
|
|
console.log(this.form.id); |
|
|
|
console.log(this.sampleGroupAsbitems); |
|
|
|
let sdate = []; |
|
|
|
this.sampleGroupAsbitems.forEach((element) => { |
|
|
|
let sss = { sampleGroupId: sampleGroupId, asbitemId: element.id }; |
|
|
|
sdate.push(sss); |
|
|
|
}); |
|
|
|
this.dict.asbItem.forEach((element) => { |
|
|
|
let sss = { sampleGroupId: sampleGroupId, asbitemId: element.id }; |
|
|
|
sdate.push(sss); |
|
|
|
}); |
|
|
|
console.log(sdate); |
|
|
|
if (sampleGroupId == undefined) { |
|
|
|
this.$message.warning("请选择列表"); |
|
|
|
} else { |
|
|
|
// batchcreaion(sdate).then((res) => { |
|
|
|
// if (res.code == 0) { |
|
|
|
// this.$message.success("操作成功"); |
|
|
|
// } |
|
|
|
|
|
|
|
// this.isdislob = true; |
|
|
|
// }); |
|
|
|
if(!this.form.id){ |
|
|
|
this.$message.warning("请选择要操作的分组!") |
|
|
|
return |
|
|
|
} |
|
|
|
let details = [] |
|
|
|
let sampleGroupId = this.form.id; |
|
|
|
|
|
|
|
// url: "/api/app/sample-group-detail/many", |
|
|
|
// method: "post", |
|
|
|
|
|
|
|
this.sampleGroupAsbitems.forEach((e) => { |
|
|
|
details.push({ |
|
|
|
sampleGroupId, |
|
|
|
asbitemId:e.id |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
let body = { sampleGroupId, details } |
|
|
|
|
|
|
|
postapi('/api/app/samplegroupdetail/createsamplegroupdetail',body).then(res =>{ |
|
|
|
if(res.code != -1){ |
|
|
|
this.$message.success("操作成功!"); |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
//右侧勾选按钮 |
|
|
|
@ -979,6 +933,7 @@ export default { |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getlist() { |
|
|
|
this.loading = true; |
|
|
|
groupinglist(this.pages).then((res) => { |
|
|
|
|