sakura 11 сар өмнө
parent
commit
d12ee70755

+ 2 - 2
.env

@@ -1,5 +1,5 @@
-VITE_API_URL=http://192.168.8.110:9998
+VITE_API_URL=https://api.raycos.net
 #线下地址
 #http://192.168.8.110:9998
 #线上地址
-#https://api.raycos.net
+#https://api.raycos.net

+ 3 - 3
src/api/login.ts

@@ -38,9 +38,9 @@ export function loginByFranchise(params) {
  * 退出账户
  * @returns {*}
  */
-export function logout() {
-    return request({
-        url: `admin/systems/admin-users/logout?uid=${Storage.getItem('admin_uid')}`,
+export function logout(uid) {
+    return request({/* Storage.getItem('admin_uid') */
+        url: `admin/systems/admin-users/logout?uid=${uid}`,
         method: 'post'
     })
 }

+ 1 - 0
src/assets/images/payment.svg

@@ -0,0 +1 @@
+<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1722310054363" class="icon" viewBox="0 0 1144 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6354" width="17.875" height="16" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M0 125.436973q0-49.509866 38.038433-87.458443Q76.016962 0 125.616683 0h886.864561q49.59972 0 87.608201 37.97853Q1138.157829 75.927108 1138.157829 125.436973v767.477796q0 49.509866-38.038432 87.458443Q1062.140867 1018.351742 1012.541147 1018.351742H125.646634q-50.019041 0-87.458444-34.83362Q0 947.965666 0 898.815218V125.466925z m59.903044 0v773.348294q0 23.152526 19.168974 40.973682 20.157374 18.779604 46.574616 18.779604h886.864561q24.79986 0 45.25675-20.456889 20.486841-20.426938 20.486841-45.166895v-213.254836h-258.781149q-86.350237 0-132.415678-54.212254-38.337948-45.106992-38.337948-116.211905 0-71.25467 38.337948-116.361662 46.065441-54.212255 132.385727-54.212255H1078.254786V125.436973q0-24.739957-20.486841-45.166895-20.486841-20.456889-45.226798-20.456889H125.616683q-24.79986 0-45.25675 20.456889Q59.903044 100.697016 59.903044 125.436973z m1018.231936 273.038073H819.473637q-58.64508 0-86.739607 33.06648-24.110975 28.364091-24.110975 77.664297 0 49.270253 24.110975 77.574441 28.124479 33.06648 86.739607 33.06648h258.661343v-221.371698z" fill="#8a8a8a" p-id="6355"></path></svg>

+ 120 - 8
src/components/layout/Header.vue

@@ -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>

+ 11 - 3
src/locales/en.json

@@ -8,7 +8,7 @@
   "goodsInventory": "Inventory Check",
   "goodsInventoryLoss": "Inventory Loss",
   "goodsUnderstock": "Transfer List",
-  "configMsg": "Message Configuration", 
+  "configMsg": "Message Configuration",
 
     "setting": "System Management",
     "companyList": "Company List",
@@ -74,7 +74,7 @@
     "del_success": "Deleted Successfully",
     "form_erroe": "Form Filling Error, Please Check!",
     "search_placeholde": "Please Enter Keywords to Search",
-    
+
     "warechouse": "Warehouse",
     "warechouse_sn": "Warehouse Number",
     "warechouse_name": "Warehouse Name",
@@ -173,12 +173,20 @@
     "brand": "Brand",
     "weight": "Weight",
     "consistent": "Cannot Be Consistent",
+    "setPayment": "Set Payment Information",
+    "payinfo": "This payment method is a partner collection model. Merchants need to register their own WeChat mchid and bind with the partner. During the binding period, the partner and the merchant can negotiate service fees, or choose not to use a commission. Please communicate carefully with customer service personnel before filling out.",
+    "payment_type": "Payment Method",
+    "ali_private_key": "Ali Private Key",
+    "ali_public_key": "Ali Public Key",
+    "wx_sub_mch_id": "WeChat Store ID",
+    "logout_commit": "Are you sure you want to log out?",
+    "payment_success": "Setup Successful",
 
     "goods_tips":"The item is out of stock!",
     "calendar": "Calendar",
     "tabs": "Tabs",
     "error": "Error",
-    
+
     "info": "Personal Information",
     "edit_password": "Change Password",
     "logout": "Log Out",

+ 11 - 3
src/locales/zh.json

@@ -8,7 +8,7 @@
     "goodsInventory":"库存盘点",
     "goodsInventoryLoss":"库存报损",
     "goodsUnderstock":"调拨列表",
-    "configMsg":"消息配置",   
+    "configMsg":"消息配置",
 
     "setting":"系统管理",
     "companyList":"公司列表",
@@ -74,7 +74,7 @@
     "del_success":"删除成功",
     "form_erroe":"表单填写有误,请核对!",
     "search_placeholde":"请输入关键字搜索",
-    
+
     "warechouse":"仓库",
     "warechouse_sn":"仓库编号",
     "warechouse_name":"仓库名称",
@@ -202,7 +202,15 @@
     "brand":"品牌",
     "weight":"重量",
     "consistent":"不能一致",
-    
+    "setPayment":"设置收款信息",
+    "payinfo":"此支付方式为或作伙伴代收模式。需要商家自己注册微信的mchid,和合作伙伴进行绑定,绑定期间合作伙伴和商家可协商服务费,也可以不用佣金。请商家自行和客服人员沟通后谨慎填写",
+    "payment_type":"收款方式",
+    "ali_private_key":"阿里私钥",
+    "ali_public_key":"阿里公钥",
+    "wx_sub_mch_id":"微信店铺id",
+    "logout_commit":"确定退出吗",
+    "payment_success":"设置成功",
+
 
     "tabs": "标签",
     "error": "错误",

+ 2 - 1
src/stores/modules/user.js

@@ -107,8 +107,9 @@ export const actions = {
    * @returns {Promise<any>}
    */
   logoutAction({ dispatch }) {
+    const uid=JSON.parse(JSON.parse(localStorage.getItem('admin_user')).data).uid
     return new Promise((resolve, reject) => {
-      API_Login.logout().then(() => {
+      API_Login.logout(uid).then(() => {
         dispatch('fedLogoutAction')
         resolve()
       }).catch(reject)

+ 2 - 2
src/views/stock/goodsTransfer.vue

@@ -54,7 +54,7 @@
           </template>
         </el-table-column>
         <el-table-column prop="goods_unit" :label="$t('goods_unit')" />
-        <el-table-column prop="actual_stock" :label="$t('goods_unit')">
+        <el-table-column prop="actual_stock" :label="$t('actual_stock')">
           <template #default="scope">
             <span :style="Number(scope.row.actual_stock) < Number(scope.row.warning_stock) ? 'color:red' : ''">{{ scope.row.actual_stock }}</span>
           </template>
@@ -308,4 +308,4 @@ watch(route, () => {
   padding: 10px 20px;
 }
 </style>
- -->
+ -->