add
This commit is contained in:
parent
cdc6489fff
commit
c081f3269f
|
@ -1,5 +1,5 @@
|
||||||
NODE_ENV = 'development'
|
NODE_ENV = 'development'
|
||||||
VITE_NOW_TYPE = 'dist'
|
VITE_NOW_TYPE = 'dist'
|
||||||
# Base API
|
# 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'
|
VITE_APP_BASE_URL='https://erp.lihaink.cn'
|
|
@ -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 })
|
||||||
|
}
|
|
@ -1,31 +1,18 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="material-select">
|
<div class="material-select">
|
||||||
<popup
|
<popup ref="popupRef" width="830px" custom-class="body-padding" :title="`选择${tipsText}`" @confirm="handleConfirm"
|
||||||
ref="popupRef"
|
@close="handleClose">
|
||||||
width="830px"
|
|
||||||
custom-class="body-padding"
|
|
||||||
:title="`选择${tipsText}`"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
@close="handleClose"
|
|
||||||
>
|
|
||||||
<template v-if="!hiddenUpload" #trigger>
|
<template v-if="!hiddenUpload" #trigger>
|
||||||
<div class="material-select__trigger clearfix" @click.stop>
|
<div class="material-select__trigger clearfix" @click.stop>
|
||||||
<draggable class="draggable" v-model="fileList" animation="300" item-key="id">
|
<draggable class="draggable" v-model="fileList" animation="300" item-key="id">
|
||||||
<template v-slot:item="{ element, index }">
|
<template v-slot:item="{ element, index }">
|
||||||
<div
|
<div class="material-preview" :class="{
|
||||||
class="material-preview"
|
'is-disabled': disabled,
|
||||||
:class="{
|
'is-one': limit == 1
|
||||||
'is-disabled': disabled,
|
}" @click="showPopup(index)">
|
||||||
'is-one': limit == 1
|
|
||||||
}"
|
|
||||||
@click="showPopup(index)"
|
|
||||||
>
|
|
||||||
<del-wrap @close="deleteImg(index)">
|
<del-wrap @close="deleteImg(index)">
|
||||||
<file-item
|
<file-item :uri="excludeDomain ? getImageUrl(element) : element" :file-size="size"
|
||||||
:uri="excludeDomain ? getImageUrl(element) : element"
|
:type="type"></file-item>
|
||||||
:file-size="size"
|
|
||||||
:type="type"
|
|
||||||
></file-item>
|
|
||||||
</del-wrap>
|
</del-wrap>
|
||||||
<div class="operation-btns text-xs text-center">
|
<div class="operation-btns text-xs text-center">
|
||||||
<span>修改</span>
|
<span>修改</span>
|
||||||
|
@ -35,24 +22,16 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</draggable>
|
</draggable>
|
||||||
<div
|
<div class="material-upload" @click="showPopup(-1)" v-show="showUpload" :class="{
|
||||||
class="material-upload"
|
'is-disabled': disabled,
|
||||||
@click="showPopup(-1)"
|
'is-one': limit == 1,
|
||||||
v-show="showUpload"
|
[uploadClass]: true
|
||||||
:class="{
|
}">
|
||||||
'is-disabled': disabled,
|
|
||||||
'is-one': limit == 1,
|
|
||||||
[uploadClass]: true
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<slot name="upload">
|
<slot name="upload">
|
||||||
<div
|
<div class="upload-btn" :style="{
|
||||||
class="upload-btn"
|
width: size,
|
||||||
:style="{
|
height: size
|
||||||
width: size,
|
}">
|
||||||
height: size
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<icon :size="25" name="el-icon-Plus" />
|
<icon :size="25" name="el-icon-Plus" />
|
||||||
<span>添加</span>
|
<span>添加</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -62,13 +41,8 @@
|
||||||
</template>
|
</template>
|
||||||
<el-scrollbar>
|
<el-scrollbar>
|
||||||
<div class="material-wrap">
|
<div class="material-wrap">
|
||||||
<material
|
<material ref="materialRef" :type="type" :file-size="fileSize" :limit="meterialLimit"
|
||||||
ref="materialRef"
|
@change="selectChange" />
|
||||||
:type="type"
|
|
||||||
:file-size="fileSize"
|
|
||||||
:limit="meterialLimit"
|
|
||||||
@change="selectChange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</popup>
|
</popup>
|
||||||
|
@ -208,7 +182,7 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
const deleteImg = (index: number) => {
|
const deleteImg = (index: number) => {
|
||||||
if(disabled.value) return;
|
if (disabled.value) return;
|
||||||
fileList.value.splice(index, 1)
|
fileList.value.splice(index, 1)
|
||||||
handleChange()
|
handleChange()
|
||||||
}
|
}
|
||||||
|
@ -259,6 +233,7 @@ export default defineComponent({
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.material-select {
|
.material-select {
|
||||||
|
|
||||||
.material-upload,
|
.material-upload,
|
||||||
.material-preview {
|
.material-preview {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
@ -268,17 +243,21 @@ export default defineComponent({
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
float: left;
|
float: left;
|
||||||
|
|
||||||
&.is-disabled {
|
&.is-disabled {
|
||||||
cursor: not-allowed;
|
cursor: not-allowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.is-one {
|
&.is-one {
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
.operation-btns {
|
.operation-btns {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.operation-btns {
|
.operation-btns {
|
||||||
display: none;
|
display: none;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
@ -290,12 +269,14 @@ export default defineComponent({
|
||||||
background-color: rgba(0, 0, 0, 0.3);
|
background-color: rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.material-upload {
|
.material-upload {
|
||||||
:deep(.upload-btn) {
|
:deep(.upload-btn) {
|
||||||
@apply text-tx-secondary box-border rounded border-br border-dashed border flex flex-col justify-center items-center;
|
@apply text-tx-secondary box-border rounded border-br border-dashed border flex flex-col justify-center items-center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.material-wrap {
|
.material-wrap {
|
||||||
min-width: 720px;
|
min-width: 720px;
|
||||||
height: 430px;
|
height: 430px;
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
<template>
|
<template></template>
|
||||||
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style></style>
|
||||||
|
|
||||||
</style>
|
|
|
@ -62,9 +62,9 @@
|
||||||
<el-descriptions-item label="商品图片">
|
<el-descriptions-item label="商品图片">
|
||||||
<material-picker v-model="formData.imgs" disabled />
|
<material-picker v-model="formData.imgs" disabled />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="商品详情">
|
<!-- <el-descriptions-item label="商品详情">
|
||||||
<material-picker v-model="formData.details" disabled />
|
<material-picker v-model="formData.details" disabled />
|
||||||
</el-descriptions-item>
|
</el-descriptions-item> -->
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</popup>
|
</popup>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<popup ref="popupRef" :title="popupTitle" :async="true" width="80%" @confirm="handleSubmit" @close="handleClose">
|
<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-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="商品名称" prop="name">
|
<el-form-item label="商品名称" prop="name">
|
||||||
<el-input v-model="formData.name" clearable placeholder="请输入商品名称" />
|
<el-input v-model="formData.name" clearable placeholder="请输入商品名称" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- <el-col :span="8"
|
<!-- <el-col :span="8"
|
||||||
>
|
>
|
||||||
<el-form-item label="首拼字母" prop="py">
|
<el-form-item label="首拼字母" prop="py">
|
||||||
<el-input
|
<el-input
|
||||||
|
@ -18,132 +18,133 @@
|
||||||
/> </el-form-item
|
/> </el-form-item
|
||||||
>
|
>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<!-- <el-col :span="8">
|
<!-- <el-col :span="8">
|
||||||
<el-form-item label="商品编号" prop="number">
|
<el-form-item label="商品编号" prop="number">
|
||||||
<el-input v-model="formData.number" clearable placeholder="请输入商品编号" />
|
<el-input v-model="formData.number" clearable placeholder="请输入商品编号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col> -->
|
</el-col> -->
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="规格型号" prop="spec">
|
<el-form-item label="规格型号" prop="spec">
|
||||||
<el-input v-model="formData.spec" clearable placeholder="请输入规格型号" />
|
<el-input v-model="formData.spec" clearable placeholder="请输入规格型号" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="商品分类" prop="class">
|
<el-form-item label="商品分类" prop="class">
|
||||||
<el-cascader style="width: 100%" v-model="formData.class" :props="props" placeholder="请选择商品分类" />
|
<el-cascader style="width: 100%" v-model="formData.class" class="caser" filterable
|
||||||
</el-form-item>
|
:before-filter="beforeFilter" :props="props" placeholder="请选择商品分类" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="商品品牌" prop="brand">
|
<el-col :span="8">
|
||||||
<el-cascader style="width: 100%" v-model="formData.brand" :options="brandList" :props="{
|
<el-form-item label="商品品牌" prop="brand">
|
||||||
value: 'id',
|
<el-cascader style="width: 100%" v-model="formData.brand" :options="brandList" :props="{
|
||||||
label: 'name',
|
value: 'id',
|
||||||
emitPath: false,
|
label: 'name',
|
||||||
}" placeholder="请选择商品品牌" />
|
emitPath: false,
|
||||||
</el-form-item>
|
}" placeholder="请选择商品品牌" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="商品单位" prop="unit">
|
<el-col :span="8">
|
||||||
<el-cascader style="width: 100%" v-model="formData.unit" :options="unitList" :props="{
|
<el-form-item label="商品单位" prop="unit">
|
||||||
value: 'id',
|
<el-cascader style="width: 100%" v-model="formData.unit" :options="unitList" :props="{
|
||||||
label: 'name',
|
value: 'id',
|
||||||
emitPath: false,
|
label: 'name',
|
||||||
}" placeholder="请选择商品单位" />
|
emitPath: false,
|
||||||
</el-form-item>
|
}" placeholder="请选择商品单位" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="标签" prop="sys_labels">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.sys_labels_text" readonly @click="showDialog = true" clearable
|
<el-form-item label="标签" prop="sys_labels">
|
||||||
placeholder="请输入标签" />
|
<el-input v-model="formData.sys_labels_text" readonly @click="showDialog = true" clearable
|
||||||
</el-form-item>
|
placeholder="请输入标签" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="购货价格" prop="buy">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.buy" clearable placeholder="请输入购货价格" />
|
<el-form-item label="购货价格" prop="buy">
|
||||||
</el-form-item>
|
<el-input v-model="formData.buy" clearable placeholder="请输入购货价格" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="销货价格" prop="sell">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.sell" clearable placeholder="请输入销货价格" />
|
<el-form-item label="销货价格" prop="sell">
|
||||||
</el-form-item>
|
<el-input v-model="formData.sell" clearable placeholder="请输入销货价格" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="零售价格" prop="retail">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.retail" clearable placeholder="请输入零售价格" />
|
<el-form-item label="零售价格" prop="retail">
|
||||||
</el-form-item>
|
<el-input v-model="formData.retail" clearable placeholder="请输入零售价格" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="兑换积分" prop="integral">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.integral" clearable placeholder="请输入兑换积分" />
|
<el-form-item label="兑换积分" prop="integral">
|
||||||
</el-form-item>
|
<el-input v-model="formData.integral" clearable placeholder="请输入兑换积分" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="税率" prop="tax_rate">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.tax_rate" clearable placeholder="请输入税率" />
|
<el-form-item label="税率" prop="tax_rate">
|
||||||
</el-form-item>
|
<el-input v-model="formData.tax_rate" clearable placeholder="请输入税率" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="条形码" prop="code">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.code" clearable placeholder="请输入条形码" />
|
<el-form-item label="条形码" prop="code">
|
||||||
</el-form-item>
|
<el-input v-model="formData.code" clearable placeholder="请输入条形码" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="默认仓库" prop="warehouse">
|
<el-col :span="8">
|
||||||
<el-cascader style="width: 100%" v-model="formData.warehouse" :options="warehouseList" :props="{
|
<el-form-item label="默认仓库" prop="warehouse">
|
||||||
value: 'id',
|
<el-cascader style="width: 100%" v-model="formData.warehouse" :options="warehouseList" :props="{
|
||||||
label: 'name',
|
value: 'id',
|
||||||
emitPath: false,
|
label: 'name',
|
||||||
}" placeholder="请选择仓库" />
|
emitPath: false,
|
||||||
</el-form-item>
|
}" placeholder="请选择仓库" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="商品货位" prop="location">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.location" clearable placeholder="请输入商品货位" />
|
<el-form-item label="商品货位" prop="location">
|
||||||
</el-form-item>
|
<el-input v-model="formData.location" clearable placeholder="请输入商品货位" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="库存阈值" prop="stocktip">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.stocktip" clearable placeholder="请输入库存阈值" />
|
<el-form-item label="库存阈值" prop="stocktip">
|
||||||
</el-form-item>
|
<el-input v-model="formData.stocktip" clearable placeholder="请输入库存阈值" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="零售名称" prop="retail_name">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.retail_name" clearable placeholder="请输入零售名称" />
|
<el-form-item label="零售名称" prop="retail_name">
|
||||||
</el-form-item>
|
<el-input v-model="formData.retail_name" clearable placeholder="请输入零售名称" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="扩展信息" prop="more">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.more" clearable placeholder="请输入扩展信息" />
|
<el-form-item label="扩展信息" prop="more">
|
||||||
</el-form-item>
|
<el-input v-model="formData.more" clearable placeholder="请输入扩展信息" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="备注信息" prop="data">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.data" clearable placeholder="请输入备注信息" />
|
<el-form-item label="备注信息" prop="data">
|
||||||
</el-form-item>
|
<el-input v-model="formData.data" clearable placeholder="请输入备注信息" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="8">
|
</el-col>
|
||||||
<el-form-item label="排序" prop="sort">
|
<el-col :span="8">
|
||||||
<el-input v-model="formData.sort" type="number" clearable placeholder="请输入排序" />
|
<el-form-item label="排序" prop="sort">
|
||||||
</el-form-item>
|
<el-input v-model="formData.sort" type="number" clearable placeholder="请输入排序" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="24">
|
</el-col>
|
||||||
<el-form-item label="商品图片" prop="imgs">
|
<el-col :span="24">
|
||||||
<material-picker v-model="formData.imgs" />
|
<el-form-item label="商品图片" prop="imgs">
|
||||||
</el-form-item>
|
<material-picker v-model="formData.imgs" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
<el-col :span="24">
|
</el-col>
|
||||||
<el-form-item label="商品详情" prop="details">
|
<!-- <el-col :span="24">
|
||||||
<material-picker v-model="formData.details" :limit="9" />
|
<el-form-item label="商品详情" prop="details">
|
||||||
</el-form-item>
|
<material-picker v-model="formData.details" :limit="9" />
|
||||||
</el-col>
|
</el-form-item>
|
||||||
</el-row>
|
</el-col> -->
|
||||||
</el-form>
|
</el-row>
|
||||||
<el-dialog v-model="showDialog" title="选择标签" width="70%">
|
</el-form>
|
||||||
<dialogTable multipleChoice :config="goods_label" @customEvent="customEvent">
|
<el-dialog v-model="showDialog" title="选择标签" width="70%">
|
||||||
</dialogTable>
|
<dialogTable multipleChoice :config="goods_label" @customEvent="customEvent">
|
||||||
</el-dialog>
|
</dialogTable>
|
||||||
</popup>
|
</el-dialog>
|
||||||
</div>
|
</popup>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup name="goodsEdit">
|
<script lang="ts" setup name="goodsEdit">
|
||||||
|
@ -157,10 +158,10 @@ import { apiWarehouseLists } from "@/api/warehouse";
|
||||||
import { goods_label } from "@/components/dialogTable/dialogTableConfig"
|
import { goods_label } from "@/components/dialogTable/dialogTableConfig"
|
||||||
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 formRef = shallowRef<FormInstance>();
|
const formRef = shallowRef<FormInstance>();
|
||||||
|
@ -170,36 +171,36 @@ const showDialog = ref(false)
|
||||||
|
|
||||||
// 弹窗标题
|
// 弹窗标题
|
||||||
const popupTitle = computed(() => {
|
const popupTitle = computed(() => {
|
||||||
return mode.value == "edit" ? "编辑商品表" : "新增商品表";
|
return mode.value == "edit" ? "编辑商品表" : "新增商品表";
|
||||||
});
|
});
|
||||||
|
|
||||||
// 表单数据
|
// 表单数据
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: "",
|
id: "",
|
||||||
name: "",
|
name: "",
|
||||||
py: "",
|
py: "",
|
||||||
number: "",
|
number: "",
|
||||||
spec: "",
|
spec: "",
|
||||||
class: "",
|
class: "",
|
||||||
brand: "",
|
brand: "",
|
||||||
unit: "",
|
unit: "",
|
||||||
buy: "",
|
buy: "",
|
||||||
sell: "",
|
sell: "",
|
||||||
retail: "",
|
retail: "",
|
||||||
integral: "",
|
integral: "",
|
||||||
code: "",
|
code: "",
|
||||||
tax_rate: "",
|
tax_rate: "",
|
||||||
warehouse: "",
|
warehouse: "",
|
||||||
location: "",
|
location: "",
|
||||||
stocktip: "",
|
stocktip: "",
|
||||||
retail_name: "",
|
retail_name: "",
|
||||||
sys_labels_text: "",
|
sys_labels_text: "",
|
||||||
sys_labels: "",
|
sys_labels: "",
|
||||||
imgs: "",
|
imgs: "",
|
||||||
details: "",
|
details: "",
|
||||||
data: "",
|
data: "",
|
||||||
more: "",
|
more: "",
|
||||||
sort: "",
|
sort: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -239,197 +240,260 @@ const formData = reactive({
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const customEvent = (e) => {
|
const customEvent = (e) => {
|
||||||
formData.sys_labels = []
|
formData.sys_labels = []
|
||||||
let text = []
|
let text = []
|
||||||
e.forEach(item => {
|
e.forEach(item => {
|
||||||
formData.sys_labels.push(item.id)
|
formData.sys_labels.push(item.id)
|
||||||
text.push(item.name)
|
text.push(item.name)
|
||||||
});
|
});
|
||||||
formData.sys_labels_text = text.join(',')
|
formData.sys_labels_text = text.join(',')
|
||||||
formData.sys_labels = formData.sys_labels.join(',')
|
formData.sys_labels = formData.sys_labels.join(',')
|
||||||
showDialog.value = false
|
showDialog.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 表单验证
|
// 表单验证
|
||||||
const formRules = reactive<any>({
|
const formRules = reactive<any>({
|
||||||
name: [
|
name: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入商品名称",
|
message: "请输入商品名称",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
spec: [
|
spec: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入规格型号",
|
message: "请输入规格型号",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
sys_labels: [
|
sys_labels: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请选择标签",
|
message: "请选择标签",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
buy: [
|
buy: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入购货价格",
|
message: "请输入购货价格",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
stocktip: [
|
stocktip: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入库存阈值",
|
message: "请输入库存阈值",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
py: [
|
py: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入首拼字母",
|
message: "请输入首拼字母",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
class: [
|
class: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入商品分类",
|
message: "请输入商品分类",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
warehouse: [
|
warehouse: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入库存阈值",
|
message: "请输入库存阈值",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
imgs: [
|
imgs: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请上传商品图片",
|
message: "请上传商品图片",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
// brand: [
|
// brand: [
|
||||||
// {
|
// {
|
||||||
// required: true,
|
// required: true,
|
||||||
// message: "请输入商品品牌",
|
// message: "请输入商品品牌",
|
||||||
// trigger: ["blur"],
|
// trigger: ["blur"],
|
||||||
// },
|
// },
|
||||||
// ],
|
// ],
|
||||||
unit: [
|
unit: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "请输入商品单位",
|
message: "请输入商品单位",
|
||||||
trigger: ["blur"],
|
trigger: ["blur"],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const props = {
|
|
||||||
value: "id",
|
// 鉴于刘某无故缺席两次
|
||||||
label: "name",
|
|
||||||
emitPath: false,
|
|
||||||
lazy: true,
|
|
||||||
lazyLoad(node, resolve) {
|
let resolves;
|
||||||
let pid = node.value || 0;
|
let nodes;
|
||||||
apiGoodsclassLists({
|
let flag = ref(false);
|
||||||
pid: pid,
|
let name;
|
||||||
page_size: 10000,
|
|
||||||
}).then((res) => {
|
|
||||||
resolve(
|
|
||||||
res.lists.map((item: any) => {
|
onMounted(() => {
|
||||||
item.leaf = item.is_menu == 0;
|
setTimeout(() => {
|
||||||
return item;
|
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 classList = ref([]);
|
||||||
const getClassList = () => {
|
const getClassList = () => {
|
||||||
apiGoodsclassLists({}).then((res) => {
|
apiGoodsclassLists({}).then((res) => {
|
||||||
classList.value = res.lists;
|
classList.value = res.lists;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
// getClassList();
|
// getClassList();
|
||||||
|
|
||||||
const brandList = ref([]);
|
const brandList = ref([]);
|
||||||
const getBrandList = () => {
|
const getBrandList = () => {
|
||||||
apiBrandLists({}).then((res) => {
|
apiBrandLists({}).then((res) => {
|
||||||
brandList.value = res.lists;
|
brandList.value = res.lists;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getBrandList();
|
getBrandList();
|
||||||
|
|
||||||
const unitList = ref([]);
|
const unitList = ref([]);
|
||||||
const getUnitList = () => {
|
const getUnitList = () => {
|
||||||
apiUnitLists({}).then((res) => {
|
apiUnitLists({}).then((res) => {
|
||||||
unitList.value = res.lists;
|
unitList.value = res.lists;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getUnitList();
|
getUnitList();
|
||||||
|
|
||||||
const warehouseList = ref([]);
|
const warehouseList = ref([]);
|
||||||
const getWarehouseList = () => {
|
const getWarehouseList = () => {
|
||||||
apiWarehouseLists({}).then((res) => {
|
apiWarehouseLists({}).then((res) => {
|
||||||
warehouseList.value = res.lists;
|
warehouseList.value = res.lists;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
getWarehouseList();
|
getWarehouseList();
|
||||||
|
|
||||||
// 获取详情
|
// 获取详情
|
||||||
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];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDetail = async (row: Record<string, any>) => {
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
const data = await apiGoodsDetail({
|
const data = await apiGoodsDetail({
|
||||||
id: row.id,
|
id: row.id,
|
||||||
});
|
});
|
||||||
setFormData(data);
|
setFormData(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
await formRef.value?.validate();
|
await formRef.value?.validate();
|
||||||
const data = { ...formData };
|
const data = { ...formData };
|
||||||
mode.value == "edit" ? await apiGoodsEdit(data) : await apiGoodsAdd(data);
|
mode.value == "edit" ? await apiGoodsEdit(data) : await apiGoodsAdd(data);
|
||||||
popupRef.value?.close();
|
popupRef.value?.close();
|
||||||
emit("success");
|
emit("success");
|
||||||
};
|
};
|
||||||
|
|
||||||
//打开弹窗
|
//打开弹窗
|
||||||
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,
|
||||||
getDetail,
|
getDetail,
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,16 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="edit-popup">
|
<div class="edit-popup">
|
||||||
<popup
|
<popup ref="popupRef" :title="popupTitle" :async="true" width="550px" @confirm="handleSubmit" @close="handleClose">
|
||||||
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 ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
<el-form-item label="标签名" prop="name" required>
|
<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-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</popup>
|
</popup>
|
||||||
|
@ -65,8 +58,8 @@ const setFormData = async (data: Record<any, any>) => {
|
||||||
formData[key] = data[key]
|
formData[key] = data[key]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getDetail = async (row: Record<string, any>) => {
|
const getDetail = async (row: Record<string, any>) => {
|
||||||
|
@ -80,9 +73,9 @@ const getDetail = async (row: Record<string, any>) => {
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
const handleSubmit = async () => {
|
const handleSubmit = async () => {
|
||||||
await formRef.value?.validate()
|
await formRef.value?.validate()
|
||||||
const data = { ...formData, }
|
const data = { ...formData, }
|
||||||
mode.value == 'edit'
|
mode.value == 'edit'
|
||||||
? await apiGoodsLabelEdit(data)
|
? await apiGoodsLabelEdit(data)
|
||||||
: await apiGoodsLabelAdd(data)
|
: await apiGoodsLabelAdd(data)
|
||||||
popupRef.value?.close()
|
popupRef.value?.close()
|
||||||
emit('success')
|
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({
|
defineExpose({
|
||||||
open,
|
open,
|
||||||
|
|
|
@ -73,9 +73,10 @@ import { useDictData } from '@/hooks/useDictOptions'
|
||||||
import { apiUnitLists, apiUnitDelete, apiUnitDetail } from '@/api/unit'
|
import { apiUnitLists, apiUnitDelete, apiUnitDetail } from '@/api/unit'
|
||||||
import feedback from '@/utils/feedback'
|
import feedback from '@/utils/feedback'
|
||||||
import DetailPopup from './detail.vue'
|
import DetailPopup from './detail.vue'
|
||||||
|
import EditPopup from "./edit.vue";
|
||||||
|
|
||||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
const editRef = ref(null)
|
||||||
const detailRef = shallowRef<InstanceType<typeof EditPopup>>()
|
const detailRef = ref(null)
|
||||||
// 是否显示编辑框
|
// 是否显示编辑框
|
||||||
const showEdit = ref(false)
|
const showEdit = ref(false)
|
||||||
const showDetail = ref(false)
|
const showDetail = ref(false)
|
||||||
|
@ -117,6 +118,9 @@ const handleAdd = async () => {
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
const handleEdit = async (data: any) => {
|
const handleEdit = async (data: any) => {
|
||||||
|
|
||||||
|
|
||||||
|
console.log(editRef.value)
|
||||||
showEdit.value = true
|
showEdit.value = true
|
||||||
await nextTick()
|
await nextTick()
|
||||||
editRef.value?.open('edit')
|
editRef.value?.open('edit')
|
||||||
|
|
|
@ -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>
|
|
@ -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>
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="edit-popup">
|
<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 ref="formRef" :model="formData" label-width="90px" :rules="formRules">
|
||||||
<el-form-item label="用户id" prop="uid">
|
<el-form-item label="用户id" prop="uid">
|
||||||
<el-input v-model="formData.uid" clearable placeholder="请输入用户id" :readonly="false" />
|
<el-input v-model="formData.uid" clearable placeholder="请输入用户id" :readonly="false" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="反馈内容" prop="content">
|
<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>
|
||||||
<el-form-item label="反馈图片" prop="images">
|
<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>
|
||||||
<el-form-item label="联系姓名" prop="name">
|
<el-form-item label="联系姓名" prop="name">
|
||||||
<el-input v-model="formData.name" clearable placeholder="请输入联系姓名" :readonly="false" />
|
<el-input v-model="formData.name" clearable placeholder="请输入联系姓名" :readonly="false" />
|
||||||
|
|
Loading…
Reference in New Issue