|
|
|
@ -1,37 +1,69 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<div> |
|
|
|
<el-table :data="tableData" border style="width: 100%" row-key="id" height="300" highlight-current-row size="small"> |
|
|
|
<el-table |
|
|
|
:data="tableData" |
|
|
|
border |
|
|
|
style="width: 100%" |
|
|
|
row-key="id" |
|
|
|
height="300" |
|
|
|
highlight-current-row |
|
|
|
size="small" |
|
|
|
> |
|
|
|
<el-table-column label="组合项目" width="120" prop="asbitemName" /> |
|
|
|
<el-table-column label="操作" width="130" prop="operate"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.operate" placeholder="请操作方式" size="small" :disabled="scope.row.disabled" |
|
|
|
@change="changeOperate(scope.row)"> |
|
|
|
<el-option v-for="(item, index) in options" :key="index" :label="item.label" :value="item.value" /> |
|
|
|
<el-select |
|
|
|
v-model="scope.row.operate" |
|
|
|
placeholder="请操作方式" |
|
|
|
size="small" |
|
|
|
:disabled="scope.row.disabled" |
|
|
|
@change="changeOperate(scope.row)" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in options" |
|
|
|
:key="index" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="条码分组" width="120" prop="sampleGroupName" /> |
|
|
|
<el-table-column label="检验申请号" width="180" prop="lisRequestNo"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-select v-model="scope.row.lisRequestNo" size="small" :disabled="scope.row.disabled"> |
|
|
|
<el-option v-for="(item, index) in lisRequestNos" :key="index" :label="item.lisRequestNo" |
|
|
|
:value="item.lisRequestId" /> |
|
|
|
<el-select |
|
|
|
v-model="scope.row.lisRequestNo" |
|
|
|
size="small" |
|
|
|
:disabled="scope.row.disabled" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, index) in lisRequestNos" |
|
|
|
:key="index" |
|
|
|
:label="item.lisRequestNo" |
|
|
|
:value="item.lisRequestId" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<!-- 按钮区域 --> |
|
|
|
<div style="display: flex; margin-top: 30px; margin-left: 280px; "> |
|
|
|
<div style="display: flex; margin-top: 30px; margin-left: 280px"> |
|
|
|
<div style="margin-left: 10px"> |
|
|
|
<el-button type="primary" @click="submit">确定</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-left: 10px"> |
|
|
|
<el-button type="success" @click="lisPrint('0002',false)">条码打印</el-button> |
|
|
|
<el-button type="success" @click="lisPrint('0002', false)" |
|
|
|
>条码打印</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
<div style="margin-left: 10px"> |
|
|
|
<el-button type="danger" @click="patientRegister.lisRequestVisble = false">关闭</el-button> |
|
|
|
<el-button |
|
|
|
type="danger" |
|
|
|
@click="patientRegister.lisRequestVisble = false" |
|
|
|
>关闭</el-button |
|
|
|
> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
@ -48,12 +80,16 @@ export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
tableData: [], //组合项目数据 |
|
|
|
options: [{ label: '无', value: 'no' }, { label: '追加到以前条码', value: 'append' }, { label: '申请新的条码', value: 'new' }], //操作方式 |
|
|
|
options: [ |
|
|
|
{ label: "无", value: "no" }, |
|
|
|
{ label: "追加到以前条码", value: "append" }, |
|
|
|
{ label: "申请新的条码", value: "new" }, |
|
|
|
], //操作方式 |
|
|
|
lisRequestNos: [], //可选条码 |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
created() { }, |
|
|
|
created() {}, |
|
|
|
|
|
|
|
mounted() { |
|
|
|
this.getAsbItemList(this.id); |
|
|
|
@ -62,7 +98,6 @@ export default { |
|
|
|
...mapState(["patientRegister"]), |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
parseData(asbItem) { |
|
|
|
// "registerAsbitemId": "3a0d2e90-db36-09fe-4210-53fadb4f7d02", |
|
|
|
// asbitemId": "3a0c5600-ae78-9ed4-e3c1-993ef41d3c51", |
|
|
|
@ -77,26 +112,28 @@ export default { |
|
|
|
let lfind = -1; |
|
|
|
this.lisRequestNos = []; |
|
|
|
|
|
|
|
asbItem.forEach(e => { |
|
|
|
asbItem.forEach((e) => { |
|
|
|
if (e.lisRequestNo) { |
|
|
|
e['operate'] = 'no'; |
|
|
|
e['disabled'] = true; |
|
|
|
e["operate"] = "no"; |
|
|
|
e["disabled"] = true; |
|
|
|
|
|
|
|
lfind = arrayExistObj(this.lisRequestNos, 'lisRequestNo', e.lisRequestNo); |
|
|
|
lfind = arrayExistObj( |
|
|
|
this.lisRequestNos, |
|
|
|
"lisRequestNo", |
|
|
|
e.lisRequestNo |
|
|
|
); |
|
|
|
if (lfind == -1) { |
|
|
|
this.lisRequestNos.push({ |
|
|
|
sampleGroupId: e.sampleGroupId, |
|
|
|
lisRequestNo: e.lisRequestNo, |
|
|
|
lisRequestId: e.lisRequestId, |
|
|
|
}) |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
e['disabled'] = false; |
|
|
|
e["disabled"] = false; |
|
|
|
} |
|
|
|
return e; |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getAsbItemList(id) { |
|
|
|
@ -111,44 +148,48 @@ export default { |
|
|
|
|
|
|
|
//操作方式 |
|
|
|
changeOperate(row) { |
|
|
|
let lfind = -1 |
|
|
|
if (row.operate == 'append') { |
|
|
|
let lfind = -1; |
|
|
|
if (row.operate == "append") { |
|
|
|
if (row.sampleGroupId) { |
|
|
|
lfind = arrayExistObj(this.lisRequestNos, 'sampleGroupId', row.sampleGroupId); |
|
|
|
lfind = arrayExistObj( |
|
|
|
this.lisRequestNos, |
|
|
|
"sampleGroupId", |
|
|
|
row.sampleGroupId |
|
|
|
); |
|
|
|
if (lfind > -1) { |
|
|
|
row.lisRequestNo = this.lisRequestNos[lfind].lisRequestNo; |
|
|
|
row.lisRequestId = this.lisRequestNos[lfind].lisRequestId; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
row.lisRequestNo = ''; |
|
|
|
row.lisRequestId = ''; |
|
|
|
row.lisRequestNo = ""; |
|
|
|
row.lisRequestId = ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//确定 |
|
|
|
submit() { |
|
|
|
let append = [], news = []; |
|
|
|
let validMsg = '', lfind = -1; |
|
|
|
let append = [], |
|
|
|
news = []; |
|
|
|
let validMsg = "", |
|
|
|
lfind = -1; |
|
|
|
|
|
|
|
this.tableData.forEach(item => { |
|
|
|
if (item.operate == 'append') { |
|
|
|
this.tableData.forEach((item) => { |
|
|
|
if (item.operate == "append") { |
|
|
|
if (item.lisRequestId) { |
|
|
|
lfind = arrayExistObj(append, 'lisRequestId', item.lisRequestId); |
|
|
|
if (lfind = -1) { |
|
|
|
append.push( |
|
|
|
{ |
|
|
|
lisRequestId: item.lisRequestId, |
|
|
|
registerAsbitemIds: [item.registerAsbitemId], |
|
|
|
} |
|
|
|
) |
|
|
|
lfind = arrayExistObj(append, "lisRequestId", item.lisRequestId); |
|
|
|
if ((lfind = -1)) { |
|
|
|
append.push({ |
|
|
|
lisRequestId: item.lisRequestId, |
|
|
|
registerAsbitemIds: [item.registerAsbitemId], |
|
|
|
}); |
|
|
|
} else { |
|
|
|
append[lfind]['registerAsbitemIds'].push(item.registerAsbitemId); |
|
|
|
append[lfind]["registerAsbitemIds"].push(item.registerAsbitemId); |
|
|
|
} |
|
|
|
} else { |
|
|
|
validMsg = row.asbitemName + '项目,未选择追加到哪个检验申请单号!' |
|
|
|
validMsg = row.asbitemName + "项目,未选择追加到哪个检验申请单号!"; |
|
|
|
} |
|
|
|
} else if (item.operate == 'new') { |
|
|
|
} else if (item.operate == "new") { |
|
|
|
news.push(item.registerAsbitemId); |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -159,79 +200,89 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
if (append.length > 0) { |
|
|
|
postapi('/api/app/lisrequest/appendlisrequestmany', append) |
|
|
|
.then(res => { |
|
|
|
postapi("/api/app/lisrequest/appendlisrequestmany", append).then( |
|
|
|
(res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.$message.success('项目追加到检验申请单成功!'); |
|
|
|
this.$message.success("项目追加到检验申请单成功!"); |
|
|
|
this.getAsbItemList(this.id); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
); |
|
|
|
} |
|
|
|
if (news.length > 0) { |
|
|
|
postapi('/api/app/lisrequest/addlisrequest', news) |
|
|
|
.then(res => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.$message.success('项目创建检验申请单成功!'); |
|
|
|
this.getAsbItemList(this.id); |
|
|
|
} |
|
|
|
}); |
|
|
|
postapi("/api/app/lisrequest/addlisrequest", news).then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
this.$message.success("项目创建检验申请单成功!"); |
|
|
|
this.getAsbItemList(this.id); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//条码打印 |
|
|
|
lisPrint(ReportCode, isPreview) { |
|
|
|
|
|
|
|
let token = localStorage.getItem('token'); |
|
|
|
let user = localStorage.getItem('user'); |
|
|
|
lisPrint(ReportCode, isPreview) { |
|
|
|
let token = localStorage.getItem("token"); |
|
|
|
let user = localStorage.getItem("user"); |
|
|
|
let toOutShell = { |
|
|
|
ReportCode, token, |
|
|
|
ReportCode, |
|
|
|
token, |
|
|
|
Parameters: [ |
|
|
|
{ Name: 'printer', Value: user }, |
|
|
|
{ Name: 'hisLog', Value: 'pic/hisLog.jpg' }, |
|
|
|
{ Name: "printer", Value: user }, |
|
|
|
{ Name: "hisLog", Value: "pic/hisLog.jpg" }, |
|
|
|
], |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
if (isPreview) { |
|
|
|
//http://140.143.162.39:9529/api/app/printreport/getlisrequestreport?PatientRegisterId=3a0d2e90-da68-3746-6775-bf17e5f9b295 |
|
|
|
//this.multipleSelection.forEach((item,index) =>{ |
|
|
|
postapi(`/api/app/printreport/getlisrequestreport?PatientRegisterId=${this.id}`) |
|
|
|
postapi( |
|
|
|
`/api/app/printreport/getlisrequestreport?PatientRegisterId=${this.id}` |
|
|
|
) |
|
|
|
.then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
toOutShell.ReportTable = { lisRequest: res.data }; |
|
|
|
console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell)); |
|
|
|
console.log( |
|
|
|
"JSON.stringify(toOutShell)", |
|
|
|
JSON.stringify(toOutShell) |
|
|
|
); |
|
|
|
return this.$peisAPI.printPre(JSON.stringify(toOutShell)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
.catch((err) => { |
|
|
|
this.$message.warning(err); |
|
|
|
}); |
|
|
|
// }); |
|
|
|
} else { |
|
|
|
|
|
|
|
postapi(`/api/app/printreport/getlisrequestreport?PatientRegisterId=${this.id}`) |
|
|
|
postapi( |
|
|
|
`/api/app/printreport/getlisrequestreport?PatientRegisterId=${this.id}` |
|
|
|
) |
|
|
|
.then((res) => { |
|
|
|
if (res.code != -1) { |
|
|
|
toOutShell.ReportTable = { lisRequest: res.data }; |
|
|
|
console.log('JSON.stringify(toOutShell)', JSON.stringify(toOutShell)); |
|
|
|
console.log( |
|
|
|
"JSON.stringify(toOutShell)", |
|
|
|
JSON.stringify(toOutShell) |
|
|
|
); |
|
|
|
return this.$peisAPI.print(JSON.stringify(toOutShell)); |
|
|
|
} |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
if (res.toLowerCase() == 'success') { |
|
|
|
.then((res) => { |
|
|
|
if (res.toLowerCase() == "success") { |
|
|
|
//更新打印状态 /api/app/lisrequest/updatelisrequestisprint |
|
|
|
// { |
|
|
|
// "operateType": 0, 操作类型(1.按PatientRegisterId 2.按LisRequestId) |
|
|
|
// "patientRegisterId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", |
|
|
|
// "lisRequestId": "3fa85f64-5717-4562-b3fc-2c963f66afa6" |
|
|
|
// } |
|
|
|
return postapi('/api/app/lisrequest/updatelisrequestisprint', { operateType: 1, patientRegisterId: this.id }) |
|
|
|
return postapi("/api/app/lisrequest/updatelisrequestisprint", { |
|
|
|
operateType: 1, |
|
|
|
patientRegisterId: this.id, |
|
|
|
}); |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
.catch((err) => { |
|
|
|
this.$message.warning(err); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -245,7 +296,7 @@ export default { |
|
|
|
// } |
|
|
|
// }, |
|
|
|
|
|
|
|
"brushTimes"(newVal, oldVal) { |
|
|
|
brushTimes(newVal, oldVal) { |
|
|
|
if (newVal != oldVal && newVal != "") { |
|
|
|
this.getAsbItemList(this.id); |
|
|
|
} |
|
|
|
@ -276,7 +327,6 @@ export default { |
|
|
|
padding-right: 1px; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
::v-deep input[type="number"]::-webkit-inner-spin-button, |
|
|
|
input[type="number"]::-webkit-outer-spin-button { |
|
|
|
-webkit-appearance: none !important; |
|
|
|
|