增加出入库、销售订单页面、仓库管理页面
parent
3f7953ea1c
commit
bf6fa31e22
|
|
@ -3,7 +3,7 @@ const props = defineProps<{
|
|||
placeholder: string;
|
||||
disabled?: boolean;
|
||||
api: any;
|
||||
modelValue?: string | number;
|
||||
modelValue?: string | number | undefined;
|
||||
valueKey?: string;
|
||||
labelKey?: string;
|
||||
tableColumn: any[];
|
||||
|
|
@ -16,6 +16,10 @@ const pagination = reactive<G.Pagination>({
|
|||
size: 20,
|
||||
});
|
||||
|
||||
watch(props, () => {
|
||||
loadData();
|
||||
});
|
||||
|
||||
const dropdown = ref();
|
||||
const showDropdown = () => {
|
||||
dropdown.value.handleOpen();
|
||||
|
|
@ -66,7 +70,7 @@ function loadData() {
|
|||
}
|
||||
}
|
||||
|
||||
onMounted(loadData);
|
||||
// onMounted(loadData);
|
||||
|
||||
// defineExpose({
|
||||
// loadData,
|
||||
|
|
|
|||
|
|
@ -171,12 +171,6 @@
|
|||
:disabled="status === 'view'"
|
||||
placeholder="修改时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||
<ElInput
|
||||
v-model="formData.deleted"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="是否删除; 0-->未删除、1-->已删除"/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,206 @@
|
|||
<template>
|
||||
<Page>
|
||||
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||
<!-- <ElFormItem label="Id">
|
||||
<ElInput
|
||||
v-model="searchForm.id"
|
||||
placeholder="Id"/>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="编号">
|
||||
<ElInput v-model="searchForm.sn" placeholder="编号" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="仓库">
|
||||
<ElInput v-model="searchForm.warehouseId" placeholder="仓库" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="存放位置">
|
||||
<ElInput v-model="searchForm.location" placeholder="存放位置" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="入库时间">
|
||||
<ElInput v-model="searchForm.inTime" placeholder="入库时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="采购单">
|
||||
<ElInput v-model="searchForm.orderId" placeholder="采购单" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="采购单单号">
|
||||
<ElInput v-model="searchForm.orderSn" placeholder="采购单单号" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品分类 Id">
|
||||
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="分类名称">
|
||||
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品名称">
|
||||
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="创建时间">
|
||||
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改时间">
|
||||
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
|
||||
</ElFormItem> -->
|
||||
|
||||
<ElFormItem>
|
||||
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
|
||||
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset">重置</ElButton>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
|
||||
<div class="tool-bar">
|
||||
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler">新建</ElButton>
|
||||
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
|
||||
</div>
|
||||
|
||||
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
|
||||
<ElTableColumn label="编号" prop="sn" />
|
||||
<!-- <ElTableColumn label="责任人" prop="responsibleId" /> -->
|
||||
<ElTableColumn label="仓库" prop="warehouseName" />
|
||||
<ElTableColumn label="存放位置" prop="location" />
|
||||
<ElTableColumn label="入库时间" prop="inTime" width="170px" />
|
||||
<!-- <ElTableColumn label="采购单" prop="orderId" /> -->
|
||||
<ElTableColumn label="采购单单号" prop="orderSn" width="170px" />
|
||||
<!-- <ElTableColumn label="产品分类 Id" prop="goodsCategoryId" /> -->
|
||||
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
|
||||
<ElTableColumn label="产品名称" prop="goodsName" />
|
||||
<ElTableColumn label="商品编码" prop="goodSn" width="100px" />
|
||||
<ElTableColumn label="数量" prop="quantity" />
|
||||
<ElTableColumn label="计量单位" prop="unit" />
|
||||
<ElTableColumn label="备注" prop="memo" />
|
||||
<ElTableColumn label="创建时间" prop="createTime" width="170px" />
|
||||
<ElTableColumn label="修改时间" prop="modifyTime" width="170px" />
|
||||
<ElTableColumn label="操作" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<div class="action-btn">
|
||||
<ElPopconfirm confirm-button-text="是" cancel-button-text="否" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
|
||||
<template #reference>
|
||||
<ElButton text type="danger" :loading="deling">删除</ElButton>
|
||||
</template>
|
||||
</ElPopconfirm>
|
||||
<ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
|
||||
<InOrderForm ref="inOrderForm" @edit-succ="paging" />
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import InOrderApi from "@/pages/wh/in-order/in-order-api.ts";
|
||||
import InOrderForm from "@/pages/wh/in-order/InOrderForm.vue";
|
||||
import Page from "@/components/page/Page.vue";
|
||||
import { elIcons } from "@/common/element/element.ts";
|
||||
import Utils from "@/common/utils";
|
||||
|
||||
const totalCount = ref(0);
|
||||
const tableData = Utils.resetAble(reactive<InOrderTypes.SearchInOrderResult[]>([]));
|
||||
const searchForm = Utils.resetAble(
|
||||
reactive<InOrderTypes.SearchInOrderParam>({
|
||||
current: 1,
|
||||
size: 20,
|
||||
})
|
||||
);
|
||||
const searching = ref(false);
|
||||
const deling = ref(false);
|
||||
const showSearchForm = ref(true);
|
||||
const inOrderFormIns = useTemplateRef<InstanceType<typeof InOrderForm>>("inOrderForm");
|
||||
|
||||
function showDialog(data?: InOrderTypes.SearchInOrderResult) {
|
||||
inOrderFormIns.value?.open(data);
|
||||
}
|
||||
|
||||
function delHandler({ row }: { row: InOrderTypes.SearchInOrderResult }) {
|
||||
deling.value = true;
|
||||
InOrderApi.del([row.id!])
|
||||
.then(() => {
|
||||
ElMessage.success("删除成功");
|
||||
paging();
|
||||
})
|
||||
.finally(() => {
|
||||
deling.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function modifyHandler({ row }: { row: InOrderTypes.SearchInOrderResult }) {
|
||||
showDialog(row);
|
||||
}
|
||||
|
||||
function addHandler() {
|
||||
showDialog();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
searchForm.$reset();
|
||||
paging();
|
||||
}
|
||||
|
||||
function paging() {
|
||||
searching.value = true;
|
||||
InOrderApi.paging(searchForm)
|
||||
.then((res) => {
|
||||
totalCount.value = res.data?.total ?? 0;
|
||||
tableData.$reset(res.data?.records ?? []);
|
||||
})
|
||||
.finally(() => {
|
||||
searching.value = false;
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
paging();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.table-list {
|
||||
flex 1;
|
||||
margin 0 0 20px 0
|
||||
width 100%
|
||||
|
||||
:deep(.table-header) {
|
||||
color #454C59
|
||||
|
||||
th {
|
||||
background-color #EDF1F7
|
||||
font-weight 500
|
||||
position relative
|
||||
|
||||
& > div {
|
||||
display flex
|
||||
gap 5px
|
||||
align-items center
|
||||
}
|
||||
|
||||
&:not(:first-child) > div::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 1px;
|
||||
width: 1px;
|
||||
background-color: #D3D7DE;
|
||||
transform: translateY(-50%);
|
||||
content: "";
|
||||
height 50%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.table-cell) {
|
||||
color #2F3540
|
||||
}
|
||||
.action-btn {
|
||||
width 100%
|
||||
display flex
|
||||
flex-wrap wrap
|
||||
|
||||
& > button {
|
||||
margin 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tool-bar {
|
||||
display flex
|
||||
justify-content space-between
|
||||
margin 0 0 20px 0
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
destroy-on-close
|
||||
width="fit-content"
|
||||
@close="dialogCloseHandler">
|
||||
<ElDescriptions title="入库单" border>
|
||||
<ElDescriptionsItem label="Id" prop="id">
|
||||
{{ detailData.id }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="编号" prop="sn">
|
||||
{{ detailData.sn }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="责任人 Id;sys_user.id" prop="responsibleId">
|
||||
{{ detailData.responsibleId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="仓库 Id;wh_warehouse.id" prop="warehouseId">
|
||||
{{ detailData.warehouseId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="存放位置" prop="location">
|
||||
{{ detailData.location }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="入库时间" prop="inTime">
|
||||
{{ detailData.inTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="采购单 Id;wh_purchase_order.id" prop="orderId">
|
||||
{{ detailData.orderId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="采购单单号;wh_purchase_order.sn" prop="orderSn">
|
||||
{{ detailData.orderSn }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="产品分类 Id" prop="goodsCategoryId">
|
||||
{{ detailData.goodsCategoryId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="分类名称" prop="goodsCategoryName">
|
||||
{{ detailData.goodsCategoryName }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="产品 Id" prop="goodsId">
|
||||
{{ detailData.goodsId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="产品名称" prop="goodsName">
|
||||
{{ detailData.goodsName }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="商品编码" prop="goodSn">
|
||||
{{ detailData.goodSn }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="数量" prop="quantity">
|
||||
{{ detailData.quantity }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="计量单位;字典代码:unit" prop="unit">
|
||||
{{ detailData.unit }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="备注" prop="memo">
|
||||
{{ detailData.memo }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="创建人 Id; sys_user.id" prop="creatorId">
|
||||
{{ detailData.creatorId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="修改人 Id; sys_user.id" prop="modifierId">
|
||||
{{ detailData.modifierId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="创建时间" prop="createTime">
|
||||
{{ detailData.createTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="修改时间" prop="modifyTime">
|
||||
{{ detailData.modifyTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||
{{ detailData.deleted }}
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false" type="primary">关闭</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import InOrderApi from '@/pages/wh/in-order/in-order-api.ts'
|
||||
import Utils from '@/common/utils'
|
||||
|
||||
const showDialog = ref(false)
|
||||
|
||||
const detailData = Utils.resetAble(reactive<InOrderTypes.SearchInOrderResult>({}))
|
||||
|
||||
function dialogCloseHandler() {
|
||||
detailData.$reset()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: InOrderTypes.SearchInOrderResult) {
|
||||
showDialog.value = true
|
||||
InOrderApi.detail(data.id!)
|
||||
.then(res => {
|
||||
detailData.$reset(res.data)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="fit-content" @close="dialogCloseHandler">
|
||||
<ElForm :model="formData" :rules="rules" ref="inOrderForm" class="form-panel" label-width="auto">
|
||||
<!-- <ElFormItem label="编号" prop="sn">
|
||||
<ElInput
|
||||
v-model="formData.sn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="编号"/>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="责任人" prop="responsibleId">
|
||||
<!-- <ElInput
|
||||
v-model="formData.responsibleId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="责任人"/> -->
|
||||
<ASelect labelKey="nickname" :tableColumn="userColumn" v-model="formData.responsibleId" :api="UserApi.paging" :disabled="status === 'view'" placeholder="请选择负责人" />
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="仓库" prop="warehouseId">
|
||||
<!-- <ElInput
|
||||
v-model="formData.warehouseId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="仓库"/> -->
|
||||
<ASelect labelKey="warehouseName" v-model="formData.warehouseId" @change="warehouseChange" :tableColumn="warehouseColumn" :api="WarehouseApi.paging" :disabled="status === 'view'" placeholder="选择仓库" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="存放位置" prop="location">
|
||||
<ElInput readonly v-model="formData.location" :disabled="status === 'view'" placeholder="存放位置" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="入库时间" prop="inTime">
|
||||
<ElDatePicker v-model="formData.inTime" :disabled="status === 'view'" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="请选择入库日期" />
|
||||
<!-- <ElInput v-model="formData.inTime" :disabled="status === 'view'" placeholder="入库时间" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="采购单" prop="orderId">
|
||||
<ASelect labelKey="sn" @change="orderChange" :tableColumn="orderColumn" v-model="formData.orderId" :api="PurchaseOrderApi.paging" :disabled="status === 'view'" placeholder="请选择负责人" />
|
||||
<!-- <ElInput v-model="formData.orderId" :disabled="status === 'view'" placeholder="采购单 Id;wh_purchase_order.id" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="采购单单号" prop="orderSn">
|
||||
<ElInput v-model="formData.orderSn" readonly :disabled="status === 'view'" placeholder="采购单单号;wh_purchase_order.sn" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="产品分类 Id" prop="goodsCategoryId">
|
||||
<ElInput v-model="formData.goodsCategoryId" :disabled="status === 'view'" placeholder="产品分类 Id" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="分类名称" prop="goodsCategoryName">
|
||||
<ElInput v-model="formData.goodsCategoryName" readonly :disabled="status === 'view'" placeholder="分类名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品名称" prop="goodsName">
|
||||
<ElInput v-model="formData.goodsName" readonly :disabled="status === 'view'" placeholder="产品名称" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="商品编码" prop="goodSn">
|
||||
<ElInput v-model="formData.goodSn" readonly :disabled="status === 'view'" placeholder="商品编码" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="数量" prop="quantity">
|
||||
<ElInput v-model="formData.quantity" readonly :disabled="status === 'view'" placeholder="数量" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="计量单位;字典代码:unit" prop="unit">
|
||||
<ElInput v-model="formData.unit" :disabled="status === 'view'" placeholder="计量单位;字典代码:unit" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="备注" prop="memo">
|
||||
<ElInput v-model="formData.memo" readonly :disabled="status === 'view'" placeholder="备注" />
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === "view" ? "关闭" : "取消" }}</ElButton>
|
||||
<ElButton v-if="status !== 'view'" :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import InOrderApi from "@/pages/wh/in-order/in-order-api.ts";
|
||||
import Strings from "@/common/utils/strings.ts";
|
||||
import FormUtil from "@/common/utils/formUtil.ts";
|
||||
import Utils from "@/common/utils";
|
||||
import { ElMessage, type FormInstance, type FormRules } from "element-plus";
|
||||
import ASelect from "@/components/a-select/ASelect.vue";
|
||||
import UserApi from "@/pages/sys/user/user-api.ts";
|
||||
import WarehouseApi from "@/pages/wh/warehouse/warehouse-api.ts";
|
||||
import PurchaseOrderApi from "@/pages/wh/purchase-order/purchase-order-api.ts";
|
||||
|
||||
const emits = defineEmits(["editSucc"]);
|
||||
const showDialog = ref(false);
|
||||
const submiting = ref(false);
|
||||
const status = ref<"add" | "view" | "modify">("add");
|
||||
|
||||
const inOrderFormIns = useTemplateRef<FormInstance>("inOrderForm");
|
||||
|
||||
const formData = Utils.resetAble(reactive<InOrderTypes.SearchInOrderResult>({}));
|
||||
const rules = reactive<FormRules<InOrderTypes.SearchInOrderResult>>({
|
||||
id: [{ required: true, message: "请填写Id", trigger: "blur" }],
|
||||
sn: [{ required: true, message: "请填写编号", trigger: "blur" }],
|
||||
responsibleId: [{ required: true, message: "请填写责任人", trigger: "blur" }],
|
||||
warehouseId: [{ required: true, message: "请填写仓库", trigger: "blur" }],
|
||||
location: [{ required: true, message: "请填写存放位置", trigger: "blur" }],
|
||||
inTime: [{ required: true, message: "请填写入库时间", trigger: "blur" }],
|
||||
orderId: [{ required: true, message: "请填写采购单", trigger: "blur" }],
|
||||
orderSn: [{ required: true, message: "请填写采购单单号", trigger: "blur" }],
|
||||
goodsCategoryId: [{ required: true, message: "请填写产品分类 Id", trigger: "blur" }],
|
||||
goodsCategoryName: [{ required: true, message: "请填写分类名称", trigger: "blur" }],
|
||||
goodsId: [{ required: true, message: "请填写产品 Id", trigger: "blur" }],
|
||||
goodsName: [{ required: true, message: "请填写产品名称", trigger: "blur" }],
|
||||
goodSn: [{ required: true, message: "请填写商品编码", trigger: "blur" }],
|
||||
quantity: [{ required: true, message: "请填写数量", trigger: "blur" }],
|
||||
unit: [{ required: true, message: "请填写计量单位;字典代码:unit", trigger: "blur" }],
|
||||
memo: [{ required: true, message: "请填写备注", trigger: "blur" }],
|
||||
creatorId: [{ required: true, message: "请填写创建人 Id; sys_user.id", trigger: "blur" }],
|
||||
modifierId: [{ required: true, message: "请填写修改人 Id; sys_user.id", trigger: "blur" }],
|
||||
createTime: [{ required: true, message: "请填写创建时间", trigger: "blur" }],
|
||||
modifyTime: [{ required: true, message: "请填写修改时间", trigger: "blur" }],
|
||||
deleted: [{ required: true, message: "请填写是否删除; 0-->未删除、1-->已删除", trigger: "blur" }],
|
||||
});
|
||||
|
||||
const userColumn = [
|
||||
{
|
||||
label: "姓名",
|
||||
prop: "nickname",
|
||||
},
|
||||
{
|
||||
label: "联系电话",
|
||||
prop: "phone",
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
prop: "account.username",
|
||||
},
|
||||
];
|
||||
|
||||
const orderColumn = [
|
||||
{
|
||||
label: "编号",
|
||||
prop: "sn",
|
||||
},
|
||||
{
|
||||
label: "产品名称",
|
||||
prop: "goodsName",
|
||||
},
|
||||
{
|
||||
label: "采购日期",
|
||||
prop: "purchaseDate ",
|
||||
},
|
||||
{
|
||||
label: "数量",
|
||||
prop: "quantity",
|
||||
},
|
||||
];
|
||||
|
||||
const warehouseColumn = [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "warehouseName",
|
||||
},
|
||||
{
|
||||
label: "位置",
|
||||
prop: "location",
|
||||
},
|
||||
];
|
||||
|
||||
function warehouseChange(e: any) {
|
||||
formData.location = e.location;
|
||||
}
|
||||
function orderChange(e: any) {
|
||||
console.log(e, "ee");
|
||||
formData.orderSn = e.sn;
|
||||
formData.goodsCategoryId = e.goodsCategoryId;
|
||||
formData.goodsCategoryName = e.goodsCategoryName;
|
||||
formData.goodsName = e.goodsName;
|
||||
formData.goodSn = e.goodSn;
|
||||
formData.goodsId = e.goodsId;
|
||||
formData.quantity = e.quantity;
|
||||
formData.unit = e.unit;
|
||||
}
|
||||
|
||||
function dialogCloseHandler() {
|
||||
formData.$reset();
|
||||
}
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === "view") return;
|
||||
submiting.value = true;
|
||||
if (formData.id != null) {
|
||||
FormUtil.submit(inOrderFormIns, () => InOrderApi.modify(formData))
|
||||
.then(() => {
|
||||
ElMessage.success("修改成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false;
|
||||
});
|
||||
} else {
|
||||
FormUtil.submit(inOrderFormIns, () => InOrderApi.add(formData))
|
||||
.then(() => {
|
||||
ElMessage.success("添加成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: InOrderTypes.SearchInOrderResult = {}) {
|
||||
showDialog.value = true;
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = "modify";
|
||||
InOrderApi.detail(data.id!).then((res) => {
|
||||
formData.$reset(res.data);
|
||||
});
|
||||
} else {
|
||||
status.value = "add";
|
||||
formData.$reset(data);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.form-panel {
|
||||
padding 20px
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/utils/http-util.ts'
|
||||
|
||||
export default {
|
||||
paging(data: InOrderTypes.SearchInOrderParam) {
|
||||
return get<G.PageResult<InOrderTypes.SearchInOrderResult>>('/in_order/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<InOrderTypes.SearchInOrderResult>('/in_order/detail', {id})
|
||||
},
|
||||
add(data: InOrderTypes.AddInOrderParam) {
|
||||
return post('/in_order/add', data)
|
||||
},
|
||||
modify(data: InOrderTypes.ModifyInOrderParam) {
|
||||
return post('/in_order/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/in_order/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
export {}
|
||||
|
||||
declare global {
|
||||
namespace InOrderTypes {
|
||||
interface SearchInOrderParam extends G.PageParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 入库时间
|
||||
inTime?: string
|
||||
// 采购单 Id;wh_purchase_order.id
|
||||
orderId?: string
|
||||
// 采购单单号;wh_purchase_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface SearchInOrderResult {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 入库时间
|
||||
inTime?: string
|
||||
// 采购单 Id;wh_purchase_order.id
|
||||
orderId?: string
|
||||
// 采购单单号;wh_purchase_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface AddInOrderParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 入库时间
|
||||
inTime?: string
|
||||
// 采购单 Id;wh_purchase_order.id
|
||||
orderId?: string
|
||||
// 采购单单号;wh_purchase_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface ModifyInOrderParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 入库时间
|
||||
inTime?: string
|
||||
// 采购单 Id;wh_purchase_order.id
|
||||
orderId?: string
|
||||
// 采购单单号;wh_purchase_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
component: () => import('@/pages/wh/in-order/InOrder.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -2,74 +2,43 @@
|
|||
<Page>
|
||||
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||
<ElFormItem label="Id">
|
||||
<ElInput
|
||||
v-model="searchForm.id"
|
||||
placeholder="Id"/>
|
||||
<ElInput v-model="searchForm.id" placeholder="Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="仓库 Id">
|
||||
<ElInput
|
||||
v-model="searchForm.warehouseId"
|
||||
placeholder="仓库 Id"/>
|
||||
<ElInput v-model="searchForm.warehouseId" placeholder="仓库 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品 Id">
|
||||
<ElInput
|
||||
v-model="searchForm.goodsId"
|
||||
placeholder="产品 Id"/>
|
||||
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="存放位置">
|
||||
<ElInput
|
||||
v-model="searchForm.location"
|
||||
placeholder="存放位置"/>
|
||||
<ElInput v-model="searchForm.location" placeholder="存放位置" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="当前库存数量">
|
||||
<ElInput
|
||||
v-model="searchForm.stockQuantity"
|
||||
placeholder="当前库存数量"/>
|
||||
<ElInput v-model="searchForm.stockQuantity" placeholder="当前库存数量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="锁定数量">
|
||||
<ElInput
|
||||
v-model="searchForm.lockQuantity"
|
||||
placeholder="锁定数量"/>
|
||||
<ElInput v-model="searchForm.lockQuantity" placeholder="锁定数量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="总量">
|
||||
<ElInput
|
||||
v-model="searchForm.totalQuantity"
|
||||
placeholder="总量"/>
|
||||
<ElInput v-model="searchForm.totalQuantity" placeholder="总量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="剩余量">
|
||||
<ElInput
|
||||
v-model="searchForm.remainingQuantity"
|
||||
placeholder="剩余量"/>
|
||||
<ElInput v-model="searchForm.remainingQuantity" placeholder="剩余量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="计量单位;字典代码:unit">
|
||||
<ElInput
|
||||
v-model="searchForm.unit"
|
||||
placeholder="计量单位;字典代码:unit"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建人 Id; sys_user.id">
|
||||
<ElInput
|
||||
v-model="searchForm.creatorId"
|
||||
placeholder="创建人 Id; sys_user.id"/>
|
||||
<!-- <ElFormItem label="计量单位">
|
||||
<ElInput v-model="searchForm.unit" placeholder="计量单位;字典代码:unit" />
|
||||
</ElFormItem> -->
|
||||
<!-- <ElFormItem label="创建人 Id; sys_user.id">
|
||||
<ElInput v-model="searchForm.creatorId" placeholder="创建人 Id; sys_user.id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改人 Id; sys_user.id">
|
||||
<ElInput
|
||||
v-model="searchForm.modifierId"
|
||||
placeholder="修改人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElInput v-model="searchForm.modifierId" placeholder="修改人 Id; sys_user.id" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="创建时间">
|
||||
<ElInput
|
||||
v-model="searchForm.createTime"
|
||||
placeholder="创建时间"/>
|
||||
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改时间">
|
||||
<ElInput
|
||||
v-model="searchForm.modifyTime"
|
||||
placeholder="修改时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否删除; 0-->未删除、1-->已删除">
|
||||
<ElInput
|
||||
v-model="searchForm.deleted"
|
||||
placeholder="是否删除; 0-->未删除、1-->已删除"/>
|
||||
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
|
||||
|
|
@ -82,38 +51,23 @@
|
|||
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
|
||||
</div>
|
||||
|
||||
<ElTable v-loading="searching" :data="tableData"
|
||||
cell-class-name="table-cell"
|
||||
class="table-list"
|
||||
empty-text="暂无数据"
|
||||
header-row-class-name="table-header"
|
||||
row-key="id">
|
||||
<ElTableColumn label="Id" prop="id"/>
|
||||
<ElTableColumn label="仓库 Id" prop="warehouseId"/>
|
||||
<ElTableColumn label="产品 Id" prop="goodsId"/>
|
||||
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
|
||||
<!-- <ElTableColumn label="Id" prop="id" /> -->
|
||||
<ElTableColumn label="仓库" prop="warehouseName" />
|
||||
<ElTableColumn label="产品" prop="goodsName" />
|
||||
<ElTableColumn label="存放位置" prop="location" />
|
||||
<ElTableColumn label="当前库存数量" prop="stockQuantity"/>
|
||||
<ElTableColumn label="当前库存数量" prop="stockQuantity" width="120"/>
|
||||
<ElTableColumn label="锁定数量" prop="lockQuantity" />
|
||||
<ElTableColumn label="总量" prop="totalQuantity" />
|
||||
<ElTableColumn label="剩余量" prop="remainingQuantity" />
|
||||
<ElTableColumn label="计量单位;字典代码:unit" prop="unit"/>
|
||||
<ElTableColumn label="创建人 Id; sys_user.id" prop="creatorId"/>
|
||||
<ElTableColumn label="修改人 Id; sys_user.id" prop="modifierId"/>
|
||||
<ElTableColumn label="创建时间" prop="createTime"/>
|
||||
<ElTableColumn label="修改时间" prop="modifyTime"/>
|
||||
<ElTableColumn label="是否删除; 0-->未删除、1-->已删除" prop="deleted"/>
|
||||
<ElTableColumn label="操作" width="180">
|
||||
<ElTableColumn label="计量单位" prop="unit" />
|
||||
<ElTableColumn label="创建时间" prop="createTime" width="180" />
|
||||
<ElTableColumn label="修改时间" prop="modifyTime" width="180" />
|
||||
|
||||
<ElTableColumn label="操作" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<div class="action-btn">
|
||||
<ElPopconfirm
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
confirm-button-type="danger"
|
||||
cancel-button-type="primary"
|
||||
placement="top"
|
||||
title="是否删除当前数据?"
|
||||
width="180"
|
||||
@confirm="delHandler(scope)">
|
||||
<ElPopconfirm confirm-button-text="是" cancel-button-text="否" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
|
||||
<template #reference>
|
||||
<ElButton text type="danger" :loading="deling">删除</ElButton>
|
||||
</template>
|
||||
|
|
@ -123,81 +77,74 @@
|
|||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<ElPagination
|
||||
layout="->, sizes, total, prev, pager, next"
|
||||
v-model:current-page="searchForm.current"
|
||||
v-model:page-size="searchForm.size"
|
||||
:total="totalCount"
|
||||
:page-sizes="[10, 20, 50, 100, 500]"
|
||||
:hide-on-single-page="false"
|
||||
:teleported="false"
|
||||
@change="paging"/>
|
||||
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
|
||||
<InventoryForm ref="inventoryForm" @edit-succ="paging" />
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import InventoryApi from '@/pages/wh/inventory/inventory-api.ts'
|
||||
import InventoryForm from '@/pages/wh/inventory/InventoryForm.vue'
|
||||
import Page from '@/components/page/Page.vue'
|
||||
import { elIcons } from '@/common/element/element.ts'
|
||||
import Utils from '@/common/utils'
|
||||
import InventoryApi from "@/pages/wh/inventory/inventory-api.ts";
|
||||
import InventoryForm from "@/pages/wh/inventory/InventoryForm.vue";
|
||||
import Page from "@/components/page/Page.vue";
|
||||
import { elIcons } from "@/common/element/element.ts";
|
||||
import Utils from "@/common/utils";
|
||||
|
||||
const totalCount = ref(0)
|
||||
const tableData = Utils.resetAble(reactive<InventoryTypes.SearchInventoryResult[]>([]))
|
||||
const searchForm = Utils.resetAble(reactive<InventoryTypes.SearchInventoryParam>({
|
||||
const totalCount = ref(0);
|
||||
const tableData = Utils.resetAble(reactive<InventoryTypes.SearchInventoryResult[]>([]));
|
||||
const searchForm = Utils.resetAble(
|
||||
reactive<InventoryTypes.SearchInventoryParam>({
|
||||
current: 1,
|
||||
size: 20,
|
||||
}))
|
||||
const searching = ref(false)
|
||||
const deling = ref(false)
|
||||
const showSearchForm = ref(true)
|
||||
const inventoryFormIns = useTemplateRef<InstanceType<typeof InventoryForm>>('inventoryForm')
|
||||
})
|
||||
);
|
||||
const searching = ref(false);
|
||||
const deling = ref(false);
|
||||
const showSearchForm = ref(true);
|
||||
const inventoryFormIns = useTemplateRef<InstanceType<typeof InventoryForm>>("inventoryForm");
|
||||
|
||||
function showDialog(data?: InventoryTypes.SearchInventoryResult) {
|
||||
inventoryFormIns.value?.open(data)
|
||||
inventoryFormIns.value?.open(data);
|
||||
}
|
||||
|
||||
function delHandler({ row }: { row: InventoryTypes.SearchInventoryResult }) {
|
||||
deling.value = true
|
||||
deling.value = true;
|
||||
InventoryApi.del([row.id!])
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
paging()
|
||||
ElMessage.success("删除成功");
|
||||
paging();
|
||||
})
|
||||
.finally(() => {
|
||||
deling.value = false
|
||||
})
|
||||
deling.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function modifyHandler({ row }: { row: InventoryTypes.SearchInventoryResult }) {
|
||||
showDialog(row)
|
||||
showDialog(row);
|
||||
}
|
||||
|
||||
function addHandler() {
|
||||
showDialog()
|
||||
showDialog();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
searchForm.$reset()
|
||||
paging()
|
||||
searchForm.$reset();
|
||||
paging();
|
||||
}
|
||||
|
||||
function paging() {
|
||||
searching.value = true
|
||||
searching.value = true;
|
||||
InventoryApi.paging(searchForm)
|
||||
.then(res => {
|
||||
totalCount.value = res.data?.total ?? 0
|
||||
tableData.$reset(res.data?.records ?? [])
|
||||
.then((res) => {
|
||||
totalCount.value = res.data?.total ?? 0;
|
||||
tableData.$reset(res.data?.records ?? []);
|
||||
})
|
||||
.finally(() => {
|
||||
searching.value = false
|
||||
})
|
||||
searching.value = false;
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
paging()
|
||||
})
|
||||
|
||||
paging();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -9,23 +9,24 @@
|
|||
ref="inventoryForm"
|
||||
class="form-panel"
|
||||
label-width="auto">
|
||||
<ElFormItem label="Id" prop="id">
|
||||
<!-- <ElFormItem label="Id" prop="id">
|
||||
<ElInput
|
||||
v-model="formData.id"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="Id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="仓库 Id" prop="warehouseId">
|
||||
<ElInput
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="仓库" prop="warehouseId">
|
||||
|
||||
<ASelect labelKey="warehouseName" v-model="formData.warehouseId" :tableColumn="warehouseColumn" :api="WarehouseApi.paging" :disabled="status === 'view'" placeholder="选择仓库" />
|
||||
|
||||
<!-- <ElInput
|
||||
v-model="formData.warehouseId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="仓库 Id"/>
|
||||
placeholder="仓库 Id"/> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品 Id" prop="goodsId">
|
||||
<ElInput
|
||||
v-model="formData.goodsId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="产品 Id"/>
|
||||
<ElFormItem label="产品" prop="goodsId">
|
||||
<ASelect labelKey="goodsName" v-model="formData.goodsId" :tableColumn="goodColumn" @change="goodsChange" :api="GoodsApi.paging" :disabled="status === 'view'" placeholder="选择产品" />
|
||||
<!-- <ElInput v-model="formData.goodsId" :disabled="status === 'view'" placeholder="产品 Id" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="存放位置" prop="location">
|
||||
<ElInput
|
||||
|
|
@ -57,42 +58,13 @@
|
|||
:disabled="status === 'view'"
|
||||
placeholder="剩余量"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="计量单位;字典代码:unit" prop="unit">
|
||||
<!-- <ElFormItem label="计量单位" prop="unit">
|
||||
<ElInput
|
||||
v-model="formData.unit"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="计量单位;字典代码:unit"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建人 Id; sys_user.id" prop="creatorId">
|
||||
<ElInput
|
||||
v-model="formData.creatorId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="创建人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改人 Id; sys_user.id" prop="modifierId">
|
||||
<ElInput
|
||||
v-model="formData.modifierId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="修改人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建时间" prop="createTime">
|
||||
<ElInput
|
||||
v-model="formData.createTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="创建时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改时间" prop="modifyTime">
|
||||
<ElInput
|
||||
v-model="formData.modifyTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="修改时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||
<ElInput
|
||||
v-model="formData.deleted"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="是否删除; 0-->未删除、1-->已删除"/>
|
||||
</ElFormItem>
|
||||
placeholder="计量单位"/>
|
||||
</ElFormItem> -->
|
||||
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
|
|
@ -111,6 +83,9 @@ import {
|
|||
type FormInstance,
|
||||
type FormRules,
|
||||
} from 'element-plus'
|
||||
import ASelect from "@/components/a-select/ASelect.vue";
|
||||
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
||||
import GoodsApi from "@/pages/gds/goods/goods-api.ts";
|
||||
|
||||
const emits = defineEmits(['editSucc'])
|
||||
const showDialog = ref(false)
|
||||
|
|
@ -129,7 +104,7 @@ stockQuantity: [{ required: true, message: '请填写当前库存数量', trigge
|
|||
lockQuantity: [{ required: true, message: '请填写锁定数量', trigger: 'blur' }],
|
||||
totalQuantity: [{ required: true, message: '请填写总量', trigger: 'blur' }],
|
||||
remainingQuantity: [{ required: true, message: '请填写剩余量', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请填写计量单位;字典代码:unit', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请填写计量单位', trigger: 'blur' }],
|
||||
creatorId: [{ required: true, message: '请填写创建人 Id; sys_user.id', trigger: 'blur' }],
|
||||
modifierId: [{ required: true, message: '请填写修改人 Id; sys_user.id', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '请填写创建时间', trigger: 'blur' }],
|
||||
|
|
@ -141,6 +116,34 @@ function dialogCloseHandler() {
|
|||
formData.$reset()
|
||||
}
|
||||
|
||||
const warehouseColumn = [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "warehouseName",
|
||||
},
|
||||
{
|
||||
label: "位置",
|
||||
prop: "location",
|
||||
}
|
||||
];
|
||||
const goodColumn = [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "goodsName",
|
||||
},
|
||||
{
|
||||
label: "规格",
|
||||
prop: "specParams",
|
||||
},
|
||||
{
|
||||
label: "计量单位",
|
||||
prop: "unitTxt",
|
||||
},
|
||||
];
|
||||
const goodsChange = (val: any) => {
|
||||
// console.log(item, 'itemmm')
|
||||
formData.unit = val.unit;
|
||||
};
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
|
|
|
|||
|
|
@ -0,0 +1,231 @@
|
|||
<template>
|
||||
<Page>
|
||||
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||
<ElFormItem label="Id">
|
||||
<ElInput v-model="searchForm.id" placeholder="Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="编号">
|
||||
<ElInput v-model="searchForm.sn" placeholder="编号" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="责任人">
|
||||
<ElInput v-model="searchForm.responsibleId" placeholder="责任人" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="仓库">
|
||||
<ElInput v-model="searchForm.warehouseId" placeholder="仓库" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="存放位置">
|
||||
<ElInput v-model="searchForm.location" placeholder="存放位置" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="出库时间">
|
||||
<ElInput v-model="searchForm.outTime" placeholder="出库时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="销售单">
|
||||
<ElInput v-model="searchForm.orderId" placeholder="销售单" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="销售单号;wh_sales_order.sn">
|
||||
<ElInput v-model="searchForm.orderSn" placeholder="销售单号;wh_sales_order.sn" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品分类 Id">
|
||||
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="分类名称">
|
||||
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品 Id">
|
||||
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品名称">
|
||||
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="商品编码">
|
||||
<ElInput v-model="searchForm.goodSn" placeholder="商品编码" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="数量">
|
||||
<ElInput v-model="searchForm.quantity" placeholder="数量" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="计量单位;字典代码:unit">
|
||||
<ElInput
|
||||
v-model="searchForm.unit"
|
||||
placeholder="计量单位;字典代码:unit"/>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="备注">
|
||||
<ElInput v-model="searchForm.memo" placeholder="备注" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="创建人 Id; sys_user.id">
|
||||
<ElInput
|
||||
v-model="searchForm.creatorId"
|
||||
placeholder="创建人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改人 Id; sys_user.id">
|
||||
<ElInput
|
||||
v-model="searchForm.modifierId"
|
||||
placeholder="修改人 Id; sys_user.id"/>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="创建时间">
|
||||
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改时间">
|
||||
<ElInput v-model="searchForm.modifyTime" placeholder="修改时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
|
||||
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset">重置</ElButton>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
|
||||
<div class="tool-bar">
|
||||
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler">新建</ElButton>
|
||||
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm" />
|
||||
</div>
|
||||
|
||||
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
|
||||
<!-- <ElTableColumn label="Id" prop="id"/> -->
|
||||
<ElTableColumn label="编号" prop="sn" />
|
||||
<ElTableColumn label="仓库" prop="warehouseName" />
|
||||
<ElTableColumn label="存放位置" prop="location" />
|
||||
<ElTableColumn label="出库时间" prop="outTime" width="170px" />
|
||||
<ElTableColumn label="销售单号" prop="orderSn" width="140px"/>
|
||||
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
|
||||
<ElTableColumn label="产品名称" prop="goodsName" />
|
||||
<ElTableColumn label="商品编码" prop="goodSn" width="100px" />
|
||||
<ElTableColumn label="数量" prop="quantity" />
|
||||
<ElTableColumn label="计量单位" prop="unit" />
|
||||
<ElTableColumn label="备注" prop="memo" />
|
||||
<ElTableColumn label="创建时间" prop="createTime" width="170px" />
|
||||
<ElTableColumn label="修改时间" prop="modifyTime" width="170px" />
|
||||
<ElTableColumn label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<div class="action-btn">
|
||||
<ElPopconfirm confirm-button-text="是" cancel-button-text="否" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
|
||||
<template #reference>
|
||||
<ElButton text type="danger" :loading="deling">删除</ElButton>
|
||||
</template>
|
||||
</ElPopconfirm>
|
||||
<ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<ElPagination layout="->, sizes, total, prev, pager, next" v-model:current-page="searchForm.current" v-model:page-size="searchForm.size" :total="totalCount" :page-sizes="[10, 20, 50, 100, 500]" :hide-on-single-page="false" :teleported="false" @change="paging" />
|
||||
<OutOrderForm ref="outOrderForm" @edit-succ="paging" />
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import OutOrderApi from "@/pages/wh/out-order/out-order-api.ts";
|
||||
import OutOrderForm from "@/pages/wh/out-order/OutOrderForm.vue";
|
||||
import Page from "@/components/page/Page.vue";
|
||||
import { elIcons } from "@/common/element/element.ts";
|
||||
import Utils from "@/common/utils";
|
||||
|
||||
const totalCount = ref(0);
|
||||
const tableData = Utils.resetAble(reactive<OutOrderTypes.SearchOutOrderResult[]>([]));
|
||||
const searchForm = Utils.resetAble(
|
||||
reactive<OutOrderTypes.SearchOutOrderParam>({
|
||||
current: 1,
|
||||
size: 20,
|
||||
})
|
||||
);
|
||||
const searching = ref(false);
|
||||
const deling = ref(false);
|
||||
const showSearchForm = ref(true);
|
||||
const outOrderFormIns = useTemplateRef<InstanceType<typeof OutOrderForm>>("outOrderForm");
|
||||
|
||||
function showDialog(data?: OutOrderTypes.SearchOutOrderResult) {
|
||||
outOrderFormIns.value?.open(data);
|
||||
}
|
||||
|
||||
function delHandler({ row }: { row: OutOrderTypes.SearchOutOrderResult }) {
|
||||
deling.value = true;
|
||||
OutOrderApi.del([row.id!])
|
||||
.then(() => {
|
||||
ElMessage.success("删除成功");
|
||||
paging();
|
||||
})
|
||||
.finally(() => {
|
||||
deling.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
function modifyHandler({ row }: { row: OutOrderTypes.SearchOutOrderResult }) {
|
||||
showDialog(row);
|
||||
}
|
||||
|
||||
function addHandler() {
|
||||
showDialog();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
searchForm.$reset();
|
||||
paging();
|
||||
}
|
||||
|
||||
function paging() {
|
||||
searching.value = true;
|
||||
OutOrderApi.paging(searchForm)
|
||||
.then((res) => {
|
||||
totalCount.value = res.data?.total ?? 0;
|
||||
tableData.$reset(res.data?.records ?? []);
|
||||
})
|
||||
.finally(() => {
|
||||
searching.value = false;
|
||||
});
|
||||
}
|
||||
onMounted(() => {
|
||||
paging();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.table-list {
|
||||
flex 1;
|
||||
margin 0 0 20px 0
|
||||
width 100%
|
||||
|
||||
:deep(.table-header) {
|
||||
color #454C59
|
||||
|
||||
th {
|
||||
background-color #EDF1F7
|
||||
font-weight 500
|
||||
position relative
|
||||
|
||||
& > div {
|
||||
display flex
|
||||
gap 5px
|
||||
align-items center
|
||||
}
|
||||
|
||||
&:not(:first-child) > div::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 1px;
|
||||
width: 1px;
|
||||
background-color: #D3D7DE;
|
||||
transform: translateY(-50%);
|
||||
content: "";
|
||||
height 50%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.table-cell) {
|
||||
color #2F3540
|
||||
}
|
||||
.action-btn {
|
||||
width 100%
|
||||
display flex
|
||||
flex-wrap wrap
|
||||
|
||||
& > button {
|
||||
margin 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tool-bar {
|
||||
display flex
|
||||
justify-content space-between
|
||||
margin 0 0 20px 0
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
destroy-on-close
|
||||
width="fit-content"
|
||||
@close="dialogCloseHandler">
|
||||
<ElDescriptions title="出库单" border>
|
||||
<ElDescriptionsItem label="Id" prop="id">
|
||||
{{ detailData.id }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="编号" prop="sn">
|
||||
{{ detailData.sn }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="责任人 Id;sys_user.id" prop="responsibleId">
|
||||
{{ detailData.responsibleId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="仓库 Id;wh_warehouse.id" prop="warehouseId">
|
||||
{{ detailData.warehouseId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="存放位置" prop="location">
|
||||
{{ detailData.location }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="出库时间" prop="outTime">
|
||||
{{ detailData.outTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="销售单 Id;wh_sales_order.id" prop="orderId">
|
||||
{{ detailData.orderId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="销售单号;wh_sales_order.sn" prop="orderSn">
|
||||
{{ detailData.orderSn }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="产品分类 Id" prop="goodsCategoryId">
|
||||
{{ detailData.goodsCategoryId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="分类名称" prop="goodsCategoryName">
|
||||
{{ detailData.goodsCategoryName }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="产品 Id" prop="goodsId">
|
||||
{{ detailData.goodsId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="产品名称" prop="goodsName">
|
||||
{{ detailData.goodsName }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="商品编码" prop="goodSn">
|
||||
{{ detailData.goodSn }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="数量" prop="quantity">
|
||||
{{ detailData.quantity }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="计量单位;字典代码:unit" prop="unit">
|
||||
{{ detailData.unit }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="备注" prop="memo">
|
||||
{{ detailData.memo }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="创建人 Id; sys_user.id" prop="creatorId">
|
||||
{{ detailData.creatorId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="修改人 Id; sys_user.id" prop="modifierId">
|
||||
{{ detailData.modifierId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="创建时间" prop="createTime">
|
||||
{{ detailData.createTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="修改时间" prop="modifyTime">
|
||||
{{ detailData.modifyTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||
{{ detailData.deleted }}
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false" type="primary">关闭</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import OutOrderApi from '@/pages/wh/out-order/out-order-api.ts'
|
||||
import Utils from '@/common/utils'
|
||||
|
||||
const showDialog = ref(false)
|
||||
|
||||
const detailData = Utils.resetAble(reactive<OutOrderTypes.SearchOutOrderResult>({}))
|
||||
|
||||
function dialogCloseHandler() {
|
||||
detailData.$reset()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: OutOrderTypes.SearchOutOrderResult) {
|
||||
showDialog.value = true
|
||||
OutOrderApi.detail(data.id!)
|
||||
.then(res => {
|
||||
detailData.$reset(res.data)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="fit-content" @close="dialogCloseHandler">
|
||||
<ElForm :model="formData" :rules="rules" ref="outOrderForm" class="form-panel" label-width="auto">
|
||||
<!-- <ElFormItem label="编号" prop="sn">
|
||||
<ElInput
|
||||
v-model="formData.sn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="编号"/>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="责任人" prop="responsibleId">
|
||||
<ASelect labelKey="nickname" :tableColumn="userColumn" v-model="formData.responsibleId" :api="UserApi.paging" :disabled="status === 'view'" placeholder="请选择负责人" />
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="仓库" prop="warehouseId">
|
||||
<ASelect labelKey="warehouseName" v-model="formData.warehouseId" @change="warehouseChange" :tableColumn="warehouseColumn" :api="WarehouseApi.paging" :disabled="status === 'view'" placeholder="选择仓库" />
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="存放位置" prop="location">
|
||||
<ElInput v-model="formData.location" :disabled="status === 'view'" placeholder="存放位置" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="出库时间" prop="outTime">
|
||||
<ElDatePicker v-model="formData.outTime" :disabled="status === 'view'" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="请选择出库日期" />
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="销售单" prop="orderId">
|
||||
<ASelect labelKey="sn" @change="orderChange" :tableColumn="orderColumn" v-model="formData.orderId" :api="SalesOrderApi.paging" :disabled="status === 'view'" placeholder="请选择销售单" />
|
||||
<!-- <ElInput v-model="formData.orderId" :disabled="status === 'view'" placeholder="销售单 Id;wh_sales_order.id" /> -->
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="销售单号;wh_sales_order.sn" prop="orderSn">
|
||||
<ElInput v-model="formData.orderSn" :disabled="status === 'view'" placeholder="销售单号;wh_sales_order.sn" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="产品分类" prop="goodsCategoryId">
|
||||
<ElInput v-model="formData.goodsCategoryId" :disabled="status === 'view'" placeholder="产品分类 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="分类名称" prop="goodsCategoryName">
|
||||
<ElInput v-model="formData.goodsCategoryName" :disabled="status === 'view'" placeholder="分类名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品" prop="goodsId">
|
||||
<ElInput v-model="formData.goodsId" :disabled="status === 'view'" placeholder="产品 Id" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品名称" prop="goodsName">
|
||||
<ElInput v-model="formData.goodsName" :disabled="status === 'view'" placeholder="产品名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="商品编码" prop="goodSn">
|
||||
<ElInput v-model="formData.goodSn" :disabled="status === 'view'" placeholder="商品编码" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="数量" prop="quantity">
|
||||
<ElInput v-model="formData.quantity" :disabled="status === 'view'" placeholder="数量" />
|
||||
</ElFormItem>
|
||||
<!-- <ElFormItem label="计量单位;字典代码:unit" prop="unit">
|
||||
<ElInput v-model="formData.unit" :disabled="status === 'view'" placeholder="计量单位;字典代码:unit" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="备注" prop="memo">
|
||||
<ElInput v-model="formData.memo" :disabled="status === 'view'" placeholder="备注" />
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === "view" ? "关闭" : "取消" }}</ElButton>
|
||||
<ElButton v-if="status !== 'view'" :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import OutOrderApi from "@/pages/wh/out-order/out-order-api.ts";
|
||||
import Strings from "@/common/utils/strings.ts";
|
||||
import FormUtil from "@/common/utils/formUtil.ts";
|
||||
import Utils from "@/common/utils";
|
||||
import { ElMessage, type FormInstance, type FormRules } from "element-plus";
|
||||
import SalesOrderApi from "@/pages/wh/sales-order/sales-order-api.ts";
|
||||
import WarehouseApi from "@/pages/wh/warehouse/warehouse-api.ts";
|
||||
import ASelect from "@/components/a-select/ASelect.vue";
|
||||
import UserApi from "@/pages/sys/user/user-api.ts";
|
||||
|
||||
const userColumn = [
|
||||
{
|
||||
label: "姓名",
|
||||
prop: "nickname",
|
||||
},
|
||||
{
|
||||
label: "联系电话",
|
||||
prop: "phone",
|
||||
},
|
||||
{
|
||||
label: "用户名",
|
||||
prop: "account.username",
|
||||
},
|
||||
];
|
||||
|
||||
const orderColumn = [
|
||||
{
|
||||
label: "编号",
|
||||
prop: "sn",
|
||||
},
|
||||
{
|
||||
label: "产品名称",
|
||||
prop: "goodsName",
|
||||
},
|
||||
{
|
||||
label: "采购日期",
|
||||
prop: "purchaseDate ",
|
||||
},
|
||||
{
|
||||
label: "数量",
|
||||
prop: "quantity",
|
||||
},
|
||||
];
|
||||
const warehouseColumn = [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "warehouseName",
|
||||
},
|
||||
{
|
||||
label: "位置",
|
||||
prop: "location",
|
||||
},
|
||||
];
|
||||
|
||||
function warehouseChange(e: any) {
|
||||
formData.location = e.location;
|
||||
}
|
||||
function orderChange(e: any) {
|
||||
console.log(e, "ee");
|
||||
formData.orderSn = e.sn;
|
||||
formData.goodsCategoryId = e.goodsCategoryId;
|
||||
formData.goodsCategoryName = e.goodsCategoryName;
|
||||
formData.goodsName = e.goodsName;
|
||||
formData.goodSn = e.goodSn;
|
||||
formData.goodsId = e.goodsId;
|
||||
formData.quantity = e.quantity;
|
||||
formData.unit = e.unit;
|
||||
}
|
||||
|
||||
const emits = defineEmits(["editSucc"]);
|
||||
const showDialog = ref(false);
|
||||
const submiting = ref(false);
|
||||
const status = ref<"add" | "view" | "modify">("add");
|
||||
|
||||
const outOrderFormIns = useTemplateRef<FormInstance>("outOrderForm");
|
||||
|
||||
const formData = Utils.resetAble(reactive<OutOrderTypes.SearchOutOrderResult>({}));
|
||||
const rules = reactive<FormRules<OutOrderTypes.SearchOutOrderResult>>({
|
||||
id: [{ required: true, message: "请填写Id", trigger: "blur" }],
|
||||
sn: [{ required: true, message: "请填写编号", trigger: "blur" }],
|
||||
responsibleId: [{ required: true, message: "请填写责任人 Id;sys_user.id", trigger: "blur" }],
|
||||
warehouseId: [{ required: true, message: "请填写仓库 Id;wh_warehouse.id", trigger: "blur" }],
|
||||
location: [{ required: true, message: "请填写存放位置", trigger: "blur" }],
|
||||
outTime: [{ required: true, message: "请填写出库时间", trigger: "blur" }],
|
||||
orderId: [{ required: true, message: "请填写销售单 Id;wh_sales_order.id", trigger: "blur" }],
|
||||
orderSn: [{ required: true, message: "请填写销售单号;wh_sales_order.sn", trigger: "blur" }],
|
||||
goodsCategoryId: [{ required: true, message: "请填写产品分类 Id", trigger: "blur" }],
|
||||
goodsCategoryName: [{ required: true, message: "请填写分类名称", trigger: "blur" }],
|
||||
goodsId: [{ required: true, message: "请填写产品 Id", trigger: "blur" }],
|
||||
goodsName: [{ required: true, message: "请填写产品名称", trigger: "blur" }],
|
||||
goodSn: [{ required: true, message: "请填写商品编码", trigger: "blur" }],
|
||||
quantity: [{ required: true, message: "请填写数量", trigger: "blur" }],
|
||||
unit: [{ required: true, message: "请填写计量单位;字典代码:unit", trigger: "blur" }],
|
||||
memo: [{ required: true, message: "请填写备注", trigger: "blur" }],
|
||||
creatorId: [{ required: true, message: "请填写创建人 Id; sys_user.id", trigger: "blur" }],
|
||||
modifierId: [{ required: true, message: "请填写修改人 Id; sys_user.id", trigger: "blur" }],
|
||||
createTime: [{ required: true, message: "请填写创建时间", trigger: "blur" }],
|
||||
modifyTime: [{ required: true, message: "请填写修改时间", trigger: "blur" }],
|
||||
deleted: [{ required: true, message: "请填写是否删除; 0-->未删除、1-->已删除", trigger: "blur" }],
|
||||
});
|
||||
|
||||
function dialogCloseHandler() {
|
||||
formData.$reset();
|
||||
}
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === "view") return;
|
||||
submiting.value = true;
|
||||
if (formData.id != null) {
|
||||
FormUtil.submit(outOrderFormIns, () => OutOrderApi.modify(formData))
|
||||
.then(() => {
|
||||
ElMessage.success("修改成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false;
|
||||
});
|
||||
} else {
|
||||
FormUtil.submit(outOrderFormIns, () => OutOrderApi.add(formData))
|
||||
.then(() => {
|
||||
ElMessage.success("添加成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: OutOrderTypes.SearchOutOrderResult = {}) {
|
||||
showDialog.value = true;
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = "modify";
|
||||
OutOrderApi.detail(data.id!).then((res) => {
|
||||
formData.$reset(res.data);
|
||||
});
|
||||
} else {
|
||||
status.value = "add";
|
||||
formData.$reset(data);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.form-panel {
|
||||
padding 20px
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/utils/http-util.ts'
|
||||
|
||||
export default {
|
||||
paging(data: OutOrderTypes.SearchOutOrderParam) {
|
||||
return get<G.PageResult<OutOrderTypes.SearchOutOrderResult>>('/out_order/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<OutOrderTypes.SearchOutOrderResult>('/out_order/detail', {id})
|
||||
},
|
||||
add(data: OutOrderTypes.AddOutOrderParam) {
|
||||
return post('/out_order/add', data)
|
||||
},
|
||||
modify(data: OutOrderTypes.ModifyOutOrderParam) {
|
||||
return post('/out_order/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/out_order/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,185 @@
|
|||
export {}
|
||||
|
||||
declare global {
|
||||
namespace OutOrderTypes {
|
||||
interface SearchOutOrderParam extends G.PageParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 出库时间
|
||||
outTime?: string
|
||||
// 销售单 Id;wh_sales_order.id
|
||||
orderId?: string
|
||||
// 销售单号;wh_sales_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface SearchOutOrderResult {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 出库时间
|
||||
outTime?: string
|
||||
// 销售单 Id;wh_sales_order.id
|
||||
orderId?: string
|
||||
// 销售单号;wh_sales_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface AddOutOrderParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 出库时间
|
||||
outTime?: string
|
||||
// 销售单 Id;wh_sales_order.id
|
||||
orderId?: string
|
||||
// 销售单号;wh_sales_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface ModifyOutOrderParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 编号
|
||||
sn?: string
|
||||
// 责任人 Id;sys_user.id
|
||||
responsibleId?: string
|
||||
// 仓库 Id;wh_warehouse.id
|
||||
warehouseId?: string
|
||||
// 存放位置
|
||||
location?: string
|
||||
// 出库时间
|
||||
outTime?: string
|
||||
// 销售单 Id;wh_sales_order.id
|
||||
orderId?: string
|
||||
// 销售单号;wh_sales_order.sn
|
||||
orderSn?: string
|
||||
// 产品分类 Id
|
||||
goodsCategoryId?: string
|
||||
// 分类名称
|
||||
goodsCategoryName?: string
|
||||
// 产品 Id
|
||||
goodsId?: string
|
||||
// 产品名称
|
||||
goodsName?: string
|
||||
// 商品编码
|
||||
goodSn?: string
|
||||
// 数量
|
||||
quantity?: number
|
||||
// 计量单位;字典代码:unit
|
||||
unit?: string
|
||||
// 备注
|
||||
memo?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id; sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
component: () => import('@/pages/wh/out-order/OutOrder.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -15,18 +15,18 @@
|
|||
<ElFormItem label="采购日期">
|
||||
<ElInput v-model="searchForm.purchaseDate" placeholder="采购日期" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="到货日期">
|
||||
<!-- <ElFormItem label="到货日期">
|
||||
<ElInput v-model="searchForm.arrivalDate" placeholder="到货日期" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品分类 Id">
|
||||
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类 Id" />
|
||||
</ElFormItem>
|
||||
</ElFormItem>-->
|
||||
<ElFormItem label="分类名称">
|
||||
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品 Id">
|
||||
<!-- <ElFormItem label="产品 Id">
|
||||
<ElInput v-model="searchForm.goodsId" placeholder="产品 Id" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="产品名称">
|
||||
<ElInput v-model="searchForm.goodsName" placeholder="产品名称" />
|
||||
</ElFormItem>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
<ElFormItem label="数量">
|
||||
<ElInput v-model="searchForm.quantity" placeholder="数量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="计量单位">
|
||||
<!-- <ElFormItem label="计量单位">
|
||||
<ElInput v-model="searchForm.unit" placeholder="计量单位unit" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="总金额;单位:元">
|
||||
|
|
@ -44,7 +44,7 @@
|
|||
</ElFormItem>
|
||||
<ElFormItem label="备注">
|
||||
<ElInput v-model="searchForm.memo" placeholder="备注" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
|
||||
|
||||
<ElFormItem>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="fit-content" @close="dialogCloseHandler">
|
||||
<ElDialog v-model="showDialog" :destroy-on-close="true" :close-on-click-modal="false" width="fit-content" @close="dialogCloseHandler">
|
||||
<ElForm :model="formData" :rules="rules" ref="purchaseOrderForm" class="form-panel" label-width="auto">
|
||||
<!-- <ElFormItem label="Id" prop="id">
|
||||
<ElInput v-model="formData.id" :disabled="status === 'view'" placeholder="Id" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="编号" prop="sn">
|
||||
<!-- <ElFormItem label="编号" prop="sn">
|
||||
<ElInput v-model="formData.sn" :disabled="status === 'view'" placeholder="编号" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
|
||||
<!-- ,JinXingZhong--进行中、YiDaoHuo--已到货、YiRuKu--已入库、YiQuXiao--已取消 -->
|
||||
<!-- <ElFormItem label="状态" prop="purchaseOrderStatus">
|
||||
|
|
@ -19,10 +19,10 @@
|
|||
<ASelect labelKey="customerName" :tableColumn="customerColumn" v-model="formData.customerId" :api="CustomerApi.paging" :disabled="status === 'view'" placeholder="供货客户" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="采购日期" prop="purchaseDate">
|
||||
<el-date-picker v-model="formData.purchaseDate" :disabled="status === 'view'" format="YYYY-MM-DD hh:mm:ss" value-format="YYYY-MM-DD hh:mm:ss" type="datetime" placeholder="请选择采购日期" />
|
||||
<el-date-picker v-model="formData.purchaseDate" :disabled="status === 'view'" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="请选择采购日期" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="到货日期" prop="arrivalDate">
|
||||
<el-date-picker v-model="formData.arrivalDate" :disabled="status === 'view'" format="YYYY-MM-DD hh:mm:ss" value-format="YYYY-MM-DD hh:mm:ss" type="datetime" placeholder="请选择采购日期" />
|
||||
<el-date-picker v-model="formData.arrivalDate" :disabled="status === 'view'" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="请选择采购日期" />
|
||||
|
||||
<!-- <ElInput v-model="formData.arrivalDate" :disabled="status === 'view'" placeholder="到货日期" /> -->
|
||||
</ElFormItem>
|
||||
|
|
@ -111,7 +111,7 @@ const goodColumn = [
|
|||
},
|
||||
{
|
||||
label: "计量单位",
|
||||
prop: "unit",
|
||||
prop: "unitTxt",
|
||||
},
|
||||
];
|
||||
|
||||
|
|
@ -132,6 +132,7 @@ const customerColumn = [
|
|||
|
||||
const goodsChange = (val: any) => {
|
||||
// console.log(item, 'itemmm')
|
||||
formData.goodsCategoryName = val.goodsCategoryName;
|
||||
formData.goodsName = val.goodsName;
|
||||
formData.goodSn = val.sn;
|
||||
formData.unit = val.unit;
|
||||
|
|
@ -158,7 +159,6 @@ function dialogCloseHandler() {
|
|||
}
|
||||
|
||||
function submitHandler() {
|
||||
console.log(formData);
|
||||
if (status.value === "view") return;
|
||||
submiting.value = true;
|
||||
if (formData.id != null) {
|
||||
|
|
@ -186,7 +186,6 @@ function submitHandler() {
|
|||
|
||||
defineExpose({
|
||||
open(data: PurchaseOrderTypes.SearchPurchaseOrderResult = {}) {
|
||||
showDialog.value = true;
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = "modify";
|
||||
PurchaseOrderApi.detail(data.id!).then((res) => {
|
||||
|
|
@ -196,7 +195,9 @@ defineExpose({
|
|||
status.value = "add";
|
||||
formData.$reset(data);
|
||||
}
|
||||
// getData();
|
||||
showDialog.value = true;
|
||||
|
||||
console.log(formData.goodsId, "formData");
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -9,14 +9,15 @@
|
|||
<ElFormItem label="编号">
|
||||
<ElInput v-model="searchForm.sn" placeholder="编号" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="状态">
|
||||
<!-- JinXingZhong-进行中、YiFaHuo-已发货、YiChuKu-已出库、YiQuXiao--已取消 - -->
|
||||
<!-- <ElFormItem label="状态">
|
||||
<ElInput v-model="searchForm.salesOrderStatus" placeholder="状态" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="购买方客户">
|
||||
<ElInput v-model="searchForm.customerId" placeholder="购买方客户" />
|
||||
</ElFormItem>
|
||||
<!-- ,JinXingZhong--进行中、YiFaHuo--已发货、YiChuKu--已出库、YiQuXiao--已取消 -->
|
||||
<ElFormItem label="下单日期">
|
||||
<!-- <ElFormItem label="下单日期">
|
||||
<ElInput v-model="searchForm.orderDate" placeholder="下单日期" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="发货日期">
|
||||
|
|
@ -24,7 +25,7 @@
|
|||
</ElFormItem>
|
||||
<ElFormItem label="产品分类">
|
||||
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="分类名称">
|
||||
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
|
||||
</ElFormItem>
|
||||
|
|
@ -40,7 +41,7 @@
|
|||
<ElFormItem label="数量">
|
||||
<ElInput v-model="searchForm.quantity" placeholder="数量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="计量单位">
|
||||
<!--<ElFormItem label="计量单位">
|
||||
<ElInput v-model="searchForm.unit" placeholder="计量单位" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="总金额">
|
||||
|
|
@ -54,7 +55,7 @@
|
|||
</ElFormItem>
|
||||
<ElFormItem label="修改人">
|
||||
<ElInput v-model="searchForm.modifierId" placeholder="修改人" />
|
||||
</ElFormItem>
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="创建时间">
|
||||
<ElInput v-model="searchForm.createTime" placeholder="创建时间" />
|
||||
</ElFormItem>
|
||||
|
|
@ -73,27 +74,26 @@
|
|||
</div>
|
||||
|
||||
<ElTable v-loading="searching" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
|
||||
<ElTableColumn label="Id" prop="id" />
|
||||
<!-- <ElTableColumn label="Id" prop="id" /> -->
|
||||
<ElTableColumn label="编号" prop="sn" />
|
||||
<ElTableColumn label="状态" prop="salesOrderStatus" />
|
||||
<ElTableColumn label="购买方客户" prop="customerId" />
|
||||
<ElTableColumn label="下单日期" prop="orderDate" />
|
||||
<ElTableColumn label="发货日期" prop="shipmentDate" />
|
||||
<ElTableColumn label="状态" prop="salesOrderStatusTxt" />
|
||||
<!-- <ElTableColumn label="购买方客户" prop="customerId" /> -->
|
||||
<ElTableColumn label="下单日期" prop="orderDate" width="100"/>
|
||||
<ElTableColumn label="发货日期" prop="shipmentDate" width="100"/>
|
||||
<ElTableColumn label="产品分类" prop="goodsCategoryId" />
|
||||
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
|
||||
<ElTableColumn label="产品" prop="goodsId" />
|
||||
<!-- <ElTableColumn label="产品" prop="goodsId" /> -->
|
||||
<ElTableColumn label="产品名称" prop="goodsName" />
|
||||
<ElTableColumn label="商品编码" prop="goodSn" />
|
||||
<ElTableColumn label="商品编码" prop="goodSn" width="100"/>
|
||||
<ElTableColumn label="数量" prop="quantity" />
|
||||
<ElTableColumn label="计量单位" prop="unit" />
|
||||
<!-- <ElTableColumn label="计量单位" prop="unit" /> -->
|
||||
<ElTableColumn label="总金额" prop="totalMoney" />
|
||||
<ElTableColumn label="备注" prop="memo" />
|
||||
<ElTableColumn label="创建人" prop="creatorId" />
|
||||
<ElTableColumn label="修改人" prop="modifierId" />
|
||||
<ElTableColumn label="创建时间" prop="createTime" />
|
||||
<ElTableColumn label="修改时间" prop="modifyTime" />
|
||||
<ElTableColumn label="是否删除; 0-->未删除、1-->已删除" prop="deleted" />
|
||||
<ElTableColumn label="操作" width="180">
|
||||
<!-- <ElTableColumn label="创建人" prop="creatorId" />
|
||||
<ElTableColumn label="修改人" prop="modifierId" /> -->
|
||||
<ElTableColumn label="创建时间" prop="createTime" width="180"/>
|
||||
<ElTableColumn label="修改时间" prop="modifyTime" width="180"/>
|
||||
<ElTableColumn label="操作" width="180" fixed="right">
|
||||
<template #default="scope">
|
||||
<div class="action-btn">
|
||||
<ElPopconfirm confirm-button-text="是" cancel-button-text="否" confirm-button-type="danger" cancel-button-type="primary" placement="top" title="是否删除当前数据?" width="180" @confirm="delHandler(scope)">
|
||||
|
|
|
|||
|
|
@ -1,224 +1,211 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="fit-content"
|
||||
@close="dialogCloseHandler">
|
||||
<ElForm :model="formData"
|
||||
:rules="rules"
|
||||
ref="salesOrderForm"
|
||||
class="form-panel"
|
||||
label-width="auto">
|
||||
<ElFormItem label="编号" prop="sn">
|
||||
<ElInput
|
||||
v-model="formData.sn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="编号"/>
|
||||
</ElFormItem>
|
||||
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close width="fit-content" @close="dialogCloseHandler">
|
||||
<ElForm :model="formData" :rules="rules" ref="salesOrderForm" class="form-panel" label-width="auto">
|
||||
<!-- <ElFormItem label="编号" prop="sn">
|
||||
<ElInput v-model="formData.sn" :disabled="status === 'view'" placeholder="编号" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="状态" prop="salesOrderStatus">
|
||||
<ElInput
|
||||
v-model="formData.salesOrderStatus"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="状态"/>
|
||||
<ElSelect v-model="formData.salesOrderStatus" :disabled="status === 'view'" placeholder="身份类型">
|
||||
<ElOption v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</ElSelect>
|
||||
<!-- <ElInput v-model="formData.salesOrderStatus" :disabled="status === 'view'" placeholder="状态" /> -->
|
||||
</ElFormItem>
|
||||
|
||||
<ElFormItem label="购买方客户 Id" prop="customerId">
|
||||
<ElInput
|
||||
v-model="formData.customerId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="购买方客户 Id"/>
|
||||
<ElFormItem label="购买方客户" prop="customerId">
|
||||
<ASelect labelKey="customerName" :tableColumn="customerColumn" v-model="formData.customerId" :api="CustomerApi.paging" :disabled="status === 'view'" placeholder="购买方客户" />
|
||||
|
||||
<!-- <ElInput v-model="formData.customerId" :disabled="status === 'view'" placeholder="购买方客户 Id" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="下单日期" prop="orderDate">
|
||||
<ElInput
|
||||
v-model="formData.orderDate"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="下单日期"/>
|
||||
<ElDatePicker v-model="formData.orderDate" :disabled="status === 'view'" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="请选择采购日期" />
|
||||
|
||||
<!-- <ElInput v-model="formData.orderDate" :disabled="status === 'view'" placeholder="下单日期" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="发货日期" prop="shipmentDate">
|
||||
<ElInput
|
||||
v-model="formData.shipmentDate"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="发货日期"/>
|
||||
<!-- <ElDatePicker v-model="formData.shipmentDate" :disabled="status === 'view'" format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss" type="datetime" placeholder="请选择发货日期" /> -->
|
||||
<ElDatePicker v-model="formData.shipmentDate" :disabled="status === 'view'" format="YYYY-MM-DD" value-format="YYYY-MM-DD" type="date" placeholder="请选择发货日期" />
|
||||
|
||||
<!-- <ElInput v-model="formData.shipmentDate" :disabled="status === 'view'" placeholder="发货日期" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品分类 Id" prop="goodsCategoryId">
|
||||
<ElInput
|
||||
v-model="formData.goodsCategoryId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="产品分类 Id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="分类名称" prop="goodsCategoryName">
|
||||
<ElInput
|
||||
v-model="formData.goodsCategoryName"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="分类名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品 Id" prop="goodsId">
|
||||
<ElInput
|
||||
v-model="formData.goodsId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="产品 Id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="产品名称" prop="goodsName">
|
||||
<ElInput
|
||||
v-model="formData.goodsName"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="产品名称"/>
|
||||
<!-- <ElFormItem label="产品分类 Id" prop="goodsCategoryId">
|
||||
<ElInput v-model="formData.goodsCategoryId" :disabled="status === 'view'" placeholder="产品分类 Id" />
|
||||
</ElFormItem> -->
|
||||
<!-- <ElFormItem label="分类名称" prop="goodsCategoryName">
|
||||
<ElInput v-model="formData.goodsCategoryName" :disabled="status === 'view'" placeholder="分类名称" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="产品" prop="goodsId">
|
||||
<ASelect labelKey="goodsName" v-model="formData.goodsId" :tableColumn="goodColumn" @change="goodsChange" :api="GoodsApi.paging" :disabled="status === 'view'" placeholder="选择产品" />
|
||||
<!-- <ElInput v-model="formData.goodsId" :disabled="status === 'view'" placeholder="产品 Id" /> -->
|
||||
</ElFormItem>
|
||||
<ElFormItem label="商品编码" prop="goodSn">
|
||||
<ElInput
|
||||
v-model="formData.goodSn"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="商品编码"/>
|
||||
<ElInput v-model="formData.goodSn" :disabled="status === 'view'" placeholder="商品编码" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="数量" prop="quantity">
|
||||
<ElInput
|
||||
v-model="formData.quantity"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="数量"/>
|
||||
<ElInput v-model="formData.quantity" :disabled="status === 'view'" placeholder="数量" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="计量单位;字典代码:unit" prop="unit">
|
||||
<ElInput
|
||||
v-model="formData.unit"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="计量单位;字典代码:unit"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="总金额;单位:元" prop="totalMoney">
|
||||
<ElInput
|
||||
v-model="formData.totalMoney"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="总金额;单位:元"/>
|
||||
<!-- <ElFormItem label="计量单位" prop="unit">
|
||||
<ElInput v-model="formData.unit" readonly :disabled="status === 'view'" placeholder="计量单位;字典代码:unit" />
|
||||
</ElFormItem> -->
|
||||
<ElFormItem label="总金额(元)" prop="totalMoney">
|
||||
<ElInput v-model="formData.totalMoney" :disabled="status === 'view'" placeholder="总金额;单位:元" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="备注" prop="memo">
|
||||
<ElInput
|
||||
v-model="formData.memo"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="备注"/>
|
||||
<ElInput v-model="formData.memo" :disabled="status === 'view'" placeholder="备注" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建人 Id; sys_user.id" prop="creatorId">
|
||||
<ElInput
|
||||
v-model="formData.creatorId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="创建人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改人 Id; sys_user.id" prop="modifierId">
|
||||
<ElInput
|
||||
v-model="formData.modifierId"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="修改人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建时间" prop="createTime">
|
||||
<ElInput
|
||||
v-model="formData.createTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="创建时间"/>
|
||||
<!-- <ElFormItem label="创建时间" prop="createTime">
|
||||
<ElInput v-model="formData.createTime" :disabled="status === 'view'" placeholder="创建时间" />
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改时间" prop="modifyTime">
|
||||
<ElInput
|
||||
v-model="formData.modifyTime"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="修改时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||
<ElInput
|
||||
v-model="formData.deleted"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="是否删除; 0-->未删除、1-->已删除"/>
|
||||
</ElFormItem>
|
||||
<ElInput v-model="formData.modifyTime" :disabled="status === 'view'" placeholder="修改时间" />
|
||||
</ElFormItem> -->
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
<ElButton @click="showDialog = false">{{ status === "view" ? "关闭" : "取消" }}</ElButton>
|
||||
<ElButton v-if="status !== 'view'" :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import SalesOrderApi from '@/pages/wh/sales-order/sales-order-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import FormUtil from '@/common/utils/formUtil.ts'
|
||||
import Utils from '@/common/utils'
|
||||
import {
|
||||
ElMessage,
|
||||
type FormInstance,
|
||||
type FormRules,
|
||||
} from 'element-plus'
|
||||
import SalesOrderApi from "@/pages/wh/sales-order/sales-order-api.ts";
|
||||
import Strings from "@/common/utils/strings.ts";
|
||||
import FormUtil from "@/common/utils/formUtil.ts";
|
||||
import Utils from "@/common/utils";
|
||||
import { ElMessage, type FormInstance, type FormRules } from "element-plus";
|
||||
import CustomerApi from "@/pages/cst/customer/customer-api.ts";
|
||||
import GoodsApi from "@/pages/gds/goods/goods-api.ts";
|
||||
import ASelect from "@/components/a-select/ASelect.vue";
|
||||
|
||||
const emits = defineEmits(['editSucc'])
|
||||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||
const emits = defineEmits(["editSucc"]);
|
||||
const showDialog = ref(false);
|
||||
const submiting = ref(false);
|
||||
const status = ref<"add" | "view" | "modify">("add");
|
||||
|
||||
const salesOrderFormIns = useTemplateRef<FormInstance>('salesOrderForm')
|
||||
const salesOrderFormIns = useTemplateRef<FormInstance>("salesOrderForm");
|
||||
|
||||
const formData = Utils.resetAble(reactive<SalesOrderTypes.SearchSalesOrderResult>({}))
|
||||
const formData = Utils.resetAble(reactive<SalesOrderTypes.SearchSalesOrderResult>({}));
|
||||
const rules = reactive<FormRules<SalesOrderTypes.SearchSalesOrderResult>>({
|
||||
id: [{ required: true, message: '请填写Id', trigger: 'blur' }],
|
||||
sn: [{ required: true, message: '请填写编号', trigger: 'blur' }],
|
||||
salesOrderStatus: [{ required: true, message: '请填写状态', trigger: 'blur' }],
|
||||
customerId: [{ required: true, message: '请填写购买方客户 Id', trigger: 'blur' }],
|
||||
orderDate: [{ required: true, message: '请填写下单日期', trigger: 'blur' }],
|
||||
shipmentDate: [{ required: true, message: '请填写发货日期', trigger: 'blur' }],
|
||||
goodsCategoryId: [{ required: true, message: '请填写产品分类 Id', trigger: 'blur' }],
|
||||
goodsCategoryName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
|
||||
goodsId: [{ required: true, message: '请填写产品 Id', trigger: 'blur' }],
|
||||
goodsName: [{ required: true, message: '请填写产品名称', trigger: 'blur' }],
|
||||
goodSn: [{ required: true, message: '请填写商品编码', trigger: 'blur' }],
|
||||
quantity: [{ required: true, message: '请填写数量', trigger: 'blur' }],
|
||||
unit: [{ required: true, message: '请填写计量单位;字典代码:unit', trigger: 'blur' }],
|
||||
totalMoney: [{ required: true, message: '请填写总金额;单位:元', trigger: 'blur' }],
|
||||
memo: [{ required: true, message: '请填写备注', trigger: 'blur' }],
|
||||
creatorId: [{ required: true, message: '请填写创建人 Id; sys_user.id', trigger: 'blur' }],
|
||||
modifierId: [{ required: true, message: '请填写修改人 Id; sys_user.id', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '请填写创建时间', trigger: 'blur' }],
|
||||
modifyTime: [{ required: true, message: '请填写修改时间', trigger: 'blur' }],
|
||||
deleted: [{ required: true, message: '请填写是否删除; 0-->未删除、1-->已删除', trigger: 'blur' }],
|
||||
})
|
||||
id: [{ required: true, message: "请填写Id", trigger: "blur" }],
|
||||
sn: [{ required: true, message: "请填写编号", trigger: "blur" }],
|
||||
salesOrderStatus: [{ required: true, message: "请填写状态", trigger: "blur" }],
|
||||
customerId: [{ required: true, message: "请填写购买方客户 Id", trigger: "blur" }],
|
||||
orderDate: [{ required: true, message: "请填写下单日期", trigger: "blur" }],
|
||||
shipmentDate: [{ required: true, message: "请填写发货日期", trigger: "blur" }],
|
||||
goodsCategoryId: [{ required: true, message: "请填写产品分类 Id", trigger: "blur" }],
|
||||
goodsCategoryName: [{ required: true, message: "请填写分类名称", trigger: "blur" }],
|
||||
goodsId: [{ required: true, message: "请填写产品 Id", trigger: "blur" }],
|
||||
goodsName: [{ required: true, message: "请填写产品名称", trigger: "blur" }],
|
||||
goodSn: [{ required: true, message: "请填写商品编码", trigger: "blur" }],
|
||||
quantity: [{ required: true, message: "请填写数量", trigger: "blur" }],
|
||||
unit: [{ required: true, message: "请填写计量单位;字典代码:unit", trigger: "blur" }],
|
||||
totalMoney: [{ required: true, message: "请填写总金额;单位:元", trigger: "blur" }],
|
||||
memo: [{ required: true, message: "请填写备注", trigger: "blur" }],
|
||||
creatorId: [{ required: true, message: "请填写创建人 Id; sys_user.id", trigger: "blur" }],
|
||||
modifierId: [{ required: true, message: "请填写修改人 Id; sys_user.id", trigger: "blur" }],
|
||||
createTime: [{ required: true, message: "请填写创建时间", trigger: "blur" }],
|
||||
modifyTime: [{ required: true, message: "请填写修改时间", trigger: "blur" }],
|
||||
deleted: [{ required: true, message: "请填写是否删除; 0-->未删除、1-->已删除", trigger: "blur" }],
|
||||
});
|
||||
|
||||
const statusList = [
|
||||
{
|
||||
value: "JinXingZhong",
|
||||
label: "进行中",
|
||||
},
|
||||
{
|
||||
value: "YiFaHuo",
|
||||
label: "已发货",
|
||||
},
|
||||
{
|
||||
value: "YiChuKu",
|
||||
label: "已出库",
|
||||
},
|
||||
{
|
||||
value: "YiQuXiao",
|
||||
label: "已取消",
|
||||
},
|
||||
];
|
||||
const goodColumn = [
|
||||
{
|
||||
label: "名称",
|
||||
prop: "goodsName",
|
||||
},
|
||||
{
|
||||
label: "规格",
|
||||
prop: "specParams",
|
||||
},
|
||||
{
|
||||
label: "计量单位",
|
||||
prop: "unitTxt",
|
||||
},
|
||||
];
|
||||
const goodsChange = (val: any) => {
|
||||
// console.log(item, 'itemmm')
|
||||
formData.goodsCategoryName = val.goodsCategoryName;
|
||||
formData.goodsName = val.goodsName;
|
||||
formData.goodSn = val.sn;
|
||||
formData.unit = val.unit;
|
||||
formData.goodsCategoryId = val.goodsCategoryId;
|
||||
};
|
||||
const customerColumn = [
|
||||
{
|
||||
label: "公司",
|
||||
prop: "orgName",
|
||||
},
|
||||
{
|
||||
label: "地区",
|
||||
prop: "areaName",
|
||||
},
|
||||
{
|
||||
label: "负责人",
|
||||
prop: "customerName",
|
||||
},
|
||||
];
|
||||
|
||||
function dialogCloseHandler() {
|
||||
formData.$reset()
|
||||
formData.$reset();
|
||||
}
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (status.value === "view") return;
|
||||
submiting.value = true;
|
||||
if (formData.id != null) {
|
||||
FormUtil.submit(salesOrderFormIns, () => SalesOrderApi.modify(formData))
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
ElMessage.success("修改成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
submiting.value = false;
|
||||
});
|
||||
} else {
|
||||
FormUtil.submit(salesOrderFormIns, () => SalesOrderApi.add(formData))
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
ElMessage.success("添加成功");
|
||||
emits("editSucc");
|
||||
showDialog.value = false;
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
submiting.value = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: SalesOrderTypes.SearchSalesOrderResult = {}) {
|
||||
showDialog.value = true
|
||||
showDialog.value = true;
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
SalesOrderApi.detail(data.id!)
|
||||
.then(res => {
|
||||
formData.$reset(res.data)
|
||||
})
|
||||
status.value = "modify";
|
||||
SalesOrderApi.detail(data.id!).then((res) => {
|
||||
formData.$reset(res.data);
|
||||
});
|
||||
} else {
|
||||
status.value = 'add'
|
||||
formData.$reset(data)
|
||||
status.value = "add";
|
||||
formData.$reset(data);
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,209 @@
|
|||
<template>
|
||||
<Page>
|
||||
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||
<ElFormItem label="仓库名称">
|
||||
<ElInput
|
||||
v-model="searchForm.warehouseName"
|
||||
placeholder="仓库名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="位置">
|
||||
<ElInput
|
||||
v-model="searchForm.location"
|
||||
placeholder="位置"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建人 Id; sys_user.id">
|
||||
<ElInput
|
||||
v-model="searchForm.creatorId"
|
||||
placeholder="创建人 Id; sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改人 Id;sys_user.id">
|
||||
<ElInput
|
||||
v-model="searchForm.modifierId"
|
||||
placeholder="修改人 Id;sys_user.id"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="创建时间">
|
||||
<ElInput
|
||||
v-model="searchForm.createTime"
|
||||
placeholder="创建时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="修改时间">
|
||||
<ElInput
|
||||
v-model="searchForm.modifyTime"
|
||||
placeholder="修改时间"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem>
|
||||
<ElButton :icon="elIcons.Search" :loading="searching" native-type="submit" type="primary">搜索</ElButton>
|
||||
<ElButton :icon="elIcons.Refresh" :loading="searching" @click="reset">重置</ElButton>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
|
||||
<div class="tool-bar">
|
||||
<ElButton :icon="elIcons.Plus" type="primary" @click="addHandler">新建</ElButton>
|
||||
<ElButton :icon="elIcons.Filter" type="default" @click="showSearchForm = !showSearchForm"/>
|
||||
</div>
|
||||
|
||||
<ElTable v-loading="searching" :data="tableData"
|
||||
cell-class-name="table-cell"
|
||||
class="table-list"
|
||||
empty-text="暂无数据"
|
||||
header-row-class-name="table-header"
|
||||
row-key="id">
|
||||
<ElTableColumn label="Id" prop="id"/>
|
||||
<ElTableColumn label="仓库名称" prop="warehouseName"/>
|
||||
<ElTableColumn label="位置" prop="location"/>
|
||||
<!-- <ElTableColumn label="创建人 Id; sys_user.id" prop="creatorId"/>
|
||||
<ElTableColumn label="修改人 Id;sys_user.id" prop="modifierId"/> -->
|
||||
<ElTableColumn label="创建时间" prop="createTime"/>
|
||||
<ElTableColumn label="修改时间" prop="modifyTime"/>
|
||||
<!-- <ElTableColumn label="是否删除; 0-->未删除、1-->已删除" prop="deleted"/> -->
|
||||
<ElTableColumn label="操作" width="180">
|
||||
<template #default="scope">
|
||||
<div class="action-btn">
|
||||
<ElPopconfirm
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
confirm-button-type="danger"
|
||||
cancel-button-type="primary"
|
||||
placement="top"
|
||||
title="是否删除当前数据?"
|
||||
width="180"
|
||||
@confirm="delHandler(scope)">
|
||||
<template #reference>
|
||||
<ElButton text type="danger" :loading="deling">删除</ElButton>
|
||||
</template>
|
||||
</ElPopconfirm>
|
||||
<ElButton text type="primary" @click="modifyHandler(scope)">修改</ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ElTableColumn>
|
||||
</ElTable>
|
||||
<ElPagination
|
||||
layout="->, sizes, total, prev, pager, next"
|
||||
v-model:current-page="searchForm.current"
|
||||
v-model:page-size="searchForm.size"
|
||||
:total="totalCount"
|
||||
:page-sizes="[10, 20, 50, 100, 500]"
|
||||
:hide-on-single-page="false"
|
||||
:teleported="false"
|
||||
@change="paging"/>
|
||||
<WarehouseForm ref="warehouseForm" @edit-succ="paging"/>
|
||||
</Page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
||||
import WarehouseForm from '@/pages/wh/warehouse/WarehouseForm.vue'
|
||||
import Page from '@/components/page/Page.vue'
|
||||
import { elIcons } from '@/common/element/element.ts'
|
||||
import Utils from '@/common/utils'
|
||||
|
||||
const totalCount = ref(0)
|
||||
const tableData = Utils.resetAble(reactive<WarehouseTypes.SearchWarehouseResult[]>([]))
|
||||
const searchForm = Utils.resetAble(reactive<WarehouseTypes.SearchWarehouseParam>({
|
||||
current: 1,
|
||||
size: 20,
|
||||
}))
|
||||
const searching = ref(false)
|
||||
const deling = ref(false)
|
||||
const showSearchForm = ref(true)
|
||||
const warehouseFormIns = useTemplateRef<InstanceType<typeof WarehouseForm>>('warehouseForm')
|
||||
|
||||
function showDialog(data?: WarehouseTypes.SearchWarehouseResult) {
|
||||
warehouseFormIns.value?.open(data)
|
||||
}
|
||||
|
||||
function delHandler({row}: { row: WarehouseTypes.SearchWarehouseResult }) {
|
||||
deling.value = true
|
||||
WarehouseApi.del([ row.id! ])
|
||||
.then(() => {
|
||||
ElMessage.success('删除成功')
|
||||
paging()
|
||||
})
|
||||
.finally(() => {
|
||||
deling.value = false
|
||||
})
|
||||
}
|
||||
|
||||
function modifyHandler({row}: { row: WarehouseTypes.SearchWarehouseResult }) {
|
||||
showDialog(row)
|
||||
}
|
||||
|
||||
function addHandler() {
|
||||
showDialog()
|
||||
}
|
||||
|
||||
function reset() {
|
||||
searchForm.$reset()
|
||||
paging()
|
||||
}
|
||||
|
||||
function paging() {
|
||||
searching.value = true
|
||||
WarehouseApi.paging(searchForm)
|
||||
.then(res => {
|
||||
totalCount.value = res.data?.total ?? 0
|
||||
tableData.$reset(res.data?.records ?? [])
|
||||
})
|
||||
.finally(() => {
|
||||
searching.value = false
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
paging()
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.table-list {
|
||||
flex 1;
|
||||
margin 0 0 20px 0
|
||||
width 100%
|
||||
|
||||
:deep(.table-header) {
|
||||
color #454C59
|
||||
|
||||
th {
|
||||
background-color #EDF1F7
|
||||
font-weight 500
|
||||
position relative
|
||||
|
||||
& > div {
|
||||
display flex
|
||||
gap 5px
|
||||
align-items center
|
||||
}
|
||||
|
||||
&:not(:first-child) > div::before {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 1px;
|
||||
width: 1px;
|
||||
background-color: #D3D7DE;
|
||||
transform: translateY(-50%);
|
||||
content: "";
|
||||
height 50%
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.table-cell) {
|
||||
color #2F3540
|
||||
}
|
||||
.action-btn {
|
||||
width 100%
|
||||
display flex
|
||||
flex-wrap wrap
|
||||
|
||||
& > button {
|
||||
margin 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tool-bar {
|
||||
display flex
|
||||
justify-content space-between
|
||||
margin 0 0 20px 0
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
destroy-on-close
|
||||
width="fit-content"
|
||||
@close="dialogCloseHandler">
|
||||
<ElDescriptions title="仓库信息" border>
|
||||
<ElDescriptionsItem label="Id" prop="id">
|
||||
{{ detailData.id }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="仓库名称" prop="warehouseName">
|
||||
{{ detailData.warehouseName }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="位置" prop="location">
|
||||
{{ detailData.location }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="创建人 Id; sys_user.id" prop="creatorId">
|
||||
{{ detailData.creatorId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="修改人 Id;sys_user.id" prop="modifierId">
|
||||
{{ detailData.modifierId }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="创建时间" prop="createTime">
|
||||
{{ detailData.createTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="修改时间" prop="modifyTime">
|
||||
{{ detailData.modifyTime }}
|
||||
</ElDescriptionsItem>
|
||||
<ElDescriptionsItem label="是否删除; 0-->未删除、1-->已删除" prop="deleted">
|
||||
{{ detailData.deleted }}
|
||||
</ElDescriptionsItem>
|
||||
</ElDescriptions>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false" type="primary">关闭</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
||||
import Utils from '@/common/utils'
|
||||
|
||||
const showDialog = ref(false)
|
||||
|
||||
const detailData = Utils.resetAble(reactive<WarehouseTypes.SearchWarehouseResult>({}))
|
||||
|
||||
function dialogCloseHandler() {
|
||||
detailData.$reset()
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: WarehouseTypes.SearchWarehouseResult) {
|
||||
showDialog.value = true
|
||||
WarehouseApi.detail(data.id!)
|
||||
.then(res => {
|
||||
detailData.$reset(res.data)
|
||||
})
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
|
||||
</style>
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<template>
|
||||
<ElDialog v-model="showDialog"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
width="fit-content"
|
||||
@close="dialogCloseHandler">
|
||||
<ElForm :model="formData"
|
||||
:rules="rules"
|
||||
ref="warehouseForm"
|
||||
class="form-panel"
|
||||
label-width="auto">
|
||||
<ElFormItem label="仓库名称" prop="warehouseName">
|
||||
<ElInput
|
||||
v-model="formData.warehouseName"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="仓库名称"/>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="位置" prop="location">
|
||||
<ElInput
|
||||
v-model="formData.location"
|
||||
:disabled="status === 'view'"
|
||||
placeholder="位置"/>
|
||||
</ElFormItem>
|
||||
|
||||
</ElForm>
|
||||
<template #footer>
|
||||
<ElButton @click="showDialog = false">{{ status === 'view' ? '关闭' : '取消' }}</ElButton>
|
||||
<ElButton v-if="status !== 'view'" :loading="submiting" type="primary" @click="submitHandler">提交</ElButton>
|
||||
</template>
|
||||
</ElDialog>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import WarehouseApi from '@/pages/wh/warehouse/warehouse-api.ts'
|
||||
import Strings from '@/common/utils/strings.ts'
|
||||
import FormUtil from '@/common/utils/formUtil.ts'
|
||||
import Utils from '@/common/utils'
|
||||
import {
|
||||
ElMessage,
|
||||
type FormInstance,
|
||||
type FormRules,
|
||||
} from 'element-plus'
|
||||
|
||||
const emits = defineEmits(['editSucc'])
|
||||
const showDialog = ref(false)
|
||||
const submiting = ref(false)
|
||||
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||
|
||||
const warehouseFormIns = useTemplateRef<FormInstance>('warehouseForm')
|
||||
|
||||
const formData = Utils.resetAble(reactive<WarehouseTypes.SearchWarehouseResult>({}))
|
||||
const rules = reactive<FormRules<WarehouseTypes.SearchWarehouseResult>>({
|
||||
id: [{ required: true, message: '请填写Id', trigger: 'blur' }],
|
||||
warehouseName: [{ required: true, message: '请填写仓库名称', trigger: 'blur' }],
|
||||
location: [{ required: true, message: '请填写位置', trigger: 'blur' }],
|
||||
creatorId: [{ required: true, message: '请填写创建人 Id; sys_user.id', trigger: 'blur' }],
|
||||
modifierId: [{ required: true, message: '请填写修改人 Id;sys_user.id', trigger: 'blur' }],
|
||||
createTime: [{ required: true, message: '请填写创建时间', trigger: 'blur' }],
|
||||
modifyTime: [{ required: true, message: '请填写修改时间', trigger: 'blur' }],
|
||||
deleted: [{ required: true, message: '请填写是否删除; 0-->未删除、1-->已删除', trigger: 'blur' }],
|
||||
})
|
||||
|
||||
function dialogCloseHandler() {
|
||||
formData.$reset()
|
||||
}
|
||||
|
||||
function submitHandler() {
|
||||
if (status.value === 'view') return
|
||||
submiting.value = true
|
||||
if (formData.id != null) {
|
||||
FormUtil.submit(warehouseFormIns, () => WarehouseApi.modify(formData))
|
||||
.then(() => {
|
||||
ElMessage.success('修改成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
} else {
|
||||
FormUtil.submit(warehouseFormIns, () => WarehouseApi.add(formData))
|
||||
.then(() => {
|
||||
ElMessage.success('添加成功')
|
||||
emits('editSucc')
|
||||
showDialog.value = false
|
||||
})
|
||||
.finally(() => {
|
||||
submiting.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open(data: WarehouseTypes.SearchWarehouseResult = {}) {
|
||||
showDialog.value = true
|
||||
if (!Strings.isBlank(data.id)) {
|
||||
status.value = 'modify'
|
||||
WarehouseApi.detail(data.id!)
|
||||
.then(res => {
|
||||
formData.$reset(res.data)
|
||||
})
|
||||
} else {
|
||||
status.value = 'add'
|
||||
formData.$reset(data)
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="stylus" scoped>
|
||||
.form-panel {
|
||||
padding 20px
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
export default {
|
||||
component: () => import('@/pages/wh/warehouse/Warehouse.vue'),
|
||||
} as RouterTypes.RouteConfig
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import {
|
||||
get,
|
||||
post
|
||||
} from '@/common/utils/http-util.ts'
|
||||
|
||||
export default {
|
||||
paging(data: WarehouseTypes.SearchWarehouseParam) {
|
||||
return get<G.PageResult<WarehouseTypes.SearchWarehouseResult>>('/warehouse/paging', data)
|
||||
},
|
||||
detail(id: string) {
|
||||
return get<WarehouseTypes.SearchWarehouseResult>('/warehouse/detail', {id})
|
||||
},
|
||||
add(data: WarehouseTypes.AddWarehouseParam) {
|
||||
return post('/warehouse/add', data)
|
||||
},
|
||||
modify(data: WarehouseTypes.ModifyWarehouseParam) {
|
||||
return post('/warehouse/modify', data)
|
||||
},
|
||||
del(ids: string[]) {
|
||||
return post('/warehouse/del', ids)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
export {}
|
||||
|
||||
declare global {
|
||||
namespace WarehouseTypes {
|
||||
interface SearchWarehouseParam extends G.PageParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 仓库名称
|
||||
warehouseName?: string
|
||||
// 位置
|
||||
location?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id;sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface SearchWarehouseResult {
|
||||
// Id
|
||||
id?: string
|
||||
// 仓库名称
|
||||
warehouseName?: string
|
||||
// 位置
|
||||
location?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id;sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface AddWarehouseParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 仓库名称
|
||||
warehouseName?: string
|
||||
// 位置
|
||||
location?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id;sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
|
||||
interface ModifyWarehouseParam {
|
||||
// Id
|
||||
id?: string
|
||||
// 仓库名称
|
||||
warehouseName?: string
|
||||
// 位置
|
||||
location?: string
|
||||
// 创建人 Id; sys_user.id
|
||||
creatorId?: string
|
||||
// 修改人 Id;sys_user.id
|
||||
modifierId?: string
|
||||
// 创建时间
|
||||
createTime?: string
|
||||
// 修改时间
|
||||
modifyTime?: string
|
||||
// 是否删除; 0-->未删除、1-->已删除
|
||||
deleted?: boolean
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue