work in ofiice - has bug in discount

pull/1/head
Saeid 5 years ago
parent c972983693
commit d245855104

@ -1,6 +1,6 @@
{ {
"/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=223aee52028b1e49695f", "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=b5f905ff1ac688651a5b",
"/js/vue/Home/app.js": "/js/vue/Home/app.js?id=467f28f4a10c9a5374d1", "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=1a90d1e9fc805200faab",
"/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=8294dc99fea9ac523715", "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=05cf114c9b8d0aeeeb5c",
"/js/vue/User/app.js": "/js/vue/User/app.js?id=bcf7df987a0272543aee" "/js/vue/User/app.js": "/js/vue/User/app.js?id=ffa76709d0a81fd79236"
} }

@ -7,7 +7,7 @@
</a> </a>
<div class="Name caption"> {{ getAuthUser.name }} </div> <div class="Name caption"> {{ getAuthUser.name }} </div>
<div class="Time"> <div class="Time">
<div class="WM-Font-22 En Bold">{{ timeNow }}</div> <div class="WM-Font-22 En Bold">{{ getCurrentTime }}</div>
<div class="WM-Font-14 Fa FaNum">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div> <div class="WM-Font-14 Fa FaNum">{{ new Date() | moment("dddd jDD jMMMM jYYYY") }}</div>
</div> </div>
<!-- <div class="Notification" dark> <!-- <div class="Notification" dark>
@ -57,6 +57,7 @@ import Tile from "@Global/components/Drawer/Tile";
import Notifications from "@Global/components/Drawer/Notifications"; import Notifications from "@Global/components/Drawer/Notifications";
import Routes from "@Global/utils/common/routes"; import Routes from "@Global/utils/common/routes";
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters } from "vuex";
// import { getTime } from "@Global/utils/date/time";
export default { export default {
data() { data() {
return { return {
@ -79,16 +80,11 @@ export default {
} }
], ],
user: { name: "" }, user: { name: "" },
timeNow: "",
mainHref: Routes.main(), mainHref: Routes.main(),
}; };
}, },
mounted(){ mounted() {
var self = this; let self = this;
self.getTime(new Date())
setInterval(function() {
self.getTime(new Date())
}, 2000);
}, },
components: { components: {
"wm-list-tile": Tile, "wm-list-tile": Tile,
@ -96,20 +92,10 @@ export default {
}, },
computed: { computed: {
...mapGetters("auth", ["getAuthUser"]), ...mapGetters("auth", ["getAuthUser"]),
...mapGetters("common", ["getCurrentTime"]),
}, },
methods: { methods: {
...mapActions("auth", ["logout"]), ...mapActions("auth", ["logout"]),
getTime(date) {
let h = this.addZero(date.getHours());
let m = this.addZero(date.getMinutes());
this.timeNow = h + ":" + m;
},
addZero(i) {
if (i < 10) {
i = "0" + i;
}
return i;
}
} }
}; };
</script> </script>

