Flatten nested repos

This commit is contained in:
sas.fajri
2026-04-27 10:13:31 +07:00
parent 01c2963a43
commit 8347aef8f4
17935 changed files with 5015229 additions and 3 deletions

View File

@@ -0,0 +1,154 @@
const URL = "/one-api/cpone/mcuoffline/";
// cpone start
export async function xdeletev0(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/deletev0',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 getGroupPemeriksaan(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/getGroupPemeriksaan',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 getPacketById(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/getPaketById',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 savesetupv0(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/savesetupv0',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 getTTestByTPriceHeaderCurrent(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/getTTestByTPriceHeaderCurrent',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 getTPriceHeaderCurrent(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/getTPriceHeaderCurrent',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 getTPriceHeader(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/getTPriceHeader',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 searchv0(prm) {
try {
var resp = await axios.post(URL + 'packet/packetcponev2/searchv0',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
};
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,94 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>CPOne</title>
<link rel="stylesheet" href="../../../libs/vendor/css/google-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/icomoon-fonts.css">
<link rel="stylesheet" href="../../../libs/vendor/css/vuetify.min.css">
</head>
<body>
<div v-cloak id="app">
<v-app id="smartApp" >
<one-navbar></one-navbar>
<v-content style="background:#F5E8DF!important" >
<v-container fluid fill-height class="pl-1 pr-1 pt-2 pb-2">
<v-layout row wrap >
<v-flex xs12 class="left" fill-height pa-1>
<one-md-packet-list></one-md-packet-list>
</v-flex>
<!-- <v-flex xs8 class="right" fill-height pa-1>
<one-md-patient-detail></one-md-patient-detail>
</v-flex> -->
</v-layout>
</v-container>
</v-content>
<one-footer> </one-footer>
</v-app>
</div>
<!-- Vendor -->
<script src="../../../libs/vendor/moment.min.js"></script>
<script src="../../../libs/vendor/numeral.min.js"></script>
<script src="../../../libs/vendor/moment-locale-id.js"></script>
<script src="../../../libs/vendor/lodash.js"></script>
<script src="../../../libs/vendor/axios.min.js"></script>
<script src="../../../libs/vendor/vue.js"></script>
<script src="../../../libs/vendor/vuex.js"></script>
<script src="../../../libs/vendor/vuetify.js"></script>
<script src="../../../libs/vendor/httpVueLoader.js"></script>
<script src="../../../libs/one_global.js"></script>
<!-- App Script -->
<?php
$ts = "?ts=" . Date("ymdhis");
?>
<script type="module">
window.calculate_age = function (inp_dob) {
var now = moment(new Date())
var dob = moment(new Date(inp_dob))
var year = now.diff(dob,'years')
dob.add(year,'years')
var month = now.diff(dob,'months')
dob.add(month,'months')
var day = now.diff(dob,'days')
if (isNaN(year)) return ''
return `${year} tahun ${month} bulan ${day} hari`
}
import { store } from './store.js<?php echo $ts ?>';
//for testing
window.store = store;
new Vue({
store,
el: '#app',
methods: {
tab_selected : function(tab) {
return this.$store.state.tab_selected == tab
}
},
components: {
'one-navbar': httpVueLoader('../../../apps/components/oneNavbarComponent.vue'),
'one-footer': httpVueLoader('../../../apps/components/oneFooter.vue'),
'one-md-packet-list': httpVueLoader('./components/oneMdPacketList.vue'),
// 'one-md-patient-detail': httpVueLoader('./components/oneMdPatientDetail.vue'),
// 'one-md-patient-address': httpVueLoader('./components/oneMdPatientAddress.vue')
}
})
</script>
<style>
[v-cloak] {
display: none
}
.left {
}
.right {
}
</style>
</body>
</html>

View File

@@ -0,0 +1,500 @@
// 1 => LOADING
// 2 => DONE
// 3 => ERROR
import * as api from "../api/packet.js"
export default {
namespaced: true,
state: {
dialog_success: false,
msg_success: "",
open_alert_confirmation: false,
no_save: 0,
open_alert_confirmation: false,
search_tpacket:'',
tpriceheaderCb:[],
selected_tpriceheaderCb:{},
search_packet:0,
total_packets:0,
search_status: 0,
search_error_message:'',
tpackets:[],
total_tpacket:0,
current_page:1,
selected_packet: {},
dialog_add:false,
act: 'edit',
xid:-1,
// form
inp_T_PacketName:'',
inp_T_PacketNameEdit:'',
search_kode:'',
search_nama:'',
tpriceheaderformCb:[],
tpriceheaderformeditCb:[],
selected_tpriceheaderformCb:{},
selected_tpriceheaderformeditCb:{},
total_prices:0,
current_page_tprice:1,
tprices:[],
selected_tprice:{},
selected_tpricedetail:{},
tpricedetails:[],
tpackettypeRb:'PN',
pricepackets:[],
total_tpacketdetails:0,
tpacketdetails:[],
current_page_tpacketdetails:1,
totalTPriceAwal:0,
totalTPricePacket:0,
save_status: 0,
dialog_error:false,
msg_error:'',
dialog_edit:false,
show_inputan_paket:false,
natsubgroupCb:[],
selected_natsubgroupCb:{},
msg_confirmation_delete:'',
dialog_confirmation_delete:false,
start_date:moment(new Date()).format('YYYY-MM-DD'),
end_date:moment(new Date()).format('YYYY-MM-DD'),
},
mutations: {
update_start_date(state, val) {
state.start_date = val
},
update_end_date(state, val) {
state.end_date = val
},
update_dialog_confirmation_delete(state, val) {
state.dialog_confirmation_delete = val
},
update_msg_confirmation_delete(state, val) {
state.msg_confirmation_delete = val
},
update_natsubgroupCb(state, status){
state.natsubgroupCb = status
},
update_selected_natsubgroupCb(state, status){
state.selected_natsubgroupCb = status
},
update_show_inputan_paket(state, val) {
state.show_inputan_paket = val
},
update_msg_error(state, val) {
state.msg_error = val
},
update_dialog_error(state, val){
state.dialog_error = val
},
update_totalTPricePacket(state, val) {
state.totalTPricePacket = val
},
update_totalTPriceAwal(state, val) {
state.totalTPriceAwal = val
},
update_tpacketdetails(state, val) {
state.tpacketdetails = val
},
update_current_page_tpacketdetails(state, val) {
state.current_page_tpacketdetails = val
},
update_total_tpacketdetails(state, val) {
state.total_tpacketdetails = val
},
update_pricepackets(state,status) {
state.pricepackets = status
},
update_tpackettypeRb(state,status) {
state.tpackettypeRb = status
},
update_tpricedetails(state,status) {
state.tpricedetails = status
},
update_selected_tpricedetail(state, val) {
state.selected_tpricedetail = val
},
update_selected_tprice(state, val) {
state.selected_tprice = val
},
update_tprices(state,status) {
state.tprices = status
},
update_current_page_tprice(state, val) {
state.current_page_tprice = val
},
update_total_prices(state, val) {
state.total_prices = val
},
update_tpriceheaderformCb(state, status){
state.tpriceheaderformCb = status
},
update_tpriceheaderformeditCb(state, status){
state.tpriceheaderformeditCb = status
},
update_selected_tpriceheaderformCb(state, status){
state.selected_tpriceheaderformCb = status
},
update_selected_tpriceheaderformeditCb(state, status){
state.selected_tpriceheaderformeditCb = status
},
update_search_kode(state,status) {
state.search_kode = status
},
update_search_nama(state,status) {
state.search_nama = status
},
update_inp_T_PacketName(state, val){
state.inp_T_PacketName = val
},
update_inp_T_PacketNameEdit(state, val){
state.inp_T_PacketNameEdit = val
},
update_xid(state,val){
state.xid = val
},
update_act(state, val) {
state.act = val
},
update_dialog_add(state, val) {
state.dialog_add = val
},
update_dialog_edit(state, val) {
state.dialog_edit = val
},
update_selected_packet(state, val) {
state.selected_packet = val
},
update_tpackets(state,status) {
state.tpackets = status
},
update_total_tpacket(state, val) {
state.total_tpacket = val
},
update_search_error_message(state, val) {
state.search_error_message = val
},
update_search_status(state, val) {
state.search_status = val
},
update_total_packets(state, val) {
state.total_packets = val
},
update_dialog_success(state, val) {
state.dialog_success = val
},
update_msg_success(state, val) {
state.msg_success = val
},
update_open_alert_confirmation(state, val) {
state.open_alert_confirmation = val
},
update_no_save(state, val) {
state.no_save = val
},
update_open_alert_confirmation(state, val) {
state.open_alert_confirmation = val
},
update_search_tpacket(state,status) {
state.search_tpacket = status
},
update_tpriceheaderCb(state, status){
state.tpriceheaderCb = status
},
update_selected_tpriceheaderCb(state, status){
state.selected_tpriceheaderCb = status
},
update_search_packet(state,status) {
state.search_packet = status
},
update_current_page(state, val) {
state.current_page = val
},
update_save_status(state, val) {
state.save_status = val
},
},
actions: {
// delete data
async deletev0(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.xdeletev0(prm)
if (resp.status != "OK") {
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
context.commit("update_last_id", 0)
context.commit("update_dialog_confirmation_delete", false)
context.commit("update_dialog_success", true)
var msg = "Data paket dengan nama " + prm.name + " sudah dihapus dong ..."
context.commit("update_msg_success", msg)
context.commit("update_inp_T_PacketName", "")
context.commit("update_selected_tpriceheaderformCb",{})
context.commit("update_tpackettypeRb",'PN')
context.commit("update_tpacketdetails", [])
context.commit("update_totalTPriceAwal", 0)
context.commit("update_totalTPricePacket", 0)
context.commit("update_search_nama", "")
context.commit("update_search_kode", "")
context.commit("update_tprices", [])
context.commit("update_total_prices", 0)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
// dropdown autocomplete get group pemeriksaan
async getGroupPemeriksaan(context) {
context.commit("update_search_packet", 1)
try {
var prm = {token: one_token()}
let resp = await api.getGroupPemeriksaan(prm)
if (resp.status != "OK") {
context.commit("update_search_packet", 3)
} else {
context.commit("update_search_packet", 2)
let data = {
records: resp.data.records,
}
context.commit("update_natsubgroupCb", resp.data.records)
// context.commit("update_selected_tpriceheaderCb",resp.data.records[0])
}
} catch (e) {
context.commit("update_search_packet", 3)
}
},
// getPacketById
async getPacketById(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.getPacketById(prm)
if (resp.status != "OK") {
context.commit("update_msg_error",resp.message)
context.commit("update_dialog_error",true)
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
console.log("data paket edit ", data.records)
// context.commit("update_tpacketdetails", data.records[0].detailpackets)
context.commit("update_inp_T_PacketName", data.records[0].T_PacketName)
context.commit("update_selected_tpriceheaderformCb",{
T_PriceHeaderID: resp.data.records[0].T_PriceHeaderID,
T_PriceHeaderName: resp.data.records[0].T_PriceHeaderName
})
context.commit("update_tpackettypeRb",resp.data.records[0].T_PacketType)
context.commit("update_tpacketdetails", resp.data.records[0].detailpackets)
context.commit("update_totalTPricePacket", resp.data.records[0].sumhargapaket)
context.commit("update_totalTPriceAwal", resp.data.records[0].sumhargaawal)
context.commit("update_xid", resp.data.records[0].T_PacketID)
context.commit("update_dialog_add", true)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
// save data
async savesetupv0(context, prm) {
context.commit("update_save_status", 1)
try {
prm.token = one_token()
let resp = await api.savesetupv0(prm)
if (resp.status != "OK") {
context.commit("update_msg_error",resp.message)
context.commit("update_dialog_error",true)
context.commit("update_save_status", 3)
} else {
context.commit("update_save_status", 2)
let data = {
records: resp.data.records,
total: resp.data.total
}
// namapacket:this.$store.state.packet.inp_T_PacketName,
// priceheader:this.$store.state.packet.selected_tpriceheaderformCb,
// jenispacket:this.$store.state.packet.tpackettypeRb,
// detailpacket:this.$store.state.packet.tpacketdetails,
// T_PacketOriginalPrice: this.totalTPriceAwal,
// T_PacketPrice: this.totalTPricePacket,
context.commit("update_inp_T_PacketName", "")
context.commit("update_selected_tpriceheaderformCb",{})
context.commit("update_tpackettypeRb",'PN')
context.commit("update_tpacketdetails", [])
context.commit("update_totalTPriceAwal", 0)
context.commit("update_totalTPricePacket", 0)
context.commit("update_search_nama", "")
context.commit("update_search_kode", "")
context.commit("update_tprices", [])
context.commit("update_total_prices", 0)
context.commit("update_selected_natsubgroupCb", {})
if(context.state.act === 'new')
var msg = "Pembuatan paket dengan nama " + resp.data.records.xnumber + " sudah berhasil dong ..."
else
var msg = "Perubahan paket dengan nama " + resp.data.records.xnumber + " sudah berhasil dong ..."
context.commit("update_dialog_add", false)
context.commit("update_msg_error","")
context.commit("update_dialog_error",false)
context.commit("update_dialog_success", true)
context.commit("update_msg_success", msg)
}
} catch (e) {
context.commit("update_save_status", 3)
}
},
// dropdown tpriceheader listing search
async getTPriceHeader(context) {
context.commit("update_search_packet", 1)
try {
var prm = {token: one_token()}
let resp = await api.getTPriceHeader(prm)
if (resp.status != "OK") {
context.commit("update_search_packet", 3)
} else {
context.commit("update_search_packet", 2)
let data = {
records: resp.data.records,
}
context.commit("update_tpriceheaderCb", resp.data.records)
context.commit("update_selected_tpriceheaderCb",resp.data.records[0])
// context.commit("update_selected_tpriceheaderCb",{
// T_PriceHeaderID: "All",
// T_PriceHeaderName: "All",
// T_PriceHeaderStartDate: "",
// T_PriceHeaderEndDate: "",
// T_PriceHeaderIsActive: "",
// T_PriceHeaderUserID: "",
// T_PriceHeaderCreated: "",
// T_PriceHeaderCraetdUserID: "",
// T_PriceHeaderLastUpdated: "",
// T_PriceHeaderLastUpdatedUserID: "",
// T_PriceHeaderDeleted: "",
// T_PriceHeaderDeletedUserID: ""
// })
}
} catch (e) {
context.commit("update_search_packet", 3)
}
},
// dropdown tpriceheader form
async getTPriceHeaderCurrent(context) {
context.commit("update_search_packet", 1)
try {
var prm = {token: one_token()}
let resp = await api.getTPriceHeaderCurrent(prm)
if (resp.status != "OK") {
context.commit("update_search_packet", 3)
} else {
context.commit("update_search_packet", 2)
let data = {
records: resp.data.records,
}
context.commit("update_tpriceheaderformCb", resp.data.records)
// context.commit("update_selected_tpriceheaderCb",resp.data.records[0])
}
} catch (e) {
context.commit("update_search_packet", 3)
}
},
//
async searchTPricev0(context, prm) {
context.commit("update_search_packet", 1)
try {
prm.token = one_token()
let resp = await api.getTTestByTPriceHeaderCurrent(prm)
if (resp.status != "OK") {
context.commit("update_search_packet", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_packet", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_tprices", data.records)
context.commit("update_total_prices", data.total)
context.commit("update_no_save", 0)
if (prm.lastid === -1) {
//context.commit("update_selected_patient", data.records[0])
/*context.dispatch("getaddress", {
id: pat.M_PatientID
})*/
} else {
//context.commit("update_selected_patient", data.records[prm.lastid])
/*context.dispatch("getaddress", {
id: pat.M_PatientID
})*/
}
}
} catch (e) {
context.commit("update_search_packet", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
//
async searchv0(context, prm) {
context.commit("update_search_packet", 1)
try {
prm.token = one_token()
let resp = await api.searchv0(prm)
if (resp.status != "OK") {
context.commit("update_search_packet", 3)
context.commit("update_search_error_message", resp.message)
} else {
context.commit("update_search_packet", 2)
context.commit("update_search_error_message", "")
let data = {
records: resp.data.records,
total: resp.data.total
}
context.commit("update_tpackets", data.records)
context.commit("update_total_packets", data.total)
context.commit("update_no_save", 0)
if (prm.lastid === -1) {
//context.commit("update_selected_patient", data.records[0])
/*context.dispatch("getaddress", {
id: pat.M_PatientID
})*/
} else {
//context.commit("update_selected_patient", data.records[prm.lastid])
/*context.dispatch("getaddress", {
id: pat.M_PatientID
})*/
}
}
} catch (e) {
context.commit("update_search_packet", 3)
context.commit("update_search_error_message", e.message)
console.log(e)
}
},
},
}

View File

@@ -0,0 +1,27 @@
// State
// data ...
// Mutations
//
//
// Actions
import packet from "./modules/packet.js";
import system from "../../../apps/modules/system/system.js";
export const store = new Vuex.Store({
modules: {
packet: packet,
system: system
},
state: {
tab_selected: 'pasien-dokter'
},
mutations: {
change_tab(state, ntab) {
state.tab_selected = ntab
}
},
actions: {
change_tab(context, ntab) {
context.commit('change_tab', ntab)
}
}
});