增加预约单列表
parent
a297536102
commit
3f7953ea1c
|
|
@ -1,3 +1,8 @@
|
||||||
# 后台服务地址
|
# 后台服务地址
|
||||||
VITE_HTTP_PROXY_TARGET=http://localhost:10086
|
# VITE_HTTP_PROXY_TARGET=http://localhost:10086
|
||||||
|
# VITE_HTTP_PROXY_TARGET=http://192.168.2.124:10086
|
||||||
|
VITE_HTTP_PROXY_TARGET=http://192.168.2.2:8808
|
||||||
|
|
||||||
|
# VITE_HTTP_PROXY_TARGET=https://s2.njzscloud.com/api/
|
||||||
|
# VITE_HTTP_PROXY_TARGET=https://chengdu.njzscloud.com/api
|
||||||
VITE_WS_PROXY_TARGET=ws://localhost:10086
|
VITE_WS_PROXY_TARGET=ws://localhost:10086
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,103 @@
|
||||||
|
<script lang="ts" setup>
|
||||||
|
const props = defineProps<{
|
||||||
|
placeholder: string;
|
||||||
|
disabled?: boolean;
|
||||||
|
api: any;
|
||||||
|
modelValue?: string | number;
|
||||||
|
valueKey?: string;
|
||||||
|
labelKey?: string;
|
||||||
|
tableColumn: any[];
|
||||||
|
}>();
|
||||||
|
|
||||||
|
const pagination = reactive<G.Pagination>({
|
||||||
|
total: 1,
|
||||||
|
pages: 1,
|
||||||
|
current: 1,
|
||||||
|
size: 20,
|
||||||
|
});
|
||||||
|
|
||||||
|
const dropdown = ref();
|
||||||
|
const showDropdown = () => {
|
||||||
|
dropdown.value.handleOpen();
|
||||||
|
pageChangeHandler(1);
|
||||||
|
};
|
||||||
|
const tableValue = ref<GoodsTypes.SearchGoodsResult[]>([]);
|
||||||
|
|
||||||
|
function pageChangeHandler(currentPage: number) {
|
||||||
|
pagination.current = currentPage;
|
||||||
|
props.api({ size: 20, current: currentPage }).then((res: any) => {
|
||||||
|
tableValue.value = res.data.records;
|
||||||
|
pagination.pages = res.data.pages;
|
||||||
|
pagination.total = res.data.total;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const emit = defineEmits(["change", "update:modelValue"]);
|
||||||
|
|
||||||
|
const inputValue = ref("");
|
||||||
|
function currentChangeHandler(val?: any) {
|
||||||
|
if (!val) return;
|
||||||
|
inputValue.value = val[props.labelKey || "name"];
|
||||||
|
emit("change", val);
|
||||||
|
emit("update:modelValue", val[props.valueKey || "id"]);
|
||||||
|
pagination.total = 0;
|
||||||
|
pagination.pages = 1;
|
||||||
|
pagination.current = 1;
|
||||||
|
pagination.size = 0;
|
||||||
|
tableValue.value = [];
|
||||||
|
dropdown.value.handleClose();
|
||||||
|
|
||||||
|
// if (val == null) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// formData.goodsName = val.goodsName;
|
||||||
|
// formData.goodSn = val.sn;
|
||||||
|
// formData.unit = val.unit;
|
||||||
|
// formData.goodsCategoryId = val.goodsCategoryId;
|
||||||
|
// goodsDropdown.value.handleClose();
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadData() {
|
||||||
|
if (props.modelValue) {
|
||||||
|
props.api({ size: 50, current: 1 }).then((res: any) => {
|
||||||
|
let list = res.data.records;
|
||||||
|
let data = list.find((item: any) => item[props.valueKey || "id"] === props.modelValue);
|
||||||
|
inputValue.value = data[props.labelKey || "name"];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(loadData);
|
||||||
|
|
||||||
|
// defineExpose({
|
||||||
|
// loadData,
|
||||||
|
// });
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<ElDropdown closable ref="dropdown" trigger="contextmenu" header="选择产品" placement="bottom">
|
||||||
|
<ElInput @click="showDropdown" v-model="inputValue" :placeholder="placeholder" readonly> </ElInput>
|
||||||
|
<template #dropdown>
|
||||||
|
<div class="dropdown-table-wrapper" style="width: 500px">
|
||||||
|
<ElTable ref="dropdownTable" :data="tableValue" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="index" width="500" @current-change="currentChangeHandler">
|
||||||
|
<ElTableColumn :label="item.label" :prop="item.prop" v-for="(item, i) in props.tableColumn" :key="i" />
|
||||||
|
<!-- <ElTableColumn label="#" type="index" />
|
||||||
|
<ElTableColumn label="名称" prop="goodsName" />
|
||||||
|
<ElTableColumn label="规格" prop="specParams" />
|
||||||
|
<ElTableColumn label="单位" prop="unit" /> -->
|
||||||
|
</ElTable>
|
||||||
|
<div class="select-page">
|
||||||
|
<ElPagination :page-size="pagination.size" :total="pagination.total" layout="total, prev, pager, next" @change="pageChangeHandler" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ElDropdown>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
.select-page{
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
// ------
|
// ------
|
||||||
// Generated by unplugin-vue-components
|
// Generated by unplugin-vue-components
|
||||||
// Read more: https://github.com/vuejs/core/pull/3399
|
// Read more: https://github.com/vuejs/core/pull/3399
|
||||||
|
import { GlobalComponents } from 'vue'
|
||||||
|
|
||||||
export {}
|
export {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ const searchForm = Utils.resetAble(
|
||||||
const searching = ref(false);
|
const searching = ref(false);
|
||||||
const deling = ref(false);
|
const deling = ref(false);
|
||||||
const showSearchForm = ref(true);
|
const showSearchForm = ref(true);
|
||||||
const orgFormIns = useTemplateRef<InstanceType<typeof OrgForm>>("orgForm");
|
// const orgFormIns = useTemplateRef<InstanceType<typeof OrgForm>>("orgForm");
|
||||||
|
|
||||||
// function showDialog(data?: OrgTypes.SearchOrgResult) {
|
// function showDialog(data?: OrgTypes.SearchOrgResult) {
|
||||||
// orgFormIns.value?.open(data);
|
// orgFormIns.value?.open(data);
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,6 @@ function submitHandler() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const category = ref<GoodsCategoryTypes.SearchGoodsCategoryResult[]>([]);
|
const category = ref<GoodsCategoryTypes.SearchGoodsCategoryResult[]>([]);
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const remoteMethod = (query: string) => {
|
const remoteMethod = (query: string) => {
|
||||||
console.log(query, "query");
|
console.log(query, "query");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
|
||||||
|
# top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
end_of_line = crlf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = false
|
||||||
|
insert_final_newline = false
|
||||||
|
|
@ -0,0 +1,337 @@
|
||||||
|
<template>
|
||||||
|
<Page>
|
||||||
|
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||||
|
<ElFormItem label="订单编号">
|
||||||
|
<ElInput v-model="searchForm.sn" placeholder="订单编号" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="项目 Id">
|
||||||
|
<ElInput v-model="searchForm.projectId" placeholder="项目 Id" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人">
|
||||||
|
<ElInput v-model="searchForm.userId" placeholder="下单人" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人客户">
|
||||||
|
<ElInput v-model="searchForm.customerId" placeholder="下单人客户" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人姓名">
|
||||||
|
<ElInput v-model="searchForm.contacts" placeholder="下单人姓名" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人联系方式">
|
||||||
|
<ElInput v-model="searchForm.phone" placeholder="下单人联系方式" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单时间">
|
||||||
|
<ElInput v-model="searchForm.orderTime" placeholder="下单时间" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="订单类型">
|
||||||
|
<ElInput v-model="searchForm.orderCategory" placeholder="订单类型" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="订单状态">
|
||||||
|
<ElInput v-model="searchForm.orderStatus" placeholder="订单状态" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="完结时间">
|
||||||
|
<ElInput v-model="searchForm.finishTime" placeholder="完结时间" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="运输组织">
|
||||||
|
<ElInput v-model="searchForm.transOrgId" placeholder="运输组织" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="指派清运公司时间">
|
||||||
|
<ElInput v-model="searchForm.assignmentTransTime" placeholder="指派清运公司时间" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="站点">
|
||||||
|
<ElInput v-model="searchForm.stationId" placeholder="站点" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="站点名称">
|
||||||
|
<ElInput v-model="searchForm.stationName" placeholder="站点名称" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="预估量">
|
||||||
|
<ElInput v-model="searchForm.estimatedQuantity" placeholder="预估量" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="预估车数">
|
||||||
|
<ElInput v-model="searchForm.estimatedTrainNum" 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.unit" placeholder="计量单位" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="客户备注">
|
||||||
|
<ElInput v-model="searchForm.customerMemo" placeholder="客户备注" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="创建人">
|
||||||
|
<ElInput v-model="searchForm.creatorId" placeholder="创建人" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="修改人">
|
||||||
|
<ElInput v-model="searchForm.modifierId" placeholder="修改人" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="创建时间">
|
||||||
|
<ElInput v-model="searchForm.createTime" 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" @expand-change="treeLoad" :data="tableData" cell-class-name="table-cell" class="table-list" empty-text="暂无数据" header-row-class-name="table-header" row-key="id">
|
||||||
|
<el-table-column type="expand">
|
||||||
|
<template #default="props">
|
||||||
|
<ElTable :data="props.row.children" header-row-class-name="table-header" :border="true" cell-class-name="table-cell" class="table-list">
|
||||||
|
<ElTableColumn label="商品名称" prop="goodsName" />
|
||||||
|
<ElTableColumn label="清运状态" prop="transStatus" />
|
||||||
|
<ElTableColumn label="订单状态" prop="orderStatus" />
|
||||||
|
<ElTableColumn label="清运公司" prop="transOrgId" />
|
||||||
|
<ElTableColumn label="操作" width="180" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<div class="action-btn">
|
||||||
|
<ElButton text v-if="!scope.row.transOrgId" type="primary" @click="showAssignDialog(scope.row)">指派清运公司</ElButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ElTableColumn>
|
||||||
|
</ElTable>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<ElTableColumn label="订单编号" prop="sn" width="140" />
|
||||||
|
<!-- <ElTableColumn label="项目 Id" prop="projectId" /> -->
|
||||||
|
<ElTableColumn label="下单人" prop="contacts" />
|
||||||
|
<ElTableColumn label="联系方式" prop="phone" width="120" />
|
||||||
|
<ElTableColumn label="垃圾品类" prop="goodsName" />
|
||||||
|
<ElTableColumn label="运输站点" prop="goodsName" />
|
||||||
|
<!-- <ElTableColumn label="下单时间" prop="orderTime" />
|
||||||
|
<ElTableColumn label="订单类型" prop="orderCategory"/>
|
||||||
|
<ElTableColumn label="运输方客户 Id" prop="transCustomerId"/>-->
|
||||||
|
<ElTableColumn label="运距(米)" prop="transDistance" width="120" />
|
||||||
|
<ElTableColumn label="预估量" prop="estimatedQuantity" />
|
||||||
|
<ElTableColumn label="预估车数" prop="estimatedTrainNum" />
|
||||||
|
<!-- <ElTableColumn label="计量单位" prop="unit"/> -->
|
||||||
|
<ElTableColumn label="客户备注" prop="customerMemo" />
|
||||||
|
<ElTableColumn label="创建时间" prop="createTime" width="160" />
|
||||||
|
<ElTableColumn label="修改时间" prop="modifyTime" width="160" />
|
||||||
|
<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" />
|
||||||
|
<OrderForm ref="orderForm" @edit-succ="paging" />
|
||||||
|
|
||||||
|
<ElDialog v-model="assignDialog" :destroy-on-close="true" title="指派清运公司" width="500">
|
||||||
|
<div style="display: flex; align-items: center">
|
||||||
|
<span style="margin-right: 10px">选择公司:</span>
|
||||||
|
<ASelect labelKey="orgName" valueKey="id" :tableColumn="customerColumn" v-model="assignFrom.transOrgId" :api="OrgApi.paging" placeholder="请选择清运公司" />
|
||||||
|
</div>
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<ElButton @click="assignDialog = false">关闭</ElButton>
|
||||||
|
<ElButton type="primary" @click="confirmDialog"> 确认 </ElButton>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</ElDialog>
|
||||||
|
</Page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import OrderApi from "@/pages/order/book-order/order-api.ts";
|
||||||
|
import OrderForm from "@/pages/order/book-order/OrderForm.vue";
|
||||||
|
import Page from "@/components/page/Page.vue";
|
||||||
|
import { elIcons } from "@/common/element/element.ts";
|
||||||
|
import Utils from "@/common/utils";
|
||||||
|
import OrgApi from "@/pages/cst/org/org-api.ts";
|
||||||
|
import ASelect from "@/components/a-select/ASelect.vue";
|
||||||
|
|
||||||
|
const totalCount = ref(0);
|
||||||
|
const tableData = Utils.resetAble(reactive<OrderTypes.SearchOrderResult[]>([]));
|
||||||
|
const searchForm = Utils.resetAble(
|
||||||
|
reactive<OrderTypes.SearchOrderParam>({
|
||||||
|
current: 1,
|
||||||
|
size: 20,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const searching = ref(false);
|
||||||
|
const deling = ref(false);
|
||||||
|
const showSearchForm = ref(true);
|
||||||
|
const assignDialog = ref(false);
|
||||||
|
const orderFormIns = useTemplateRef<InstanceType<typeof OrderForm>>("orderForm");
|
||||||
|
const assignFrom = ref({
|
||||||
|
transOrgId: "",
|
||||||
|
orderTransId: "",
|
||||||
|
});
|
||||||
|
|
||||||
|
function treeLoad(row: any, expanded: any, resolve: (data: any[]) => void) {
|
||||||
|
if (resolve == null && !expanded) return;
|
||||||
|
searching.value = true;
|
||||||
|
OrderApi.orderTrans({ sn: row.sn })
|
||||||
|
.then((res) => {
|
||||||
|
console.log(resolve, "res.data");
|
||||||
|
row.children = res.data?.records;
|
||||||
|
|
||||||
|
// if (resolve!=null){
|
||||||
|
// resolve(res.data?.records.map((it:any) => {
|
||||||
|
// it.hasChildren = true
|
||||||
|
// return it
|
||||||
|
// }) ?? [])
|
||||||
|
// console.log(res.data?.records)
|
||||||
|
// } else {
|
||||||
|
// tableData.updateKeyChildren(row.id, res.data?.records.map(it => {
|
||||||
|
// it.hasChildren = true
|
||||||
|
// it.children = []
|
||||||
|
// return it
|
||||||
|
// }) ?? [])
|
||||||
|
// }
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
searching.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const customerColumn = [
|
||||||
|
{
|
||||||
|
label: "公司",
|
||||||
|
prop: "orgName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "公司类型",
|
||||||
|
prop: "customerList[0].identityCategoryTxt",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地区",
|
||||||
|
prop: "areaName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "统一社会编码",
|
||||||
|
prop: "uscc",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
function showAssignDialog(data: any) {
|
||||||
|
assignFrom.value.transOrgId = data.transOrgId;
|
||||||
|
assignFrom.value.orderTransId = data.id;
|
||||||
|
assignDialog.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmDialog() {
|
||||||
|
console.log(assignFrom.value, "assignFrom");
|
||||||
|
if (!assignFrom.value.transOrgId) {
|
||||||
|
ElMessage.error("请选择清运公司");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OrderApi.assignmentOrg(assignFrom.value).then(() => {
|
||||||
|
assignDialog.value = false;
|
||||||
|
ElMessage.success("派车成功");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function showDialog(data?: OrderTypes.SearchOrderResult) {
|
||||||
|
orderFormIns.value?.open(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delHandler({ row }: { row: OrderTypes.SearchOrderResult }) {
|
||||||
|
deling.value = true;
|
||||||
|
OrderApi.del([row.id!])
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
paging();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
deling.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function modifyHandler({ row }: { row: OrderTypes.SearchOrderResult }) {
|
||||||
|
showDialog(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addHandler() {
|
||||||
|
showDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
searchForm.$reset();
|
||||||
|
paging();
|
||||||
|
}
|
||||||
|
|
||||||
|
function paging() {
|
||||||
|
searching.value = true;
|
||||||
|
OrderApi.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,123 @@
|
||||||
|
<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" prop="projectId">
|
||||||
|
{{ detailData.projectId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="下单人 Id;sys_user.id" prop="userId">
|
||||||
|
{{ detailData.userId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="下单人客户 Id;cst_customer.id" prop="customerId">
|
||||||
|
{{ detailData.customerId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="下单人姓名" prop="contacts">
|
||||||
|
{{ detailData.contacts }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="下单人联系方式" prop="phone">
|
||||||
|
{{ detailData.phone }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="下单时间" prop="orderTime">
|
||||||
|
{{ detailData.orderTime }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出" prop="orderCategory">
|
||||||
|
{{ detailData.orderCategory }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消" prop="orderStatus">
|
||||||
|
{{ detailData.orderStatus }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="完结时间" prop="finishTime">
|
||||||
|
{{ detailData.finishTime }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="运输组织 Id;cst_org.id" prop="transOrgId">
|
||||||
|
{{ detailData.transOrgId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="运输方客户 Id" prop="transCustomerId">
|
||||||
|
{{ detailData.transCustomerId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="指派清运公司时间" prop="assignmentTransTime">
|
||||||
|
{{ detailData.assignmentTransTime }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="站点 Id;cst_station.id" prop="stationId">
|
||||||
|
{{ detailData.stationId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="站点名称;cst_station.station.name" prop="stationName">
|
||||||
|
{{ detailData.stationName }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="运距;单位:米" prop="transDistance">
|
||||||
|
{{ detailData.transDistance }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="预估量" prop="estimatedQuantity">
|
||||||
|
{{ detailData.estimatedQuantity }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="预估车数" prop="estimatedTrainNum">
|
||||||
|
{{ detailData.estimatedTrainNum }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="产品 Id" prop="goodsId">
|
||||||
|
{{ detailData.goodsId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="产品名称" prop="goodsName">
|
||||||
|
{{ detailData.goodsName }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="计量单位;字典代码:unit" prop="unit">
|
||||||
|
{{ detailData.unit }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="客户备注" prop="customerMemo">
|
||||||
|
{{ detailData.customerMemo }}
|
||||||
|
</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 OrderApi from '@/pages/order/book-order/order-api.ts'
|
||||||
|
import Utils from '@/common/utils'
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
|
||||||
|
const detailData = Utils.resetAble(reactive<OrderTypes.SearchOrderResult>({}))
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
detailData.$reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: OrderTypes.SearchOrderResult) {
|
||||||
|
showDialog.value = true
|
||||||
|
OrderApi.detail(data.id!)
|
||||||
|
.then(res => {
|
||||||
|
detailData.$reset(res.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,289 @@
|
||||||
|
<template>
|
||||||
|
<ElDialog v-model="showDialog"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
destroy-on-close
|
||||||
|
width="fit-content"
|
||||||
|
@close="dialogCloseHandler">
|
||||||
|
<ElForm :model="formData"
|
||||||
|
:rules="rules"
|
||||||
|
ref="orderForm"
|
||||||
|
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">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.sn"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="订单编号"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="项目 Id" prop="projectId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.projectId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="项目 Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人 Id;sys_user.id" prop="userId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.userId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="下单人 Id;sys_user.id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人客户 Id;cst_customer.id" prop="customerId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.customerId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="下单人客户 Id;cst_customer.id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人姓名" prop="contacts">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.contacts"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="下单人姓名"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单人联系方式" prop="phone">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.phone"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="下单人联系方式"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="下单时间" prop="orderTime">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.orderTime"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="下单时间"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出" prop="orderCategory">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.orderCategory"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消" prop="orderStatus">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.orderStatus"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="完结时间" prop="finishTime">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.finishTime"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="完结时间"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="运输组织 Id;cst_org.id" prop="transOrgId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.transOrgId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="运输组织 Id;cst_org.id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="运输方客户 Id" prop="transCustomerId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.transCustomerId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="运输方客户 Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="指派清运公司时间" prop="assignmentTransTime">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.assignmentTransTime"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="指派清运公司时间"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="站点 Id;cst_station.id" prop="stationId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.stationId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="站点 Id;cst_station.id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="站点名称;cst_station.station.name" prop="stationName">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.stationName"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="站点名称;cst_station.station.name"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="运距;单位:米" prop="transDistance">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.transDistance"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="运距;单位:米"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="预估量" prop="estimatedQuantity">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.estimatedQuantity"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="预估量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="预估车数" prop="estimatedTrainNum">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.estimatedTrainNum"
|
||||||
|
: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>
|
||||||
|
<ElFormItem label="计量单位;字典代码:unit" prop="unit">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.unit"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="计量单位;字典代码:unit"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="客户备注" prop="customerMemo">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.customerMemo"
|
||||||
|
: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>
|
||||||
|
<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>
|
||||||
|
</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 OrderApi from '@/pages/order/book-order/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'
|
||||||
|
|
||||||
|
const emits = defineEmits(['editSucc'])
|
||||||
|
const showDialog = ref(false)
|
||||||
|
const submiting = ref(false)
|
||||||
|
const status = ref<'add' | 'view' | 'modify'>('add')
|
||||||
|
|
||||||
|
const orderFormIns = useTemplateRef<FormInstance>('orderForm')
|
||||||
|
|
||||||
|
const formData = Utils.resetAble(reactive<OrderTypes.SearchOrderResult>({}))
|
||||||
|
const rules = reactive<FormRules<OrderTypes.SearchOrderResult>>({
|
||||||
|
id: [{ required: true, message: '请填写Id', trigger: 'blur' }],
|
||||||
|
sn: [{ required: true, message: '请填写订单编号', trigger: 'blur' }],
|
||||||
|
projectId: [{ required: true, message: '请填写项目 Id', trigger: 'blur' }],
|
||||||
|
userId: [{ required: true, message: '请填写下单人 Id;sys_user.id', trigger: 'blur' }],
|
||||||
|
customerId: [{ required: true, message: '请填写下单人客户 Id;cst_customer.id', trigger: 'blur' }],
|
||||||
|
contacts: [{ required: true, message: '请填写下单人姓名', trigger: 'blur' }],
|
||||||
|
phone: [{ required: true, message: '请填写下单人联系方式', trigger: 'blur' }],
|
||||||
|
orderTime: [{ required: true, message: '请填写下单时间', trigger: 'blur' }],
|
||||||
|
orderCategory: [{ required: true, message: '请填写订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出', trigger: 'blur' }],
|
||||||
|
orderStatus: [{ required: true, message: '请填写订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消', trigger: 'blur' }],
|
||||||
|
finishTime: [{ required: true, message: '请填写完结时间', trigger: 'blur' }],
|
||||||
|
transOrgId: [{ required: true, message: '请填写运输组织 Id;cst_org.id', trigger: 'blur' }],
|
||||||
|
transCustomerId: [{ required: true, message: '请填写运输方客户 Id', trigger: 'blur' }],
|
||||||
|
assignmentTransTime: [{ required: true, message: '请填写指派清运公司时间', trigger: 'blur' }],
|
||||||
|
stationId: [{ required: true, message: '请填写站点 Id;cst_station.id', trigger: 'blur' }],
|
||||||
|
stationName: [{ required: true, message: '请填写站点名称;cst_station.station.name', trigger: 'blur' }],
|
||||||
|
transDistance: [{ required: true, message: '请填写运距;单位:米', trigger: 'blur' }],
|
||||||
|
estimatedQuantity: [{ required: true, message: '请填写预估量', trigger: 'blur' }],
|
||||||
|
estimatedTrainNum: [{ required: true, message: '请填写预估车数', trigger: 'blur' }],
|
||||||
|
goodsId: [{ required: true, message: '请填写产品 Id', trigger: 'blur' }],
|
||||||
|
goodsName: [{ required: true, message: '请填写产品名称', trigger: 'blur' }],
|
||||||
|
unit: [{ required: true, message: '请填写计量单位;字典代码:unit', trigger: 'blur' }],
|
||||||
|
customerMemo: [{ 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(orderFormIns, () => OrderApi.modify(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('修改成功')
|
||||||
|
emits('editSucc')
|
||||||
|
showDialog.value = false
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
FormUtil.submit(orderFormIns, () => OrderApi.add(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功')
|
||||||
|
emits('editSucc')
|
||||||
|
showDialog.value = false
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: OrderTypes.SearchOrderResult = {}) {
|
||||||
|
showDialog.value = true
|
||||||
|
if (!Strings.isBlank(data.id)) {
|
||||||
|
status.value = 'modify'
|
||||||
|
OrderApi.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,25 @@
|
||||||
|
import { get, post } from "@/common/utils/http-util.ts";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
paging(data: OrderTypes.SearchOrderParam) {
|
||||||
|
return get<G.PageResult<OrderTypes.SearchOrderResult>>("/order/paging", data);
|
||||||
|
},
|
||||||
|
detail(id: string) {
|
||||||
|
return get<OrderTypes.SearchOrderResult>("/order/detail", { id });
|
||||||
|
},
|
||||||
|
add(data: OrderTypes.AddOrderParam) {
|
||||||
|
return post("/order/add", data);
|
||||||
|
},
|
||||||
|
modify(data: OrderTypes.ModifyOrderParam) {
|
||||||
|
return post("/order/modify", data);
|
||||||
|
},
|
||||||
|
del(ids: string[]) {
|
||||||
|
return post("/order/del", ids);
|
||||||
|
},
|
||||||
|
assignmentOrg(data: any) {
|
||||||
|
return post("/order/assignmentOrg", data);
|
||||||
|
},
|
||||||
|
orderTrans(data: OrderTypes.SearchOrderParam) {
|
||||||
|
return get<G.PageResult<OrderTypes.SearchOrderResult>>("/order_trans/paging", data);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,241 @@
|
||||||
|
export {}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
namespace OrderTypes {
|
||||||
|
interface SearchOrderParam extends G.PageParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 订单编号
|
||||||
|
sn?: string
|
||||||
|
// 项目 Id
|
||||||
|
projectId?: string
|
||||||
|
// 下单人 Id;sys_user.id
|
||||||
|
userId?: string
|
||||||
|
// 下单人客户 Id;cst_customer.id
|
||||||
|
customerId?: string
|
||||||
|
// 下单人姓名
|
||||||
|
contacts?: string
|
||||||
|
// 下单人联系方式
|
||||||
|
phone?: string
|
||||||
|
// 下单时间
|
||||||
|
orderTime?: string
|
||||||
|
// 订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出
|
||||||
|
orderCategory?: string
|
||||||
|
// 订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消
|
||||||
|
orderStatus?: string
|
||||||
|
// 完结时间
|
||||||
|
finishTime?: string
|
||||||
|
// 运输组织 Id;cst_org.id
|
||||||
|
transOrgId?: string
|
||||||
|
// 运输方客户 Id
|
||||||
|
transCustomerId?: string
|
||||||
|
// 指派清运公司时间
|
||||||
|
assignmentTransTime?: string
|
||||||
|
// 站点 Id;cst_station.id
|
||||||
|
stationId?: string
|
||||||
|
// 站点名称;cst_station.station.name
|
||||||
|
stationName?: string
|
||||||
|
// 运距;单位:米
|
||||||
|
transDistance?: number
|
||||||
|
// 预估量
|
||||||
|
estimatedQuantity?: number
|
||||||
|
// 预估车数
|
||||||
|
estimatedTrainNum?: number
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 客户备注
|
||||||
|
customerMemo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SearchOrderResult {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 订单编号
|
||||||
|
sn?: string
|
||||||
|
// 项目 Id
|
||||||
|
projectId?: string
|
||||||
|
// 下单人 Id;sys_user.id
|
||||||
|
userId?: string
|
||||||
|
// 下单人客户 Id;cst_customer.id
|
||||||
|
customerId?: string
|
||||||
|
// 下单人姓名
|
||||||
|
contacts?: string
|
||||||
|
// 下单人联系方式
|
||||||
|
phone?: string
|
||||||
|
// 下单时间
|
||||||
|
orderTime?: string
|
||||||
|
// 订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出
|
||||||
|
orderCategory?: string
|
||||||
|
// 订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消
|
||||||
|
orderStatus?: string
|
||||||
|
// 完结时间
|
||||||
|
finishTime?: string
|
||||||
|
// 运输组织 Id;cst_org.id
|
||||||
|
transOrgId?: string
|
||||||
|
// 运输方客户 Id
|
||||||
|
transCustomerId?: string
|
||||||
|
// 指派清运公司时间
|
||||||
|
assignmentTransTime?: string
|
||||||
|
// 站点 Id;cst_station.id
|
||||||
|
stationId?: string
|
||||||
|
// 站点名称;cst_station.station.name
|
||||||
|
stationName?: string
|
||||||
|
// 运距;单位:米
|
||||||
|
transDistance?: number
|
||||||
|
// 预估量
|
||||||
|
estimatedQuantity?: number
|
||||||
|
// 预估车数
|
||||||
|
estimatedTrainNum?: number
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 客户备注
|
||||||
|
customerMemo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AddOrderParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 订单编号
|
||||||
|
sn?: string
|
||||||
|
// 项目 Id
|
||||||
|
projectId?: string
|
||||||
|
// 下单人 Id;sys_user.id
|
||||||
|
userId?: string
|
||||||
|
// 下单人客户 Id;cst_customer.id
|
||||||
|
customerId?: string
|
||||||
|
// 下单人姓名
|
||||||
|
contacts?: string
|
||||||
|
// 下单人联系方式
|
||||||
|
phone?: string
|
||||||
|
// 下单时间
|
||||||
|
orderTime?: string
|
||||||
|
// 订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出
|
||||||
|
orderCategory?: string
|
||||||
|
// 订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消
|
||||||
|
orderStatus?: string
|
||||||
|
// 完结时间
|
||||||
|
finishTime?: string
|
||||||
|
// 运输组织 Id;cst_org.id
|
||||||
|
transOrgId?: string
|
||||||
|
// 运输方客户 Id
|
||||||
|
transCustomerId?: string
|
||||||
|
// 指派清运公司时间
|
||||||
|
assignmentTransTime?: string
|
||||||
|
// 站点 Id;cst_station.id
|
||||||
|
stationId?: string
|
||||||
|
// 站点名称;cst_station.station.name
|
||||||
|
stationName?: string
|
||||||
|
// 运距;单位:米
|
||||||
|
transDistance?: number
|
||||||
|
// 预估量
|
||||||
|
estimatedQuantity?: number
|
||||||
|
// 预估车数
|
||||||
|
estimatedTrainNum?: number
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 客户备注
|
||||||
|
customerMemo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ModifyOrderParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 订单编号
|
||||||
|
sn?: string
|
||||||
|
// 项目 Id
|
||||||
|
projectId?: string
|
||||||
|
// 下单人 Id;sys_user.id
|
||||||
|
userId?: string
|
||||||
|
// 下单人客户 Id;cst_customer.id
|
||||||
|
customerId?: string
|
||||||
|
// 下单人姓名
|
||||||
|
contacts?: string
|
||||||
|
// 下单人联系方式
|
||||||
|
phone?: string
|
||||||
|
// 下单时间
|
||||||
|
orderTime?: string
|
||||||
|
// 订单类型;字典代码:order_category,HuiShouYuYue-->回收预约单、XiaoShouYuYue-->销售预约单、DuanBoRu-->短驳入、DuanBoChu-->短驳出
|
||||||
|
orderCategory?: string
|
||||||
|
// 订单状态;字典代码:order_status,YiYuYue-->已预约、JinXingZhong-->进行中、YiWanCheng-->已完成、YiQuXiao-->已取消
|
||||||
|
orderStatus?: string
|
||||||
|
// 完结时间
|
||||||
|
finishTime?: string
|
||||||
|
// 运输组织 Id;cst_org.id
|
||||||
|
transOrgId?: string
|
||||||
|
// 运输方客户 Id
|
||||||
|
transCustomerId?: string
|
||||||
|
// 指派清运公司时间
|
||||||
|
assignmentTransTime?: string
|
||||||
|
// 站点 Id;cst_station.id
|
||||||
|
stationId?: string
|
||||||
|
// 站点名称;cst_station.station.name
|
||||||
|
stationName?: string
|
||||||
|
// 运距;单位:米
|
||||||
|
transDistance?: number
|
||||||
|
// 预估量
|
||||||
|
estimatedQuantity?: number
|
||||||
|
// 预估车数
|
||||||
|
estimatedTrainNum?: number
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 客户备注
|
||||||
|
customerMemo?: 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/order/book-order/Order.vue'),
|
||||||
|
} as RouterTypes.RouteConfig
|
||||||
|
|
@ -0,0 +1,255 @@
|
||||||
|
<template>
|
||||||
|
<Page>
|
||||||
|
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||||
|
<ElFormItem label="Id">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.id"
|
||||||
|
placeholder="Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="仓库 Id">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.warehouseId"
|
||||||
|
placeholder="仓库 Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="产品 Id">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.goodsId"
|
||||||
|
placeholder="产品 Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="存放位置">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.location"
|
||||||
|
placeholder="存放位置"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="当前库存数量">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.stockQuantity"
|
||||||
|
placeholder="当前库存数量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="锁定数量">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.lockQuantity"
|
||||||
|
placeholder="锁定数量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="总量">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.totalQuantity"
|
||||||
|
placeholder="总量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="剩余量">
|
||||||
|
<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>
|
||||||
|
<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 label="是否删除; 0-->未删除、1-->已删除">
|
||||||
|
<ElInput
|
||||||
|
v-model="searchForm.deleted"
|
||||||
|
placeholder="是否删除; 0-->未删除、1-->已删除"/>
|
||||||
|
</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="仓库 Id" prop="warehouseId"/>
|
||||||
|
<ElTableColumn label="产品 Id" prop="goodsId"/>
|
||||||
|
<ElTableColumn label="存放位置" prop="location"/>
|
||||||
|
<ElTableColumn label="当前库存数量" prop="stockQuantity"/>
|
||||||
|
<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">
|
||||||
|
<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"/>
|
||||||
|
<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'
|
||||||
|
|
||||||
|
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')
|
||||||
|
|
||||||
|
function showDialog(data?: InventoryTypes.SearchInventoryResult) {
|
||||||
|
inventoryFormIns.value?.open(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
function delHandler({row}: { row: InventoryTypes.SearchInventoryResult }) {
|
||||||
|
deling.value = true
|
||||||
|
InventoryApi.del([ row.id! ])
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('删除成功')
|
||||||
|
paging()
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
deling.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
function modifyHandler({row}: { row: InventoryTypes.SearchInventoryResult }) {
|
||||||
|
showDialog(row)
|
||||||
|
}
|
||||||
|
|
||||||
|
function addHandler() {
|
||||||
|
showDialog()
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
searchForm.$reset()
|
||||||
|
paging()
|
||||||
|
}
|
||||||
|
|
||||||
|
function paging() {
|
||||||
|
searching.value = true
|
||||||
|
InventoryApi.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,81 @@
|
||||||
|
<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="仓库 Id" prop="warehouseId">
|
||||||
|
{{ detailData.warehouseId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="产品 Id" prop="goodsId">
|
||||||
|
{{ detailData.goodsId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="存放位置" prop="location">
|
||||||
|
{{ detailData.location }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="当前库存数量" prop="stockQuantity">
|
||||||
|
{{ detailData.stockQuantity }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="锁定数量" prop="lockQuantity">
|
||||||
|
{{ detailData.lockQuantity }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="总量" prop="totalQuantity">
|
||||||
|
{{ detailData.totalQuantity }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="剩余量" prop="remainingQuantity">
|
||||||
|
{{ detailData.remainingQuantity }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="计量单位;字典代码:unit" prop="unit">
|
||||||
|
{{ detailData.unit }}
|
||||||
|
</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 InventoryApi from '@/pages/wh/inventory/inventory-api.ts'
|
||||||
|
import Utils from '@/common/utils'
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
|
||||||
|
const detailData = Utils.resetAble(reactive<InventoryTypes.SearchInventoryResult>({}))
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
detailData.$reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: InventoryTypes.SearchInventoryResult) {
|
||||||
|
showDialog.value = true
|
||||||
|
InventoryApi.detail(data.id!)
|
||||||
|
.then(res => {
|
||||||
|
detailData.$reset(res.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,191 @@
|
||||||
|
<template>
|
||||||
|
<ElDialog v-model="showDialog"
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
destroy-on-close
|
||||||
|
width="fit-content"
|
||||||
|
@close="dialogCloseHandler">
|
||||||
|
<ElForm :model="formData"
|
||||||
|
:rules="rules"
|
||||||
|
ref="inventoryForm"
|
||||||
|
class="form-panel"
|
||||||
|
label-width="auto">
|
||||||
|
<ElFormItem label="Id" prop="id">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.id"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="仓库 Id" prop="warehouseId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.warehouseId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="仓库 Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="产品 Id" prop="goodsId">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.goodsId"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="产品 Id"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="存放位置" prop="location">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.location"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="存放位置"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="当前库存数量" prop="stockQuantity">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.stockQuantity"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="当前库存数量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="锁定数量" prop="lockQuantity">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.lockQuantity"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="锁定数量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="总量" prop="totalQuantity">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.totalQuantity"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="总量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="剩余量" prop="remainingQuantity">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.remainingQuantity"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="剩余量"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="计量单位;字典代码:unit" 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>
|
||||||
|
</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 InventoryApi from '@/pages/wh/inventory/inventory-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 inventoryFormIns = useTemplateRef<FormInstance>('inventoryForm')
|
||||||
|
|
||||||
|
const formData = Utils.resetAble(reactive<InventoryTypes.SearchInventoryResult>({}))
|
||||||
|
const rules = reactive<FormRules<InventoryTypes.SearchInventoryResult>>({
|
||||||
|
id: [{ required: true, message: '请填写Id', trigger: 'blur' }],
|
||||||
|
warehouseId: [{ required: true, message: '请填写仓库 Id', trigger: 'blur' }],
|
||||||
|
goodsId: [{ required: true, message: '请填写产品 Id', trigger: 'blur' }],
|
||||||
|
location: [{ required: true, message: '请填写存放位置', trigger: 'blur' }],
|
||||||
|
stockQuantity: [{ required: true, message: '请填写当前库存数量', trigger: 'blur' }],
|
||||||
|
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' }],
|
||||||
|
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(inventoryFormIns, () => InventoryApi.modify(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('修改成功')
|
||||||
|
emits('editSucc')
|
||||||
|
showDialog.value = false
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
FormUtil.submit(inventoryFormIns, () => InventoryApi.add(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功')
|
||||||
|
emits('editSucc')
|
||||||
|
showDialog.value = false
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: InventoryTypes.SearchInventoryResult = {}) {
|
||||||
|
showDialog.value = true
|
||||||
|
if (!Strings.isBlank(data.id)) {
|
||||||
|
status.value = 'modify'
|
||||||
|
InventoryApi.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: InventoryTypes.SearchInventoryParam) {
|
||||||
|
return get<G.PageResult<InventoryTypes.SearchInventoryResult>>('/inventory/paging', data)
|
||||||
|
},
|
||||||
|
detail(id: string) {
|
||||||
|
return get<InventoryTypes.SearchInventoryResult>('/inventory/detail', {id})
|
||||||
|
},
|
||||||
|
add(data: InventoryTypes.AddInventoryParam) {
|
||||||
|
return post('/inventory/add', data)
|
||||||
|
},
|
||||||
|
modify(data: InventoryTypes.ModifyInventoryParam) {
|
||||||
|
return post('/inventory/modify', data)
|
||||||
|
},
|
||||||
|
del(ids: string[]) {
|
||||||
|
return post('/inventory/del', ids)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,129 @@
|
||||||
|
export {}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
namespace InventoryTypes {
|
||||||
|
interface SearchInventoryParam extends G.PageParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 仓库 Id
|
||||||
|
warehouseId?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 存放位置
|
||||||
|
location?: string
|
||||||
|
// 当前库存数量
|
||||||
|
stockQuantity?: number
|
||||||
|
// 锁定数量
|
||||||
|
lockQuantity?: number
|
||||||
|
// 总量
|
||||||
|
totalQuantity?: number
|
||||||
|
// 剩余量
|
||||||
|
remainingQuantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SearchInventoryResult {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 仓库 Id
|
||||||
|
warehouseId?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 存放位置
|
||||||
|
location?: string
|
||||||
|
// 当前库存数量
|
||||||
|
stockQuantity?: number
|
||||||
|
// 锁定数量
|
||||||
|
lockQuantity?: number
|
||||||
|
// 总量
|
||||||
|
totalQuantity?: number
|
||||||
|
// 剩余量
|
||||||
|
remainingQuantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AddInventoryParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 仓库 Id
|
||||||
|
warehouseId?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 存放位置
|
||||||
|
location?: string
|
||||||
|
// 当前库存数量
|
||||||
|
stockQuantity?: number
|
||||||
|
// 锁定数量
|
||||||
|
lockQuantity?: number
|
||||||
|
// 总量
|
||||||
|
totalQuantity?: number
|
||||||
|
// 剩余量
|
||||||
|
remainingQuantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ModifyInventoryParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 仓库 Id
|
||||||
|
warehouseId?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 存放位置
|
||||||
|
location?: string
|
||||||
|
// 当前库存数量
|
||||||
|
stockQuantity?: number
|
||||||
|
// 锁定数量
|
||||||
|
lockQuantity?: number
|
||||||
|
// 总量
|
||||||
|
totalQuantity?: number
|
||||||
|
// 剩余量
|
||||||
|
remainingQuantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: 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/inventory/Inventory.vue'),
|
||||||
|
} as RouterTypes.RouteConfig
|
||||||
|
|
@ -0,0 +1,213 @@
|
||||||
|
<template>
|
||||||
|
<Page>
|
||||||
|
<ElForm v-show="showSearchForm" inline @submit.prevent="paging">
|
||||||
|
<ElFormItem label="编号">
|
||||||
|
<ElInput v-model="searchForm.sn" placeholder="编号" />
|
||||||
|
</ElFormItem>
|
||||||
|
|
||||||
|
<!-- ,JinXingZhong-进行中、YiDaoHuo-已到货、YiRuKu-已入库、YiQuXiao-已取消 -->
|
||||||
|
<ElFormItem label="状态">
|
||||||
|
<ElInput v-model="searchForm.purchaseOrderStatus" placeholder="状态" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="供货客户 Id">
|
||||||
|
<ElInput v-model="searchForm.customerId" placeholder="供货客户 Id" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="采购日期">
|
||||||
|
<ElInput v-model="searchForm.purchaseDate" placeholder="采购日期" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="到货日期">
|
||||||
|
<ElInput v-model="searchForm.arrivalDate" placeholder="到货日期" />
|
||||||
|
</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="计量单位">
|
||||||
|
<ElInput v-model="searchForm.unit" placeholder="计量单位unit" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="总金额;单位:元">
|
||||||
|
<ElInput v-model="searchForm.totalMoney" placeholder="总金额;单位:元" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="备注">
|
||||||
|
<ElInput v-model="searchForm.memo" 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" />
|
||||||
|
<!-- ,JinXingZhong--进行中、YiDaoHuo--已到货、YiRuKu--已入库、YiQuXiao--已取消 -->
|
||||||
|
<ElTableColumn label="状态" prop="purchaseOrderStatus" />
|
||||||
|
<!-- <ElTableColumn label="供货客户 Id" prop="customerId" /> -->
|
||||||
|
<ElTableColumn label="采购日期" prop="purchaseDate" />
|
||||||
|
<ElTableColumn label="到货日期" prop="arrivalDate" />
|
||||||
|
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
|
||||||
|
<ElTableColumn label="产品名称" prop="goodsName" />
|
||||||
|
<ElTableColumn label="商品编码" prop="goodSn" />
|
||||||
|
<ElTableColumn label="数量" prop="quantity" />
|
||||||
|
<ElTableColumn label="计量单位" prop="unit" />
|
||||||
|
<ElTableColumn label="总金额(元)" prop="totalMoney" />
|
||||||
|
<ElTableColumn label="备注" prop="memo" />
|
||||||
|
<ElTableColumn label="创建时间" prop="createTime" />
|
||||||
|
<ElTableColumn label="修改时间" prop="modifyTime" />
|
||||||
|
<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" />
|
||||||
|
<PurchaseOrderForm ref="purchaseOrderForm" @edit-succ="paging" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import PurchaseOrderApi from "@/pages/wh/purchase-order/purchase-order-api.ts";
|
||||||
|
import PurchaseOrderForm from "@/pages/wh/purchase-order/PurchaseOrderForm.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<PurchaseOrderTypes.SearchPurchaseOrderResult[]>([]));
|
||||||
|
const searchForm = Utils.resetAble(
|
||||||
|
reactive<PurchaseOrderTypes.SearchPurchaseOrderParam>({
|
||||||
|
current: 1,
|
||||||
|
size: 20,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const searching = ref(false);
|
||||||
|
const deling = ref(false);
|
||||||
|
const showSearchForm = ref(true);
|
||||||
|
const purchaseOrderFormIns = useTemplateRef<InstanceType<typeof PurchaseOrderForm>>("purchaseOrderForm");
|
||||||
|
|
||||||
|
function showDialog(data?: PurchaseOrderTypes.SearchPurchaseOrderResult) {
|
||||||
|
purchaseOrderFormIns.value?.open(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delHandler({ row }: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
|
||||||
|
deling.value = true;
|
||||||
|
PurchaseOrderApi.del([row.id!])
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
paging();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
deling.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function modifyHandler({ row }: { row: PurchaseOrderTypes.SearchPurchaseOrderResult }) {
|
||||||
|
showDialog(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addHandler() {
|
||||||
|
showDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
searchForm.$reset();
|
||||||
|
paging();
|
||||||
|
}
|
||||||
|
|
||||||
|
function paging() {
|
||||||
|
searching.value = true;
|
||||||
|
PurchaseOrderApi.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,99 @@
|
||||||
|
<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="状态,JinXingZhong-->进行中、YiDaoHuo-->已到货、YiRuKu-->已入库、YiQuXiao-->已取消" prop="purchaseOrderStatus">
|
||||||
|
{{ detailData.purchaseOrderStatus }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="供货客户 Id" prop="customerId">
|
||||||
|
{{ detailData.customerId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="采购日期" prop="purchaseDate">
|
||||||
|
{{ detailData.purchaseDate }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="到货日期" prop="arrivalDate">
|
||||||
|
{{ detailData.arrivalDate }}
|
||||||
|
</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="totalMoney">
|
||||||
|
{{ detailData.totalMoney }}
|
||||||
|
</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 PurchaseOrderApi from '@/pages/wh/purchase-order/purchase-order-api.ts'
|
||||||
|
import Utils from '@/common/utils'
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
|
||||||
|
const detailData = Utils.resetAble(reactive<PurchaseOrderTypes.SearchPurchaseOrderResult>({}))
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
detailData.$reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: PurchaseOrderTypes.SearchPurchaseOrderResult) {
|
||||||
|
showDialog.value = true
|
||||||
|
PurchaseOrderApi.detail(data.id!)
|
||||||
|
.then(res => {
|
||||||
|
detailData.$reset(res.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,208 @@
|
||||||
|
<template>
|
||||||
|
<ElDialog v-model="showDialog" :close-on-click-modal="false" destroy-on-close 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">
|
||||||
|
<ElInput v-model="formData.sn" :disabled="status === 'view'" placeholder="编号" />
|
||||||
|
</ElFormItem>
|
||||||
|
|
||||||
|
<!-- ,JinXingZhong--进行中、YiDaoHuo--已到货、YiRuKu--已入库、YiQuXiao--已取消 -->
|
||||||
|
<!-- <ElFormItem label="状态" prop="purchaseOrderStatus">
|
||||||
|
<ElInput v-model="formData.purchaseOrderStatus" :disabled="status === 'view'" placeholder="状态" />
|
||||||
|
</ElFormItem> -->
|
||||||
|
<ElFormItem label="供货客户" prop="customerId">
|
||||||
|
<!-- <ElSelect v-model="formData.goodsCategoryId" :disabled="status === 'view'" placeholder="产品类型" filterable remote reserve-keyword remote-show-suffix :remote-method="remoteMethod" :loading="loading" style="width: 240px">
|
||||||
|
<ElOption v-for="item in category" :key="item.id" :label="item.categoryName" :value="item.id" />
|
||||||
|
</ElSelect> -->
|
||||||
|
<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="请选择采购日期" />
|
||||||
|
</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="请选择采购日期" />
|
||||||
|
|
||||||
|
<!-- <ElInput v-model="formData.arrivalDate" :disabled="status === 'view'" placeholder="到货日期" /> -->
|
||||||
|
</ElFormItem>
|
||||||
|
<!-- <ElFormItem label="产品分类" prop="goodsCategoryId">
|
||||||
|
<ElInput v-model="formData.goodsCategoryId" :disabled="status === 'view'" placeholder="产品分类" />
|
||||||
|
</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="选择产品" />
|
||||||
|
</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="计量单位" prop="unit">
|
||||||
|
<ElInput v-model="formData.unit" readonly placeholder="计量单位" />
|
||||||
|
</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="备注" />
|
||||||
|
</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 PurchaseOrderApi from "@/pages/wh/purchase-order/purchase-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 GoodsCategoryApi from '@/pages/gds/goods-category/goods-category-api.ts'
|
||||||
|
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 purchaseOrderFormIns = useTemplateRef<FormInstance>("purchaseOrderForm");
|
||||||
|
|
||||||
|
const formData = Utils.resetAble(reactive<PurchaseOrderTypes.SearchPurchaseOrderResult>({}));
|
||||||
|
const rules = reactive<FormRules<PurchaseOrderTypes.SearchPurchaseOrderResult>>({
|
||||||
|
sn: [{ required: true, message: "请填写编号", trigger: "blur" }],
|
||||||
|
purchaseOrderStatus: [{ required: true, message: "请填写状态", trigger: "blur" }],
|
||||||
|
customerId: [{ required: true, message: "请填写供货客户", trigger: "blur" }],
|
||||||
|
purchaseDate: [{ required: true, message: "请填写采购日期", trigger: "blur" }],
|
||||||
|
arrivalDate: [{ required: true, message: "请填写到货日期", trigger: "blur" }],
|
||||||
|
goodsCategoryId: [{ required: true, message: "请填写产品分类", trigger: "blur" }],
|
||||||
|
goodsCategoryName: [{ required: true, message: "请填写分类名称", trigger: "blur" }],
|
||||||
|
goodsId: [{ required: true, message: "请填写产品", trigger: "blur" }],
|
||||||
|
goodsName: [{ required: true, message: "请填写产品名称", trigger: "blur" }],
|
||||||
|
goodSn: [{ required: true, message: "请填写商品编码", trigger: "blur" }],
|
||||||
|
quantity: [{ required: true, message: "请填写数量", trigger: "blur" }],
|
||||||
|
unit: [{ required: true, message: "请填写计量单位", trigger: "blur" }],
|
||||||
|
totalMoney: [{ required: true, message: "请填写总金额;单位:元", trigger: "blur" }],
|
||||||
|
memo: [{ required: true, message: "请填写备注", trigger: "blur" }],
|
||||||
|
creatorId: [{ required: true, message: "请填写创建人", trigger: "blur" }],
|
||||||
|
modifierId: [{ required: true, message: "请填写修改人", trigger: "blur" }],
|
||||||
|
createTime: [{ required: true, message: "请填写创建时间", trigger: "blur" }],
|
||||||
|
modifyTime: [{ required: true, message: "请填写修改时间", trigger: "blur" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
const goodColumn = [
|
||||||
|
{
|
||||||
|
label: "名称",
|
||||||
|
prop: "goodsName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "规格",
|
||||||
|
prop: "specParams",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "计量单位",
|
||||||
|
prop: "unit",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const customerColumn = [
|
||||||
|
{
|
||||||
|
label: "公司",
|
||||||
|
prop: "orgName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "地区",
|
||||||
|
prop: "areaName",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "负责人",
|
||||||
|
prop: "customerName",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const goodsChange = (val: any) => {
|
||||||
|
// console.log(item, 'itemmm')
|
||||||
|
formData.goodsName = val.goodsName;
|
||||||
|
formData.goodSn = val.sn;
|
||||||
|
formData.unit = val.unit;
|
||||||
|
formData.goodsCategoryId = val.goodsCategoryId;
|
||||||
|
};
|
||||||
|
|
||||||
|
// const iconTableDataSource = ref<any>(
|
||||||
|
// icons.glyphs.filter((_, i) => {
|
||||||
|
// return i >= 0 && i < 5;
|
||||||
|
// })
|
||||||
|
// );
|
||||||
|
|
||||||
|
// const remoteMethod = (query: string) => {
|
||||||
|
// console.log(query, "query");
|
||||||
|
// loading.value = true;
|
||||||
|
// CustomerApi.paging({ size: 50, categoryName: query || undefined }).then((res) => {
|
||||||
|
// category.value = res.data.records;
|
||||||
|
// loading.value = false;
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
formData.$reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
console.log(formData);
|
||||||
|
if (status.value === "view") return;
|
||||||
|
submiting.value = true;
|
||||||
|
if (formData.id != null) {
|
||||||
|
FormUtil.submit(purchaseOrderFormIns, () => PurchaseOrderApi.modify(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success("修改成功");
|
||||||
|
emits("editSucc");
|
||||||
|
showDialog.value = false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
FormUtil.submit(purchaseOrderFormIns, () => PurchaseOrderApi.add(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success("添加成功");
|
||||||
|
emits("editSucc");
|
||||||
|
showDialog.value = false;
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: PurchaseOrderTypes.SearchPurchaseOrderResult = {}) {
|
||||||
|
showDialog.value = true;
|
||||||
|
if (!Strings.isBlank(data.id)) {
|
||||||
|
status.value = "modify";
|
||||||
|
PurchaseOrderApi.detail(data.id!).then((res) => {
|
||||||
|
formData.$reset(res.data);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
status.value = "add";
|
||||||
|
formData.$reset(data);
|
||||||
|
}
|
||||||
|
// getData();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
.form-panel {
|
||||||
|
padding 20px
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export default {
|
||||||
|
component: () => import('@/pages/wh/purchase-order/PurchaseOrder.vue'),
|
||||||
|
} as RouterTypes.RouteConfig
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import {
|
||||||
|
get,
|
||||||
|
post
|
||||||
|
} from '@/common/utils/http-util.ts'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
paging(data: PurchaseOrderTypes.SearchPurchaseOrderParam) {
|
||||||
|
return get<G.PageResult<PurchaseOrderTypes.SearchPurchaseOrderResult>>('/purchase_order/paging', data)
|
||||||
|
},
|
||||||
|
detail(id: string) {
|
||||||
|
return get<PurchaseOrderTypes.SearchPurchaseOrderResult>('/purchase_order/detail', {id})
|
||||||
|
},
|
||||||
|
add(data: PurchaseOrderTypes.AddPurchaseOrderParam) {
|
||||||
|
return post('/purchase_order/add', data)
|
||||||
|
},
|
||||||
|
modify(data: PurchaseOrderTypes.ModifyPurchaseOrderParam) {
|
||||||
|
return post('/purchase_order/modify', data)
|
||||||
|
},
|
||||||
|
del(ids: string[]) {
|
||||||
|
return post('/purchase_order/del', ids)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,177 @@
|
||||||
|
export {}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
namespace PurchaseOrderTypes {
|
||||||
|
interface SearchPurchaseOrderParam extends G.PageParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiDaoHuo-->已到货、YiRuKu-->已入库、YiQuXiao-->已取消
|
||||||
|
purchaseOrderStatus?: string
|
||||||
|
// 供货客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 采购日期
|
||||||
|
purchaseDate?: string
|
||||||
|
// 到货日期
|
||||||
|
arrivalDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SearchPurchaseOrderResult {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiDaoHuo-->已到货、YiRuKu-->已入库、YiQuXiao-->已取消
|
||||||
|
purchaseOrderStatus?: string
|
||||||
|
// 供货客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 采购日期
|
||||||
|
purchaseDate?: string
|
||||||
|
// 到货日期
|
||||||
|
arrivalDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AddPurchaseOrderParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiDaoHuo-->已到货、YiRuKu-->已入库、YiQuXiao-->已取消
|
||||||
|
purchaseOrderStatus?: string
|
||||||
|
// 供货客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 采购日期
|
||||||
|
purchaseDate?: string
|
||||||
|
// 到货日期
|
||||||
|
arrivalDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ModifyPurchaseOrderParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiDaoHuo-->已到货、YiRuKu-->已入库、YiQuXiao-->已取消
|
||||||
|
purchaseOrderStatus?: string
|
||||||
|
// 供货客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 采购日期
|
||||||
|
purchaseDate?: string
|
||||||
|
// 到货日期
|
||||||
|
arrivalDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: 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,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.salesOrderStatus" placeholder="状态" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="购买方客户">
|
||||||
|
<ElInput v-model="searchForm.customerId" placeholder="购买方客户" />
|
||||||
|
</ElFormItem>
|
||||||
|
<!-- ,JinXingZhong--进行中、YiFaHuo--已发货、YiChuKu--已出库、YiQuXiao--已取消 -->
|
||||||
|
<ElFormItem label="下单日期">
|
||||||
|
<ElInput v-model="searchForm.orderDate" placeholder="下单日期" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="发货日期">
|
||||||
|
<ElInput v-model="searchForm.shipmentDate" placeholder="发货日期" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="产品分类">
|
||||||
|
<ElInput v-model="searchForm.goodsCategoryId" placeholder="产品分类" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="分类名称">
|
||||||
|
<ElInput v-model="searchForm.goodsCategoryName" placeholder="分类名称" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="产品">
|
||||||
|
<ElInput v-model="searchForm.goodsId" placeholder="产品" />
|
||||||
|
</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="计量单位">
|
||||||
|
<ElInput v-model="searchForm.unit" placeholder="计量单位" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="总金额">
|
||||||
|
<ElInput v-model="searchForm.totalMoney" placeholder="总金额" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="备注">
|
||||||
|
<ElInput v-model="searchForm.memo" placeholder="备注" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="创建人">
|
||||||
|
<ElInput v-model="searchForm.creatorId" placeholder="创建人" />
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="修改人">
|
||||||
|
<ElInput v-model="searchForm.modifierId" 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="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="goodsCategoryId" />
|
||||||
|
<ElTableColumn label="分类名称" prop="goodsCategoryName" />
|
||||||
|
<ElTableColumn label="产品" prop="goodsId" />
|
||||||
|
<ElTableColumn label="产品名称" prop="goodsName" />
|
||||||
|
<ElTableColumn label="商品编码" prop="goodSn" />
|
||||||
|
<ElTableColumn label="数量" prop="quantity" />
|
||||||
|
<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">
|
||||||
|
<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" />
|
||||||
|
<SalesOrderForm ref="salesOrderForm" @edit-succ="paging" />
|
||||||
|
</Page>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import SalesOrderApi from "@/pages/wh/sales-order/sales-order-api.ts";
|
||||||
|
import SalesOrderForm from "@/pages/wh/sales-order/SalesOrderForm.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<SalesOrderTypes.SearchSalesOrderResult[]>([]));
|
||||||
|
const searchForm = Utils.resetAble(
|
||||||
|
reactive<SalesOrderTypes.SearchSalesOrderParam>({
|
||||||
|
current: 1,
|
||||||
|
size: 20,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const searching = ref(false);
|
||||||
|
const deling = ref(false);
|
||||||
|
const showSearchForm = ref(true);
|
||||||
|
const salesOrderFormIns = useTemplateRef<InstanceType<typeof SalesOrderForm>>("salesOrderForm");
|
||||||
|
|
||||||
|
function showDialog(data?: SalesOrderTypes.SearchSalesOrderResult) {
|
||||||
|
salesOrderFormIns.value?.open(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
function delHandler({ row }: { row: SalesOrderTypes.SearchSalesOrderResult }) {
|
||||||
|
deling.value = true;
|
||||||
|
SalesOrderApi.del([row.id!])
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
paging();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
deling.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function modifyHandler({ row }: { row: SalesOrderTypes.SearchSalesOrderResult }) {
|
||||||
|
showDialog(row);
|
||||||
|
}
|
||||||
|
|
||||||
|
function addHandler() {
|
||||||
|
showDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
function reset() {
|
||||||
|
searchForm.$reset();
|
||||||
|
paging();
|
||||||
|
}
|
||||||
|
|
||||||
|
function paging() {
|
||||||
|
searching.value = true;
|
||||||
|
SalesOrderApi.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,99 @@
|
||||||
|
<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="状态,JinXingZhong-->进行中、YiFaHuo-->已发货、YiChuKu-->已出库、YiQuXiao-->已取消" prop="salesOrderStatus">
|
||||||
|
{{ detailData.salesOrderStatus }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="购买方客户 Id" prop="customerId">
|
||||||
|
{{ detailData.customerId }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="下单日期" prop="orderDate">
|
||||||
|
{{ detailData.orderDate }}
|
||||||
|
</ElDescriptionsItem>
|
||||||
|
<ElDescriptionsItem label="发货日期" prop="shipmentDate">
|
||||||
|
{{ detailData.shipmentDate }}
|
||||||
|
</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="totalMoney">
|
||||||
|
{{ detailData.totalMoney }}
|
||||||
|
</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 SalesOrderApi from '@/pages/wh/sales-order/sales-order-api.ts'
|
||||||
|
import Utils from '@/common/utils'
|
||||||
|
|
||||||
|
const showDialog = ref(false)
|
||||||
|
|
||||||
|
const detailData = Utils.resetAble(reactive<SalesOrderTypes.SearchSalesOrderResult>({}))
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
detailData.$reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: SalesOrderTypes.SearchSalesOrderResult) {
|
||||||
|
showDialog.value = true
|
||||||
|
SalesOrderApi.detail(data.id!)
|
||||||
|
.then(res => {
|
||||||
|
detailData.$reset(res.data)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="stylus" scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
@ -0,0 +1,228 @@
|
||||||
|
<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>
|
||||||
|
<ElFormItem label="状态" prop="salesOrderStatus">
|
||||||
|
<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>
|
||||||
|
<ElFormItem label="下单日期" prop="orderDate">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.orderDate"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="下单日期"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="发货日期" prop="shipmentDate">
|
||||||
|
<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>
|
||||||
|
<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="totalMoney">
|
||||||
|
<ElInput
|
||||||
|
v-model="formData.totalMoney"
|
||||||
|
:disabled="status === 'view'"
|
||||||
|
placeholder="总金额;单位:元"/>
|
||||||
|
</ElFormItem>
|
||||||
|
<ElFormItem label="备注" prop="memo">
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
</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 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'
|
||||||
|
|
||||||
|
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 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' }],
|
||||||
|
})
|
||||||
|
|
||||||
|
function dialogCloseHandler() {
|
||||||
|
formData.$reset()
|
||||||
|
}
|
||||||
|
|
||||||
|
function submitHandler() {
|
||||||
|
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
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
FormUtil.submit(salesOrderFormIns, () => SalesOrderApi.add(formData))
|
||||||
|
.then(() => {
|
||||||
|
ElMessage.success('添加成功')
|
||||||
|
emits('editSucc')
|
||||||
|
showDialog.value = false
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
submiting.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
open(data: SalesOrderTypes.SearchSalesOrderResult = {}) {
|
||||||
|
showDialog.value = true
|
||||||
|
if (!Strings.isBlank(data.id)) {
|
||||||
|
status.value = 'modify'
|
||||||
|
SalesOrderApi.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/sales-order/SalesOrder.vue'),
|
||||||
|
} as RouterTypes.RouteConfig
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
import {
|
||||||
|
get,
|
||||||
|
post
|
||||||
|
} from '@/common/utils/http-util.ts'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
paging(data: SalesOrderTypes.SearchSalesOrderParam) {
|
||||||
|
return get<G.PageResult<SalesOrderTypes.SearchSalesOrderResult>>('/sales_order/paging', data)
|
||||||
|
},
|
||||||
|
detail(id: string) {
|
||||||
|
return get<SalesOrderTypes.SearchSalesOrderResult>('/sales_order/detail', {id})
|
||||||
|
},
|
||||||
|
add(data: SalesOrderTypes.AddSalesOrderParam) {
|
||||||
|
return post('/sales_order/add', data)
|
||||||
|
},
|
||||||
|
modify(data: SalesOrderTypes.ModifySalesOrderParam) {
|
||||||
|
return post('/sales_order/modify', data)
|
||||||
|
},
|
||||||
|
del(ids: string[]) {
|
||||||
|
return post('/sales_order/del', ids)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,177 @@
|
||||||
|
export {}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
namespace SalesOrderTypes {
|
||||||
|
interface SearchSalesOrderParam extends G.PageParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiFaHuo-->已发货、YiChuKu-->已出库、YiQuXiao-->已取消
|
||||||
|
salesOrderStatus?: string
|
||||||
|
// 购买方客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 下单日期
|
||||||
|
orderDate?: string
|
||||||
|
// 发货日期
|
||||||
|
shipmentDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface SearchSalesOrderResult {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiFaHuo-->已发货、YiChuKu-->已出库、YiQuXiao-->已取消
|
||||||
|
salesOrderStatus?: string
|
||||||
|
// 购买方客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 下单日期
|
||||||
|
orderDate?: string
|
||||||
|
// 发货日期
|
||||||
|
shipmentDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AddSalesOrderParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiFaHuo-->已发货、YiChuKu-->已出库、YiQuXiao-->已取消
|
||||||
|
salesOrderStatus?: string
|
||||||
|
// 购买方客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 下单日期
|
||||||
|
orderDate?: string
|
||||||
|
// 发货日期
|
||||||
|
shipmentDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ModifySalesOrderParam {
|
||||||
|
// Id
|
||||||
|
id?: string
|
||||||
|
// 编号
|
||||||
|
sn?: string
|
||||||
|
// 状态,JinXingZhong-->进行中、YiFaHuo-->已发货、YiChuKu-->已出库、YiQuXiao-->已取消
|
||||||
|
salesOrderStatus?: string
|
||||||
|
// 购买方客户 Id
|
||||||
|
customerId?: string
|
||||||
|
// 下单日期
|
||||||
|
orderDate?: string
|
||||||
|
// 发货日期
|
||||||
|
shipmentDate?: string
|
||||||
|
// 产品分类 Id
|
||||||
|
goodsCategoryId?: string
|
||||||
|
// 分类名称
|
||||||
|
goodsCategoryName?: string
|
||||||
|
// 产品 Id
|
||||||
|
goodsId?: string
|
||||||
|
// 产品名称
|
||||||
|
goodsName?: string
|
||||||
|
// 商品编码
|
||||||
|
goodSn?: string
|
||||||
|
// 数量
|
||||||
|
quantity?: number
|
||||||
|
// 计量单位;字典代码:unit
|
||||||
|
unit?: string
|
||||||
|
// 总金额;单位:元
|
||||||
|
totalMoney?: string
|
||||||
|
// 备注
|
||||||
|
memo?: string
|
||||||
|
// 创建人 Id; sys_user.id
|
||||||
|
creatorId?: string
|
||||||
|
// 修改人 Id; sys_user.id
|
||||||
|
modifierId?: string
|
||||||
|
// 创建时间
|
||||||
|
createTime?: string
|
||||||
|
// 修改时间
|
||||||
|
modifyTime?: string
|
||||||
|
// 是否删除; 0-->未删除、1-->已删除
|
||||||
|
deleted?: boolean
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -15,10 +15,16 @@ import ElementPlus from 'unplugin-element-plus/vite'
|
||||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||||||
import { fileWatcher } from './plugin/file-watcher.ts'
|
import { fileWatcher } from './plugin/file-watcher.ts'
|
||||||
import IconfontProcess from './plugin/iconfont-process.ts'
|
import IconfontProcess from './plugin/iconfont-process.ts'
|
||||||
|
// import * as https from "node:https";
|
||||||
|
|
||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig((configEnv) => {
|
export default defineConfig((configEnv) => {
|
||||||
const env = loadEnv(configEnv.mode, process.cwd(), '')
|
const env = loadEnv(configEnv.mode, process.cwd(), "");
|
||||||
|
// const Agent = https.Agent;
|
||||||
|
// const agent = new Agent({
|
||||||
|
// keepAlive: true,
|
||||||
|
// // host: 'https://supervisory.njzscloud.com' // 显式指定请求的主机名为目标域名
|
||||||
|
// });
|
||||||
return {
|
return {
|
||||||
base: env.VITE_APP_BASE_URL,
|
base: env.VITE_APP_BASE_URL,
|
||||||
build: {
|
build: {
|
||||||
|
|
@ -28,7 +34,7 @@ export default defineConfig((configEnv) => {
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
modules: {
|
modules: {
|
||||||
localsConvention: 'camelCase',
|
localsConvention: "camelCase",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
@ -36,16 +42,16 @@ export default defineConfig((configEnv) => {
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
VueDevTools(),
|
VueDevTools(),
|
||||||
ElementPlus({
|
ElementPlus({
|
||||||
defaultLocale: 'zh-cn',
|
defaultLocale: "zh-cn",
|
||||||
}),
|
}),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
imports: [ 'vue', 'vue-router', 'pinia' ],
|
imports: ["vue", "vue-router", "pinia"],
|
||||||
dts: './src/dts/auto-imports.d.ts',
|
dts: "./src/dts/auto-imports.d.ts",
|
||||||
resolvers: [ElementPlusResolver()],
|
resolvers: [ElementPlusResolver()],
|
||||||
}),
|
}),
|
||||||
Components({
|
Components({
|
||||||
dts: './src/dts/components.d.ts',
|
dts: "./src/dts/components.d.ts",
|
||||||
dirs: [ './src/widgets' ],
|
dirs: ["./src/widgets"],
|
||||||
resolvers: [ElementPlusResolver()],
|
resolvers: [ElementPlusResolver()],
|
||||||
}),
|
}),
|
||||||
processHtml(env.VITE_APP_NAME),
|
processHtml(env.VITE_APP_NAME),
|
||||||
|
|
@ -53,31 +59,34 @@ export default defineConfig((configEnv) => {
|
||||||
zipDist(),
|
zipDist(),
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [ '.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json' ],
|
extensions: [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"],
|
||||||
alias: [
|
alias: [
|
||||||
{
|
{
|
||||||
find: '@',
|
find: "@",
|
||||||
replacement: path.resolve(__dirname, 'src'),
|
replacement: path.resolve(__dirname, "src"),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
host: '0.0.0.0',
|
host: "0.0.0.0",
|
||||||
port: 5173,
|
port: 5173,
|
||||||
proxy: {
|
proxy: {
|
||||||
[env.VITE_HTTP_SERVER_BASE_URL]: {
|
[env.VITE_HTTP_SERVER_BASE_URL]: {
|
||||||
proxyTimeout: 10000,
|
proxyTimeout: 10000,
|
||||||
target: env.VITE_HTTP_PROXY_TARGET,
|
target: env.VITE_HTTP_PROXY_TARGET,
|
||||||
secure: false,
|
secure: false,
|
||||||
|
|
||||||
|
// agent,
|
||||||
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: path => env.VITE_HTTP_SERVER_BASE_URL == null || env.VITE_HTTP_SERVER_BASE_URL == '/' ? path : path.replace(new RegExp(env.VITE_HTTP_SERVER_BASE_URL), ''),
|
rewrite: (path) => (env.VITE_HTTP_SERVER_BASE_URL == null || env.VITE_HTTP_SERVER_BASE_URL == "/" ? path : path.replace(new RegExp(env.VITE_HTTP_SERVER_BASE_URL), "")),
|
||||||
} as ProxyOptions,
|
} as ProxyOptions,
|
||||||
[env.VITE_WS_SERVER_BASE_URL]: {
|
[env.VITE_WS_SERVER_BASE_URL]: {
|
||||||
ws: true,
|
ws: true,
|
||||||
target: env.VITE_WS_PROXY_TARGET,
|
target: env.VITE_WS_PROXY_TARGET,
|
||||||
rewrite: (path) => (env.VITE_WS_SERVER_BASE_URL == null || env.VITE_WS_SERVER_BASE_URL == '/' ? path : path.replace(new RegExp(env.VITE_WS_SERVER_BASE_URL), '')),
|
rewrite: (path) => (env.VITE_WS_SERVER_BASE_URL == null || env.VITE_WS_SERVER_BASE_URL == "/" ? path : path.replace(new RegExp(env.VITE_WS_SERVER_BASE_URL), "")),
|
||||||
} as ProxyOptions,
|
} as ProxyOptions,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
})
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue