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

@@ -22,7 +22,7 @@ const URL = "/one-api/cpone/mcuoffline/";
export async function getmultitemplates(prm) { export async function getmultitemplates(prm) {
try { try {
var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/getmultitemplates', prm); var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/getmultitemplates', prm);
if (resp.status != 200) { if (resp.status != 200) {
@@ -39,10 +39,29 @@ export async function getmultitemplates(prm) {
message: e.message message: e.message
}; };
} }
} }
export async function getReportUrlTemplates(prm) {
export async function getCover(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) {
try { try {
console.log('dadasda cover api') console.log('dadasda cover api')
var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/getcover', prm); var resp = await axios.post(URL + 'setupmcu/setupmcucponev7/getcover', prm);
@@ -676,4 +695,4 @@ export async function getdeliveries(prm) {
message: e.message message: e.message
}; };
} }
} }

View File

@@ -391,8 +391,8 @@
<!-- template fisik --> <!-- template fisik -->
<!-- Report hasil --> <!-- Report hasil -->
<v-flex xs12 pa-2> <v-flex xs12 pa-2>
<v-radio-group hide-details v-model="reportresult"> <v-radio-group hide-details v-model="reportresult">
<template v-slot:label> <template v-slot:label>
<h4 class="subheader pl-2 pt-2 pb-2">REPORT HASIL</h4> <h4 class="subheader pl-2 pt-2 pb-2">REPORT HASIL</h4>
</template> </template>
@@ -419,9 +419,14 @@
</v-radio> </v-radio>
</v-flex> </v-flex>
</v-layout> </v-layout>
</v-radio-group> </v-radio-group>
</v-flex> </v-flex>
<!-- cover --> <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 -->
<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
outline item-value="code" return-object label="Cover"> outline item-value="code" return-object label="Cover">
@@ -651,10 +656,11 @@ module.exports = {
components: { components: {
"one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"), "one-dialog-print": httpVueLoader("../../common/oneDialogPrintX.vue"),
}, },
mounted() { mounted() {
this.$store.dispatch("patient/getTemplateFisikMapping"); this.$store.dispatch("patient/getTemplateFisikMapping");
this.$store.dispatch("patient/getBranch"); this.$store.dispatch("patient/getReportUrlTemplates", { Mgm_McuID: 0 });
this.$store.dispatch("patient/getTPriceHeaderCurrent"); this.$store.dispatch("patient/getBranch");
this.$store.dispatch("patient/getTPriceHeaderCurrent");
// this.$store.dispatch("patient/getPackets", { // this.$store.dispatch("patient/getPackets", {
// searchPacket : this.search_packet, // searchPacket : this.search_packet,
// current_page: this.current_page_packet, // current_page: this.current_page_packet,
@@ -738,12 +744,23 @@ module.exports = {
} }
}, },
// cpone // cpone
xgeneratepasswordby() { xgeneratepasswordby() {
return this.$store.state.patient.generatepasswordby return this.$store.state.patient.generatepasswordby
}, },
selected_generatepasswordby: { xreportUrlTemplates() {
get() { return this.$store.state.patient.reportUrlTemplates
return this.$store.state.patient.selected_generatepasswordby },
selected_reportUrlTemplate: {
get() {
return this.$store.state.patient.selected_reportUrlTemplate
},
set(val) {
this.$store.commit("patient/update_selected_reportUrlTemplate", val || {})
}
},
selected_generatepasswordby: {
get() {
return this.$store.state.patient.selected_generatepasswordby
}, },
set(val) { set(val) {
this.$store.commit("patient/update_selected_generatepasswordby", val) this.$store.commit("patient/update_selected_generatepasswordby", val)
@@ -1458,10 +1475,11 @@ module.exports = {
// } // }
// this.$store.dispatch("patient/savesetup",prm) // this.$store.dispatch("patient/savesetup",prm)
var prm = { var prm = {
Mgm_McuGeneratePasswordBY: this.selected_generatepasswordby.generatepasswordbycode, Mgm_McuGeneratePasswordBY: this.selected_generatepasswordby.generatepasswordbycode,
Mgm_McuReportHasil: this.reportresult, Mcu_ReportUrlTemplateID: this.selected_reportUrlTemplate && this.selected_reportUrlTemplate.id ? this.selected_reportUrlTemplate.id : 0,
arrUserMcu: this.xUserMculists, Mgm_McuReportHasil: this.reportresult,
arrUserMcu: this.xUserMculists,
deleted_usermcus: this.$store.state.patient.deleted_usermcus, deleted_usermcus: this.$store.state.patient.deleted_usermcus,
xid: this.$store.state.patient.xid, xid: this.$store.state.patient.xid,
act: this.$store.state.patient.act, act: this.$store.state.patient.act,

View File

@@ -236,9 +236,12 @@ module.exports = {
Mgm_McuID: row.Mgm_McuID Mgm_McuID: row.Mgm_McuID
}) })
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)
@@ -259,10 +262,14 @@ module.exports = {
this.$store.dispatch("patient/getusermcu", { this.$store.dispatch("patient/getusermcu", {
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_generatepasswordby", { this.$store.commit("patient/update_selected_reportUrlTemplate", {
generatepasswordbycode: row.generatepasswordbycode, id: row.Mcu_ReportUrlTemplateID || 0,
generatepasswordbyname: row.generatepasswordbyname reportName: row.Mcu_ReportUrlTemplateName || ""
})
this.$store.commit("patient/update_selected_generatepasswordby", {
generatepasswordbycode: row.generatepasswordbycode,
generatepasswordbyname: row.generatepasswordbyname
}) })
// this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}]) // this.$store.commit("patient/update_companies", [{id:row.McuOfflinePrepareM_CompanyID,name:row.M_CompanyName}])
@@ -325,10 +332,12 @@ module.exports = {
this.$store.commit("patient/update_inp_Mgm_McuUserEmail", "") this.$store.commit("patient/update_inp_Mgm_McuUserEmail", "")
this.$store.commit("patient/update_selected_branch", {}) this.$store.commit("patient/update_selected_branch", {})
this.$store.commit("patient/update_selected_tpriceheaderformCb", {}) this.$store.commit("patient/update_selected_tpriceheaderformCb", {})
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
// prm.search = this.search_mgmmcu // prm.search = this.search_mgmmcu
@@ -652,4 +661,4 @@ module.exports = {
}; };
} }
} }
</script> </script>

