add
This commit is contained in:
parent
987d380d63
commit
b3822a0e45
|
@ -1,5 +1,5 @@
|
|||
NODE_ENV = 'development'
|
||||
VITE_NOW_TYPE = 'dist'
|
||||
# Base API
|
||||
VITE_APP_BASE_URL='http://192.168.1.22:8546'
|
||||
# VITE_APP_BASE_URL='https://erp.lihaink.cn'
|
||||
# VITE_APP_BASE_URL='http://192.168.1.22:8546'
|
||||
VITE_APP_BASE_URL='https://erp.lihaink.cn'
|
|
@ -0,0 +1,25 @@
|
|||
<template>
|
||||
<el-drawer
|
||||
v-model="drawer"
|
||||
title="I am the title"
|
||||
>
|
||||
<span>Hi, there!</span>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="goodList">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import {
|
||||
apiOpurchaseclassGoodsOfferList,
|
||||
apiOpurchaseclassGoodsOfferUpdate,
|
||||
} from "@/api/opurchaseclass";
|
||||
|
||||
const drawer = ref(false);
|
||||
const form = ref({});
|
||||
|
||||
const setForm = (data: any) => {
|
||||
console.log(data);
|
||||
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,188 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-radio-group
|
||||
v-model="queryParams.is_adopt"
|
||||
size="small"
|
||||
@change="changeType"
|
||||
>
|
||||
<el-radio-button label="全部" value="" />
|
||||
<el-radio-button label="未采纳" value="0" />
|
||||
<el-radio-button label="已采纳" value="1" />
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-table :data="pager.lists" border style="width: 100%; margin-top: 10px">
|
||||
<el-table-column prop="id" label="ID" width="120" />
|
||||
<!-- <el-table-column prop="order_id" label="采购订单id" width="120" /> -->
|
||||
<el-table-column
|
||||
label="商品名称"
|
||||
prop="goods_name"
|
||||
show-overflow-tooltip
|
||||
width="220"
|
||||
/>
|
||||
<el-table-column
|
||||
label="需求数量"
|
||||
prop="need_num"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column
|
||||
label="单位"
|
||||
prop="unit_name"
|
||||
width="80"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="供应商"
|
||||
prop="supplier_name"
|
||||
show-overflow-tooltip
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column
|
||||
label="提供数量"
|
||||
prop="nums"
|
||||
show-overflow-tooltip
|
||||
width="100"
|
||||
/>
|
||||
<el-table-column label="报价" prop="price" show-overflow-tooltip />
|
||||
<el-table-column label="是否采纳报价" prop="is_adopt" width="120">
|
||||
<template #default="{ row }">
|
||||
<el-tag v-if="row.is_adopt === 1" type="success">已采纳</el-tag>
|
||||
<el-tag v-else type="info">未采纳</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="更新时间"
|
||||
prop="update_time"
|
||||
show-overflow-tooltip
|
||||
width="160"
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button
|
||||
type="primary"
|
||||
v-if="row.is_adopt === 0 && row.price > 0"
|
||||
size="small"
|
||||
@click="offerGood(row, 0)"
|
||||
>采纳</el-button
|
||||
>
|
||||
<span v-if="row.is_storage">已入库</span>
|
||||
<el-button
|
||||
type="success"
|
||||
v-else-if="row.is_adopt === 1 && row.price > 0"
|
||||
size="small"
|
||||
@click="offerGood(row, 1)"
|
||||
>入库</el-button
|
||||
>
|
||||
<span
|
||||
v-if="row.is_adopt === 0 && row.price == 0"
|
||||
style="color: #e6a23c"
|
||||
>等待供应商报价</span
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
<el-dialog v-model="dialogVisible" title="入库" width="600">
|
||||
<el-descriptions class="margin-top" :column="1" border>
|
||||
<el-descriptions-item label="供应商名称">
|
||||
{{ updateInfo.supplier_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="商品名称">
|
||||
{{ updateInfo.goods_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="商品报价">
|
||||
¥ {{ updateInfo.price }} / {{ updateInfo.unit_name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="应入库数量">
|
||||
{{ updateInfo.q_nums }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="实际入库数量">
|
||||
<el-input-number v-model="updateInfo.nums" :step="1" :min="1" />
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="备注">
|
||||
<el-input v-model="updateInfo.notes" type="textarea" placeholder="请输入备注"></el-input>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="goodsOfferUpdate">
|
||||
确认
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="subOrder">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import {
|
||||
apiOpurchaseclassGoodsOfferList,
|
||||
apiOpurchaseclassGoodsOfferUpdate,
|
||||
} from "@/api/opurchaseclass";
|
||||
import { useRoute } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const queryParams = reactive({
|
||||
id: route.query.id,
|
||||
is_adopt: "",
|
||||
});
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiOpurchaseclassGoodsOfferList,
|
||||
params: queryParams,
|
||||
});
|
||||
defineExpose({
|
||||
getLists,
|
||||
});
|
||||
|
||||
const changeType = (e: any) => {
|
||||
queryParams.is_adopt = e;
|
||||
getLists();
|
||||
};
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const updateInfo = ref({
|
||||
id: "",
|
||||
type: 0,
|
||||
notes: "", //备注
|
||||
nums: 0,//实际数量
|
||||
q_nums: 0, //应到数量
|
||||
});
|
||||
const offerGood = (row: any, type: number) => {
|
||||
//type:0 采纳,1 入库
|
||||
updateInfo.value = Object.assign(
|
||||
{
|
||||
id: "",
|
||||
type: type,
|
||||
notes: "", //备注
|
||||
nums: 0,
|
||||
},
|
||||
row
|
||||
);
|
||||
if(type==0) return goodsOfferUpdate(); // 采纳时直接成功, 入库弹窗显示数量
|
||||
updateInfo.value.q_nums = row.nums;
|
||||
dialogVisible.value = true;
|
||||
};
|
||||
|
||||
|
||||
const goodsOfferUpdate = () => {
|
||||
apiOpurchaseclassGoodsOfferUpdate({
|
||||
id: updateInfo.value.id,
|
||||
type: updateInfo.value.type,
|
||||
notes: updateInfo.value.notes, //备注
|
||||
nums: updateInfo.value.nums,
|
||||
}).then((res) => {
|
||||
getLists();
|
||||
dialogVisible.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
</script>
|
|
@ -0,0 +1,67 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-table :data="pager.lists" border style="width: 100%;">
|
||||
<el-table-column prop="id" label="ID" width="120" />
|
||||
<el-table-column label="单据编号" prop="number" show-overflow-tooltip />
|
||||
<el-table-column label="单据金额" prop="total" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="抵扣金额"
|
||||
prop="deduction_price"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="实际金额" prop="actual" show-overflow-tooltip />
|
||||
<el-table-column label="实收金额" prop="money" show-overflow-tooltip />
|
||||
<el-table-column
|
||||
label="单据时间"
|
||||
prop="create_time"
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column label="操作" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" @click="openDetail(row)" link>详情</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="flex mt-4 justify-end">
|
||||
<pagination v-model="pager" @change="getLists" />
|
||||
</div>
|
||||
<detail ref="detailRef" v-if="showDetail" :dictData="dictData"
|
||||
@close="showDetail = false"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="subOrder">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiOpurchaseclassSubOrders } from "@/api/opurchaseclass";
|
||||
import { useRoute } from "vue-router";
|
||||
import detail from "@/views/retail/cashierclass/detail.vue";
|
||||
|
||||
const route = useRoute();
|
||||
|
||||
const queryParams = reactive({
|
||||
id: route.query.id,
|
||||
});
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiOpurchaseclassSubOrders,
|
||||
params: queryParams,
|
||||
});
|
||||
|
||||
defineExpose({
|
||||
getLists
|
||||
})
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('pay_type,auditing_type')
|
||||
|
||||
const showDetail = ref(false);
|
||||
const detailRef = ref(null);
|
||||
const openDetail = async (row: any) => {
|
||||
showDetail.value = true
|
||||
await nextTick()
|
||||
detailRef.value?.open('edit')
|
||||
detailRef.value?.getDetail(row)
|
||||
}
|
||||
|
||||
</script>
|
|
@ -0,0 +1,122 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-change="tabChange">
|
||||
<el-tab-pane label="概况" name="detail">
|
||||
<el-descriptions class="margin-top" :column="4" border>
|
||||
<!-- <template #extra>
|
||||
<el-button type="primary">Operation</el-button>
|
||||
</template> -->
|
||||
<el-descriptions-item :span="4" label="单据编号">
|
||||
{{ form.number }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="单据金额">
|
||||
{{ form.total }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="抵扣金额">
|
||||
{{ form.deduction_price }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="实际金额">
|
||||
{{ form.actual }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item :span="2" label="实收金额">
|
||||
{{ form.money }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="所属商户">
|
||||
{{ form.merchant_name }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table :data="form.goods_info" border style="width: 100%; margin-top: 20px">
|
||||
<el-table-column prop="id" label="ID" width="120" />
|
||||
<el-table-column prop="goods_name" label="商品名称" />
|
||||
<el-table-column prop="price" label="单价(元)" />
|
||||
<el-table-column prop="unit_name" label="单位" />
|
||||
<el-table-column prop="nums" label="数量" />
|
||||
<el-table-column prop="total" label="合计(元)" />
|
||||
<el-table-column prop="nums_count" label="已采纳数量" />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="子订单" name="order">
|
||||
<subOrder ref="subOrderRef" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="报价列表" name="offer">
|
||||
<goodsOffer ref="goodsOfferRef" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="未推送商品" name="notPushedGoods">
|
||||
<el-button type="primary" @click="rePush">
|
||||
重新推送
|
||||
</el-button>
|
||||
<el-table :data="pager.lists">
|
||||
<el-table-column label="商品名称" prop="goods_name" show-overflow-tooltip />
|
||||
<el-table-column label="单位" prop="unit_name" show-overflow-tooltip />
|
||||
<el-table-column label="单价(元)" prop="price" show-overflow-tooltip />
|
||||
<el-table-column prop="nums" label="数量" />
|
||||
<el-table-column prop="total" label="合计(元)" />
|
||||
<el-table-column label="备注" prop="data" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="opurchaseclassDetail">
|
||||
import { usePaging } from "@/hooks/usePaging";
|
||||
import { useDictData } from "@/hooks/useDictOptions";
|
||||
import {
|
||||
apiOpurchaseclassLists,
|
||||
apiOpurchaseclassDelete,
|
||||
apiOpurchaseclassDetail,
|
||||
} from "@/api/opurchaseclass";
|
||||
import { useRoute } from "vue-router";
|
||||
import subOrder from "./component/subOrder.vue";
|
||||
import goodsOffer from "./component/goodsOffer.vue";
|
||||
import { apiOpurchaseinfoListList, apicreateSupplierGoods } from "@/api/opurchaseclass";
|
||||
|
||||
const route = useRoute();
|
||||
const form = ref({});
|
||||
|
||||
const activeName = ref("detail");
|
||||
const activeMap = ref(
|
||||
new Map([
|
||||
["detail", true],
|
||||
["order", false],
|
||||
["offer", false],
|
||||
["notPushedGoods", false],
|
||||
])
|
||||
);
|
||||
const getDetail = async () => {
|
||||
const data = await apiOpurchaseclassDetail({
|
||||
id: route.query.id,
|
||||
});
|
||||
form.value = data;
|
||||
};
|
||||
getDetail();
|
||||
|
||||
const subOrderRef = ref(null);
|
||||
const goodsOfferRef = ref(null);
|
||||
const tabChange = (type: any) => {
|
||||
if (!activeMap.value.get(type)) {
|
||||
if (type == "order") subOrderRef.value?.getLists();
|
||||
if (type == "offer") goodsOfferRef.value?.getLists();
|
||||
activeMap.value.set(type, true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiOpurchaseinfoListList,
|
||||
params: { is_push: 0, id: route.query.id },
|
||||
});
|
||||
|
||||
|
||||
const rePush = async () => {
|
||||
await apicreateSupplierGoods({ id: route.query.id })
|
||||
getLists()
|
||||
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
|
||||
getLists()
|
||||
</script>
|
|
@ -0,0 +1,103 @@
|
|||
<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>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="opurchaseclassEdit">
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import { apiOpurchaseclassAdd, apiOpurchaseclassEdit, apiOpurchaseclassDetail } from '@/api/opurchaseclass'
|
||||
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: '',
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 表单验证
|
||||
const formRules = reactive<any>({
|
||||
|
||||
})
|
||||
|
||||
|
||||
// 获取详情
|
||||
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]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
const data = await apiOpurchaseclassDetail({
|
||||
id: row.id
|
||||
})
|
||||
setFormData(data)
|
||||
}
|
||||
|
||||
|
||||
// 提交按钮
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data = { ...formData, }
|
||||
mode.value == 'edit'
|
||||
? await apiOpurchaseclassEdit(data)
|
||||
: await apiOpurchaseclassAdd(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,155 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-card class="!border-none mb-4" shadow="never">
|
||||
<el-form class="mb-[-16px]" :model="queryParams" inline>
|
||||
<el-form-item label="所属商户" prop="merchant">
|
||||
<el-input class="w-[280px]" v-model="queryParams.merchant" clearable placeholder="请输入所属商户" />
|
||||
</el-form-item>
|
||||
<el-form-item label="零售订单id" prop="order_arr">
|
||||
<el-input class="w-[280px]" v-model="queryParams.order_arr" clearable placeholder="请输入零售订单id" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="单据编号" prop="number">
|
||||
<el-input class="w-[280px]" v-model="queryParams.number" 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="['operation.opurchaseclass/add']" type="primary" @click="handleAdd">
|
||||
<template #icon>
|
||||
<icon name="el-icon-Plus" />
|
||||
</template>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['operation.opurchaseclass/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" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="所属商户" prop="merchant_name" show-overflow-tooltip /> -->
|
||||
<!-- <el-table-column label="零售订单id" prop="order_arr" show-overflow-tooltip /> -->
|
||||
<el-table-column label="购物车id" prop="cart_id" show-overflow-tooltip />
|
||||
<el-table-column label="单据编号" prop="number" width="220" show-overflow-tooltip />
|
||||
<el-table-column label="单据金额" prop="total" show-overflow-tooltip />
|
||||
<el-table-column label="抵扣金额" prop="deduction_price" show-overflow-tooltip />
|
||||
<el-table-column label="实际金额" prop="actual" show-overflow-tooltip />
|
||||
<el-table-column label="实收金额" prop="money" show-overflow-tooltip />
|
||||
<el-table-column label="是否支付" prop="paid" show-overflow-tooltip />
|
||||
<el-table-column label="操作" width="120" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link @click="handleDetail(row)">
|
||||
详情
|
||||
</el-button>
|
||||
<!-- <el-button
|
||||
v-perms="['operation.opurchaseclass/edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="handleEdit(row)"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-perms="['operation.opurchaseclass/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>
|
||||
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="opurchaseclassLists">
|
||||
import { usePaging } from '@/hooks/usePaging'
|
||||
import { useDictData } from '@/hooks/useDictOptions'
|
||||
import { apiOpurchaseclassLists, apiOpurchaseclassDelete } from '@/api/opurchaseclass'
|
||||
import { timeFormat } from '@/utils/util'
|
||||
import feedback from '@/utils/feedback'
|
||||
import EditPopup from './edit.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
|
||||
// 是否显示编辑框
|
||||
const showEdit = ref(false)
|
||||
|
||||
|
||||
// 查询条件
|
||||
const queryParams = reactive({
|
||||
merchant: '',
|
||||
order_arr: '',
|
||||
number: ''
|
||||
})
|
||||
|
||||
// 选中数据
|
||||
const selectData = ref<any[]>([])
|
||||
|
||||
// 表格选择后回调事件
|
||||
const handleSelectionChange = (val: any[]) => {
|
||||
selectData.value = val.map(({ id }) => id)
|
||||
}
|
||||
|
||||
// 获取字典数据
|
||||
const { dictData } = useDictData('')
|
||||
|
||||
// 分页相关
|
||||
const { pager, getLists, resetParams, resetPage } = usePaging({
|
||||
fetchFun: apiOpurchaseclassLists,
|
||||
params: queryParams
|
||||
})
|
||||
|
||||
// 添加
|
||||
const handleAdd = async () => {
|
||||
showEdit.value = true
|
||||
await nextTick()
|
||||
editRef.value?.open('add')
|
||||
}
|
||||
|
||||
// 详情
|
||||
const handleDetail = async (data: any) => {
|
||||
console.log(data);
|
||||
router.push({
|
||||
path: 'detail',
|
||||
query: {
|
||||
id: data.id
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 编辑
|
||||
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 apiOpurchaseclassDelete({ id })
|
||||
getLists()
|
||||
}
|
||||
|
||||
getLists()
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue