This commit is contained in:
weipengfei 2024-05-20 16:20:56 +08:00
parent f67b35dfbe
commit 57055535cc
16 changed files with 759 additions and 331 deletions

View File

@ -33,4 +33,9 @@ export function apimMrchantbankLists(params: any) {
// 添加银行列表
export function apimMrchantbankCheck(params: any) {
return request.post({ url: '/merchat/merchantbank/check', params })
}
// 资金流水列表
export function apiFinancialRecordLists(params: any) {
return request.get({ url: '/financial/FinancialRecord/lists', params })
}

View File

@ -33,4 +33,19 @@ export function apiSupplierApplyLists(params: any) {
// 供应商申请审核
export function apiSupplierStatus(params: any) {
return request.post({ url: '/supplier/supplier/status', params })
}
// 供应商已绑定商品列表
export function apiSupplierBindGoods(params: any) {
return request.get({ url: '/supplier/SupplierBindGoods/lists', params })
}
// 供应商绑定商品
export function apiSupplierBindGoodsAdd(params: any) {
return request.post({ url: '/supplier/SupplierBindGoods/add', params })
}
// 供应商删除绑定商品
export function apiSupplierBindGoodsDelete(params: any) {
return request.post({ url: '/supplier/SupplierBindGoods/delete', params })
}

View File

@ -0,0 +1,130 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="商品名称" prop="name">
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入商品名称" />
</el-form-item>
<!-- <el-form-item label="商品品牌" prop="brand">
<el-input class="w-[280px]" v-model="queryParams.brand" clearable placeholder="请输入商品品牌" />
</el-form-item> -->
<el-form-item label="商品单位" prop="unit">
<el-input class="w-[280px]" v-model="queryParams.unit" clearable placeholder="请输入商品单位" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" prop="id" width="55" />
<el-table-column label="商品图片" prop="imgs">
<template #default="{ row }">
<el-image style="width:50px;height:50px;" :src="row.imgs" />
</template>
</el-table-column>
<el-table-column label="商品名称" prop="name" show-overflow-tooltip />
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip />
<el-table-column label="商品分类" prop="class_name" show-overflow-tooltip />
<!-- <el-table-column label="商品品牌" prop="brand_name" show-overflow-tooltip /> -->
<el-table-column label="商品单位" prop="unit_name" show-overflow-tooltip />
<!-- <el-table-column label="购货价格" prop="buy" show-overflow-tooltip />
<el-table-column label="销货价格" prop="sell" show-overflow-tooltip />
<el-table-column label="零售价格" prop="retail" show-overflow-tooltip />
<el-table-column label="标签" prop="sys_labels_text" show-overflow-tooltip />
<el-table-column label="数量" prop="num" width="170">
<template #default="{ row }">
<el-input type="number" v-model="row.num" clearable placeholder="请输入数量" />
</template>
</el-table-column> -->
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
<div class="flex mt-4 justify-end">
<el-button type="primary" @click="bindFn">确认绑定</el-button>
<el-button @click="canceFn">取消</el-button>
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="supplierGoodsPop">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiGoodsLists, apiBindGodds } from '@/api/goods'
import { apiSupplierBindGoodsAdd } from '@/api/supplier'
import { defineProps } from "vue"
let props = defineProps({
sid: {
type: [Number, String],
default: 0
}
})
//
const showEdit = ref(false)
const showDetail = ref(false)
const emits = defineEmits(["offPop"]);
//
const queryParams = reactive({
name: '',
class: '',
brand: '',
unit: '',
code: '',
warehouse: '',
retail_name: '',
sort: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiGoodsLists,
params: queryParams
})
const bindFn = async () => {
let list = pager.lists.filter(item => selectData.value.includes(item.id))
let data: any = [];
list.forEach(item => {
data.push({
goods_id: item.id,
price: item.sell,
goods_name: item.name,
supplier_id: props.sid,
})
})
await apiSupplierBindGoodsAdd({
data: data
})
emits("offPop");
}
const canceFn = () => {
emits("offPop");
}
getLists()
</script>

View File

@ -0,0 +1,97 @@
<template>
<div>
<!-- <el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="银行名称" prop="name">
<el-input class="w-[280px]" v-model="queryParams.name" clearable placeholder="请输入银行名称" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card> -->
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div>
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column label="ID" prop="id" width="120" show-overflow-tooltip />
<el-table-column label="订单号" prop="number_sn" show-overflow-tooltip />
<el-table-column label="用户类型" prop="type" width="120" show-overflow-tooltip />
<el-table-column label="用户" prop="user_nickname" show-overflow-tooltip>
<template #default="{ row }">
<span>{{ row.type=='用户' ? row.user_nickname : row.mer_name }}</span>
</template>
</el-table-column>
<el-table-column label="收支" prop="financial_pm" width="80" show-overflow-tooltip />
<el-table-column label="金额" prop="number" show-overflow-tooltip />
<el-table-column label="支付单号" prop="financial_record_sn" show-overflow-tooltip />
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
</div>
</template>
<script lang="ts" setup name="bankLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiFinancialRecordLists, apiBankDelete } from '@/api/bank'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
//
const showEdit = ref(false)
//
const queryParams = reactive({
name: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiFinancialRecordLists,
params: queryParams
})
// //
// const handleAdd = async () => {
// showEdit.value = true
// await nextTick()
// editRef.value?.open('add')
// }
// //
// const handleEdit = async (data: any) => {
// showEdit.value = true
// await nextTick()
// editRef.value?.open('edit')
// editRef.value?.setFormData(data)
// }
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiBankDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -1,11 +0,0 @@
<template>
</template>
<script>
</script>
<style>
</style>

View File

@ -38,18 +38,18 @@
{{ dataJSON.update_time }}
</el-descriptions-item>
</el-descriptions>
<el-form :model="formData">
<el-form :model="auditInfo">
<el-form-item label="审核状态" prop="status">
<el-radio-group v-model="formData.status" class="ml-4">
<el-radio-group v-model="auditInfo.status" class="ml-4">
<el-radio :label="1">通过</el-radio>
<el-radio :label="0">拒绝</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核备注" prop="mark">
<el-input v-model="formData.mark" type="textarea" />
<el-input v-model="auditInfo.mark" type="textarea" />
</el-form-item>
</el-form>
<div style="width: 100%; display: flex;justify-content: flex-end;">
<div style="width: 100%; display: flex; justify-content: flex-end">
<el-button @click="onAudit" type="primary">确认</el-button>
</div>
</popup>
@ -57,95 +57,99 @@
</template>
<script lang="ts" setup name="brandEdit">
import Popup from '@/components/popup/index.vue'
import { apiMerchantStatusUpdate } from "@/api/merchant"
import type { PropType } from 'vue'
import Popup from "@/components/popup/index.vue";
import { apiMerchantStatusUpdate } from "@/api/merchant";
import type { PropType } from "vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
});
const emit = defineEmits(["success", "close"]);
const popupRef = shallowRef<InstanceType<typeof Popup>>();
const mode = ref("add");
//
const popupTitle = computed(() => {
return '商户详情'
})
return "商户详情";
});
//
const formData = reactive({
financial_type: "",
mer_id: '',
category_id: '',
type_id: '',
mer_name: '',
service_user: "",
credit_buy: '',
settle_cycle: '',
interest_rate: '',
province_id: '510000',
city_id: '',
city_name: '',
area_id: '',
area_name: '',
street_id: '',
street_name: '',
village_id: '',
village_name: '',
mer_address: '',
mer_avatar: '',
merchant: {},
apply_id: '',
mark: '',
sort: '',
status: '',
commission_rate: '',
commission_switch: '',
long: '',
lat: '',
service_phone: '',
mer_money: '',
financial_bank: '',
financial_wechat: '',
financial_alipay: '',
})
financial_type: "",
mer_id: "",
category_id: "",
type_id: "",
mer_name: "",
service_user: "",
credit_buy: "",
settle_cycle: "",
interest_rate: "",
province_id: "510000",
city_id: "",
city_name: "",
area_id: "",
area_name: "",
street_id: "",
street_name: "",
village_id: "",
village_name: "",
mer_address: "",
mer_avatar: "",
merchant: {},
apply_id: "",
mark: "",
sort: "",
status: "",
commission_rate: "",
commission_switch: "",
long: "",
lat: "",
service_phone: "",
mer_money: "",
financial_bank: "",
financial_wechat: "",
financial_alipay: "",
});
//
const formRules = reactive<any>({
name: [{
required: true,
message: '请输入品牌名称',
trigger: ['blur']
}]
})
name: [
{
required: true,
message: "请输入品牌名称",
trigger: ["blur"],
},
],
});
const dataJSON = ref({});
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key];
}
dataJSON.value = JSON.parse(data.merchant?.data_json || '{}')
}
}
dataJSON.value = JSON.parse(data.merchant?.data_json || "{}");
};
const auditInfo = reactive({
status: 1,
mark: "",
});
//
const onAudit = () => {
apiMerchantStatusUpdate({
mer_id: formData.mer_id,
status: formData.status,
if (auditInfo.status == 0 && auditInfo.mark == "")
return ElMessage.error("请输入拒绝原因");
apiMerchantStatusUpdate({
mer_id: formData.merchant?.mer_id,
status: auditInfo.status,
apply_id: formData.apply_id,
service_phone: formData.service_phone,
mark: formData.mark,
service_phone: formData.merchant?.service_phone,
mark: auditInfo.mark,
}).then((res) => {
popupRef.value?.close();
});
@ -163,20 +167,18 @@ const onAudit = () => {
// }
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit('close')
}
emit("close");
};
defineExpose({
open,
setFormData,
})
open,
setFormData,
});
</script>

