Add MCU report template dropdown in setup v7

This commit is contained in:
sas.fajri
2026-04-29 15:44:48 +07:00
parent 30f09c353c
commit 33e111b7b5
4 changed files with 133 additions and 57 deletions

View File

@@ -41,6 +41,25 @@ export async function getmultitemplates(prm) {
} }
} }
export async function getReportUrlTemplates(prm) {
try {
var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/get_report_template_mcu', prm);
if (resp.status != 200) {
return {
status: "ERR",
message: resp.statusText
};
}
let data = resp.data;
return data;
} catch (e) {
return {
status: "ERR",
message: e.message
};
}
}
export async function getCover(prm) { export async function getCover(prm) {
try { try {

View File

@@ -421,6 +421,11 @@
</v-layout> </v-layout>
</v-radio-group> </v-radio-group>
</v-flex> </v-flex>
<v-flex xs12 pa-2>
<v-autocomplete :items="xreportUrlTemplates" v-model="selected_reportUrlTemplate" item-text="reportName"
hide-details outline item-value="id" return-object label="Report URL Template">
</v-autocomplete>
</v-flex>
<!-- cover --> <!-- cover -->
<v-flex xs12 pa-2> <v-flex xs12 pa-2>
<v-autocomplete :items="covers" v-model="selected_cover" item-text="name" hide-details <v-autocomplete :items="covers" v-model="selected_cover" item-text="name" hide-details
@@ -653,6 +658,7 @@ module.exports = {
}, },
mounted() { mounted() {
this.$store.dispatch("patient/getTemplateFisikMapping"); this.$store.dispatch("patient/getTemplateFisikMapping");
this.$store.dispatch("patient/getReportUrlTemplates", { Mgm_McuID: 0 });
this.$store.dispatch("patient/getBranch"); this.$store.dispatch("patient/getBranch");
this.$store.dispatch("patient/getTPriceHeaderCurrent"); this.$store.dispatch("patient/getTPriceHeaderCurrent");
// this.$store.dispatch("patient/getPackets", { // this.$store.dispatch("patient/getPackets", {
@@ -741,6 +747,17 @@ module.exports = {
xgeneratepasswordby() { xgeneratepasswordby() {
return this.$store.state.patient.generatepasswordby return this.$store.state.patient.generatepasswordby
}, },
xreportUrlTemplates() {
return this.$store.state.patient.reportUrlTemplates
},
selected_reportUrlTemplate: {
get() {
return this.$store.state.patient.selected_reportUrlTemplate
},
set(val) {
this.$store.commit("patient/update_selected_reportUrlTemplate", val || {})
}
},
selected_generatepasswordby: { selected_generatepasswordby: {
get() { get() {
return this.$store.state.patient.selected_generatepasswordby return this.$store.state.patient.selected_generatepasswordby
@@ -1460,6 +1477,7 @@ module.exports = {
var prm = { var prm = {
Mgm_McuGeneratePasswordBY: this.selected_generatepasswordby.generatepasswordbycode, Mgm_McuGeneratePasswordBY: this.selected_generatepasswordby.generatepasswordbycode,
Mcu_ReportUrlTemplateID: this.selected_reportUrlTemplate && this.selected_reportUrlTemplate.id ? this.selected_reportUrlTemplate.id : 0,
Mgm_McuReportHasil: this.reportresult, Mgm_McuReportHasil: this.reportresult,
arrUserMcu: this.xUserMculists, arrUserMcu: this.xUserMculists,
deleted_usermcus: this.$store.state.patient.deleted_usermcus, deleted_usermcus: this.$store.state.patient.deleted_usermcus,

View File

@@ -239,6 +239,9 @@ module.exports = {
this.$store.dispatch("patient/getBg", { this.$store.dispatch("patient/getBg", {
Mgm_McuID: row.Mgm_McuID Mgm_McuID: row.Mgm_McuID
}) })
this.$store.dispatch("patient/getReportUrlTemplates", {
Mgm_McuID: row.Mgm_McuID
})
this.$store.commit("patient/update_inp_Mgm_McuNote", row.Mgm_McuNote) this.$store.commit("patient/update_inp_Mgm_McuNote", row.Mgm_McuNote)
@@ -260,6 +263,10 @@ module.exports = {
Mgm_McuID: this.$store.state.patient.selected_patient.Mgm_McuID Mgm_McuID: this.$store.state.patient.selected_patient.Mgm_McuID
}) })
this.$store.commit("patient/update_reportresult", row.Mgm_McuReportHasil) this.$store.commit("patient/update_reportresult", row.Mgm_McuReportHasil)
this.$store.commit("patient/update_selected_reportUrlTemplate", {
id: row.Mcu_ReportUrlTemplateID || 0,
reportName: row.Mcu_ReportUrlTemplateName || ""
})
this.$store.commit("patient/update_selected_generatepasswordby", { this.$store.commit("patient/update_selected_generatepasswordby", {
generatepasswordbycode: row.generatepasswordbycode, generatepasswordbycode: row.generatepasswordbycode,
generatepasswordbyname: row.generatepasswordbyname generatepasswordbyname: row.generatepasswordbyname
@@ -328,6 +335,8 @@ module.exports = {
this.$store.commit("patient/update_userMcuLists", []) this.$store.commit("patient/update_userMcuLists", [])
this.$store.commit("patient/update_reportresult", "1") this.$store.commit("patient/update_reportresult", "1")
this.$store.commit("patient/update_selected_generatepasswordby", {}) this.$store.commit("patient/update_selected_generatepasswordby", {})
this.$store.commit("patient/update_selected_reportUrlTemplate", {})
this.$store.dispatch("patient/getReportUrlTemplates", { Mgm_McuID: 0 })
}, },
searchMgmMcu() { searchMgmMcu() {
// var prm = this.default_mou // var prm = this.default_mou

View File

@@ -159,6 +159,8 @@ export default {
selected_bg: {code: 'DFLT', name: 'Background Default', image: 'one-ui/BackgroundWesterindo.png'}, selected_bg: {code: 'DFLT', name: 'Background Default', image: 'one-ui/BackgroundWesterindo.png'},
multitemplates: [], multitemplates: [],
selected_multitemplates: {}, selected_multitemplates: {},
reportUrlTemplates: [],
selected_reportUrlTemplate: {},
// cpone // cpone
}, },
mutations: { mutations: {
@@ -168,6 +170,12 @@ export default {
update_selected_multitemplates(state, val) { update_selected_multitemplates(state, val) {
state.selected_multitemplates = val state.selected_multitemplates = val
}, },
update_reportUrlTemplates(state, val) {
state.reportUrlTemplates = val
},
update_selected_reportUrlTemplate(state, val) {
state.selected_reportUrlTemplate = val
},
update_covers(state, val) { update_covers(state, val) {
state.covers = val state.covers = val
}, },
@@ -868,6 +876,26 @@ export default {
context.commit("update_search_patient", 3) context.commit("update_search_patient", 3)
} }
}, },
async getReportUrlTemplates(context, prm) {
context.commit("update_get_data_status", 1)
try {
var xprm = prm || {}
xprm.token = one_token()
let resp = await api.getReportUrlTemplates(xprm)
if (resp.status != "OK") {
context.commit("update_get_data_status", 3)
} else {
context.commit("update_get_data_status", 2)
const rows = resp.data.records || []
context.commit("update_reportUrlTemplates", rows)
if (resp.data.selected) {
context.commit("update_selected_reportUrlTemplate", resp.data.selected)
}
}
} catch (e) {
context.commit("update_get_data_status", 3)
}
},
async searchv0(context, prm) { async searchv0(context, prm) {
context.commit("update_search_patient", 1) context.commit("update_search_patient", 1)
@@ -966,6 +994,7 @@ export default {
context.commit("update_inp_Mgm_McuUserPassword", "") context.commit("update_inp_Mgm_McuUserPassword", "")
context.commit("update_reportresult", "1") context.commit("update_reportresult", "1")
context.commit("update_selected_generatepasswordby", {}) context.commit("update_selected_generatepasswordby", {})
context.commit("update_selected_reportUrlTemplate", {})
context.commit("update_inp_Mgm_McuLowBackPainTampilSemua", false) context.commit("update_inp_Mgm_McuLowBackPainTampilSemua", false)
// context.commit("update_total_patient_test", 0) // context.commit("update_total_patient_test", 0)
@@ -1011,6 +1040,7 @@ export default {
context.commit("update_inp_Mgm_McuPicEmail", "") context.commit("update_inp_Mgm_McuPicEmail", "")
context.commit("update_reportresult", "1") context.commit("update_reportresult", "1")
context.commit("update_selected_generatepasswordby", {}) context.commit("update_selected_generatepasswordby", {})
context.commit("update_selected_reportUrlTemplate", {})
// context.commit("update_current_page_packet", 1) // context.commit("update_current_page_packet", 1)
// context.commit("update_total_patient_packet", 0) // context.commit("update_total_patient_packet", 0)
} }