|
@@ -226,6 +226,13 @@
|
|
|
{{ $t('info') }}
|
|
|
</a>
|
|
|
</li>
|
|
|
+ <li v-if="store.state.user.user.uid!=='8'||store.state.user.user.username=='admin'">
|
|
|
+ <a href="javascript:;" class="dark:hover:text-white" @click="setPayment">
|
|
|
+ <img src="@/assets/images/payment.svg" class="mr-2" alt="">
|
|
|
+ <!-- <icon-user class="w-4.5 h-4.5 ltr:mr-2 rtl:ml-2 shrink-0" /> -->
|
|
|
+ {{$t('setPayment') }}
|
|
|
+ </a>
|
|
|
+ </li>
|
|
|
<li>
|
|
|
<a href="javascript:;" class="dark:hover:text-white" @click="editPassword">
|
|
|
<icon-lock-dots class="w-4.5 h-4.5 ltr:mr-2 rtl:ml-2 shrink-0" />
|
|
@@ -303,7 +310,7 @@
|
|
|
<li>
|
|
|
<router-link to="/goods/SKUlist">{{ $t('SKUList') }}</router-link>
|
|
|
</li>
|
|
|
- <!-- <li>
|
|
|
+ <!-- <li>
|
|
|
<router-link to="/apps/mailbox">{{ $t('mailbox') }}</router-link>
|
|
|
</li>
|
|
|
<li>
|
|
@@ -373,7 +380,7 @@
|
|
|
<li>
|
|
|
<router-link to="/setting/systemLog">{{ $t('systemLog') }}</router-link>
|
|
|
</li>
|
|
|
- <!-- <li>
|
|
|
+ <!-- <li>
|
|
|
<router-link to="/components/countdown">{{ $t('countdown') }}</router-link>
|
|
|
</li>
|
|
|
<li>
|
|
@@ -774,6 +781,62 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
</header>
|
|
|
+ <el-dialog
|
|
|
+ :title="$t('setPayment')"
|
|
|
+ v-model="dialogVisible"
|
|
|
+ @open="handleDialogOpen"
|
|
|
+ width="40%"
|
|
|
+ :modal-append-to-body="false"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :close-on-press-escape="false"
|
|
|
+ >
|
|
|
+ <div style="font-size: 12px;text-align: center;" v-if="PaymentForm.type == 'WX'">
|
|
|
+ <span>tips:</span
|
|
|
+ ><span class="center"
|
|
|
+ >{{$t('payinfo')}}</span
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <el-form :model="PaymentForm" :rules="PaymentRules" ref="PaymentFormRef" label-width="160px">
|
|
|
+ <el-form-item :label="$t('payment_type')+':'" prop="sn">
|
|
|
+ <el-select v-model="PaymentForm.type">
|
|
|
+ <el-option label="微信" value="WX" />
|
|
|
+ <el-option label="支付宝" value="Ali" />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="AppId" prop="ali_app_id" v-if="PaymentForm.type == 'Ali'">
|
|
|
+ <el-input v-model="PaymentForm.ali_app_id" :minlength="2" :maxlength="20" clearable placeholder="请输入"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('ali_private_key')+':'" prop="ali_app_private_key" v-if="PaymentForm.type == 'Ali'">
|
|
|
+ <el-input
|
|
|
+ v-model="PaymentForm.ali_app_private_key"
|
|
|
+ :minlength="2"
|
|
|
+ :maxlength="20"
|
|
|
+ clearable
|
|
|
+ type="textarea"
|
|
|
+ :placeholder="$t('place')+$t('ali_private_key')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('ali_public_key')+':'" prop="ali_alipay_public_key" v-if="PaymentForm.type == 'Ali'">
|
|
|
+ <el-input
|
|
|
+ v-model="PaymentForm.ali_alipay_public_key"
|
|
|
+ type="textarea"
|
|
|
+ :minlength="2"
|
|
|
+ :maxlength="20"
|
|
|
+ clearable
|
|
|
+ :placeholder="$t('place')+$t('ali_public_key')"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t('wx_sub_mch_id')+':'" prop="wx_sub_mch_id" v-if="PaymentForm.type == 'WX'">
|
|
|
+ <el-input v-model="PaymentForm.wx_sub_mch_id" :placeholder="$t('place')+$t('wx_sub_mch_id')"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialogVisible = false">{{ $t('cancel') }}</el-button>
|
|
|
+ <el-button type="primary" @click="submitPaymentForm">{{ $t('submit') }}</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
@@ -796,10 +859,10 @@ import IconMoon from '@/components/icon/icon-moon.vue';
|
|
|
import IconLaptop from '@/components/icon/icon-laptop.vue';
|
|
|
import IconMailDot from '@/components/icon/icon-mail-dot.vue';
|
|
|
import IconArrowLeft from '@/components/icon/icon-arrow-left.vue';
|
|
|
-import IconInfoCircle from '@/components/icon/icon-info-circle.vue';
|
|
|
+/* import IconInfoCircle from '@/components/icon/icon-info-circle.vue'; */
|
|
|
import IconBellBing from '@/components/icon/icon-bell-bing.vue';
|
|
|
import IconUser from '@/components/icon/icon-user.vue';
|
|
|
-import IconMail from '@/components/icon/icon-mail.vue';
|
|
|
+/* import IconMail from '@/components/icon/icon-mail.vue'; */
|
|
|
import IconLockDots from '@/components/icon/icon-lock-dots.vue';
|
|
|
import IconLogout from '@/components/icon/icon-logout.vue'; /* */
|
|
|
import IconMenuDashboard from '@/components/icon/menu/icon-menu-dashboard.vue';
|
|
@@ -811,8 +874,11 @@ import IconMenuDatatables from '@/components/icon/menu/icon-menu-datatables.vue'
|
|
|
import IconMenuForms from '@/components/icon/menu/icon-menu-forms.vue';
|
|
|
import IconMenuPages from '@/components/icon/menu/icon-menu-pages.vue';
|
|
|
import IconMenuMore from '@/components/icon/menu/icon-menu-more.vue';
|
|
|
-import { ElMessageBox } from 'element-plus';
|
|
|
+import { ElMessageBox, ElMessage } from 'element-plus';
|
|
|
import * as API_Company from '@/api/company';
|
|
|
+import * as API_Auth from '@/api/auth';
|
|
|
+
|
|
|
+const { t } = useI18n();
|
|
|
//ElMessageBox
|
|
|
const store = useStore();
|
|
|
const route = useRoute();
|
|
@@ -901,6 +967,25 @@ watch(route, (to, from) => {
|
|
|
setActiveDropdown();
|
|
|
});
|
|
|
|
|
|
+/* 支付信息表单 */
|
|
|
+const dialogVisible = ref(false);
|
|
|
+const PaymentForm = ref<any>({
|
|
|
+ type: 'Ali',
|
|
|
+ ali_app_id: '',
|
|
|
+ ali_app_private_key: '',
|
|
|
+ ali_alipay_public_key: '',
|
|
|
+ wx_sub_mch_id: '',
|
|
|
+});
|
|
|
+
|
|
|
+const PaymentRules = ref<any>({
|
|
|
+ ali_app_id: [{ required: true, message: t('submit')+'Appid', trigger: 'blur' }],
|
|
|
+ ali_app_private_key: [{ required: true, message: t('submit')+t('ali_private_key'), trigger: 'blur' }],
|
|
|
+ ali_alipay_public_key: [{ required: true, message: t('submit')+t('ali_public_key'), trigger: 'blur' }],
|
|
|
+ wx_sub_mch_id: [{ required: true, message: t('submit')+t('wx_sub_mch_id'), trigger: 'blur' }],
|
|
|
+});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
const setActiveDropdown = () => {
|
|
|
const selector = document.querySelector('ul.horizontal-menu a[href="' + window.location.pathname + '"]');
|
|
|
if (selector) {
|
|
@@ -955,9 +1040,9 @@ const toggleTheme = (theme) => {
|
|
|
};
|
|
|
const closes = () => {};
|
|
|
const handleLogoutClick = () => {
|
|
|
- ElMessageBox.confirm('确定退出吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
+ ElMessageBox.confirm(t('logout_commit')+'?', t('prompt'), {
|
|
|
+ confirmButtonText: t('submit'),
|
|
|
+ cancelButtonText: t('cancel'),
|
|
|
type: 'warning',
|
|
|
})
|
|
|
.then(() => {
|
|
@@ -976,4 +1061,31 @@ const getBranch = (value) => {
|
|
|
name: 'dashboard',
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+/* 设置收款信息 */
|
|
|
+const setPayment = () => {
|
|
|
+ dialogVisible.value = true;
|
|
|
+};
|
|
|
+
|
|
|
+/* 提交收款信息 */
|
|
|
+const PaymentFormRef = ref();
|
|
|
+const submitPaymentForm = () => {
|
|
|
+ PaymentFormRef.value.validate((valid: boolean) => {
|
|
|
+ if (valid) {
|
|
|
+ API_Auth.editAdministrator(store.state.user.user.company_vo.id, PaymentForm.value).then((res) => {
|
|
|
+ PaymentForm.value={}
|
|
|
+ ElMessage.success(t('payment_success'));
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ ElMessage.error(t('form_erroe'));
|
|
|
+ /* store.dispatch('showMessage', { message: '表单填写有误,请核对!', type: 'error' }); */
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+const handleDialogOpen = () => {
|
|
|
+ setTimeout(() => {
|
|
|
+ PaymentFormRef.value.clearValidate();
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|