View File

@ -331,9 +331,9 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key]
}
}
await getAreaList(formData.city_id, true)
await getTownList(formData.area_id, true)
getVilllageList(formData.street_id)
if(formData.city_id) await getAreaList(formData.city_id, true)
if(formData.area_id) await getTownList(formData.area_id, true)
if(formData.street_id) getVilllageList(formData.street_id)
}

View File

@ -13,92 +13,35 @@
:column="3"
border
>
<el-descriptions-item label="商户头像">
<material-picker v-model="formData.mer_avatar" disabled />
<el-descriptions-item label="商户图片">
<material-picker v-model="formData.supplier.mer_avatar" disabled />
</el-descriptions-item>
<el-descriptions-item label="商户名称">
{{ formData.mer_name }}
{{ formData.supplier.mer_name }}
</el-descriptions-item>
<el-descriptions-item label="商户分类">
<dict-value
:options="dictData.mer_category_type"
:value="formData.category_id"
/>
</el-descriptions-item>
<el-descriptions-item label="店铺类型">
<dict-value
:options="dictData.merchat_type"
:value="formData.type_id"
/>
</el-descriptions-item>
<el-descriptions-item label="结算周期(天)">
{{ formData.settle_cycle }}
</el-descriptions-item>
<el-descriptions-item label="利率">
{{ formData.interest_rate }}
</el-descriptions-item>
<el-descriptions-item label="标签">
{{ formData.sys_labels_text }}
</el-descriptions-item>
<el-descriptions-item label="城市">
{{ formData.city_name }}
</el-descriptions-item>
<el-descriptions-item label="区县">
{{ formData.area_name }}
</el-descriptions-item>
<el-descriptions-item label="镇街">
{{ formData.street_name }}
</el-descriptions-item>
<el-descriptions-item label="村">
{{ formData.village_name }}
<el-descriptions-item label="商户电话">
{{ formData.supplier.service_phone }}
</el-descriptions-item>
<el-descriptions-item label="商户地址">
{{ formData.mer_address }}
{{ formData.supplier.mer_address }}
</el-descriptions-item>
<el-descriptions-item label="商户是否禁用">
<dict-value
:options="dictData.show_status"
:value="formData.status"
/>
<el-descriptions-item label="公司名称" :span="2">
{{ dataJSON.company_name }}
</el-descriptions-item>
<el-descriptions-item label="提成比例">
{{ formData.commission_rate }}
<el-descriptions-item label="营业执照">
<material-picker v-model="dataJSON.images" disabled />
</el-descriptions-item>
<el-descriptions-item label="商户手续费单独设置">
<dict-value
:options="dictData.show_status"
:value="formData.commission_switch"
/>
<el-descriptions-item label="公司地址" :span="2">
{{ dataJSON.company_address }}
</el-descriptions-item>
<el-descriptions-item label="经度">
{{ formData.long }}
<el-descriptions-item label="社会代码">
{{ dataJSON.social_credit_code }}
</el-descriptions-item>
<el-descriptions-item label="纬度">
{{ formData.lat }}
</el-descriptions-item>
<el-descriptions-item label="店铺电话">
{{ formData.service_phone }}
</el-descriptions-item>
<el-descriptions-item label="商户余额">
{{ formData.mer_money }}
</el-descriptions-item>
<el-descriptions-item label="银行卡转账信息">
{{ formData.financial_bank }}
</el-descriptions-item>
<el-descriptions-item label="微信转账信息">
{{ formData.financial_wechat }}
</el-descriptions-item>
<el-descriptions-item label="支付宝转账信息">
{{ formData.financial_alipay }}
</el-descriptions-item>
<el-descriptions-item label="默认使用类型">
<dict-value
:options="dictData.financial_type"
:value="formData.financial_type"
/>
<el-descriptions-item label="更新时间">
{{ formData.supplier.update_time }}
</el-descriptions-item>
</el-descriptions>
<el-form :model="auditInfo">
<el-form :model="auditInfo" style="margin-top: 16px;">
<el-form-item label="审核状态" prop="status">
<el-radio-group v-model="auditInfo.status" class="ml-4">
<el-radio :label="1">通过</el-radio>
@ -109,7 +52,7 @@
<el-input v-model="auditInfo.mark" type="textarea" />
</el-form-item>
</el-form>
<div style="width: 100%; display: flex; justify-content: flex-end">
<div style="width: 100%; display: flex; justify-content: flex-end;">
<el-button @click="onAudit" type="primary">确认</el-button>
</div>
</popup>
@ -184,6 +127,7 @@ const formRules = reactive<any>({
],
});
const dataJSON = ref({});
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
@ -199,6 +143,7 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key];
}
}
dataJSON.value = JSON.parse(data.supplier?.data_json || '{}')
}
};

View File

@ -49,11 +49,11 @@
<dict-value :options="dictData.merchat_type" :value="row.type_id" />
</template>
</el-table-column> -->
<el-table-column label="id" prop="id" width="100" show-overflow-tooltip />
<el-table-column label="ID" prop="id" width="100" show-overflow-tooltip />
<el-table-column label="商户名称" prop="supplier.mer_name" show-overflow-tooltip />
<el-table-column label="联系人" prop="supplier.service_user" show-overflow-tooltip />
<el-table-column label="联系电话" prop="supplier.service_phone" show-overflow-tooltip />
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
<el-table-column label="创建时间" prop="supplier.create_time" show-overflow-tooltip />
<!-- <el-table-column label="结算周期(天)" prop="settle_cycle" show-overflow-tooltip /> -->
<!-- <el-table-column label="利率" prop="interest_rate" show-overflow-tooltip /> -->
<!-- <el-table-column label="标签" prop="sys_labels_text" show-overflow-tooltip /> -->

View File

@ -0,0 +1,139 @@
<template>
<div>
<!-- <el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="160px">
<el-row>
<el-col :span="6">
<el-form-item label="商户分类" prop="category_id">
<el-select class="w-[280px]" v-model="queryParams.category_id" clearable placeholder="请选择商户分类">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in dictData.mer_category_type" :key="index"
:label="item.name" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="店铺类型" prop="type_id">
<el-select class="w-[280px]" v-model="queryParams.type_id" clearable placeholder="请选择店铺类型">
<el-option label="全部" value=""></el-option>
<el-option v-for="(item, index) in dictData.merchat_type" :key="index" :label="item.name"
:value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card> -->
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button
v-perms="['merchat.merchant/add']"
type="primary"
@click="showDialog = true"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
商品绑定
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" prop="id" width="55" />
<el-table-column label="商品图片" prop="imgs">
<template #default="{ row }">
<el-image style="width: 50px; height: 50px" :src="row.imgs" />
</template>
</el-table-column>
<el-table-column
label="商品名称"
prop="goods_name"
show-overflow-tooltip
/>
<el-table-column label="规格型号" prop="spec" show-overflow-tooltip />
<el-table-column
label="商品分类"
prop="class_name"
show-overflow-tooltip
/>
<el-table-column
label="商品单价"
prop="price"
show-overflow-tooltip
/>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['supplier.supplier/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<el-dialog v-model="showDialog" title="绑定商品" width="70%">
<supplierGoodsPop
@offPop="(showDialog = false), getLists()"
:sid="id"
></supplierGoodsPop>
</el-dialog>
</div>
</template>
<script lang="ts" setup name="merchantLists">
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import { apiSupplierBindGoods, apiSupplierBindGoodsDelete } from "@/api/supplier";
import { useRoute } from "vue-router";
import feedback from "@/utils/feedback";
const route = useRoute();
const showDialog = ref(false);
let id = route.query.id;
//
const queryParams = reactive({
supplier_id: id,
});
//
const selectData = ref<any[]>([]);
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id);
};
//
const { dictData } = useDictData(
"mer_category_type,merchat_type,show_status,off_status,financial_type"
);
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiSupplierBindGoods,
params: queryParams,
});
getLists();
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm("确定要删除?");
await apiSupplierBindGoodsDelete({ id });
getLists();
};
</script>

View File

@ -1,183 +1,289 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="120px">
<el-row>
<el-col :span="6">
<el-form-item label="商户分类" prop="category_id">
<el-select v-model="queryParams.category_id" clearable placeholder="请选择店铺类型">
<el-option v-for="(item, index) in dictData.mer_category_type" :key="index"
:label="item.name" :value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="店铺类型" prop="type_id">
<el-select v-model="queryParams.type_id" clearable placeholder="请选择店铺类型">
<el-option v-for="(item, index) in dictData.merchat_type" :key="index" :label="item.name"
:value="parseInt(item.value)" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商户名称" prop="mer_name">
<el-input v-model="queryParams.mer_name" clearable placeholder="请输入商户名称" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button v-perms="['supplier.supplier/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['supplier.supplier/delete']" :disabled="!selectData.length"
@click="handleDelete(selectData)">
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" label-width="120px">
<el-row>
<el-col :span="6">
<el-form-item label="商户分类" prop="category_id">
<el-select
v-model="queryParams.category_id"
clearable
placeholder="请选择店铺类型"
>
<el-option
v-for="(item, index) in dictData.mer_category_type"
:key="index"
:label="item.name"
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="店铺类型" prop="type_id">
<el-select
v-model="queryParams.type_id"
clearable
placeholder="请选择店铺类型"
>
<el-option
v-for="(item, index) in dictData.merchat_type"
:key="index"
:label="item.name"
:value="parseInt(item.value)"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="商户名称" prop="mer_name">
<el-input
v-model="queryParams.mer_name"
clearable
placeholder="请输入商户名称"
/>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<el-button
v-perms="['supplier.supplier/add']"
type="primary"
@click="handleAdd"
>
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['supplier.supplier/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="ID" prop="id" width="55" />
<el-table-column
label="商户分类"
prop="category_id"
show-overflow-tooltip
>
<template #default="{ row }">
<dict-value
:options="dictData.mer_category_type"
:value="row.category_id"
/>
</template>
</el-table-column>
<el-table-column
label="店铺类型"
prop="type_id"
show-overflow-tooltip
>
<template #default="{ row }">
<dict-value
:options="dictData.merchat_type"
:value="row.type_id"
/>
</template>
</el-table-column>
<el-table-column
label="商户名称"
prop="mer_name"
show-overflow-tooltip
/>
<el-table-column
label="结算周期(天)"
prop="settle_cycle"
show-overflow-tooltip
/>
<el-table-column
label="利率"
prop="interest_rate"
show-overflow-tooltip
/>
<el-table-column
label="标签"
prop="sys_labels_arr"
show-overflow-tooltip
>
<template #default="{ row }">
<span>{{
row.sys_labels_arr.map((t: any) => t.name).join(",")
}}</span>
</template>
</el-table-column>
<el-table-column
label="商户地址"
prop="mer_address"
show-overflow-tooltip
/>
<el-table-column label="商户是否禁用" prop="status">
<template #default="{ row }">
<dict-value :options="dictData.show_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column
label="提成比例"
prop="commission_rate"
show-overflow-tooltip
/>
<el-table-column
label="商户手续费单独设置"
width="200"
prop="commission_switch"
>
<template #default="{ row }">
<!-- <dict-value :options="dictData.show_status" :value="row.commission_switch" /> -->
{{ row.commission_switch ? "开启" : "关闭" }}
</template>
</el-table-column>
<el-table-column
label="商户余额"
prop="mer_money"
show-overflow-tooltip
/>
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button
v-perms="['supplier.supplier/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['supplier.supplier/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button>
<div class="mt-4">
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" />
<el-table-column label="商户分类" prop="category_id" show-overflow-tooltip>
<template #default="{ row }">
<dict-value :options="dictData.mer_category_type" :value="row.category_id" />
</template>
</el-table-column>
<el-table-column label="店铺类型" prop="type_id" show-overflow-tooltip>
<template #default="{ row }">
<dict-value :options="dictData.merchat_type" :value="row.type_id" />
</template>
</el-table-column>
<el-table-column label="商户名称" prop="mer_name" show-overflow-tooltip />
<el-table-column label="结算周期(天)" prop="settle_cycle" show-overflow-tooltip />
<el-table-column label="利率" prop="interest_rate" show-overflow-tooltip />
<el-table-column label="标签" prop="sys_labels_arr" show-overflow-tooltip >
<template #default="{ row }">
<span>{{row.sys_labels_arr.map((t:any)=>t.name).join(',')}}</span>
</template>
</el-table-column>
<el-table-column label="商户地址" prop="mer_address" show-overflow-tooltip />
<el-table-column label="商户是否禁用" prop="status">
<template #default="{ row }">
<dict-value :options="dictData.show_status" :value="row.status" />
</template>
</el-table-column>
<el-table-column label="提成比例" prop="commission_rate" show-overflow-tooltip />
<el-table-column label="商户手续费单独设置" width="200" prop="commission_switch">
<template #default="{ row }">
<!-- <dict-value :options="dictData.show_status" :value="row.commission_switch" /> -->
{{ row.commission_switch ? "开启" : "关闭" }}
</template>
</el-table-column>
<el-table-column label="商户余额" prop="mer_money" show-overflow-tooltip />
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-perms="['supplier.supplier/edit']" type="primary" link @click="handleEdit(row)">
编辑
</el-button>
<el-button v-perms="['supplier.supplier/delete']" type="danger" link
@click="handleDelete(row.id)">
删除
</el-button>
<el-button link @click="handleDetail(row.id)">
详情
</el-button>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
<DetailPopup v-if="showDetail" ref="detailRef" :dict-data="dictData" @success="getLists"
@close="showDetail = false" />
</div>
</el-button>
<el-button link @click="handleDetail(row.id)"> 详情 </el-button>
<router-link
:to="{
path: 'bindGoods',
query: {
id: row.id,
},
}"
>
<el-button link type="primary"> 商品绑定 </el-button>
</router-link>
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup
v-if="showEdit"
ref="editRef"
:dict-data="dictData"
@success="getLists"
@close="showEdit = false"
/>
<DetailPopup
v-if="showDetail"
ref="detailRef"
:dict-data="dictData"
@success="getLists"
@close="showDetail = false"
/>
</div>
</template>
<script lang="ts" setup name="supplierLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiSupplierLists, apiSupplierDelete, apiSupplierDetail } from '@/api/supplier'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import DetailPopup from './detail.vue'
import { usePaging } from "@/hooks/usePaging";
import { useDictData } from "@/hooks/useDictOptions";
import {
apiSupplierLists,
apiSupplierDelete,
apiSupplierDetail,
} from "@/api/supplier";
import { timeFormat } from "@/utils/util";
import feedback from "@/utils/feedback";
import EditPopup from "./edit.vue";
import DetailPopup from "./detail.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = shallowRef<InstanceType<typeof EditPopup>>()
const editRef = shallowRef<InstanceType<typeof EditPopup>>();
const detailRef = shallowRef<InstanceType<typeof EditPopup>>();
//
const showEdit = ref(false)
const showDetail = ref(false)
const showEdit = ref(false);
const showDetail = ref(false);
//
const queryParams = reactive({
category_id: '',
type_id: '',
mer_name: ''
})
category_id: "",
type_id: "",
mer_name: "",
});
//
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('show_status,mer_category_type,merchat_type,financial_type')
const { dictData } = useDictData(
"show_status,mer_category_type,merchat_type,financial_type"
);
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiSupplierLists,
params: queryParams
})
fetchFun: apiSupplierLists,
params: queryParams,
});
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
showEdit.value = true;
await nextTick();
editRef.value?.open("add");
};
//
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 apiSupplierDelete({ id })
getLists()
}
await feedback.confirm("确定要删除?");
await apiSupplierDelete({ id });
getLists();
};
//
const handleDetail = async (id: any) => {
let res = await apiSupplierDetail({ id })
showDetail.value = true
await nextTick()
detailRef.value?.open('edit')
detailRef.value?.setFormData(res)
}
let res = await apiSupplierDetail({ id });
showDetail.value = true;
await nextTick();
detailRef.value?.open("edit");
detailRef.value?.setFormData(res);
};
getLists()
getLists();
</script>

