This commit is contained in:
parent
77e05647bb
commit
6a86e5fa99
|
@ -2,4 +2,9 @@ NODE_ENV = 'development'
|
|||
VITE_NOW_TYPE = 'dist'
|
||||
# Base API
|
||||
# VITE_APP_BASE_URL='http://192.168.1.13:8546'
|
||||
|
||||
# VITE_PUSH_URL = 'ws://192.168.1.22:8787'
|
||||
# VITE_APP_BASE_URL = 'http://192.168.1.22:8546'
|
||||
|
||||
VITE_PUSH_URL ='wss://erp.lihaink.cn/pull'
|
||||
VITE_APP_BASE_URL='https://erp.lihaink.cn'
|
||||
|
|
|
@ -50,4 +50,10 @@ export function apiMerchantBindUser(params: any) {
|
|||
return request.post({ url: "/merchat/merchant/bind_user", params });
|
||||
}
|
||||
|
||||
|
||||
// 绑定银行卡
|
||||
export function apiMerchantBindBank(params: any) {
|
||||
return request.post({ url: "/merchat/merchant/bind_bank", params });
|
||||
}
|
||||
|
||||
// /admin?mer_id=506
|
||||
|
|
|
@ -0,0 +1,128 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog v-model="dialogFormVisible" title="绑定银行卡" width="500">
|
||||
<el-form :model="form" :rules="rulus" ref="formRef">
|
||||
<el-form-item label="商户名称" :label-width="formLabelWidth">
|
||||
<el-input v-model="mer_name" readonly autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户类型" :label-width="formLabelWidth">
|
||||
<el-radio-group v-model="form.is_own">
|
||||
<el-radio :label="0">个人</el-radio>
|
||||
<el-radio :label="1">对公</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="账户名称" :label-width="formLabelWidth" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入账户名称" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="银行" :label-width="formLabelWidth" prop="bank_id">
|
||||
<el-select v-model="form.bank_id" placeholder="请选择银行">
|
||||
<el-option v-for="(item, index) in bankList" :key="index" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="银行卡号" :label-width="formLabelWidth" prop="bank_code">
|
||||
<el-input v-model="form.bank_code" placeholder="请输入银行卡号" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开户网点" :label-width="formLabelWidth" prop="bank_branch">
|
||||
<el-input v-model="form.bank_branch" placeholder="请输入开户网点" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" :label-width="formLabelWidth" prop="id_card">
|
||||
<el-input v-model="form.id_card" placeholder="请输入身份证号" autocomplete="off" />
|
||||
</el-form-item>
|
||||
<el-form-item label="证明图片" :label-width="formLabelWidth" prop="financial_img">
|
||||
<material-picker v-model="form.financial_img" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogFormVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="submit">
|
||||
确认
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref } from 'vue'
|
||||
import { apiBankLists } from "@/api/bank"
|
||||
import { apiMerchantBindBank } from "@/api/merchant"
|
||||
|
||||
const dialogFormVisible = ref(false)
|
||||
const formLabelWidth = '140px'
|
||||
|
||||
const mer_name = ref('');
|
||||
const form = reactive({
|
||||
mer_id: '', //商户id
|
||||
name: '', //账户名称
|
||||
bank_id: '', // 开户行id
|
||||
bank_code: '', // 银行账号
|
||||
bank_branch: '', // 开户网点
|
||||
id_card: '', // 身份证号
|
||||
financial_img: '', //证明图片
|
||||
is_own: 0, //0个人,1对公
|
||||
})
|
||||
|
||||
const rulus = reactive({
|
||||
name: [
|
||||
{ required: true, message: '请输入账户名称', trigger: 'blur' },
|
||||
],
|
||||
bank_id: [
|
||||
{ required: true, message: '请选择银行', trigger: 'change' }
|
||||
],
|
||||
bank_code: [
|
||||
{ required: true, message: '请输入银行卡号', trigger: 'blur' }
|
||||
],
|
||||
|
||||
bank_branch: [
|
||||
{ required: true, message: '请输入开户网点', trigger: 'blur' }
|
||||
],
|
||||
id_card: [
|
||||
{ required: true, message: '请输入身份证号', trigger: 'blur' }
|
||||
],
|
||||
financial_img: [
|
||||
{ required: true, message: '请上传证明图片', trigger: 'change' }
|
||||
]
|
||||
})
|
||||
const formRef = ref(null);
|
||||
const submit = ()=>{
|
||||
formRef.value.validate((valid:any) => {
|
||||
if (valid) {
|
||||
apiMerchantBindBank(form).then(res=>{
|
||||
emit('onClose');
|
||||
close();
|
||||
})
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const emit = defineEmits(['onClose']);
|
||||
|
||||
const open = (e:any)=>{
|
||||
form.mer_id = e.mer_id;
|
||||
mer_name.value = e.mer_name;
|
||||
dialogFormVisible.value = true
|
||||
}
|
||||
const close = ()=>{
|
||||
dialogFormVisible.value = false
|
||||
}
|
||||
|
||||
const bankList = ref([]);
|
||||
const getBankLists = ()=>{
|
||||
apiBankLists({
|
||||
page_no: 1,
|
||||
page_size: 999
|
||||
}).then(res=>{
|
||||
bankList.value = res.lists;
|
||||
})
|
||||
}
|
||||
getBankLists();
|
||||
|
||||
defineExpose({
|
||||
open,
|
||||
close
|
||||
})
|
||||
</script>
|
|
@ -13,6 +13,9 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="navbar-item" v-if="!isMobile">
|
||||
<print />
|
||||
</div>
|
||||
<div class="navbar-item" v-if="!isMobile">
|
||||
<cache />
|
||||
</div>
|
||||
|
@ -41,6 +44,7 @@ import UserDropDown from './user-drop-down.vue'
|
|||
import Setting from '../setting/index.vue'
|
||||
import MultipleTabs from './multiple-tabs.vue'
|
||||
import Cache from './cache.vue'
|
||||
import Print from './print.vue'
|
||||
|
||||
import useSettingStore from '@/stores/modules/setting'
|
||||
const appStore = useAppStore()
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div class="full-screen h-full cursor-pointer flex items-center px-2" @click="handleClean">
|
||||
<icon :size="18" name="el-icon-printer" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="printer">
|
||||
import { printerList } from "@/utils/print"
|
||||
const handleClean = async () => {
|
||||
if(!localStorage.getItem('hiprint')) window.open("hiprint://");
|
||||
const list = printerList();
|
||||
if(list.length) {
|
||||
localStorage.setItem('hiprint', '1');
|
||||
let flag = 0;
|
||||
list.forEach((item: any) => {
|
||||
if(item.name == 'HPRT D35' || item.displayName == 'HPRT D35'){
|
||||
flag = 1;
|
||||
}
|
||||
});
|
||||
if(flag==1) ElMessage.success('已找到HPRT D35打印机, 请确保其为默认打印机');
|
||||
else ElMessage.error('未找到HPRT D35打印机, 请检查是否安装打印机驱动');
|
||||
}
|
||||
else localStorage.removeItem('hiprint');
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
|
@ -33,6 +33,9 @@ const user_channel = connection.subscribe(`platform_1`);
|
|||
// 当user-2频道有message事件的消息时
|
||||
user_channel.on('message', function (data) {
|
||||
console.log("收到消息--",data);
|
||||
if(data.event=='platform_print'){
|
||||
console.log('收到打印消息');
|
||||
}
|
||||
});
|
||||
// 断线事件
|
||||
user_channel.on('close', function () {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { hiprint, defaultElementTypeProvider } from "vue-plugin-hiprint";
|
|||
hiprint.init();
|
||||
hiprint.hiwebSocket.setHost("http://localhost:17521");
|
||||
|
||||
window.open("hiprint://");
|
||||
// window.open("hiprint://");
|
||||
|
||||
// 配置
|
||||
const WIDTH = 58; //纸张宽度 mm
|
||||
|
@ -265,6 +265,16 @@ export const testPrint = () => {
|
|||
});
|
||||
};
|
||||
|
||||
export const printerList = ()=>{
|
||||
try{
|
||||
const list = hiprint.hiwebSocket.getPrinterList();
|
||||
return list;
|
||||
}catch{
|
||||
ElMessage.error("请先安装打印机客户端")
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// 计算字符串长度
|
||||
function calculateStringLength(str: string) {
|
||||
let count = 0;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
{{ formData.merchant?.mer_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人">
|
||||
{{ formData.merchant?.service_user }}
|
||||
{{ dataJSON.company_nickname }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">
|
||||
{{ formData.merchant?.service_phone }}
|
||||
|
@ -151,6 +151,7 @@ const onAudit = () => {
|
|||
service_phone: formData.merchant?.service_phone,
|
||||
mark: auditInfo.mark,
|
||||
}).then((res) => {
|
||||
emit('success');
|
||||
popupRef.value?.close();
|
||||
});
|
||||
};
|
||||
|
|
|
@ -112,12 +112,40 @@
|
|||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" /> -->
|
||||
<el-table-column label="商户id" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="商户名称" prop="merchant.mer_name" show-overflow-tooltip />
|
||||
<el-table-column label="联系人" prop="merchant.service_user" show-overflow-tooltip />
|
||||
<el-table-column label="联系电话" prop="merchant.service_phone" show-overflow-tooltip />
|
||||
<el-table-column label="申请时间" prop="create_time" show-overflow-tooltip>
|
||||
<el-table-column
|
||||
label="商户名称"
|
||||
prop="merchant.mer_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系人"
|
||||
prop="merchant.service_user"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="联系电话"
|
||||
prop="merchant.service_phone"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="入驻状态" prop="status" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ timeFormat(row.create_time, 'yyyy-mm-dd hh:MM:ss') }}
|
||||
<span
|
||||
v-if="row.status === 0 && (row.mark == '' || row.mark == null)"
|
||||
type="info"
|
||||
>待审核</span
|
||||
>
|
||||
<span v-else-if="row.status === 1" type="success">审核通过</span>
|
||||
<span v-else-if="row.status === 0" type="danger">审核不通过</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核备注" prop="mark" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="申请时间"
|
||||
prop="create_time"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
{{ timeFormat(row.create_time, "yyyy-mm-dd hh:MM:ss") }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column label="商户分类" prop="category_id">
|
||||
|
@ -244,7 +272,22 @@
|
|||
/> -->
|
||||
<el-table-column label="操作" width="150" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button link type="primary" @click="handleDetail(row)"> 审核 </el-button>
|
||||
<el-button
|
||||
v-if="!row.status && (row.mark == '' || row.mark == null)"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleDetail(row)"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
<el-button
|
||||
v-else-if="!row.status"
|
||||
link
|
||||
type="warning"
|
||||
@click="handleDetail(row)"
|
||||
>
|
||||
重新审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -273,7 +316,7 @@
|
|||
<script lang="ts" setup name="merchantLists">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import { apiMerchantApplyLists, apiMerchantDelete, } from "@/api/merchant";
|
||||
import { apiMerchantApplyLists, apiMerchantDelete } from "@/api/merchant";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
import DetailPopup from "./detail.vue";
|
||||
|
|
|
@ -167,17 +167,17 @@
|
|||
<el-input v-model="formData.service_phone" clearable placeholder="请输入店铺电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="商户余额" prop="mer_money">
|
||||
<el-input v-model="formData.mer_money" clearable placeholder="请输入商户余额" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
<el-col :span="8">
|
||||
<el-form-item label="商户备注" prop="mark">
|
||||
<el-input v-model="formData.mark" type="textarea" clearable placeholder="请输入商户备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<!-- <el-col :span="8">
|
||||
<el-form-item label="银行卡转账信息" prop="financial_bank">
|
||||
<el-input v-model="formData.financial_bank" clearable placeholder="请输入银行卡转账信息" />
|
||||
</el-form-item>
|
||||
|
@ -199,7 +199,7 @@
|
|||
:value="parseInt(item.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
</el-form>
|
||||
</popup>
|
||||
|
|
|
@ -276,13 +276,14 @@
|
|||
mer_id: row.mer_id,
|
||||
},
|
||||
}"
|
||||
>绑定商品
|
||||
>商品列表
|
||||
</router-link>
|
||||
</el-button>
|
||||
<el-button v-if="!row.uid" link @click="bindUser(row)" type="primary">
|
||||
绑定用户
|
||||
</el-button>
|
||||
<el-button link @click="setBalance(row.mer_id)"> 设置余额 </el-button>
|
||||
<el-button link @click="bindbank(row)"> 绑定银行卡 </el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -331,6 +332,7 @@
|
|||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<BindMerBank ref="merBankRef" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -474,5 +476,11 @@ const submitBalance = () => {
|
|||
});
|
||||
};
|
||||
|
||||
// 绑定银行卡
|
||||
const merBankRef = ref();
|
||||
const bindbank = (row: any)=>{
|
||||
merBankRef.value.open(row);
|
||||
}
|
||||
|
||||
getLists();
|
||||
</script>
|
||||
|
|
|
@ -44,16 +44,16 @@
|
|||
<el-table-column label="联系电话" prop="supplier.service_phone" show-overflow-tooltip />
|
||||
<el-table-column label="入驻状态" prop="status" show-overflow-tooltip >
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.status === 0 && row.mark==''" type="info">待审核</span>
|
||||
<span v-if="row.status === 0 && (row.mark=='' || row.mark==null)" type="info">待审核</span>
|
||||
<span v-else-if="row.status === 1" type="success">审核通过</span>
|
||||
<span v-else type="danger">审核不通过</span>
|
||||
<span v-else-if="row.status === 0" type="danger">审核不通过</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="审核备注" prop="mark" show-overflow-tooltip />
|
||||
<el-table-column label="创建时间" prop="supplier.create_time" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="170" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button v-if="!row.status && row.mark==''" link type="primary" @click="handleDetail(row)">
|
||||
<el-button v-if="!row.status && (row.mark=='' || row.mark==null)" link type="primary" @click="handleDetail(row)">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-else-if="!row.status" link type="warning" @click="handleDetail(row)">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<template>
|
||||
<div class="edit-popup">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px"
|
||||
:cancelButtonText="mode=='detail'?false:'取消'"
|
||||
:confirmButtonText="mode=='detail'?false:'确定'" @confirm="handleSubmit" @close="handleClose">
|
||||
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||
<el-form-item label="提现商户">
|
||||
<el-input v-model="formData.mer_name" clearable placeholder="请输入用户类型 1-商户 2-供应商" :readonly="true" />
|
||||
|
@ -24,7 +26,7 @@
|
|||
<el-input v-model="formData.merchant_bank_info.name" clearable placeholder="账户类型" :readonly="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账户类型">
|
||||
<el-select v-model="formData.merchant_bank_info.is_own">
|
||||
<el-select v-model="formData.merchant_bank_info.is_own" disabled>
|
||||
<el-option label="对公" :value="1"></el-option>
|
||||
<el-option label="个人" :value="0"></el-option>
|
||||
</el-select>
|
||||
|
@ -45,18 +47,18 @@
|
|||
<!-- <el-form-item label="操作人员">
|
||||
<el-input v-model="formData.admin_name" clearable placeholder="请输入操作人员id" :readonly="true" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="审核意见" prop="is_check" v-if="formData.is_check == 0">
|
||||
<el-form-item label="审核意见" prop="is_check" v-if="formData.is_check == 0 && mode!='detail'">
|
||||
<el-radio-group v-model="form.is_check" class="ml-4">
|
||||
<el-radio :label="1" size="large">通过</el-radio>
|
||||
<el-radio :label="2" size="large">不通过</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="拒绝原因" v-if="form.is_check == 2" prop="fail_msg">
|
||||
<el-form-item label="拒绝原因" v-if="form.is_check == 2 && mode!='detail'" prop="fail_msg">
|
||||
<el-input type="textarea" v-model="form.fail_msg" clearable placeholder="请输入拒绝原因" :readonly="false" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="上传凭证" prop="is_check" v-if="formData.is_check == 1">
|
||||
<material-picker :limit="5" v-model="form.arrival_proof" />
|
||||
<material-picker :limit="5" v-model="form.arrival_proof" :disabled="mode=='detail'" />
|
||||
<!-- <el-radio-group v-model="formData.is_check" class="ml-4">
|
||||
<el-radio :label="1" size="large">通过</el-radio>
|
||||
<el-radio :label="2" size="large">不通过</el-radio>
|
||||
|
|
|
@ -64,7 +64,9 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="审核状态" prop="" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
{{ row.is_check == 1 ? '审核通过' : row.is_check == 2 ? "审核不通过" : "待审核" }}
|
||||
<span v-if="row.is_check == 1">审核通过</span>
|
||||
<span v-else-if="row.is_check == 2" style="color: #f56c6c">审核不通过</span>
|
||||
<span v-else>待审核</span>
|
||||
</template>
|
||||
|
||||
</el-table-column>
|
||||
|
@ -86,14 +88,18 @@
|
|||
type="primary" link @click="handleEdit(row)">
|
||||
审核
|
||||
</el-button>
|
||||
<el-button v-if="row.is_check == 2" v-perms="['withdraw.merchant_withdraw/edit']"
|
||||
<!-- <el-button v-if="row.is_check == 2" v-perms="['withdraw.merchant_withdraw/edit']"
|
||||
type="primary" link @click="handleDelete(row.id)">
|
||||
删除
|
||||
</el-button>
|
||||
<el-button v-if="row.is_check == 1" v-perms="['withdraw.merchant_withdraw/delete']"
|
||||
</el-button> -->
|
||||
<el-button v-if="row.is_check == 1 && !row.arrival_proof" v-perms="['withdraw.merchant_withdraw/delete']"
|
||||
type="primary" link @click="handleEdit(row)">
|
||||
提现到账
|
||||
</el-button>
|
||||
<el-button v-if="row.arrival_proof"
|
||||
type="primary" link @click="handleDetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
@ -164,6 +170,13 @@ const handleEdit = async (data: any) => {
|
|||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
// 详情
|
||||
const handleDetail = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('detail')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
|
|
|
@ -101,6 +101,12 @@
|
|||
prop="money"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="是否已采购" prop="is_opurchase" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.is_opurchase" style="color: #67c23a">已采购</span>
|
||||
<span v-else style="color: #f56c6c">未采购</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否支付" prop="paid" show-overflow-tooltip>
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.paid ? "是" : "否" }}</span>
|
||||
|
|
|
@ -3,7 +3,12 @@
|
|||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="所属商户" prop="merchant">
|
||||
<el-input class="w-[280px]" v-model="queryParams.merchant" clearable placeholder="请输入所属商户" />
|
||||
<el-input
|
||||
class="w-[280px]"
|
||||
v-model="queryParams.merchant"
|
||||
clearable
|
||||
placeholder="请输入所属商户"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="零售订单id" prop="order_arr">
|
||||
<el-input class="w-[280px]" v-model="queryParams.order_arr" clearable placeholder="请输入零售订单id" />
|
||||
|
@ -35,17 +40,56 @@
|
|||
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column label="ID" prop="id" show-overflow-tooltip />
|
||||
<el-table-column label="所属商户" prop="merchant_name" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="所属商户"
|
||||
prop="merchant_name"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<!-- <el-table-column label="零售订单id" prop="order_arr" show-overflow-tooltip /> -->
|
||||
<el-table-column label="购物车id" prop="cart_id" show-overflow-tooltip />
|
||||
<el-table-column label="单据编号" prop="number" width="220" show-overflow-tooltip />
|
||||
<el-table-column label="单据金额" prop="total" show-overflow-tooltip />
|
||||
<el-table-column label="抵扣金额" prop="deduction_price" show-overflow-tooltip />
|
||||
<el-table-column label="实际金额" prop="actual" show-overflow-tooltip />
|
||||
<el-table-column label="实收金额" prop="money" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="购物车id"
|
||||
prop="cart_id"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="单据编号"
|
||||
prop="number"
|
||||
width="220"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="单据金额"
|
||||
prop="total"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="抵扣金额"
|
||||
prop="deduction_price"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="实际金额"
|
||||
prop="actual"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="实收金额"
|
||||
prop="money"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="是否已采购"
|
||||
prop="is_opurchase"
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<span v-if="row.is_opurchase" style="color: #67c23a">已采购</span>
|
||||
<span v-else style="color: #f56c6c">未采购</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否支付" prop="paid">
|
||||
<template #default="{ row }">
|
||||
<span>{{ row.paid ? '是' : '否' }}</span>
|
||||
<span>{{ row.paid ? "是" : "否" }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
|
@ -77,84 +121,91 @@
|
|||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
</el-card>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
<edit-popup
|
||||
v-if="showEdit"
|
||||
ref="editRef"
|
||||
:dict-data="dictData"
|
||||
@success="getLists"
|
||||
@close="showEdit = false"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="opurchaseclassLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiOpurchaseclassLists, apiOpurchaseclassDelete } from '@/api/opurchaseclass'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiOpurchaseclassLists,
|
||||
apiOpurchaseclassDelete,
|
||||
} from "@/api/opurchaseclass";
|
||||
import { timeFormat } from "@/utils/util";
|
||||
import feedback from "@/utils/feedback";
|
||||
import EditPopup from "./edit.vue";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter()
|
||||
const router = useRouter();
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
const showEdit = ref(false);
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
merchant: '',
|
||||
order_arr: '',
|
||||
number: '',
|
||||
is_mer: 2 // 1是商户,2是平台
|
||||
})
|
||||
merchant: "",
|
||||
order_arr: "",
|
||||
number: "",
|
||||
is_mer: 2, // 1是商户,2是平台
|
||||
});
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
const selectData = ref<any[]>([]);
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
selectData.value = val.map(({ id }) => id);
|
||||
};
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
const { dictData } = useDictData("");
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiOpurchaseclassLists,
|
||||
params: queryParams
|
||||
})
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("add");
|
||||
};
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (data: any) => {
|
||||
console.log(data);
|
||||
router.push({
|
||||
path: 'transDetail',
|
||||
path: "transDetail",
|
||||
query: {
|
||||
id: data.id
|
||||
}
|
||||
})
|
||||
}
|
||||
id: data.id,
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
// 编辑
|
||||
const handleEdit = async (data: any) => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('edit')
|
||||
editRef.value?.setFormData(data)
|
||||
}
|
||||
showEdit.value = true;
|
||||
await nextTick();
|
||||
editRef.value?.open("edit");
|
||||
editRef.value?.setFormData(data);
|
||||
};
|
||||
|
||||
// 删除
|
||||
const handleDelete = async (id: number | any[]) => {
|
||||
await feedback.confirm('确定要删除?')
|
||||
await apiOpurchaseclassDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
await feedback.confirm("确定要删除?");
|
||||
await apiOpurchaseclassDelete({ id });
|
||||
getLists();
|
||||
};
|
||||
|
||||
getLists()
|
||||
getLists();
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue