This commit is contained in:
zmj 2024-05-14 18:45:42 +08:00
parent cdc6489fff
commit c081f3269f
11 changed files with 825 additions and 373 deletions

View File

@ -1,5 +1,5 @@
NODE_ENV = 'development'
VITE_NOW_TYPE = 'dist'
# Base API
# VITE_APP_BASE_URL='http://192.168.1.16:8546'
# VITE_APP_BASE_URL='http://192.168.1.21:8546'
VITE_APP_BASE_URL='https://erp.lihaink.cn'

View File

@ -0,0 +1,36 @@
import request from '@/utils/request'
// 商户供应商提现表列表
export function apiMerchantWithdrawLists(params: any) {
return request.get({ url: '/withdraw/merchantwithdraw/lists', params })
}
// 添加商户供应商提现表
export function apiMerchantWithdrawAdd(params: any) {
return request.post({ url: '/withdraw/merchantwithdraw/add', params })
}
// 编辑商户供应商提现表
export function apiMerchantWithdrawEdit(params: any) {
return request.post({ url: '/withdraw/merchantwithdraw/edit', params })
}
// 删除商户供应商提现表
export function apiMerchantWithdrawDelete(params: any) {
return request.post({ url: '/withdraw/merchantwithdraw/delete', params })
}
// 商户供应商提现表详情
export function apiMerchantWithdrawDetail(params: any) {
return request.get({ url: '/withdraw/merchantwithdraw/detail', params })
}
// 删除商户供应商提现表
export function apimerchantwithdrawCheck(params: any) {
return request.post({ url: '/withdraw/merchantwithdraw/check', params })
}
export function apimerchantwithdraw(params: any) {
return request.post({ url: '/withdraw/merchantwithdraw/arrival', params })
}

View File

@ -1,31 +1,18 @@
<template>
<div class="material-select">
<popup
ref="popupRef"
width="830px"
custom-class="body-padding"
:title="`选择${tipsText}`"
@confirm="handleConfirm"
@close="handleClose"
>
<popup ref="popupRef" width="830px" custom-class="body-padding" :title="`选择${tipsText}`" @confirm="handleConfirm"
@close="handleClose">
<template v-if="!hiddenUpload" #trigger>
<div class="material-select__trigger clearfix" @click.stop>
<draggable class="draggable" v-model="fileList" animation="300" item-key="id">
<template v-slot:item="{ element, index }">
<div
class="material-preview"
:class="{
'is-disabled': disabled,
'is-one': limit == 1
}"
@click="showPopup(index)"
>
<div class="material-preview" :class="{
'is-disabled': disabled,
'is-one': limit == 1
}" @click="showPopup(index)">
<del-wrap @close="deleteImg(index)">
<file-item
:uri="excludeDomain ? getImageUrl(element) : element"
:file-size="size"
:type="type"
></file-item>
<file-item :uri="excludeDomain ? getImageUrl(element) : element" :file-size="size"
:type="type"></file-item>
</del-wrap>
<div class="operation-btns text-xs text-center">
<span>修改</span>
@ -35,24 +22,16 @@
</div>
</template>
</draggable>
<div
class="material-upload"
@click="showPopup(-1)"
v-show="showUpload"
:class="{
'is-disabled': disabled,
'is-one': limit == 1,
[uploadClass]: true
}"
>
<div class="material-upload" @click="showPopup(-1)" v-show="showUpload" :class="{
'is-disabled': disabled,
'is-one': limit == 1,
[uploadClass]: true
}">
<slot name="upload">
<div
class="upload-btn"
:style="{
width: size,
height: size
}"
>
<div class="upload-btn" :style="{
width: size,
height: size
}">
<icon :size="25" name="el-icon-Plus" />
<span>添加</span>
</div>
@ -62,13 +41,8 @@
</template>
<el-scrollbar>
<div class="material-wrap">
<material
ref="materialRef"
:type="type"
:file-size="fileSize"
:limit="meterialLimit"
@change="selectChange"
/>
<material ref="materialRef" :type="type" :file-size="fileSize" :limit="meterialLimit"
@change="selectChange" />
</div>
</el-scrollbar>
</popup>
@ -208,7 +182,7 @@ export default defineComponent({
}
const deleteImg = (index: number) => {
if(disabled.value) return;
if (disabled.value) return;
fileList.value.splice(index, 1)
handleChange()
}
@ -259,6 +233,7 @@ export default defineComponent({
<style scoped lang="scss">
.material-select {
.material-upload,
.material-preview {
position: relative;
@ -268,17 +243,21 @@ export default defineComponent({
margin-bottom: 8px;
box-sizing: border-box;
float: left;
&.is-disabled {
cursor: not-allowed;
}
&.is-one {
margin-bottom: 0;
}
&:hover {
.operation-btns {
display: block;
}
}
.operation-btns {
display: none;
position: absolute;
@ -290,12 +269,14 @@ export default defineComponent({
background-color: rgba(0, 0, 0, 0.3);
}
}
.material-upload {
:deep(.upload-btn) {
@apply text-tx-secondary box-border rounded border-br border-dashed border flex flex-col justify-center items-center;
}
}
}
.material-wrap {
min-width: 720px;
height: 430px;

View File

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

View File

@ -62,9 +62,9 @@
<el-descriptions-item label="商品图片">
<material-picker v-model="formData.imgs" disabled />
</el-descriptions-item>
<el-descriptions-item label="商品详情">
<!-- <el-descriptions-item label="商品详情">
<material-picker v-model="formData.details" disabled />
</el-descriptions-item>
</el-descriptions-item> -->
</el-descriptions>
</popup>
</div>

View File

@ -1,14 +1,14 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="商品名称" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<!-- <el-col :span="8"
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-row>
<el-col :span="8">
<el-form-item label="商品名称" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入商品名称" />
</el-form-item>
</el-col>
<!-- <el-col :span="8"
>
<el-form-item label="首拼字母" prop="py">
<el-input
@ -18,132 +18,133 @@
/> </el-form-item
>
</el-col> -->
<!-- <el-col :span="8">
<!-- <el-col :span="8">
<el-form-item label="商品编号" prop="number">
<el-input v-model="formData.number" clearable placeholder="请输入商品编号" />
</el-form-item>
</el-col> -->
<el-col :span="8">
<el-form-item label="规格型号" prop="spec">
<el-input v-model="formData.spec" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品分类" prop="class">
<el-cascader style="width: 100%" v-model="formData.class" :props="props" placeholder="请选择商品分类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品品牌" prop="brand">
<el-cascader style="width: 100%" v-model="formData.brand" :options="brandList" :props="{
value: 'id',
label: 'name',
emitPath: false,
}" placeholder="请选择商品品牌" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品单位" prop="unit">
<el-cascader style="width: 100%" v-model="formData.unit" :options="unitList" :props="{
value: 'id',
label: 'name',
emitPath: false,
}" placeholder="请选择商品单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="标签" prop="sys_labels">
<el-input v-model="formData.sys_labels_text" readonly @click="showDialog = true" clearable
placeholder="请输入标签" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="购货价格" prop="buy">
<el-input v-model="formData.buy" clearable placeholder="请输入购货价格" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销货价格" prop="sell">
<el-input v-model="formData.sell" clearable placeholder="请输入销货价格" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="零售价格" prop="retail">
<el-input v-model="formData.retail" clearable placeholder="请输入零售价格" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="兑换积分" prop="integral">
<el-input v-model="formData.integral" clearable placeholder="请输入兑换积分" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率" prop="tax_rate">
<el-input v-model="formData.tax_rate" clearable placeholder="请输入税率" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="条形码" prop="code">
<el-input v-model="formData.code" clearable placeholder="请输入条形码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="默认仓库" prop="warehouse">
<el-cascader style="width: 100%" v-model="formData.warehouse" :options="warehouseList" :props="{
value: 'id',
label: 'name',
emitPath: false,
}" placeholder="请选择仓库" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品货位" prop="location">
<el-input v-model="formData.location" clearable placeholder="请输入商品货位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存阈值" prop="stocktip">
<el-input v-model="formData.stocktip" clearable placeholder="请输入库存阈值" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="零售名称" prop="retail_name">
<el-input v-model="formData.retail_name" clearable placeholder="请输入零售名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="扩展信息" prop="more">
<el-input v-model="formData.more" clearable placeholder="请输入扩展信息" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注信息" prop="data">
<el-input v-model="formData.data" clearable placeholder="请输入备注信息" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" type="number" clearable placeholder="请输入排序" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品图片" prop="imgs">
<material-picker v-model="formData.imgs" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品详情" prop="details">
<material-picker v-model="formData.details" :limit="9" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-dialog v-model="showDialog" title="选择标签" width="70%">
<dialogTable multipleChoice :config="goods_label" @customEvent="customEvent">
</dialogTable>
</el-dialog>
</popup>
</div>
<el-col :span="8">
<el-form-item label="规格型号" prop="spec">
<el-input v-model="formData.spec" clearable placeholder="请输入规格型号" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品分类" prop="class">
<el-cascader style="width: 100%" v-model="formData.class" class="caser" filterable
:before-filter="beforeFilter" :props="props" placeholder="请选择商品分类" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品品牌" prop="brand">
<el-cascader style="width: 100%" v-model="formData.brand" :options="brandList" :props="{
value: 'id',
label: 'name',
emitPath: false,
}" placeholder="请选择商品品牌" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品单位" prop="unit">
<el-cascader style="width: 100%" v-model="formData.unit" :options="unitList" :props="{
value: 'id',
label: 'name',
emitPath: false,
}" placeholder="请选择商品单位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="标签" prop="sys_labels">
<el-input v-model="formData.sys_labels_text" readonly @click="showDialog = true" clearable
placeholder="请输入标签" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="购货价格" prop="buy">
<el-input v-model="formData.buy" clearable placeholder="请输入购货价格" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="销货价格" prop="sell">
<el-input v-model="formData.sell" clearable placeholder="请输入销货价格" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="零售价格" prop="retail">
<el-input v-model="formData.retail" clearable placeholder="请输入零售价格" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="兑换积分" prop="integral">
<el-input v-model="formData.integral" clearable placeholder="请输入兑换积分" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="税率" prop="tax_rate">
<el-input v-model="formData.tax_rate" clearable placeholder="请输入税率" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="条形码" prop="code">
<el-input v-model="formData.code" clearable placeholder="请输入条形码" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="默认仓库" prop="warehouse">
<el-cascader style="width: 100%" v-model="formData.warehouse" :options="warehouseList" :props="{
value: 'id',
label: 'name',
emitPath: false,
}" placeholder="请选择仓库" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="商品货位" prop="location">
<el-input v-model="formData.location" clearable placeholder="请输入商品货位" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="库存阈值" prop="stocktip">
<el-input v-model="formData.stocktip" clearable placeholder="请输入库存阈值" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="零售名称" prop="retail_name">
<el-input v-model="formData.retail_name" clearable placeholder="请输入零售名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="扩展信息" prop="more">
<el-input v-model="formData.more" clearable placeholder="请输入扩展信息" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="备注信息" prop="data">
<el-input v-model="formData.data" clearable placeholder="请输入备注信息" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" type="number" clearable placeholder="请输入排序" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="商品图片" prop="imgs">
<material-picker v-model="formData.imgs" />
</el-form-item>
</el-col>
<!-- <el-col :span="24">
<el-form-item label="商品详情" prop="details">
<material-picker v-model="formData.details" :limit="9" />
</el-form-item>
</el-col> -->
</el-row>
</el-form>
<el-dialog v-model="showDialog" title="选择标签" width="70%">
<dialogTable multipleChoice :config="goods_label" @customEvent="customEvent">
</dialogTable>
</el-dialog>
</popup>
</div>
</template>
<script lang="ts" setup name="goodsEdit">
@ -157,10 +158,10 @@ import { apiWarehouseLists } from "@/api/warehouse";
import { goods_label } from "@/components/dialogTable/dialogTableConfig"
import type { PropType } from "vue";
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({}),
},
});
const emit = defineEmits(["success", "close"]);
const formRef = shallowRef<FormInstance>();
@ -170,36 +171,36 @@ const showDialog = ref(false)
//
const popupTitle = computed(() => {
return mode.value == "edit" ? "编辑商品表" : "新增商品表";
return mode.value == "edit" ? "编辑商品表" : "新增商品表";
});
//
const formData = reactive({
id: "",
name: "",
py: "",
number: "",
spec: "",
class: "",
brand: "",
unit: "",
buy: "",
sell: "",
retail: "",
integral: "",
code: "",
tax_rate: "",
warehouse: "",
location: "",
stocktip: "",
retail_name: "",
sys_labels_text: "",
sys_labels: "",
imgs: "",
details: "",
data: "",
more: "",
sort: "",
id: "",
name: "",
py: "",
number: "",
spec: "",
class: "",
brand: "",
unit: "",
buy: "",
sell: "",
retail: "",
integral: "",
code: "",
tax_rate: "",
warehouse: "",
location: "",
stocktip: "",
retail_name: "",
sys_labels_text: "",
sys_labels: "",
imgs: "",
details: "",
data: "",
more: "",
sort: "",
});
@ -239,197 +240,260 @@ const formData = reactive({
const customEvent = (e) => {
formData.sys_labels = []
let text = []
e.forEach(item => {
formData.sys_labels.push(item.id)
text.push(item.name)
});
formData.sys_labels_text = text.join(',')
formData.sys_labels = formData.sys_labels.join(',')
showDialog.value = false
formData.sys_labels = []
let text = []
e.forEach(item => {
formData.sys_labels.push(item.id)
text.push(item.name)
});
formData.sys_labels_text = text.join(',')
formData.sys_labels = formData.sys_labels.join(',')
showDialog.value = false
}
//
const formRules = reactive<any>({
name: [
{
required: true,
message: "请输入商品名称",
trigger: ["blur"],
},
],
spec: [
{
required: true,
message: "请输入规格型号",
trigger: ["blur"],
},
],
sys_labels: [
{
required: true,
message: "请选择标签",
trigger: ["blur"],
},
],
buy: [
{
required: true,
message: "请输入购货价格",
trigger: ["blur"],
},
],
name: [
{
required: true,
message: "请输入商品名称",
trigger: ["blur"],
},
],
spec: [
{
required: true,
message: "请输入规格型号",
trigger: ["blur"],
},
],
sys_labels: [
{
required: true,
message: "请选择标签",
trigger: ["blur"],
},
],
buy: [
{
required: true,
message: "请输入购货价格",
trigger: ["blur"],
},
],
stocktip: [
{
required: true,
message: "请输入库存阈值",
trigger: ["blur"],
},
],
stocktip: [
{
required: true,
message: "请输入库存阈值",
trigger: ["blur"],
},
],
py: [
{
required: true,
message: "请输入首拼字母",
trigger: ["blur"],
},
],
class: [
{
required: true,
message: "请输入商品分类",
trigger: ["blur"],
},
],
warehouse: [
{
required: true,
message: "请输入库存阈值",
trigger: ["blur"],
},
],
imgs: [
{
required: true,
message: "请上传商品图片",
trigger: ["blur"],
},
],
py: [
{
required: true,
message: "请输入首拼字母",
trigger: ["blur"],
},
],
class: [
{
required: true,
message: "请输入商品分类",
trigger: ["blur"],
},
],
warehouse: [
{
required: true,
message: "请输入库存阈值",
trigger: ["blur"],
},
],
imgs: [
{
required: true,
message: "请上传商品图片",
trigger: ["blur"],
},
],
// brand: [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
unit: [
{
required: true,
message: "请输入商品单位",
trigger: ["blur"],
},
],
// brand: [
// {
// required: true,
// message: "",
// trigger: ["blur"],
// },
// ],
unit: [
{
required: true,
message: "请输入商品单位",
trigger: ["blur"],
},
],
});
const props = {
value: "id",
label: "name",
emitPath: false,
lazy: true,
lazyLoad(node, resolve) {
let pid = node.value || 0;
apiGoodsclassLists({
pid: pid,
page_size: 10000,
}).then((res) => {
resolve(
res.lists.map((item: any) => {
item.leaf = item.is_menu == 0;
return item;
//
let resolves;
let nodes;
let flag = ref(false);
let name;
onMounted(() => {
setTimeout(() => {
let dom = document.getElementsByClassName('caser')[0]
let ipt = dom.getElementsByClassName('el-input__inner')[0]
ipt.addEventListener('input', (e) => {
beforeFilter(e.target.value)
})
);
});
},
})
})
const beforeFilter = (value) => {
name = value
flag.value = true
props.lazyLoad(nodes, resolves)
return false
}
const props = {
value: "id",
label: "name",
emitPath: false,
lazy: true,
lazyLoad(node, resolve) {
if (!resolves) resolves = resolve;
if (!nodes) nodes = node;
let pid = node.value || 0;
let data = {}
if (flag.value) {
data = { name: name }
if (!name) {
data = {
pid: pid,
page_size: 10000,
}
}
} else {
data = {
pid: pid,
page_size: 10000,
}
}
apiGoodsclassLists({
...data
}).then((res) => {
resolve(
res.lists.map((item: any) => {
item.leaf = item.is_menu == 0;
flag.value = false
return item;
})
);
});
},
};
const classList = ref([]);
const getClassList = () => {
apiGoodsclassLists({}).then((res) => {
classList.value = res.lists;
});
apiGoodsclassLists({}).then((res) => {
classList.value = res.lists;
});
};
// getClassList();
const brandList = ref([]);
const getBrandList = () => {
apiBrandLists({}).then((res) => {
brandList.value = res.lists;
});
apiBrandLists({}).then((res) => {
brandList.value = res.lists;
});
};
getBrandList();
const unitList = ref([]);
const getUnitList = () => {
apiUnitLists({}).then((res) => {
unitList.value = res.lists;
});
apiUnitLists({}).then((res) => {
unitList.value = res.lists;
});
};
getUnitList();
const warehouseList = ref([]);
const getWarehouseList = () => {
apiWarehouseLists({}).then((res) => {
warehouseList.value = res.lists;
});
apiWarehouseLists({}).then((res) => {
warehouseList.value = res.lists;
});
};
getWarehouseList();
//
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];
}
}
}
};
const getDetail = async (row: Record<string, any>) => {
const data = await apiGoodsDetail({
id: row.id,
});
setFormData(data);
const data = await apiGoodsDetail({
id: row.id,
});
setFormData(data);
};
//
const handleSubmit = async () => {
await formRef.value?.validate();
const data = { ...formData };
mode.value == "edit" ? await apiGoodsEdit(data) : await apiGoodsAdd(data);
popupRef.value?.close();
emit("success");
await formRef.value?.validate();
const data = { ...formData };
mode.value == "edit" ? await apiGoodsEdit(data) : await apiGoodsAdd(data);
popupRef.value?.close();
emit("success");
};
//
const open = (type = "add") => {
mode.value = type;
popupRef.value?.open();
mode.value = type;
popupRef.value?.open();
};
//
const handleClose = () => {
emit("close");
emit("close");
};
defineExpose({
open,
setFormData,
getDetail,
open,
setFormData,
getDetail,
});
</script>

