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

@ -34,3 +34,8 @@ export function apimMrchantbankLists(params: any) {
export function apimMrchantbankCheck(params: any) { export function apimMrchantbankCheck(params: any) {
return request.post({ url: '/merchat/merchantbank/check', params }) return request.post({ url: '/merchat/merchantbank/check', params })
} }
// 资金流水列表
export function apiFinancialRecordLists(params: any) {
return request.get({ url: '/financial/FinancialRecord/lists', params })
}

View File

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

View File

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

View File

@ -13,92 +13,35 @@
:column="3" :column="3"
border border
> >
<el-descriptions-item label="商户头像"> <el-descriptions-item label="商户图片">
<material-picker v-model="formData.mer_avatar" disabled /> <material-picker v-model="formData.supplier.mer_avatar" disabled />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="商户名称"> <el-descriptions-item label="商户名称">
{{ formData.mer_name }} {{ formData.supplier.mer_name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="商户分类"> <el-descriptions-item label="商户电话">
<dict-value {{ formData.supplier.service_phone }}
: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> </el-descriptions-item>
<el-descriptions-item label="商户地址"> <el-descriptions-item label="商户地址">
{{ formData.mer_address }} {{ formData.supplier.mer_address }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="商户是否禁用"> <el-descriptions-item label="公司名称" :span="2">
<dict-value {{ dataJSON.company_name }}
:options="dictData.show_status"
:value="formData.status"
/>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="提成比例"> <el-descriptions-item label="营业执照">
{{ formData.commission_rate }} <material-picker v-model="dataJSON.images" disabled />
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="商户手续费单独设置"> <el-descriptions-item label="公司地址" :span="2">
<dict-value {{ dataJSON.company_address }}
:options="dictData.show_status"
:value="formData.commission_switch"
/>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="经度"> <el-descriptions-item label="社会代码">
{{ formData.long }} {{ dataJSON.social_credit_code }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="纬度"> <el-descriptions-item label="更新时间">
{{ formData.lat }} {{ formData.supplier.update_time }}
</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> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-form :model="auditInfo"> <el-form :model="auditInfo" style="margin-top: 16px;">
<el-form-item label="审核状态" prop="status"> <el-form-item label="审核状态" prop="status">
<el-radio-group v-model="auditInfo.status" class="ml-4"> <el-radio-group v-model="auditInfo.status" class="ml-4">
<el-radio :label="1">通过</el-radio> <el-radio :label="1">通过</el-radio>
@ -109,7 +52,7 @@
<el-input v-model="auditInfo.mark" type="textarea" /> <el-input v-model="auditInfo.mark" type="textarea" />
</el-form-item> </el-form-item>
</el-form> </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> <el-button @click="onAudit" type="primary">确认</el-button>
</div> </div>
</popup> </popup>
@ -184,6 +127,7 @@ const formRules = reactive<any>({
], ],
}); });
const dataJSON = ref({});
// //
const setFormData = async (data: Record<any, any>) => { const setFormData = async (data: Record<any, any>) => {
for (const key in formData) { for (const key in formData) {
@ -199,6 +143,7 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key]; 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" /> <dict-value :options="dictData.merchat_type" :value="row.type_id" />
</template> </template>
</el-table-column> --> </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.mer_name" show-overflow-tooltip />
<el-table-column label="联系人" prop="supplier.service_user" 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="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="settle_cycle" show-overflow-tooltip /> -->
<!-- <el-table-column label="利率" prop="interest_rate" show-overflow-tooltip /> --> <!-- <el-table-column label="利率" prop="interest_rate" 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 /> -->

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

View File

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

View File

@ -126,7 +126,7 @@
<material-picker v-model="formData.imgs" /> <material-picker v-model="formData.imgs" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <!-- <el-col :span="24">
<el-form-item label="标签" prop="sys_labels_arr"> <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)" <el-tag class="mr-2" v-for="(item, index) in formData.sys_labels_arr" @close="delTags(index)"
:key="index" closable> :key="index" closable>
@ -134,7 +134,7 @@
</el-tag> </el-tag>
<el-button type="primary" @click="showDialog = true">添加标签</el-button> <el-button type="primary" @click="showDialog = true">添加标签</el-button>
</el-form-item> </el-form-item>
</el-col> </el-col> -->
<!-- <el-col :span="24"> <!-- <el-col :span="24">
<el-form-item label="商品详情" prop="details"> <el-form-item label="商品详情" prop="details">
<material-picker v-model="formData.details" :limit="9" /> <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="buy" show-overflow-tooltip />
<el-table-column label="销货价格" prop="sell" 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="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 }"> <template #default="{ row }">
<span>{{ row.sys_labels_arr.map((t:any)=>t.name).join(',') }}</span> <span>{{ row.sys_labels_arr.map((t:any)=>t.name).join(',') }}</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="条形码" prop="code" show-overflow-tooltip /> <el-table-column label="条形码" prop="code" show-overflow-tooltip />
<!-- <el-table-column label="默认仓库" prop="warehouse_name" show-overflow-tooltip /> --> <!-- <el-table-column label="默认仓库" prop="warehouse_name" show-overflow-tooltip /> -->
<!-- <el-table-column label="商品货位" prop="location" show-overflow-tooltip /> --> <!-- <el-table-column label="商品货位" prop="location" show-overflow-tooltip /> -->