@ -44,6 +44,7 @@
<script> <script>
import { mapActions, mapGetters } from "vuex"; import { mapActions, mapGetters } from "vuex";
export default { export default {
name: "modal_modal_dialog",
data: () => ({ data: () => ({
defaultMessage: { defaultMessage: {
delete: { delete: {
@ -76,36 +77,30 @@ export default {
} }
}, },
computed: { computed: {
...mapGetters("modal", [ ...mapGetters("modal", ["isModalStack", "getModal", "getDialogType", "getDialogProperties"]),
"getDialogType",
"getDialogProperties",
"isModal"
]),
modal: { modal: {
get() { get() {
return this.isModal("modal/dialog"); return this.isModalStack(this.$options.name);
}, },
set(value) { set(value) {
if (value) { if (!value) {
this.$_openModal("modal/dialog"); this.$_closeModalStack();
} else { }
this.$_closeModal("modal/dialog"); }
} },
}
}
}, },
methods: { methods: {
async confirm() { async confirm() {
if (typeof this.getDialogProperties.success == "function") { if (typeof this.getDialogProperties.success == "function") {
await this.getDialogProperties.success(); await this.getDialogProperties.success();
} }
this.$_closeModal("modal/dialog"); this.$_closeModalStack();
}, },
async cancel() { async cancel() {
if (typeof this.getDialogProperties.close == "function") { if (typeof this.getDialogProperties.close == "function") {
await this.getDialogProperties.close(); await this.getDialogProperties.close();
} }
this.$_closeModal("modal/dialog"); this.$_closeModalStack();
} }
} }
}; };

@ -0,0 +1,66 @@
<template>
<v-dialog v-model="modal" :width="properties.width || '40%'" transition="slide-x-transition">
<v-card class="RTL">
<v-card-title class="red lighten-5" primary-title>
<WM-PartTitle
class="WM-Margin-T-20"
:TitleFa="properties.title || 'عنوان'"
:TitleEn="properties.titleEn || 'title'"
:color="properties.color || 'orange'"
></WM-PartTitle>
</v-card-title>
<v-card-text>
<div
class="WM-Align-R WM-Margin-T-10"
>{{ properties.message || 'پیام'}}</div>
</v-card-text>
<v-divider></v-divider>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn
:color="properties.color || 'orange'"
depressed
dark
@click="$_closeModalStack()"
>
<v-icon dark right>fas fa-trash-alt</v-icon>
متوجه شدم!
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</template>
<script>
import { mapActions, mapGetters } from "vuex";
import axios from 'axios';
import { url } from '@Common/mixins/urls';
export default {
name: "modal_modal_helper",
data: () => ({
properties: {}
}),
computed: {
...mapGetters("modal", ["isModalStack", "getModal"]),
modal: {
get() {
return this.isModalStack(this.$options.name);
},
set(value) {
if (!value) {
this.$_closeModalStack();
}
}
},
},
async created() {
if (this.modal) {
let response = await axios.get(url('helpers', {helper: this.getModal(this.$options.name).slug}));
if (response && response.status == 200) {
this.properties = response.data.data;
}
}
},
};
</script>

@ -15,11 +15,8 @@ const global = {
//Modal //Modal
...mapActions("modal", [ ...mapActions("modal", [
"$_openModal",
"$_closeModal",
"$_openModalCallback",
"$_closeModalCallback",
"$_dialog", "$_dialog",
"$_helper",
"$_openModalStack", "$_openModalStack",
"$_closeModalStack" "$_closeModalStack"
]), ]),

@ -10,7 +10,8 @@ import PageTitle from "@Global/components/Dividers/PageTitle.vue";
import Checkbox from "@Global/components/Inputs/Checkbox.vue"; import Checkbox from "@Global/components/Inputs/Checkbox.vue";
import InfoBlock from "@Global/components/Misc/InfoBlock.vue"; import InfoBlock from "@Global/components/Misc/InfoBlock.vue";
import Breadcrumbs from "@Global/components/Misc/Breadcrumbs"; import Breadcrumbs from "@Global/components/Misc/Breadcrumbs";
import Dialog from "@Global/components/Misc/Dialog.vue"; import Dialog from "@Global/components/Modals/Dialog.vue";
import Helper from "@Global/components/Modals/Helper.vue";
Vue.component("WM-PartTitle", PartTitle); Vue.component("WM-PartTitle", PartTitle);
Vue.component("WM-PageTitle", PageTitle); Vue.component("WM-PageTitle", PageTitle);
@ -18,6 +19,11 @@ Vue.component("WM-Checkbox", Checkbox);
Vue.component("wm-info-block", InfoBlock); Vue.component("wm-info-block", InfoBlock);
Vue.component("wm-breadcrumbs", Breadcrumbs); Vue.component("wm-breadcrumbs", Breadcrumbs);
Vue.component("wm-dialog", Dialog); Vue.component("wm-dialog", Dialog);
Vue.component("wm-helper", Helper);
//setTime
import store from "@Global/store/index";
store.dispatch('common/setCurrentTime');
//jalali => 0.6MB //jalali => 0.6MB
import jalaliMoment from "vue-jalali-moment" import jalaliMoment from "vue-jalali-moment"

@ -0,0 +1,9 @@
import { getTime } from "@Global/utils/date/time";
export default {
setCurrentTime:({ commit }) => {
commit('SET_CURRENT_TIME', getTime());
setInterval(function() {
commit('SET_CURRENT_TIME', getTime());
}, 2000);
},
}

@ -1,4 +1,5 @@
export default { export default {
getCurrentModule: state => state.current_module, getCurrentModule: state => state.current_module,
getCurrentModuleInfo: state => state.current_module_info, getCurrentModuleInfo: state => state.current_module_info,
getCurrentTime: state => state.time_now,
} }

@ -4,5 +4,8 @@ export default {
}, },
SET_CURRENT_MODULE_INFO(state, moduleInfo) { SET_CURRENT_MODULE_INFO(state, moduleInfo) {
state.current_module_info = moduleInfo; state.current_module_info = moduleInfo;
} },
SET_CURRENT_TIME(state, currentTime) {
state.time_now = currentTime;
},
}; };

@ -1,4 +1,5 @@
export default { export default {
time_now: "",
current_module: "", current_module: "",
current_module_info: { current_module_info: {
name: "" name: ""

@ -1,30 +1,4 @@
export default { export default {
$_openModal: ({ rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = true;
} else {
rootState.modal[modalArray[0]] = true;
}
},
$_closeModal: ({ state, rootState }, modal) => {
let modalArray = modal.split("/");
if (modalArray.length == 2) {
rootState[modalArray[0]]['modal'][modalArray[1]] = false;
} else {
rootState.modal[modalArray[0]] = false;
}
state.properties = null;
},
$_openModalCallback ({ dispatch }, data) {
dispatch(data.module + '/openModal' + data.type.charAt(0).toUpperCase() + data.type.slice(1), data, { root: true });
},
$_closeModalCallback: ({ dispatch }, data) => {
dispatch(data.module + '/closeModal' + data.type.charAt(0).toUpperCase() + data.type.slice(1) , data, { root: true });
},
$_openModalStack({ state, rootState }, data) { // data: {name, rel, model, form_data, data, modal_pop_data, type} $_openModalStack({ state, rootState }, data) { // data: {name, rel, model, form_data, data, modal_pop_data, type}
data.name = 'modal_' + data.name; data.name = 'modal_' + data.name;
@ -36,6 +10,7 @@ export default {
rootState[module[1]].current_model = data.model ? data.model : {}; rootState[module[1]].current_model = data.model ? data.model : {};
rootState[module[1]].page_type = data.page_type ? data.page_type : 'modal'; rootState[module[1]].page_type = data.page_type ? data.page_type : 'modal';
} }
}, },
$_closeModalStack({ state, rootState }) { $_closeModalStack({ state, rootState }) {
if (state.modals.length) { if (state.modals.length) {
@ -51,9 +26,18 @@ export default {
} }
}, },
$_dialog:({state, commit}, properties) => { $_dialog:({commit, dispatch}, properties) => {
state.modal.dialog = true; properties['name'] = 'modal_dialog';
dispatch('$_openModalStack', properties);
commit('SET_DIALOG_TYPE', properties.type); commit('SET_DIALOG_TYPE', properties.type);
commit('SET_DIALOG_PROPERTIES', properties); commit('SET_DIALOG_PROPERTIES', properties);
}, },
$_helper:({dispatch}, slug) => {
let data = {};
data['name'] = 'modal_helper';
data['slug'] = slug;
dispatch('$_openModalStack', data);
},
}; };

@ -0,0 +1,14 @@
const getTime = (date = null) => {
date = date ? date : new Date();
let h = addZero(date.getHours());
let m = addZero(date.getMinutes());
return h + ":" + m;
};
const addZero= (i) => {
if (i < 10) {
i = "0" + i;
}
return i;
};
export { getTime };

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> <!-- <link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> -->
<title> Welcome </title> <title> Welcome </title>

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> <!-- <link href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" rel="stylesheet"> -->
<title> Website Management </title> <title> Website Management </title>

Loading…
Cancel
Save