体现入库时间,供应商名称,去查询系统直接选择供应商导出
This commit is contained in:
@@ -4,10 +4,14 @@
|
||||
<!-- 左侧:客户列表(对齐你截图的“左侧列表 + 右侧详情”布局) -->
|
||||
<el-col :span="6" class="customer-left">
|
||||
<div class="left-toolbar">
|
||||
<el-radio-group v-model="entityType" size="small" @change="handleEntityTypeChange">
|
||||
<el-radio-button label="customer">客户</el-radio-button>
|
||||
<el-radio-button label="supplier">供货商</el-radio-button>
|
||||
</el-radio-group>
|
||||
<el-input
|
||||
v-model="queryParams.name"
|
||||
v-model="searchKeyword"
|
||||
clearable
|
||||
placeholder="请输入关键字搜索客户"
|
||||
:placeholder="entityType === 'customer' ? '请输入关键字搜索客户' : '请输入关键字搜索供货商'"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@clear="handleQuery"
|
||||
>
|
||||
@@ -22,14 +26,14 @@
|
||||
</div>
|
||||
|
||||
<div class="left-list" v-loading="loading">
|
||||
<el-empty v-if="!customerList.length" description="暂无客户" />
|
||||
<el-empty v-if="entityType === 'customer' ? !customerList.length : !supplierList.length" :description="entityType === 'customer' ? '暂无客户' : '暂无供货商'" />
|
||||
<el-scrollbar v-else height="calc(100vh - 220px)">
|
||||
<div
|
||||
v-for="item in customerList"
|
||||
:key="item.customerId"
|
||||
v-for="item in (entityType === 'customer' ? customerList : supplierList)"
|
||||
:key="entityType === 'customer' ? item.customerId : item.supplierId"
|
||||
class="customer-card"
|
||||
:class="{ active: item.customerId === selectedCustomerId }"
|
||||
@click="handleSelect(item)"
|
||||
:class="{ active: entityType === 'customer' ? item.customerId === selectedCustomerId : item.supplierId === selectedSupplierId }"
|
||||
@click="entityType === 'customer' ? handleSelect(item) : handleSelectSupplier(item)"
|
||||
>
|
||||
<div class="customer-card__row">
|
||||
<div class="customer-card__title">{{ item.name || '-' }}</div>
|
||||
@@ -43,42 +47,62 @@
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="customer-card__meta">
|
||||
<span class="customer-card__meta-item">手机:{{ item.mobile || '-' }}</span>
|
||||
<span class="customer-card__meta-item">电话:{{ item.telephone || '-' }}</span>
|
||||
</div>
|
||||
<div class="customer-card__meta">
|
||||
<span class="customer-card__meta-item">邮箱:{{ item.email || '-' }}</span>
|
||||
</div>
|
||||
<template v-if="entityType === 'customer'">
|
||||
<div class="customer-card__meta">
|
||||
<span class="customer-card__meta-item">手机:{{ item.mobile || '-' }}</span>
|
||||
<span class="customer-card__meta-item">电话:{{ item.telephone || '-' }}</span>
|
||||
</div>
|
||||
<div class="customer-card__meta">
|
||||
<span class="customer-card__meta-item">邮箱:{{ item.email || '-' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="customer-card__meta">
|
||||
<span class="customer-card__meta-item">联系人:{{ item.contactPerson || '-' }}</span>
|
||||
<span class="customer-card__meta-item">电话:{{ item.phone || '-' }}</span>
|
||||
</div>
|
||||
<div class="customer-card__meta">
|
||||
<span class="customer-card__meta-item">地址:{{ item.address || '-' }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
|
||||
<pagination
|
||||
v-if="entityType === 'customer'"
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
v-model:page="queryParams.pageNum"
|
||||
v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination
|
||||
v-else
|
||||
v-show="supplierTotal>0"
|
||||
:total="supplierTotal"
|
||||
v-model:page="supplierQueryParams.pageNum"
|
||||
v-model:limit="supplierQueryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-col>
|
||||
|
||||
<!-- 右侧:客户详情(Tab 结构参考你截图) -->
|
||||
<el-col :span="18" class="customer-right">
|
||||
<el-card shadow="never" class="right-card">
|
||||
<el-tabs v-model="activeTab" @tab-click="handleTabChange">
|
||||
<el-tab-pane label="客户详情" name="detail" />
|
||||
<el-tab-pane :label="entityType === 'customer' ? '客户详情' : '供货商详情'" name="detail" />
|
||||
<el-tab-pane label="信息编辑" name="edit" />
|
||||
<el-tab-pane label="历史订单" name="orders" />
|
||||
<el-tab-pane label="财务状态" name="finance" />
|
||||
<el-tab-pane label="订单异议" name="dispute" />
|
||||
<el-tab-pane label="发货单据" name="shipping" />
|
||||
<el-tab-pane v-if="entityType === 'customer'" label="历史订单" name="orders" />
|
||||
<el-tab-pane v-if="entityType === 'customer'" label="财务状态" name="finance" />
|
||||
<el-tab-pane v-if="entityType === 'customer'" label="订单异议" name="dispute" />
|
||||
<el-tab-pane v-if="entityType === 'customer'" label="发货单据" name="shipping" />
|
||||
</el-tabs>
|
||||
|
||||
<div class="right-body" v-loading="detailLoading">
|
||||
<el-empty v-if="!selectedCustomerId" description="请选择左侧客户" />
|
||||
<el-empty v-if="entityType === 'customer' ? !selectedCustomerId : !selectedSupplierId" :description="entityType === 'customer' ? '请选择左侧客户' : '请选择左侧供货商'" />
|
||||
|
||||
<template v-else>
|
||||
<template v-else-if="entityType === 'customer'">
|
||||
<div v-show="activeTab === 'detail'">
|
||||
<!-- 客户详情:用表格/预览式展示,便于快速浏览 -->
|
||||
<el-descriptions :column="2" border>
|
||||
@@ -300,6 +324,50 @@
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template v-else>
|
||||
<div v-show="activeTab === 'detail'">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="供货商编号">{{ selectedSupplier.supplierId }}</el-descriptions-item>
|
||||
<el-descriptions-item label="供货商名称">{{ selectedSupplier.name }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系人">{{ selectedSupplier.contactPerson }}</el-descriptions-item>
|
||||
<el-descriptions-item label="联系电话">{{ selectedSupplier.phone }}</el-descriptions-item>
|
||||
<el-descriptions-item label="地址" :span="2">{{ selectedSupplier.address }}</el-descriptions-item>
|
||||
<el-descriptions-item label="供货商类型">{{ supplierTypeName(selectedSupplier.typeId) }}</el-descriptions-item>
|
||||
<el-descriptions-item label="备注" :span="2">{{ selectedSupplier.remark }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
|
||||
<div v-show="activeTab === 'edit'">
|
||||
<el-form ref="supplierEditFormRef" :model="supplierEditForm" label-width="90px" class="edit-form">
|
||||
<el-form-item label="供货商名称" prop="name">
|
||||
<el-input v-model="supplierEditForm.name" placeholder="请输入供货商名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系人" prop="contactPerson">
|
||||
<el-input v-model="supplierEditForm.contactPerson" placeholder="请输入联系人" />
|
||||
</el-form-item>
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="supplierEditForm.phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
<el-form-item label="地址" prop="address">
|
||||
<el-input v-model="supplierEditForm.address" placeholder="请输入地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货商类型" prop="typeId">
|
||||
<el-select v-model="supplierEditForm.typeId" filterable clearable placeholder="请选择供货商类型">
|
||||
<el-option v-for="t in supplyTypeList" :key="t.typeId" :label="t.typeName" :value="t.typeId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="supplierEditForm.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<div class="edit-actions">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitEdit">保存</el-button>
|
||||
<el-button @click="resetEdit">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@@ -310,6 +378,8 @@
|
||||
<script>
|
||||
import { getCurrentInstance } from "vue";
|
||||
import { listCustomer, getCustomer, delCustomer, addCustomer, updateCustomer } from "@/api/oms/customer";
|
||||
import { listSupplier, getSupplier, delSupplier, addSupplier, updateSupplier } from "@/api/oa/supplier";
|
||||
import { listSupplyType } from "@/api/oa/supplyType";
|
||||
import { listOrder } from "@/api/oms/order";
|
||||
import { listShippingOrder } from "@/api/oms/shippingOrder";
|
||||
import { listOrderDetail } from "@/api/oms/orderDetail";
|
||||
@@ -340,6 +410,9 @@ export default {
|
||||
total: 0,
|
||||
// CRM 客户表格数据
|
||||
customerList: [],
|
||||
entityType: "customer",
|
||||
supplierList: [],
|
||||
supplierTotal: 0,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -353,9 +426,22 @@ export default {
|
||||
// 当前选中客户(左侧列表点击后刷新)
|
||||
selectedCustomerId: undefined,
|
||||
selectedCustomer: {},
|
||||
selectedSupplierId: undefined,
|
||||
selectedSupplier: {},
|
||||
detailLoading: false,
|
||||
// 编辑表单(右侧“信息编辑”Tab 使用)
|
||||
editForm: {},
|
||||
supplierEditForm: {},
|
||||
supplierQueryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
name: undefined,
|
||||
contactPerson: undefined,
|
||||
phone: undefined,
|
||||
address: undefined,
|
||||
typeId: undefined
|
||||
},
|
||||
supplyTypeList: [],
|
||||
// 历史订单(右侧“历史订单/财务状态”Tab 使用)
|
||||
ordersLoading: false,
|
||||
orderList: [],
|
||||
@@ -397,25 +483,69 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.loadSupplyTypeList();
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
loadSupplyTypeList() {
|
||||
return listSupplyType({ pageNum: 1, pageSize: 9999 })
|
||||
.then((res) => {
|
||||
this.supplyTypeList = (res && res.rows) ? res.rows : [];
|
||||
})
|
||||
.catch(() => {
|
||||
this.supplyTypeList = [];
|
||||
});
|
||||
},
|
||||
supplierTypeName(typeId) {
|
||||
const id = typeId != null ? Number(typeId) : null;
|
||||
const list = this.supplyTypeList || [];
|
||||
const hit = list.find((t) => t && Number(t.typeId) === id);
|
||||
return hit && hit.typeName ? hit.typeName : (typeId != null ? String(typeId) : "-");
|
||||
},
|
||||
/** 查询CRM 客户列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCustomer(this.queryParams).then(response => {
|
||||
this.customerList = response.rows;
|
||||
this.total = response.total;
|
||||
if (this.entityType === "customer") {
|
||||
listCustomer(this.queryParams).then(response => {
|
||||
this.customerList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
if (!this.selectedCustomerId && this.customerList.length) {
|
||||
this.handleSelect(this.customerList[0]);
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
listSupplier(this.supplierQueryParams).then(response => {
|
||||
this.supplierList = response.rows;
|
||||
this.supplierTotal = response.total;
|
||||
this.loading = false;
|
||||
// 列表刷新后:如果未选中客户,则默认选中第一条(便于右侧有内容)
|
||||
if (!this.selectedCustomerId && this.customerList.length) {
|
||||
this.handleSelect(this.customerList[0]);
|
||||
if (!this.selectedSupplierId && this.supplierList.length) {
|
||||
this.handleSelectSupplier(this.supplierList[0]);
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
if (this.entityType === "customer") {
|
||||
this.queryParams.pageNum = 1;
|
||||
} else {
|
||||
this.supplierQueryParams.pageNum = 1;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
handleEntityTypeChange() {
|
||||
this.activeTab = "detail";
|
||||
this.selectedCustomerId = undefined;
|
||||
this.selectedCustomer = {};
|
||||
this.editForm = {};
|
||||
this.selectedSupplierId = undefined;
|
||||
this.selectedSupplier = {};
|
||||
this.supplierEditForm = {};
|
||||
this.getList();
|
||||
},
|
||||
/** 左侧列表点击:加载客户详情,并同步初始化编辑表单 */
|
||||
@@ -458,61 +588,117 @@ export default {
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
handleSelectSupplier(row) {
|
||||
if (!row || !row.supplierId) return;
|
||||
this.selectedSupplierId = row.supplierId;
|
||||
this.detailLoading = true;
|
||||
getSupplier(row.supplierId).then(res => {
|
||||
this.selectedSupplier = res.data || {};
|
||||
this.supplierEditForm = { ...(res.data || {}) };
|
||||
}).finally(() => {
|
||||
this.detailLoading = false;
|
||||
});
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
// 说明:新增时直接切换到“信息编辑”Tab,并初始化空表单
|
||||
this.activeTab = "edit";
|
||||
this.selectedCustomerId = undefined;
|
||||
this.selectedCustomer = {};
|
||||
this.editForm = {
|
||||
customerId: undefined,
|
||||
if (this.entityType === "customer") {
|
||||
this.selectedCustomerId = undefined;
|
||||
this.selectedCustomer = {};
|
||||
this.editForm = {
|
||||
customerId: undefined,
|
||||
name: undefined,
|
||||
mobile: undefined,
|
||||
telephone: undefined,
|
||||
qq: undefined,
|
||||
wechat: undefined,
|
||||
email: undefined,
|
||||
areaId: undefined,
|
||||
detailAddress: undefined,
|
||||
level: undefined,
|
||||
source: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
return;
|
||||
}
|
||||
this.selectedSupplierId = undefined;
|
||||
this.selectedSupplier = {};
|
||||
this.supplierEditForm = {
|
||||
supplierId: undefined,
|
||||
name: undefined,
|
||||
mobile: undefined,
|
||||
telephone: undefined,
|
||||
qq: undefined,
|
||||
wechat: undefined,
|
||||
email: undefined,
|
||||
areaId: undefined,
|
||||
detailAddress: undefined,
|
||||
level: undefined,
|
||||
source: undefined,
|
||||
contactPerson: undefined,
|
||||
phone: undefined,
|
||||
address: undefined,
|
||||
typeId: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
},
|
||||
/** 保存编辑(新增/修改共用) */
|
||||
submitEdit() {
|
||||
this.$refs["editFormRef"].validate(valid => {
|
||||
if (!valid) return;
|
||||
this.buttonLoading = true;
|
||||
const req = this.editForm.customerId ? updateCustomer(this.editForm) : addCustomer(this.editForm);
|
||||
req.then(() => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
// 保存后刷新列表,并保持选中(新增场景会重新选中第一条,或你也可以改为选中新建记录)
|
||||
this.activeTab = "detail";
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
})
|
||||
if (this.entityType === "customer") {
|
||||
this.$refs["editFormRef"].validate(valid => {
|
||||
if (!valid) return;
|
||||
this.buttonLoading = true;
|
||||
const req = this.editForm.customerId ? updateCustomer(this.editForm) : addCustomer(this.editForm);
|
||||
req.then(() => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.activeTab = "detail";
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
this.buttonLoading = true;
|
||||
const req = this.supplierEditForm.supplierId ? updateSupplier(this.supplierEditForm) : addSupplier(this.supplierEditForm);
|
||||
req.then(() => {
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
this.activeTab = "detail";
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
},
|
||||
/** 重置编辑表单:还原为当前选中客户的详情 */
|
||||
resetEdit() {
|
||||
// 说明:如果是新增态(没有 selectedCustomerId),重置为一个空表单
|
||||
if (!this.selectedCustomerId) {
|
||||
if (this.entityType === "customer") {
|
||||
if (!this.selectedCustomerId) {
|
||||
this.handleAdd();
|
||||
return;
|
||||
}
|
||||
this.editForm = { ...(this.selectedCustomer || {}) };
|
||||
return;
|
||||
}
|
||||
if (!this.selectedSupplierId) {
|
||||
this.handleAdd();
|
||||
return;
|
||||
}
|
||||
this.editForm = { ...(this.selectedCustomer || {}) };
|
||||
this.supplierEditForm = { ...(this.selectedSupplier || {}) };
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const customerId = row && row.customerId ? row.customerId : undefined;
|
||||
if (!customerId) return;
|
||||
this.$modal.confirm('是否确认删除该客户?').then(() => {
|
||||
if (this.entityType === "customer") {
|
||||
const customerId = row && row.customerId ? row.customerId : undefined;
|
||||
if (!customerId) return;
|
||||
this.$modal.confirm('是否确认删除该客户?').then(() => {
|
||||
this.loading = true;
|
||||
return delCustomer(customerId);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
return;
|
||||
}
|
||||
const supplierId = row && row.supplierId ? row.supplierId : undefined;
|
||||
if (!supplierId) return;
|
||||
this.$modal.confirm('是否确认删除该供货商?').then(() => {
|
||||
this.loading = true;
|
||||
return delCustomer(customerId);
|
||||
return delSupplier(supplierId);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {
|
||||
@@ -522,6 +708,7 @@ export default {
|
||||
},
|
||||
/** Tab 切换:部分Tab在首次进入时加载数据 */
|
||||
handleTabChange() {
|
||||
if (this.entityType !== "customer") return;
|
||||
if (!this.selectedCustomerId) return;
|
||||
if (this.activeTab === "orders") {
|
||||
this.loadOrders();
|
||||
@@ -815,12 +1002,30 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('wms/customer/export', {
|
||||
...this.queryParams
|
||||
}, `customer_${new Date().getTime()}.xlsx`)
|
||||
if (this.entityType === "customer") {
|
||||
this.download('oa/customer/export', {
|
||||
...this.queryParams
|
||||
}, `customer_${new Date().getTime()}.xlsx`)
|
||||
return;
|
||||
}
|
||||
this.download('oa/supplier/export', {
|
||||
...this.supplierQueryParams
|
||||
}, `supplier_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
searchKeyword: {
|
||||
get() {
|
||||
return this.entityType === "customer" ? (this.queryParams.name || "") : (this.supplierQueryParams.name || "");
|
||||
},
|
||||
set(v) {
|
||||
if (this.entityType === "customer") {
|
||||
this.queryParams.name = v;
|
||||
} else {
|
||||
this.supplierQueryParams.name = v;
|
||||
}
|
||||
}
|
||||
},
|
||||
disputeDialogTitle() {
|
||||
return this.disputeOrderCode ? `订单异议 - ${this.disputeOrderCode}` : "订单异议";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-scrollbar style="margin-bottom: 10px;">
|
||||
<el-radio-group v-model="deptTab" size="small" @change="handleDeptChange">
|
||||
<el-radio-button :label="''">全部</el-radio-button>
|
||||
<el-radio-button v-for="d in deptTabs" :key="d.deptId" :label="String(d.deptId)">{{ d.deptName }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-scrollbar>
|
||||
|
||||
<el-form :model="queryParams" ref="queryRef" size="small" :inline="true" v-show="showSearch" label-width="60px">
|
||||
<el-form-item label="员工" prop="employeeName">
|
||||
<user-select v-model="queryParams.employeeId" placeholder="请选择员工" />
|
||||
@@ -158,6 +165,7 @@
|
||||
<script setup name="SalaryRecords">
|
||||
import { listSalaryRecords, getSalaryRecords, delSalaryRecords, addSalaryRecords, updateSalaryRecords, batchPaySalary } from "@/api/oa/salaryRecords";
|
||||
import UserSelect from "@/components/UserSelect/index.vue";
|
||||
import { listDept } from "@/api/system/dept";
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
|
||||
const { proxy } = getCurrentInstance();
|
||||
@@ -173,6 +181,8 @@ const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const deptTab = ref("");
|
||||
const deptTabs = ref([]);
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
@@ -180,6 +190,7 @@ const data = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
employeeId: undefined,
|
||||
deptId: undefined,
|
||||
payPeriod: undefined,
|
||||
},
|
||||
rules: {
|
||||
@@ -202,6 +213,46 @@ function getList() {
|
||||
});
|
||||
}
|
||||
|
||||
function flattenDept(list) {
|
||||
const res = [];
|
||||
const stack = Array.isArray(list) ? [...list] : [];
|
||||
while (stack.length) {
|
||||
const n = stack.shift();
|
||||
if (!n) continue;
|
||||
if (n.deptId != null && n.deptName) {
|
||||
res.push({ deptId: n.deptId, deptName: n.deptName });
|
||||
}
|
||||
const children = n.children;
|
||||
if (Array.isArray(children) && children.length) {
|
||||
stack.unshift(...children);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
function loadDeptTabs() {
|
||||
return listDept({ status: "0" })
|
||||
.then((res) => {
|
||||
const rows = res?.data || res?.rows || res || [];
|
||||
const flat = flattenDept(rows);
|
||||
const uniq = new Map();
|
||||
flat.forEach((d) => {
|
||||
if (!d || d.deptId == null) return;
|
||||
const id = String(d.deptId);
|
||||
if (!uniq.has(id)) uniq.set(id, d);
|
||||
});
|
||||
deptTabs.value = Array.from(uniq.values());
|
||||
})
|
||||
.catch(() => {
|
||||
deptTabs.value = [];
|
||||
});
|
||||
}
|
||||
|
||||
function handleDeptChange() {
|
||||
queryParams.value.deptId = deptTab.value ? Number(deptTab.value) : undefined;
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
@@ -322,5 +373,7 @@ function handleExport() {
|
||||
}, `salaryRecords_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
loadDeptTabs().finally(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -4,6 +4,22 @@
|
||||
<el-form-item label="单号" prop="orderCode">
|
||||
<el-input v-model="queryParams.orderCode" placeholder="请输入单据编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="itemName">
|
||||
<el-input v-model="queryParams.itemName" placeholder="请输入物料名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货商" prop="supplierId">
|
||||
<VendorSelect v-model="queryParams.supplierId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="入库时间" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.timeRange"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
range-separator="~"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-input v-model="queryParams.bizType" placeholder="请输入业务类型" clearable />
|
||||
</el-form-item>
|
||||
@@ -323,6 +339,7 @@
|
||||
|
||||
<script>
|
||||
import RawSelector from '@/components/RawSelector/index.vue'
|
||||
import VendorSelect from '@/components/VendorSelect/index.vue'
|
||||
import {
|
||||
listStockIoOrder,
|
||||
getStockIoOrderWithDetail,
|
||||
@@ -334,7 +351,7 @@ import {
|
||||
|
||||
export default {
|
||||
name: 'StockIoOrderIn',
|
||||
components: { RawSelector },
|
||||
components: { RawSelector, VendorSelect },
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
@@ -350,6 +367,11 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderCode: undefined,
|
||||
itemName: undefined,
|
||||
supplierId: undefined,
|
||||
timeRange: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
ioType: 'I',
|
||||
bizType: undefined,
|
||||
responsibleName: undefined
|
||||
@@ -427,11 +449,15 @@ export default {
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.syncTimeRange()
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.ioType = 'I'
|
||||
this.queryParams.timeRange = undefined
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
@@ -441,14 +467,25 @@ export default {
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleExport() {
|
||||
this.syncTimeRange()
|
||||
this.download(
|
||||
'/gear/stockIoOrder/export',
|
||||
'/gear/stockIoOrder/exportDetail',
|
||||
{
|
||||
...this.queryParams
|
||||
},
|
||||
`stockIoOrder_in_${new Date().getTime()}.xlsx`
|
||||
`stockIoOrder_in_detail_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
syncTimeRange() {
|
||||
const tr = this.queryParams.timeRange
|
||||
if (tr && tr.length === 2) {
|
||||
this.queryParams.startTime = tr[0]
|
||||
this.queryParams.endTime = tr[1]
|
||||
} else {
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
}
|
||||
},
|
||||
handleConfirm(row) {
|
||||
const target = row || (this.rows && this.rows[0])
|
||||
if (!target || !target.orderId) return
|
||||
|
||||
@@ -4,6 +4,22 @@
|
||||
<el-form-item label="单号" prop="orderCode">
|
||||
<el-input v-model="queryParams.orderCode" placeholder="请输入单据编号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物料" prop="itemName">
|
||||
<el-input v-model="queryParams.itemName" placeholder="请输入物料名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="供货商" prop="supplierId">
|
||||
<VendorSelect v-model="queryParams.supplierId" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出库时间" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.timeRange"
|
||||
type="datetimerange"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
range-separator="~"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="业务类型" prop="bizType">
|
||||
<el-input v-model="queryParams.bizType" placeholder="请输入业务类型" clearable />
|
||||
</el-form-item>
|
||||
@@ -306,6 +322,7 @@
|
||||
|
||||
<script>
|
||||
import RawSelector from '@/components/RawSelector/index.vue'
|
||||
import VendorSelect from '@/components/VendorSelect/index.vue'
|
||||
import {
|
||||
listStockIoOrder,
|
||||
getStockIoOrderWithDetail,
|
||||
@@ -316,7 +333,7 @@ import {
|
||||
|
||||
export default {
|
||||
name: 'StockIoOrderOut',
|
||||
components: { RawSelector },
|
||||
components: { RawSelector, VendorSelect },
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
@@ -331,6 +348,11 @@ export default {
|
||||
pageNum: 1,
|
||||
pageSize: 20,
|
||||
orderCode: undefined,
|
||||
itemName: undefined,
|
||||
supplierId: undefined,
|
||||
timeRange: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
ioType: 'O',
|
||||
bizType: undefined,
|
||||
responsibleName: undefined
|
||||
@@ -408,11 +430,15 @@ export default {
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.syncTimeRange()
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.ioType = 'O'
|
||||
this.queryParams.timeRange = undefined
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
this.handleQuery()
|
||||
},
|
||||
handleSelectionChange(selection) {
|
||||
@@ -421,14 +447,25 @@ export default {
|
||||
this.single = selection.length !== 1
|
||||
},
|
||||
handleExport() {
|
||||
this.syncTimeRange()
|
||||
this.download(
|
||||
'/gear/stockIoOrder/export',
|
||||
'/gear/stockIoOrder/exportDetail',
|
||||
{
|
||||
...this.queryParams
|
||||
},
|
||||
`stockIoOrder_out_${new Date().getTime()}.xlsx`
|
||||
`stockIoOrder_out_detail_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
},
|
||||
syncTimeRange() {
|
||||
const tr = this.queryParams.timeRange
|
||||
if (tr && tr.length === 2) {
|
||||
this.queryParams.startTime = tr[0]
|
||||
this.queryParams.endTime = tr[1]
|
||||
} else {
|
||||
this.queryParams.startTime = undefined
|
||||
this.queryParams.endTime = undefined
|
||||
}
|
||||
},
|
||||
resetEdit() {
|
||||
this.editForm = {
|
||||
ioType: 'O',
|
||||
|
||||
Reference in New Issue
Block a user