View File

@ -1,16 +1,9 @@
<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" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="标签名" prop="name" required>
<el-input v-model="formData.name" clearable placeholder="请输入" :readonly="false"/>
<el-input v-model="formData.name" clearable placeholder="请输入" :readonly="false" />
</el-form-item>
</el-form>
</popup>
@ -65,8 +58,8 @@ const setFormData = async (data: Record<any, any>) => {
formData[key] = data[key]
}
}
}
const getDetail = async (row: Record<string, any>) => {
@ -80,9 +73,9 @@ const getDetail = async (row: Record<string, any>) => {
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiGoodsLabelEdit(data)
const data = { ...formData, }
mode.value == 'edit'
? await apiGoodsLabelEdit(data)
: await apiGoodsLabelAdd(data)
popupRef.value?.close()
emit('success')
@ -100,6 +93,24 @@ const handleClose = () => {
}
let list = ['pingguo', 'xiangjiao', 'list', 'sadasd']
let i = 0
const handAdd = () => {
apiGoodsLabelAdd({ name: list[i] })
}
// let timer = setInterval(() => {
// i++
// if (i > list.length) {
// clearTimeout(timer)
// return
// }
// handAdd()
// }, 2000)
defineExpose({
open,

View File

@ -73,9 +73,10 @@ import { useDictData } from '@/hooks/useDictOptions'
import { apiUnitLists, apiUnitDelete, apiUnitDetail } from '@/api/unit'
import feedback from '@/utils/feedback'
import DetailPopup from './detail.vue'
import EditPopup from "./edit.vue";
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
const detailRef = shallowRef<InstanceType<typeof EditPopup>>()
const editRef = ref(null)
const detailRef = ref(null)
//
const showEdit = ref(false)
const showDetail = ref(false)
@ -117,6 +118,9 @@ const handleAdd = async () => {
//
const handleEdit = async (data: any) => {
console.log(editRef.value)
showEdit.value = true
await nextTick()
editRef.value?.open('edit')

View File

@ -0,0 +1,189 @@
<template>
<div class="edit-popup">
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<!-- <el-form-item label="用户类型 1-商户 2-供应商" prop="user_type">
<el-input v-model="formData.user_type" clearable placeholder="请输入用户类型 1-商户 2-供应商" :readonly="false" />
</el-form-item>
<el-form-item label="商户id" prop="mer_id">
<el-input v-model="formData.mer_id" clearable placeholder="请输入商户id" :readonly="false" />
</el-form-item>
<el-form-item label="供应商id" prop="supplier_id">
<el-input v-model="formData.supplier_id" clearable placeholder="请输入供应商id" :readonly="false" />
</el-form-item>
<el-form-item label="提现账户id" prop="merchant_bank_id">
<el-input v-model="formData.merchant_bank_id" clearable placeholder="请输入提现账户id" :readonly="false" />
</el-form-item>
<el-form-item label="提现金额" prop="amout">
<el-input v-model="formData.amout" clearable placeholder="请输入提现金额" :readonly="false" />
</el-form-item>
<el-form-item label="审核状态 0-待审核 1-已审核 2-审核不通过" prop="is_check">
<el-input v-model="formData.is_check" clearable placeholder="请输入审核状态 0-待审核 1-已审核 2-审核不通过"
:readonly="false" />
</el-form-item>
<el-form-item label="是否到账 0-未到账 1-已到账" prop="is_arrival">
<el-input v-model="formData.is_arrival" clearable placeholder="请输入是否到账 0-未到账 1-已到账" :readonly="false" />
</el-form-item>
<el-form-item label="到账凭据" prop="arrival_proof">
<el-input v-model="formData.arrival_proof" clearable placeholder="请输入到账凭据" :readonly="false" />
</el-form-item>
<el-form-item label="操作人员id" prop="admin_id">
<el-input v-model="formData.admin_id" clearable placeholder="请输入操作人员id" :readonly="false" />
</el-form-item> -->
<el-form-item label="审核意见" prop="is_check" v-if="formData.is_check == 0">
<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>
</el-radio-group>
</el-form-item>
<el-form-item label="拒绝原因" v-if="formData.is_check == 2" prop="fail_msg">
<el-input type="textarea" v-model="formData.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="formData.arrival_proof" />
<!-- <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>
</el-radio-group> -->
</el-form-item>
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="merchantWithdrawEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiMerchantWithdrawAdd, apimerchantwithdraw, apiMerchantWithdrawDetail, apimerchantwithdrawCheck } from '@/api/merchant_withdraw'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑商户供应商提现表' : '新增商户供应商提现表'
})
//
const formData = reactive({
id: "",
is_check: '',
fail_msg: "",
arrival_proof: []
})
//
const formRules = reactive<any>({
user_type: [{
required: true,
message: '请输入用户类型 1-商户 2-供应商',
trigger: ['blur']
}],
mer_id: [{
required: true,
message: '请输入商户id',
trigger: ['blur']
}],
supplier_id: [{
required: true,
message: '请输入供应商id',
trigger: ['blur']
}],
merchant_bank_id: [{
required: true,
message: '请输入提现账户id',
trigger: ['blur']
}],
amout: [{
required: true,
message: '请输入提现金额',
trigger: ['blur']
}],
is_check: [{
required: true,
message: '请输入审核状态 0-待审核 1-已审核 2-审核不通过',
trigger: ['blur']
}],
is_arrival: [{
required: true,
message: '请输入是否到账 0-未到账 1-已到账',
trigger: ['blur']
}],
admin_id: [{
required: true,
message: '请输入操作人员id',
trigger: ['blur']
}]
})
//
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]
}
}
console.log(data)
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiMerchantWithdrawDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
formData.is_check == 0 ?
await apimerchantwithdrawCheck(data)
: await apimerchantwithdraw(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,163 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form class="mb-[-16px]" :model="queryParams" inline>
<el-form-item label="用户类型" prop="user_type">
<el-input class="w-[280px]" v-model="queryParams.user_type" clearable placeholder="请输入用户类型" />
</el-form-item>
<el-form-item label="审核状态" prop="is_check">
<el-input class="w-[280px]" v-model="queryParams.is_check" clearable placeholder="请输入审核状态" />
</el-form-item>
<el-form-item label="是否到账" prop="is_arrival">
<el-input class="w-[280px]" v-model="queryParams.is_arrival" 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">
<el-button v-perms="['withdraw.merchant_withdraw/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button v-perms="['withdraw.merchant_withdraw/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="用户类型" prop="user_type" show-overflow-tooltip>
<template #default="{ row }">
{{ row.user_type == 1 ? "商户" : "供应商" }}
</template>
</el-table-column> -->
<el-table-column label="提现商户" prop="mer_name" show-overflow-tooltip />
<!-- <el-table-column label="供应商id" prop="supplier_id" show-overflow-tooltip /> -->
<!-- <el-table-column label="提现账户id" prop="merchant_bank_id" show-overflow-tooltip /> -->
<el-table-column label="提现银行" prop="merchant_bank_info.bank_info.name" show-overflow-tooltip />
<el-table-column label="提现金额" prop="amount" show-overflow-tooltip />
<el-table-column label="提现账号" prop="merchant_bank_info.bank_code" show-overflow-tooltip />
<el-table-column label="开户网点" prop="merchant_bank_info.bank_branch" show-overflow-tooltip />
<el-table-column label="账户名称" prop="merchant_bank_info.name" show-overflow-tooltip />
<el-table-column label="账户类型" prop="merchant_bank_info.is_own" show-overflow-tooltip>
<template #default="{ row }">
{{ row.merchant_bank_info.is_own ? "对公账户" : "个人账户" }}
</template>
</el-table-column>
<el-table-column label="审核状态" prop="" show-overflow-tooltip>
<template #default="{ row }">
{{ row.is_check == 1 ? '审核通过' : row.is_check == 2 ? "审核不通过" : "待审核" }}
</template>
</el-table-column>
<el-table-column label="是否到账" prop="is_arrival" show-overflow-tooltip>
<template #default="{ row }">
{{ row.is_arrival ? "已到账" : "未到账" }}
</template>
</el-table-column>
<!-- <el-table-column label="到账凭据" prop="arrival_proof" show-overflow-tooltip>
<template #default="{ row }">
<el-image v-for="item in row.arrival_proof" :src="item" style="width: 50px;height: 50px" />
</template>
</el-table-column> -->
<el-table-column label="操作人员" prop="admin_name" show-overflow-tooltip />
<el-table-column label="操作" width="170" fixed="right">
<template #default="{ row }">
<el-button v-if="row.is_check == 0" v-perms="['withdraw.merchant_withdraw/edit']" type="primary"
link @click="handleEdit(row)">
审核
</el-button>
<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']"
type="primary" link @click="handleEdit(row)">
提现到账
</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" />
</div>
</template>
<script lang="ts" setup name="merchantWithdrawLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiMerchantWithdrawLists, apiMerchantWithdrawDelete } from '@/api/merchant_withdraw'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
user_type: '',
mer_id: '',
supplier_id: '',
merchant_bank_id: '',
amout: '',
is_check: '',
is_arrival: '',
arrival_proof: '',
admin_id: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiMerchantWithdrawLists,
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 apiMerchantWithdrawDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -1,15 +1,23 @@
<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" @confirm="handleSubmit" @close="handleClose"
:bottom-btn="false">
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
<el-form-item label="用户id" prop="uid">
<el-input v-model="formData.uid" clearable placeholder="请输入用户id" :readonly="false" />
</el-form-item>
<el-form-item label="反馈内容" prop="content">
<el-input v-model="formData.content" clearable placeholder="请输入反馈内容" :readonly="false" />
<el-input v-model="formData.content" type="textarea" clearable placeholder="请输入反馈内容"
:readonly="false" />
</el-form-item>
<el-form-item label="反馈图片" prop="images">
<el-input v-model="formData.images" clearable placeholder="请输入反馈图片" :readonly="false" />
<!-- <el-input v-model="formData.images" clearable placeholder="请输入反馈图片" :readonly="false" /> -->
<el-image v-for="(item, index) in formData.images" :key="index" style="width: 100px; height: 100px"
:src="item" :zoom-rate="1.2" :max-scale="7" :min-scale="0.2" :preview-src-list="formData.images"
:initial-index="4" fit="cover" />
</el-form-item>
<el-form-item label="联系姓名" prop="name">
<el-input v-model="formData.name" clearable placeholder="请输入联系姓名" :readonly="false" />