Handy_Cao 2 年之前
父节点
当前提交
4b5362684c

+ 91 - 0
src/packages/pc/views/account/sign/components/sign/index.vue

@@ -0,0 +1,91 @@
+<!-- 账户管理-签约账号管理-签约 -->
+<template>
+    <app-drawer :title="bankInfo ? '修改签约账户' : '添加签约账户'" :width="460" v-model:show="show" :loading="loading"
+        :refresh="refresh">
+        <el-form ref="formRef" class="el-form--vertical" label-width="100px" :model="bankInfo" :rules="formRules">
+            <el-form-item label="开户银行" prop="OpenBankAccId">
+                <el-select v-model="formData.OpenBankAccId">
+                    <el-option :label="item.bankname" :value="item.bankid" v-for="(item, index) in banklist"
+                        :key="index" />
+                </el-select>
+            </el-form-item>
+            <el-form-item label="银行卡号" prop="BankAccountNo">
+                <el-input name="BankAccountNo" placeholder="银行卡账户名" v-model="formData.BankAccountNo" :rules="formRules.BankAccountNo"/>
+            </el-form-item>
+            <el-form-item label="姓名" prop="AccountName">
+                <el-input name="AccountName" placeholder="银行卡账户名" v-model="formData.AccountName" :rules="formRules.AccountName"/>
+            </el-form-item>
+            <el-form-item label="支行名称" prop="BranchBankName">
+                <el-input name="BranchBankName" placeholder="请输入银行卡支行名称" v-model="formData.OpenBankName" :rules="formRules.OpenBankName"/>
+            </el-form-item>
+        </el-form>
+        <template #footer>
+            <el-button type="info" @click="onCancel(false)" plain>取消</el-button>
+            <el-button type="primary" @click="formSubmit">{{ bankInfo ? '修改' : '提交' }}</el-button>
+        </template>
+    </app-drawer>
+</template>
+
+<script lang="ts" setup>
+import { ref, PropType } from 'vue'
+import { ElMessage } from 'element-plus'
+import type { FormInstance, FormRules } from 'element-plus'
+import { useDoBankSign } from '@/business/bank'
+import AppDrawer from '@pc/components/base/drawer/index.vue'
+import { validateRules } from '@/constants/regex'
+
+defineProps({
+    selectedRow: {
+        type: Object as PropType<Model.BankAccountSignRsp>,
+        required: true
+    }
+})
+
+const formRules: FormRules = {
+    OpenBankAccId: [{
+        message: '请选择银行信息',
+        validator: () => {
+            return !!formData.OpenBankAccId
+        }
+    }],
+    BankAccountNo: [{
+        required: true,
+        message: '请输入银行卡账号',
+        validator: (val) => {
+            if (validateRules.bankcardno.validate(val)) {
+                return true
+            }
+            return validateRules.bankcardno.message
+        }
+    }],
+    BankAccountName: [{
+        required: true,
+        message: '请输入银行卡账户名',
+    }],
+    OpenBankName: [{
+        required: true,
+        message: '请输入银行卡支行名称'
+    }],
+}
+
+const { formData, onSubmit, banklist, bankInfo } = useDoBankSign()
+
+const show = ref(true)
+const refresh = ref(false)
+const formRef = ref<FormInstance>()
+
+const onCancel = (isRefresh = false) => {
+    show.value = false
+    refresh.value = isRefresh
+}
+
+const formSubmit = () => {
+    onSubmit().then(() => {
+        ElMessage.success(bankInfo ? '签约信息修改成功' : '签约提交成功,请耐心等待审核。')
+        onCancel(true)
+    }).catch((err) => {
+        ElMessage.error('提交失败:' + err)
+    })
+}
+
+</script>

+ 1 - 0
src/packages/pc/views/account/sign/index.vue

@@ -41,6 +41,7 @@ import AppFilter from '@pc/components/base/table-filter/index.vue'
 
 const componentMap = new Map<string, unknown>([
     ['cancel', defineAsyncComponent(() => import('./components/cancel/index.vue'))],
+    ['sign', defineAsyncComponent(() => import('./components/sign/index.vue'))],
 ])
 
 const { rowKey, expandKeys, rowClick, selectedRow } = useComposeTable<Model.BankAccountSignRsp>({ rowKey: 'applyexchticket' })

+ 1 - 1
src/packages/pc/views/footer/goods/position/components/transfer/index.vue

@@ -37,8 +37,8 @@
             </el-form-item>
         </el-form>
         <template #footer>
+            <el-button type="info" @click="onCancel(false)" plain>取消</el-button>
             <el-button type="primary" @click="onCloseSumit">提交</el-button>
-            <el-button type="info" @click="onCancel(false)">取消</el-button>
         </template>
     </app-drawer>
 </template>

+ 1 - 1
src/packages/pc/views/footer/spot/position/components/listing/index.vue

@@ -26,8 +26,8 @@
             </el-form-item>
         </el-form>
         <template #footer>
+            <el-button type="info" @click="onCancel(false)" plain>取消</el-button>
             <el-button type="primary" @click="formSubmit">提交</el-button>
-            <el-button type="danger" @click="onCancel(false)">取消</el-button>
         </template>
     </app-drawer>
 </template>

+ 1 - 1
src/packages/pc/views/footer/spot/position/components/pickup/index.vue

@@ -75,8 +75,8 @@
             </el-form-item>
         </el-form>
         <template #footer>
+            <el-button type="info" @click="onCancel(false)" plain>取消</el-button>
             <el-button type="primary" @click="onSubmit">提货</el-button>
-            <el-button @click="onCancel(false)" plain>取消</el-button>
         </template>
     </app-drawer>
 </template>