View File

@@ -157,20 +157,28 @@ export default {
selected_cover: {code: 'DFLT', name: 'Cover Default'}, selected_cover: {code: 'DFLT', name: 'Cover Default'},
backgrounds: [], backgrounds: [],
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: {},
// cpone reportUrlTemplates: [],
}, selected_reportUrlTemplate: {},
mutations: { // cpone
},
mutations: {
update_multitemplates(state, val) { update_multitemplates(state, val) {
state.multitemplates = val state.multitemplates = val
}, },
update_selected_multitemplates(state, val) { update_selected_multitemplates(state, val) {
state.selected_multitemplates = val state.selected_multitemplates = val
}, },
update_covers(state, val) { update_reportUrlTemplates(state, val) {
state.covers = val state.reportUrlTemplates = val
}, },
update_selected_reportUrlTemplate(state, val) {
state.selected_reportUrlTemplate = val
},
update_covers(state, val) {
state.covers = val
},
update_backgrounds(state, val) { update_backgrounds(state, val) {
state.backgrounds = val state.backgrounds = val
}, },
@@ -850,7 +858,7 @@ export default {
} }
}, },
async getTemplateFisikMapping(context) { async getTemplateFisikMapping(context) {
context.commit("update_search_patient", 1) context.commit("update_search_patient", 1)
try { try {
var prm = { token: one_token() } var prm = { token: one_token() }
@@ -867,7 +875,27 @@ export default {
} catch (e) { } catch (e) {
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)
@@ -964,9 +992,10 @@ export default {
context.commit("update_userMcuLists", []) context.commit("update_userMcuLists", [])
context.commit("update_inp_Mgm_McuUserEmail", "") context.commit("update_inp_Mgm_McuUserEmail", "")
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_inp_Mgm_McuLowBackPainTampilSemua", false) context.commit("update_selected_reportUrlTemplate", {})
context.commit("update_inp_Mgm_McuLowBackPainTampilSemua", false)
// context.commit("update_total_patient_test", 0) // context.commit("update_total_patient_test", 0)
if (context.state.act === 'new') if (context.state.act === 'new')
@@ -1009,9 +1038,10 @@ export default {
context.commit("update_inp_Mgm_McuTotalParticipant", 0) context.commit("update_inp_Mgm_McuTotalParticipant", 0)
context.commit("update_inp_Mgm_McuPicName", "") context.commit("update_inp_Mgm_McuPicName", "")
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_current_page_packet", 1) context.commit("update_selected_reportUrlTemplate", {})
// context.commit("update_current_page_packet", 1)
// context.commit("update_total_patient_packet", 0) // context.commit("update_total_patient_packet", 0)
} }
} catch (e) { } catch (e) {
@@ -1450,4 +1480,4 @@ export default {
} }
}, },
} }
} }