View File

@ -20,9 +20,9 @@
<el-descriptions-item label="商品单位">
{{ formData.unit }}
</el-descriptions-item>
<el-descriptions-item label="标签">
<!-- <el-descriptions-item label="标签">
{{ formData.sys_labels_text }}
</el-descriptions-item>
</el-descriptions-item> -->
<el-descriptions-item label="购货价格">
{{ formData.buy }}
</el-descriptions-item>

View File

@ -126,7 +126,7 @@
<material-picker v-model="formData.imgs" />
</el-form-item>
</el-col>
<el-col :span="24">
<!-- <el-col :span="24">
<el-form-item label="标签" prop="sys_labels_arr">
<el-tag class="mr-2" v-for="(item, index) in formData.sys_labels_arr" @close="delTags(index)"
:key="index" closable>
@ -134,7 +134,7 @@
</el-tag>
<el-button type="primary" @click="showDialog = true">添加标签</el-button>
</el-form-item>
</el-col>
</el-col> -->
<!-- <el-col :span="24">
<el-form-item label="商品详情" prop="details">
<material-picker v-model="formData.details" :limit="9" />

View File

@ -61,11 +61,11 @@
<el-table-column label="购货价格" prop="buy" show-overflow-tooltip />
<el-table-column label="销货价格" prop="sell" show-overflow-tooltip />
<el-table-column label="零售价格" prop="retail" show-overflow-tooltip />
<el-table-column label="标签" prop="sys_labels_text" show-overflow-tooltip >
<!-- <el-table-column label="标签" prop="sys_labels_text" show-overflow-tooltip >
<template #default="{ row }">
<span>{{ row.sys_labels_arr.map((t:any)=>t.name).join(',') }}</span>
</template>
</el-table-column>
</el-table-column> -->
<el-table-column label="条形码" prop="code" show-overflow-tooltip />
<!-- <el-table-column label="默认仓库" prop="warehouse_name" show-overflow-tooltip /> -->
<!-- <el-table-column label="商品货位" prop="location" show-overflow-tooltip /> -->