master
吴普建 12 months ago
parent c472019cc7
commit b4458abf52

400
src/typings/md.d.ts vendored

@ -1,210 +1,212 @@
declare namespace Md {
interface CopperBar {
weightMeasureName: string;
id: number;
weightMeasureId: string;
copperbarName: string;
copperbarDiameter: string;
unitWeight: string;
createBy: string;
createTime: string;
}
interface CopperBarSearch {
copperbarName: string;
copperbarDiameter: string;
weightMeasureId: string | null;
pageNum: number;
pageSize: number;
total: number;
}
interface CopperBarAdd {
weightMeasureName: string;
id?: number;
copperbarDiameter: string;
copperbarName: string;
unitWeight: string;
weightMeasureId: string | null;
}
interface WorkGroupMember {
memberName: string;
memberId: string;
workgroupName: string;
orkgroupCode: string;
headName: string;
ifEnable: number;
createTime: string;
}
interface WorkMember {
userId: number;
userName: string;
nickName: string;
email: string;
phonenumber: string;
}
interface WorkGroupSearch {
workgroupId?: string;
memberName: string;
memberId: string;
pageNum: number;
pageSize: number;
total: number;
}
interface workUser {
phonenumber: string;
userName: string | null;
pageNum: number;
pageSize: number;
total: number | undefined;
}
interface CopperBar {
weightMeasureName: string;
id: number;
weightMeasureId: string;
copperbarName: string;
copperbarDiameter: string;
unitWeight: string;
createBy: string;
createTime: string;
}
interface CopperBarSearch {
copperbarName: string;
copperbarDiameter: string;
weightMeasureId: string | null;
pageNum: number;
pageSize: number;
total: number;
}
interface CopperBarAdd {
weightMeasureName: string;
id?: number;
copperbarDiameter: string;
copperbarName: string;
unitWeight: string;
weightMeasureId: string | null;
}
interface WorkGroupMember {
memberName: string;
memberId: string;
workgroupName: string;
orkgroupCode: string;
headName: string;
ifEnable: number;
createTime: string;
}
interface WorkMember {
userId: number;
userName: string;
nickName: string;
email: string;
phonenumber: string;
}
interface WorkGroupSearch {
workgroupId?: string;
memberName: string;
memberId: string;
pageNum: number;
pageSize: number;
total: number;
}
interface workUser {
phonenumber: string;
userName: string | null;
pageNum: number;
pageSize: number;
total: number | undefined;
}
}
declare namespace List {
type DataForm = {
productId: number | string | null;
id: number;
processRouteId: string | null;
productTypeId: string;
productTypeName: string;
productName: string;
productCode: string;
productSize: string;
productSizeInternational: string;
numMeasureId: string;
weightMeasureId: string;
specification: string;
processRouteName: string;
numMeasureName: string;
weightMeasureName: string;
createTime: string;
remark: string;
ifEnable: number;
};
type SearchForm = {
productTypeId: string;
productName: string;
specification: string;
pageNum: number;
pageSize: number;
total: number;
};
type AddForm = {
processRouteName: string;
id?: number;
productTypeId: string;
productSize: string;
productSizeInternational: string;
specification: string;
processRouteId: string | null;
productName: string;
productTypeName?: string;
weightMeasureId: string | null;
weightMeasureName?: string;
remark: string;
ifEnable: number;
};
type DataForm = {
productId: number | string | null;
id: number;
processRouteId: string | null;
productTypeId: string;
productTypeName: string;
productName: string;
productCode: string;
productSize: string;
productSizeInternational: string;
numMeasureId: string;
weightMeasureId: string;
specification: string;
processRouteName: string;
numMeasureName: string;
weightMeasureName: string;
createTime: string;
remark: string;
ifEnable: number;
};
type SearchForm = {
productTypeId: string;
productName: string;
specification: string;
pageNum: number;
pageSize: number;
total: number;
};
type AddForm = {
processRouteName: string;
id?: number;
productTypeId: string;
productSize: string;
productSizeInternational: string;
specification: string;
processRouteId: string | null;
productName: string;
productTypeName?: string;
weightMeasureId: string | null;
weightMeasureName?: string;
remark: string;
ifEnable: number;
};
}
declare namespace Type {
interface searchForm {
id: string | null;
typeCode: string;
ifEnable: number | null;
pageNum: number;
pageSize: number;
total: number;
}
interface addForm {
id?: number;
typeName: string;
typeCode: string;
parentTypeId: number | null;
ifEnable: number;
}
interface DataForm {
createBy: string;
createTime: string;
updateBy: string;
updateTime: string;
remark: string;
id: number;
typeName: string;
typeCode: string;
parentTypeId: number;
ancestors: string;
ifEnable: number;
version: number;
isDeleted: number;
attr1: string | null;
attr2: string | null;
attr3: string | null;
children?: DataForm[];
}
interface searchForm {
id: string | null;
typeCode: string;
ifEnable: number | null;
pageNum: number;
pageSize: number;
total: number;
}
interface addForm {
id?: number;
typeName: string;
typeCode: string;
parentTypeId: number | null;
ifEnable: number;
}
interface DataForm {
createBy: string;
createTime: string;
updateBy: string;
updateTime: string;
remark: string;
id: number;
typeName: string;
typeCode: string;
parentTypeId: number;
ancestors: string;
ifEnable: number;
version: number;
isDeleted: number;
attr1: string | null;
attr2: string | null;
attr3: string | null;
children?: DataForm[];
}
}
declare namespace Item {
interface List {
id: number;
itemCode: string;
itemName: string;
itemTypeName: string;
itemTypeCode?: string;
itemTypeId: string | null | number;
workstageId: string | null;
workstageName: string;
numMeasureName: string;
minStock: string;
maxStock: string;
createTime: string;
remark: string;
ifEnable: number;
attr1: string | null;
attr2: string | null;
attr3: string | null;
}
interface SearchForm {
itemCode: string;
numMeasureId?: string | null;
itemName: string;
numMeasureName?: string;
itemTypeName?: string;
itemTypeId?: string | number | null;
pageNum: number;
pageSize: number;
total: number;
weightMeasureId?: string | null;
}
interface AddForm {
remark: string;
id?: number | null;
specification?: string;
itemTypeId: string | number | null;
itemTypeName?: string;
workstageId: string | null;
workstageName?: string;
itemName: string;
weightMeasureId?: string | null;
weightMeasureName?: string;
ifEnable: number;
}
interface List {
id: number;
itemCode: string;
itemName: string;
itemTypeName: string;
itemTypeCode?: string;
itemTypeId: string | null | number;
workstageId: string | null;
workstageName: string;
numMeasureName: string;
minStock: string;
maxStock: string;
createTime: string;
remark: string;
color: string,
ifEnable: number;
attr1: string | null;
attr2: string | null;
attr3: string | null;
}
interface SearchForm {
itemCode: string;
numMeasureId?: string | null;
itemName: string;
numMeasureName?: string;
itemTypeName?: string;
itemTypeId?: string | number | null;
pageNum: number;
pageSize: number;
total: number;
weightMeasureId?: string | null;
}
interface AddForm {
remark: string;
id?: number | null;
specification?: string;
itemTypeId: string | number | null;
itemTypeName?: string;
workstageId: string | null;
workstageName?: string;
itemName: string;
color?: string;
weightMeasureId?: string | null;
weightMeasureName?: string;
ifEnable: number;
}
}
declare namespace PrintTemplate {
interface Data {
clientCode: null | string;
clientId: null | string;
clientName: null | string;
code: null | string;
content: null | string;
createBy: null | string;
createTime: null | string;
defaultPrinterName: null | string;
enableFlag: null | string;
remark: null | string;
status: null | string;
templateCode: null | string;
templateId: null | string;
templateName: null | string;
type: null | string;
updateBy: null | string;
updateTime: null | string;
userId: null | string;
userNickName: null | string;
}
interface Data {
clientCode: null | string;
clientId: null | string;
clientName: null | string;
code: null | string;
content: null | string;
createBy: null | string;
createTime: null | string;
defaultPrinterName: null | string;
enableFlag: null | string;
remark: null | string;
status: null | string;
templateCode: null | string;
templateId: null | string;
templateName: null | string;
type: null | string;
updateBy: null | string;
updateTime: null | string;
userId: null | string;
userNickName: null | string;
}
}

@ -170,6 +170,7 @@ declare namespace PageRoute {
| 'scm_accessorySupplier'
| 'storage'
| 'storage_copperWire'
| 'storage_auxiliaryProduceinfo'
| 'storage_earlyWarning'
| 'storage_enamelCover'
| 'storage_finishedProductInventory'

@ -1,100 +1,100 @@
<template>
<my-dialog
v-model:show="modalVisible"
:title="title"
:loading="subDialog"
width="1000px"
@submit="submit"
@cancel="cancel"
>
<template #content>
<div>
<n-form ref="formRef" label-placement="left" :label-width="100" :model="formModel" :rules="rules">
<n-grid :cols="24" :x-gap="18">
<!-- <n-form-item-grid-item :span="8" label="入库单ID" path="recptId">
<n-input v-model:value="formModel.recptId" placeholder="请输入入库单ID" />
</n-form-item-grid-item> -->
<!-- <n-form-item-grid-item :span="8" label="产品物料ID" path="itemId">
<n-input v-model:value="formModel.itemId" placeholder="请输入产品物料ID" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="产品物料编码" path="itemCode">
<n-input v-model:value="formModel.itemCode" placeholder="请输入产品物料编码" />
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="产品物料名称" path="itemName">
<n-input v-model:value="formModel.itemName" disabled placeholder="请输入产品物料名称" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="规格型号" path="specification">
<n-input v-model:value="formModel.specification" placeholder="请输入规格型号" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="单位" path="unitOfMeasure">
<n-input v-model:value="formModel.unitOfMeasure" placeholder="请输入单位" />
</n-form-item-grid-item>
<!-- <n-form-item-grid-item :span="8" label="应入数量" path="quantityRecived">
<n-input v-model:value="formModel.quantityRecived" placeholder="请输入应入数量" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="验收数量" path="quantityChecked">
<n-input v-model:value="formModel.quantityChecked" placeholder="请输入验收数量" />
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="入库数量" path="quantitySaved">
<n-input v-model:value="formModel.quantitySaved" placeholder="请输入上架数量" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="入库批次号" path="batchCode">
<n-input v-model:value="formModel.batchCode" placeholder="请输入入库批次号" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="仓库名称" path="warehouseName">
<n-input v-model:value="formModel.warehouseName" disabled />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="库区名称" path="locationName">
<n-select v-model:value="formModel.locationId" :options="locationOptions" @update:value="locationSelect">
<template #empty>
<div>
<n-empty v-if="locationOptions.length === 0" description="暂无数据" />
</div>
</template>
</n-select>
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="库位名称" path="locationName">
<n-select v-model:value="formModel.areaId" :options="areaOptions" @update:value="areaSelect">
<template #empty>
<div>
<n-empty v-if="areaOptions.length === 0" description="暂无数据" />
<n-empty v-if="!formModel.locationId && areaOptions.length > 0" description="请选择库区" />
</div>
</template>
</n-select>
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="有效期" path="expireDate">
<n-date-picker v-model:value="formModel.expireDate" type="date" placeholder="请选择有效期" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="备注" path="remark">
<n-input v-model:value="formModel.remark" placeholder="请输入备注" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="来料检验单ID" path="iqcId">
<n-input v-model:value="formModel.iqcId" placeholder="请输入来料检验单ID" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="来料检验单编号" path="iqcCode">
<n-input v-model:value="formModel.iqcCode" placeholder="请输入来料检验单编号" />
</n-form-item-grid-item>
<!-- <n-form-item-grid-item :span="8" label="净重" path="weight">
<n-input-number v-model:value="formModel.weight" placeholder="请输入净重" />
</n-form-item-grid-item> -->
<!-- <n-form-item-grid-item :span="8" label="应入重量" path="weightRecived">
<n-input-number v-model:value="formModel.weightRecived" placeholder="请输入应入重量" />
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="入库重量" path="totalWeight">
<n-input-number v-model:value="formModel.totalWeight" placeholder="请输入毛重" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="重量单位" path="weightUnit">
<n-input v-model:value="formModel.weightUnit" placeholder="请输入重量单位" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="容器码" path="containerCode">
<n-input v-model:value="formModel.containerCode" placeholder="请输入容器码" />
</n-form-item-grid-item>
</n-grid>
</n-form>
</div>
</template>
</my-dialog>
<my-dialog
v-model:show="modalVisible"
:title="title"
:loading="subDialog"
width="1000px"
@submit="submit"
@cancel="cancel"
>
<template #content>
<div>
<n-form ref="formRef" label-placement="left" :label-width="100" :model="formModel" :rules="rules">
<n-grid :cols="24" :x-gap="18">
<!-- <n-form-item-grid-item :span="8" label="入库单ID" path="recptId">
<n-input v-model:value="formModel.recptId" placeholder="请输入入库单ID" />
</n-form-item-grid-item> -->
<!-- <n-form-item-grid-item :span="8" label="产品物料ID" path="itemId">
<n-input v-model:value="formModel.itemId" placeholder="请输入产品物料ID" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="产品物料编码" path="itemCode">
<n-input v-model:value="formModel.itemCode" placeholder="请输入产品物料编码" />
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="产品物料名称" path="itemName">
<n-input v-model:value="formModel.itemName" disabled placeholder="请输入产品物料名称" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="规格型号" path="specification">
<n-input v-model:value="formModel.specification" placeholder="请输入规格型号" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="单位" path="unitOfMeasure">
<n-input v-model:value="formModel.unitOfMeasure" placeholder="请输入单位" />
</n-form-item-grid-item>
<!-- <n-form-item-grid-item :span="8" label="应入数量" path="quantityRecived">
<n-input v-model:value="formModel.quantityRecived" placeholder="请输入应入数量" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="验收数量" path="quantityChecked">
<n-input v-model:value="formModel.quantityChecked" placeholder="请输入验收数量" />
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="入库数量" path="quantitySaved">
<n-input v-model:value="formModel.quantitySaved" placeholder="请输入上架数量" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="入库批次号" path="batchCode">
<n-input v-model:value="formModel.batchCode" placeholder="请输入入库批次号" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="仓库名称" path="warehouseName">
<n-input v-model:value="formModel.warehouseName" disabled />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="库区名称" path="locationName">
<n-select v-model:value="formModel.locationId" :options="locationOptions" @update:value="locationSelect">
<template #empty>
<div>
<n-empty v-if="locationOptions.length === 0" description="暂无数据" />
</div>
</template>
</n-select>
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="库位名称" path="locationName">
<n-select v-model:value="formModel.areaId" :options="areaOptions" @update:value="areaSelect">
<template #empty>
<div>
<n-empty v-if="areaOptions.length === 0" description="暂无数据" />
<n-empty v-if="!formModel.locationId && areaOptions.length > 0" description="请选择库区" />
</div>
</template>
</n-select>
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="有效期" path="expireDate">
<n-date-picker v-model:value="formModel.expireDate" type="date" placeholder="请选择有效期" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="备注" path="remark">
<n-input v-model:value="formModel.remark" placeholder="请输入备注" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="来料检验单ID" path="iqcId">
<n-input v-model:value="formModel.iqcId" placeholder="请输入来料检验单ID" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="来料检验单编号" path="iqcCode">
<n-input v-model:value="formModel.iqcCode" placeholder="请输入来料检验单编号" />
</n-form-item-grid-item>
<!-- <n-form-item-grid-item :span="8" label="净重" path="weight">
<n-input-number v-model:value="formModel.weight" placeholder="请输入净重" />
</n-form-item-grid-item> -->
<!-- <n-form-item-grid-item :span="8" label="应入重量" path="weightRecived">
<n-input-number v-model:value="formModel.weightRecived" placeholder="请输入应入重量" />
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="入库重量" path="totalWeight">
<n-input-number v-model:value="formModel.totalWeight" placeholder="请输入毛重" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="重量单位" path="weightUnit">
<n-input v-model:value="formModel.weightUnit" placeholder="请输入重量单位" />
</n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="容器码" path="containerCode">
<n-input v-model:value="formModel.containerCode" placeholder="请输入容器码" />
</n-form-item-grid-item>
</n-grid>
</n-form>
</div>
</template>
</my-dialog>
</template>
<script setup lang="ts">
@ -103,22 +103,20 @@ import { useMessage } from 'naive-ui';
import type { FormInst } from 'naive-ui';
// import { createRequiredFormRule } from '@/utils';
import { editWmsItemRecptLine, addWmsItemRecptLine } from '@/service/api/wms/recptLine';
import { selectAllWmsStorageLocationList } from '@/service/api/wms/location';
import { selectAllWmsStorageAreaList } from '@/service/api/wms/area';
const locationOptions = ref<{ value: string; label: string }[]>([]);
const areaOptions = ref<{ value: string; label: string }[]>([]);
export interface Props {
/** 弹窗可见性 */
visible: boolean;
/**
* 弹窗类型
* add: 新增
* edit: 编辑
*/
type?: 'add' | 'edit';
/** 编辑的表格行数据 */
editData?: any;
getList;
/** 弹窗可见性 */
visible: boolean;
/**
* 弹窗类型
* add: 新增
* edit: 编辑
*/
type?: 'add' | 'edit';
/** 编辑的表格行数据 */
editData?: any;
getList;
}
export type ModalType = NonNullable<Props['type']>;
@ -127,224 +125,194 @@ const subDialog = ref<boolean>(false);
defineOptions({ name: 'TableActionModal' });
const props = withDefaults(defineProps<Props>(), {
type: 'add',
editData: null
type: 'add',
editData: null
});
interface Emits {
(e: 'update:visible', visible: boolean): void;
(e: 'update:visible', visible: boolean): void;
}
const emit = defineEmits<Emits>();
const message = useMessage();
const modalVisible = computed({
get() {
return props.visible;
},
set(visible) {
emit('update:visible', visible);
}
get() {
return props.visible;
},
set(visible) {
emit('update:visible', visible);
}
});
const cancel = () => {
modalVisible.value = false;
modalVisible.value = false;
};
const title = computed(() => {
const titles: Record<ModalType, string> = {
add: '添加物料入库单行',
edit: '编辑物料入库单行'
};
return titles[props.type];
const titles: Record<ModalType, string> = {
add: '添加物料入库单行',
edit: '编辑物料入库单行'
};
return titles[props.type];
});
const formRef = ref<HTMLElement & FormInst>();
const formModel = ref<wms.recptLineRawType.columns>({
lineId: null,
recptId: null,
itemId: null,
itemCode: null,
itemName: null,
specification: null,
unitOfMeasure: null,
quantityRecived: null,
quantityChecked: null,
quantitySaved: null,
batchCode: null,
warehouseId: null,
warehouseCode: null,
warehouseName: null,
locationId: null,
locationCode: null,
locationName: null,
areaId: null,
areaCode: null,
areaName: null,
expireDate: null,
remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
iqcId: null,
iqcCode: null,
weight: null,
weightRecived: null,
totalWeight: null,
weightUnit: null,
containerCode: null
lineId: null,
recptId: null,
itemId: null,
itemCode: null,
itemName: null,
specification: null,
unitOfMeasure: null,
quantityRecived: null,
quantityChecked: null,
quantitySaved: null,
batchCode: null,
warehouseId: null,
warehouseCode: null,
warehouseName: null,
locationId: null,
locationCode: null,
locationName: null,
areaId: null,
areaCode: null,
areaName: null,
expireDate: null,
remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
iqcId: null,
iqcCode: null,
weight: null,
weightRecived: null,
totalWeight: null,
weightUnit: null,
containerCode: null
});
const rules = {};
function handleUpdateFormModelByModalType() {
const handlers: Record<ModalType, () => void> = {
add: () => {
reset();
},
edit: () => {
reset();
if (props.editData) {
Object.assign(formModel.value, props.editData);
init();
}
}
};
const handlers: Record<ModalType, () => void> = {
add: () => {
reset();
},
edit: () => {
reset();
if (props.editData) {
Object.assign(formModel.value, props.editData);
init();
}
}
};
handlers[props.type]();
handlers[props.type]();
}
async function submit() {
await formRef.value?.validate(vaild => {
if (!vaild) {
if (formModel.value.lineId) {
editWmsItemRecptLine(formModel.value)
.then(res => {
if (res.code === 200) {
message.success('修改成功');
subDialog.value = false;
props.getList();
cancel();
}
})
.catch(() => {
message.success('修改失败');
});
} else {
addWmsItemRecptLine(formModel.value)
.then(res => {
if (res.code === 200) {
message.success('新增成功');
props.getList();
subDialog.value = false;
cancel();
}
})
.catch(() => {
message.success('修改失败');
});
}
}
});
await formRef.value?.validate(vaild => {
if (!vaild) {
if (formModel.value.lineId) {
editWmsItemRecptLine(formModel.value)
.then(res => {
if (res.code === 200) {
message.success('修改成功');
subDialog.value = false;
props.getList();
cancel();
}
})
.catch(() => {
message.success('修改失败');
});
} else {
addWmsItemRecptLine(formModel.value)
.then(res => {
if (res.code === 200) {
message.success('新增成功');
props.getList();
subDialog.value = false;
cancel();
}
})
.catch(() => {
message.success('修改失败');
});
}
}
});
}
function reset() {
formModel.value = {
lineId: null,
recptId: null,
itemId: null,
itemCode: null,
itemName: null,
specification: null,
unitOfMeasure: null,
quantityRecived: null,
quantityChecked: null,
quantitySaved: null,
batchCode: null,
warehouseId: null,
warehouseCode: null,
warehouseName: null,
locationId: null,
locationCode: null,
locationName: null,
areaId: null,
areaCode: null,
areaName: null,
expireDate: null,
remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
iqcId: null,
iqcCode: null,
weight: null,
weightRecived: null,
totalWeight: null,
weightUnit: null,
containerCode: null
};
formModel.value = {
lineId: null,
recptId: null,
itemId: null,
itemCode: null,
itemName: null,
specification: null,
unitOfMeasure: null,
quantityRecived: null,
quantityChecked: null,
quantitySaved: null,
batchCode: null,
warehouseId: null,
warehouseCode: null,
warehouseName: null,
locationId: null,
locationCode: null,
locationName: null,
areaId: null,
areaCode: null,
areaName: null,
expireDate: null,
remark: null,
attr1: null,
attr2: null,
attr3: null,
attr4: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
iqcId: null,
iqcCode: null,
weight: null,
weightRecived: null,
totalWeight: null,
weightUnit: null,
containerCode: null
};
}
watch(
() => props.visible,
newValue => {
if (newValue) {
handleUpdateFormModelByModalType();
}
}
() => props.visible,
newValue => {
if (newValue) {
handleUpdateFormModelByModalType();
}
}
);
function locationSelect(_val, item) {
formModel.value.locationId = item.locationId;
formModel.value.locationCode = item.locationCode;
formModel.value.locationName = item.locationName;
// console.log(formModel.value, item, '------');
selectAllWmsStorageAreaList({ locationId: item.locationId }).then(res => {
areaOptions.value = [];
res.data.forEach(listItem => {
areaOptions.value.push({
value: listItem.areaId,
label: listItem.areaName,
...listItem
});
});
});
formModel.value.locationId = item.locationId;
formModel.value.locationCode = item.locationCode;
formModel.value.locationName = item.locationName;
// console.log(formModel.value, item, '------');
}
function areaSelect(_val, item) {
formModel.value.areaId = item.areaId;
formModel.value.areaCode = item.areaCode;
formModel.value.areaName = item.areaName;
// console.log(formModel.value, item, '------');
formModel.value.areaId = item.areaId;
formModel.value.areaCode = item.areaCode;
formModel.value.areaName = item.areaName;
// console.log(formModel.value, item, '------');
}
function init() {
// console.log(formModel.value, '------');
selectAllWmsStorageLocationList({ warehouseId: formModel.value.warehouseId }).then(res => {
locationOptions.value = [];
res.data.forEach(listItem => {
locationOptions.value.push({
value: listItem.locationId,
label: listItem.locationName,
...listItem
});
});
});
selectAllWmsStorageAreaList({ locationId: formModel.value.locationId }).then(res => {
areaOptions.value = [];
res.data.forEach(listItem => {
areaOptions.value.push({
value: listItem.areaId,
label: listItem.areaName,
...listItem
});
});
});
// console.log(formModel.value, '------');
}
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,141 +1,144 @@
<template>
<div>
<my-card title="搜索条件" search>
<n-form inline>
<n-form-item label="物料名称">
<n-input v-model:value="searchForm.itemName" placeholder="请输入物料名称" />
</n-form-item>
<n-form-item label="物料编码">
<n-input v-model:value="searchForm.itemCode" placeholder="请输入物料名称" />
</n-form-item>
<n-form-item label="物料类型">
<n-tree-select
v-model:value="searchForm.itemTypeId"
:options="OptionsData"
label-field="itemTypeName"
key-field="id"
style="width: 180px"
></n-tree-select>
<!-- <n-input v-model:value="searchForm.itemTypeId" placeholder="请输入物料类型" /> -->
</n-form-item>
<n-form-item label="单位" style="width: 180px">
<n-select v-model:value="searchForm.numMeasureId" :options="primaryOptions" placeholder="请输入单位" />
</n-form-item>
<n-form-item>
<n-button type="primary" class="mr-10px" @click="handleSearch">
<icon-ic-round-search class="mr-4px text-20px" />
搜索
</n-button>
<n-button @click="handleReset">
<icon-ic-round-refresh class="mr-4px text-20px" />
重置
</n-button>
</n-form-item>
</n-form>
</my-card>
<my-card title="物料列表">
<template #right>
<div class="flex-center">
<n-button :loading="exportLoading" size="small" type="warning" @click="exportList">
<icon-uil:export class="mr-4px text-20px" />
导出
</n-button>
<n-button size="small" type="primary" class="mr-5px ml-5px" @click="setShow">
<icon-ic-round-plus class="mr-4px text-20px" />
新增
</n-button>
<cx-columns v-model:columns="columns"></cx-columns>
</div>
</template>
<n-data-table
:loading="loading"
:data="data"
:columns="columns"
:max-height="dataTableConfig.maxHeight"
></n-data-table>
<!-- <n-pagination
:page="searchForm.pageNum"
:item-count="searchForm.total"
:page-size="searchForm.pageSize"
style="margin-top: 20px; float: right"
@update:page="changePage"
/> -->
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card>
<my-dialog
:title="addForm.id ? '编辑物料' : '新增物料'"
:show="show"
width="750px"
@cancel="cancel"
@submit="submit"
>
<template #content>
<div>
<n-form
ref="addFormRef"
label-placement="left"
label-align="left"
:label-width="100"
:model="addForm"
:rules="rules"
>
<n-grid :cols="24" :x-gap="20">
<n-form-item-grid-item label="物料类型" :span="11" path="itemTypeName">
<n-tree-select
v-model:value="addForm.itemTypeId"
style="width: 200px"
:options="OptionsData"
label-field="itemTypeName"
key-field="id"
@update:value="handleChange"
></n-tree-select>
<!-- <n-input v-model:value="addForm.itemTypeId" placeholder="请输入物料类型" /> -->
</n-form-item-grid-item>
<n-form-item-grid-item label="物料名称" :span="11" path="itemName">
<n-input v-model:value="addForm.itemName" placeholder="请输入物料名称" />
</n-form-item-grid-item>
<div>
<my-card title="搜索条件" search>
<n-form inline>
<n-form-item label="物料名称">
<n-input v-model:value="searchForm.itemName" placeholder="请输入物料名称" />
</n-form-item>
<n-form-item label="物料编码">
<n-input v-model:value="searchForm.itemCode" placeholder="请输入物料名称" />
</n-form-item>
<n-form-item label="物料类型">
<n-tree-select
v-model:value="searchForm.itemTypeId"
:options="OptionsData"
label-field="itemTypeName"
key-field="id"
style="width: 180px"
></n-tree-select>
<!-- <n-input v-model:value="searchForm.itemTypeId" placeholder="请输入物料类型" /> -->
</n-form-item>
<n-form-item label="单位" style="width: 180px">
<n-select v-model:value="searchForm.numMeasureId" :options="primaryOptions" placeholder="请输入单位" />
</n-form-item>
<n-form-item>
<n-button type="primary" class="mr-10px" @click="handleSearch">
<icon-ic-round-search class="mr-4px text-20px" />
搜索
</n-button>
<n-button @click="handleReset">
<icon-ic-round-refresh class="mr-4px text-20px" />
重置
</n-button>
</n-form-item>
</n-form>
</my-card>
<my-card title="物料列表">
<template #right>
<div class="flex-center">
<n-button :loading="exportLoading" size="small" type="warning" @click="exportList">
<icon-uil:export class="mr-4px text-20px" />
导出
</n-button>
<n-button size="small" type="primary" class="mr-5px ml-5px" @click="setShow">
<icon-ic-round-plus class="mr-4px text-20px" />
新增
</n-button>
<cx-columns v-model:columns="columns"></cx-columns>
</div>
</template>
<n-data-table
:loading="loading"
:data="data"
:columns="columns"
:max-height="dataTableConfig.maxHeight"
></n-data-table>
<!-- <n-pagination
:page="searchForm.pageNum"
:item-count="searchForm.total"
:page-size="searchForm.pageSize"
style="margin-top: 20px; float: right"
@update:page="changePage"
/> -->
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card>
<my-dialog
:title="addForm.id ? '编辑物料' : '新增物料'"
:show="show"
width="750px"
@cancel="cancel"
@submit="submit"
>
<template #content>
<div>
<n-form
ref="addFormRef"
label-placement="left"
label-align="left"
:label-width="100"
:model="addForm"
:rules="rules"
>
<n-grid :cols="24" :x-gap="20">
<n-form-item-grid-item label="物料类型" :span="11" path="itemTypeName">
<n-tree-select
v-model:value="addForm.itemTypeId"
style="width: 200px"
:options="OptionsData"
label-field="itemTypeName"
key-field="id"
@update:value="handleChange"
></n-tree-select>
<!-- <n-input v-model:value="addForm.itemTypeId" placeholder="请输入物料类型" /> -->
</n-form-item-grid-item>
<n-form-item-grid-item label="物料名称" :span="11" path="itemName">
<n-input v-model:value="addForm.itemName" placeholder="请输入物料名称" />
</n-form-item-grid-item>
<n-form-item-grid-item label="规格" :span="11" path="specification">
<n-input
v-model:value="addForm.specification"
placeholder="请输入规格"
:disabled="addForm.id !== null"
></n-input>
</n-form-item-grid-item>
<n-form-item-grid-item label="重量单位" :span="11" path="weightMeasureId">
<n-select
v-model:value="addForm.weightMeasureId"
class="w-200px"
:options="primaryOptions"
placeholder="请输入重量单位"
@update:value="weightHandleChange"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="工序名称" :span="11" path="workstageId">
<n-select
v-model:value="addForm.workstageId"
class="w-200px"
:options="workstageOptions"
placeholder="请选择工序名称"
@update:value="workstageHandleChange"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="是否启用" :span="11">
<n-switch v-model:value="addForm.ifEnable" :checked-value="1" :unchecked-value="0" />
</n-form-item-grid-item>
<n-form-item-grid-item label="备注" :span="25">
<n-input v-model:value="addForm.remark" type="textarea" placeholder="请输入备注" />
</n-form-item-grid-item>
</n-grid>
</n-form>
</div>
</template>
</my-dialog>
</div>
<n-form-item-grid-item label="规格" :span="11" path="specification">
<n-input
v-model:value="addForm.specification"
placeholder="请输入规格"
:disabled="addForm.id !== null"
></n-input>
</n-form-item-grid-item>
<n-form-item-grid-item label="颜色" :span="11" path="color">
<n-select v-model:value="addForm.color" class="w-200px" :options="corlor_types" placeholder="请选择颜色" ></n-select>
</n-form-item-grid-item>
<n-form-item-grid-item label="单位" :span="11" path="weightMeasureId">
<n-select
v-model:value="addForm.weightMeasureId"
class="w-200px"
:options="primaryOptions"
placeholder="请输入单位"
@update:value="weightHandleChange"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="工序名称" :span="11" path="workstageId">
<n-select
v-model:value="addForm.workstageId"
class="w-200px"
:options="workstageOptions"
placeholder="请选择工序名称"
@update:value="workstageHandleChange"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="是否启用" :span="11">
<n-switch v-model:value="addForm.ifEnable" :checked-value="1" :unchecked-value="0" />
</n-form-item-grid-item>
<n-form-item-grid-item label="备注" :span="25">
<n-input v-model:value="addForm.remark" type="textarea" placeholder="请输入备注" />
</n-form-item-grid-item>
</n-grid>
</n-form>
</div>
</template>
</my-dialog>
</div>
</template>
<script setup lang="tsx">
import type { Ref } from 'vue';
import { getCurrentInstance, Ref } from 'vue';
import { ref, onMounted } from 'vue';
import { useMessage } from 'naive-ui';
import type { DataTableColumns, FormInst } from 'naive-ui';
@ -148,6 +151,9 @@ import { download } from '@/service/request/helpers';
import { dataTableConfig } from '@/config/dataTableConfig';
import { useLoading, useWarning, useBoolean } from '~/src/hooks';
const { proxy } = getCurrentInstance() as any;
const { corlor_types } = proxy.useDict('corlor_types');
const message = useMessage();
const { bool: show, setTrue: setShow, setFalse: setHide } = useBoolean();
const { loading, startLoading, endLoading } = useLoading();
@ -155,109 +161,111 @@ const dialog = useWarning();
const addFormRef = ref<FormInst | null>(null);
const rules = {
itemName: createRequiredFormRule('请输入物料名称'),
itemTypeName: createRequiredFormRule('请输入物料类型'),
workstageId: createRequiredFormRule('请选择工序'),
specification: createRequiredFormRule('请输入规格')
itemName: createRequiredFormRule('请输入物料名称'),
itemTypeName: createRequiredFormRule('请输入物料类型'),
workstageId: createRequiredFormRule('请选择工序'),
specification: createRequiredFormRule('请输入规格')
};
const addForm = ref<Item.AddForm>({
id: null,
remark: '',
itemName: '',
itemTypeId: null,
itemTypeName: '',
workstageId: null,
workstageName: '',
specification: '',
weightMeasureId: null,
weightMeasureName: '',
ifEnable: 1
id: null,
remark: '',
itemName: '',
itemTypeId: null,
itemTypeName: '',
workstageId: null,
workstageName: '',
specification: '',
weightMeasureId: null,
weightMeasureName: '',
color: '',
ifEnable: 1
});
function cancel() {
setHide();
addForm.value = {
id: null,
remark: '',
itemName: '',
itemTypeId: null,
itemTypeName: '',
workstageId: null,
workstageName: '',
weightMeasureId: null,
weightMeasureName: '',
ifEnable: 1
};
setHide();
addForm.value = {
id: null,
remark: '',
itemName: '',
itemTypeId: null,
itemTypeName: '',
workstageId: null,
workstageName: '',
weightMeasureId: null,
color: '',
weightMeasureName: '',
ifEnable: 1
};
}
async function changeStatus(row: any, val: number) {
row.ifEnable = val;
await editMaterial(row).then(res => {
if (res.code === 200) {
message.success(res.msg);
cancel();
}
});
init();
row.ifEnable = val;
await editMaterial(row).then(res => {
if (res.code === 200) {
message.success(res.msg);
cancel();
}
});
init();
}
function handleChange(val, item) {
addForm.value.itemTypeId = val;
addForm.value.itemTypeName = item.itemTypeName;
addForm.value.itemTypeId = val;
addForm.value.itemTypeName = item.itemTypeName;
}
function weightHandleChange(val, item) {
addForm.value.weightMeasureId = val;
addForm.value.weightMeasureName = item.label;
addForm.value.weightMeasureId = val;
addForm.value.weightMeasureName = item.label;
}
function workstageHandleChange(val, item) {
addForm.value.workstageId = val;
addForm.value.workstageName = item.label;
addForm.value.workstageId = val;
addForm.value.workstageName = item.label;
}
function submit() {
if (!addFormRef.value) return;
addFormRef.value.validate(errors => {
if (!errors) {
if (!addForm.value.id) {
addMaterial(addForm.value).then(res => {
if (res.code === 200) {
message.success(res.msg);
cancel();
init();
}
});
} else {
editMaterial(addForm.value).then(res => {
if (res.code === 200) {
message.success(res.msg);
cancel();
init();
}
});
}
}
});
if (!addFormRef.value) return;
addFormRef.value.validate(errors => {
if (!errors) {
if (!addForm.value.id) {
addMaterial(addForm.value).then(res => {
if (res.code === 200) {
message.success(res.msg);
cancel();
init();
}
});
} else {
editMaterial(addForm.value).then(res => {
if (res.code === 200) {
message.success(res.msg);
cancel();
init();
}
});
}
}
});
}
const searchForm = ref<Item.SearchForm>({
itemCode: '',
itemName: '',
itemTypeId: null,
numMeasureId: null,
pageNum: 1,
pageSize: 10,
total: 0
itemCode: '',
itemName: '',
itemTypeId: null,
numMeasureId: null,
pageNum: 1,
pageSize: 10,
total: 0
});
function handleSearch() {
searchForm.value.pageNum = 1;
init();
searchForm.value.pageNum = 1;
init();
}
function handleReset() {
searchForm.value = {
itemCode: '',
itemName: '',
itemTypeId: null,
numMeasureId: '',
pageNum: 1,
pageSize: 10,
total: 0
};
init();
searchForm.value = {
itemCode: '',
itemName: '',
itemTypeId: null,
numMeasureId: '',
pageNum: 1,
pageSize: 10,
total: 0
};
init();
}
// function changePage(page: number) {
// searchForm.value.pageNum = page;
@ -265,181 +273,198 @@ function handleReset() {
// }
const data = ref<Item.List[]>([]);
function init() {
startLoading();
getMaterialList(searchForm.value).then(res => {
data.value = res.rows;
searchForm.value.total = res.total;
endLoading();
});
startLoading();
getMaterialList(searchForm.value).then(res => {
data.value = res.rows;
searchForm.value.total = res.total;
endLoading();
});
}
const columns: Ref<DataTableColumns<Item.List>> = ref([
{
title: '序号',
key: 'index',
align: 'center',
width: 60,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '物料编码',
key: 'itemCode',
align: 'center',
width: 200
},
{
title: '物料名称',
align: 'center',
key: 'itemName'
},
{
title: '类型名称',
align: 'center',
key: 'itemTypeName'
},
{
title: '规格',
align: 'center',
key: 'specification'
},
{
title: '工序名称',
align: 'center',
key: 'workstageName'
},
{
title: '单位',
align: 'center',
key: 'weightMeasureName'
},
{
title: '是否启用',
key: 'ifEnable',
render(row) {
return (
<my-switch
v-model:value={row.ifEnable}
checked={1}
unchecked={0}
onChecked={val => {
changeStatus(row, val);
}}
onUnchecked={val => {
changeStatus(row, val);
}}
/>
);
}
},
{
title: '备注',
key: 'remark'
},
{
title: '创建时间',
key: 'createTime',
width: 170
},
{
title: '操作',
key: 'action',
width: 170,
render(row) {
return (
<div>
<n-button
type="warning"
size="small"
class="mr-10px"
onClick={() => {
addForm.value = deepClone(row);
setShow();
}}
>
<icon-tdesign-edit class="mr-1px text-15px " />
编辑
</n-button>
<n-button
type="error"
size="small"
onClick={() => {
dialog.warn(() => {
console.log(row);
deleteMaterial(row.id).then(res => {
if (res.code === 200) {
message.success(res.msg);
init();
}
});
});
}}
>
<icon-tdesign-delete class="mr-1px text-15px " />
删除
</n-button>
</div>
);
}
}
{
title: '序号',
key: 'index',
align: 'center',
width: 60,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '物料编码',
key: 'itemCode',
align: 'center',
width: 200
},
{
title: '物料名称',
align: 'center',
key: 'itemName'
},
{
title: '类型名称',
align: 'center',
key: 'itemTypeName'
},
{
title: '颜色',
align: 'center',
key: 'color'
},
{
title: '颜色名称',
key: 'status',
align: 'center',
render: row => {
return <dict-tag options={corlor_types.value} value={row.color}></dict-tag>;
},
width: 110,
ellipsis: {
tooltip: true
}
},
{
title: '规格',
align: 'center',
key: 'specification'
},
{
title: '工序名称',
align: 'center',
key: 'workstageName'
},
{
title: '单位',
align: 'center',
key: 'weightMeasureName'
},
{
title: '是否启用',
key: 'ifEnable',
render(row) {
return (
<my-switch
v-model:value={row.ifEnable}
checked={1}
unchecked={0}
onChecked={val => {
changeStatus(row, val);
}}
onUnchecked={val => {
changeStatus(row, val);
}}
/>
);
}
},
{
title: '备注',
key: 'remark'
},
{
title: '创建时间',
key: 'createTime',
width: 170
},
{
title: '操作',
key: 'action',
width: 170,
render(row) {
return (
<div>
<n-button
type="warning"
size="small"
class="mr-10px"
onClick={() => {
addForm.value = deepClone(row);
setShow();
}}
>
<icon-tdesign-edit class="mr-1px text-15px " />
编辑
</n-button>
<n-button
type="error"
size="small"
onClick={() => {
dialog.warn(() => {
console.log(row);
deleteMaterial(row.id).then(res => {
if (res.code === 200) {
message.success(res.msg);
init();
}
});
});
}}
>
<icon-tdesign-delete class="mr-1px text-15px " />
删除
</n-button>
</div>
);
}
}
]);
const workstageOptions = ref<any[]>([]);
const exportLoading = ref<boolean>(false);
function exportList() {
exportLoading.value = true;
download('md/mes/md/mdItem/export', searchForm.value, `itemlist_${new Date().getTime()}.xlsx`, undefined)
.then(() => {
exportLoading.value = false;
})
.catch(() => {
exportLoading.value = false;
});
console.log('导出');
exportLoading.value = true;
download('md/mes/md/mdItem/export', searchForm.value, `itemlist_${new Date().getTime()}.xlsx`, undefined)
.then(() => {
exportLoading.value = false;
})
.catch(() => {
exportLoading.value = false;
});
console.log('导出');
}
const primaryOptions = ref<{ value: string; label: string }[]>([]);
const weightOptions = ref<{ value: string; label: string }[]>([]);
const OptionsData = ref<ApiItemTypeManagement.ItemType[]>([]);
function setTableData(list: ApiItemTypeManagement.ItemType[]) {
OptionsData.value = list;
OptionsData.value = list;
}
onMounted(async () => {
const typeData = await fetchItemTypeList({});
if (typeData) {
setTimeout(() => {
setTableData(typeData.data);
console.log(OptionsData.value, '11');
// endLoading();
// allRowKeysArr = typeData.allParentIDArr;
// expandedRows.value = typeData.allParentIDArr;
}, 100);
}
init();
getAllTechnologyList().then(res => {
if (res.code === 200) {
workstageOptions.value = [];
res.data.forEach((item: any) => {
workstageOptions.value.push({
label: item.workstageName,
value: item.id
});
});
}
});
getAllUnit().then(res => {
primaryOptions.value = [];
weightOptions.value = [];
if (res.code === 200) {
res.data.forEach((item: any) => {
primaryOptions.value.push({
label: item.measureName,
value: item.id
});
const typeData = await fetchItemTypeList({});
if (typeData) {
setTimeout(() => {
setTableData(typeData.data);
console.log(OptionsData.value, '11');
// endLoading();
// allRowKeysArr = typeData.allParentIDArr;
// expandedRows.value = typeData.allParentIDArr;
}, 100);
}
init();
getAllTechnologyList().then(res => {
if (res.code === 200) {
workstageOptions.value = [];
res.data.forEach((item: any) => {
workstageOptions.value.push({
label: item.workstageName,
value: item.id
});
});
}
});
getAllUnit().then(res => {
primaryOptions.value = [];
weightOptions.value = [];
if (res.code === 200) {
res.data.forEach((item: any) => {
primaryOptions.value.push({
label: item.measureName,
value: item.id
});
weightOptions.value.push({
label: item.measureName,
value: item.id
});
});
}
});
weightOptions.value.push({
label: item.measureName,
value: item.id
});
});
}
});
});
</script>

@ -355,7 +355,7 @@ function getListTotal(total, num, price) {
// }
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-unused-vars
return total.form.totalPrice.toFixed(4);
return total.form.totalPrice;
}
const editFlag = ref(false);
const getTotalPric = computed(() => {

@ -1,24 +1,24 @@
<template>
<div>
<my-card :title="title">
<template #right>
<div style="display: flex; align-items: center">
<CxColumns v-model:columns="columns" />
<n-button class="ml-5px" type="primary" size="small" attr-type="button" style="width: 80px" @click="back">
返回
</n-button>
</div>
</template>
<n-data-table
:loading="loading"
:columns="columns"
:data="data"
:max-height="dataTableConfig.maxHeight"
:scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table>
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card>
</div>
<div>
<my-card :title="title">
<template #right>
<div style="display: flex; align-items: center">
<CxColumns v-model:columns="columns" />
<n-button class="ml-5px" type="primary" size="small" attr-type="button" style="width: 80px" @click="back">
返回
</n-button>
</div>
</template>
<n-data-table
:loading="loading"
:columns="columns"
:data="data"
:max-height="dataTableConfig.maxHeight"
:scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table>
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card>
</div>
</template>
<script setup lang="ts">
@ -37,163 +37,163 @@ const router = useRouter();
const title = ref<string>('投料记录');
const searchForm = ref<{
pageNum: number;
pageSize: number;
total: number;
taskId: number;
taskType: string;
pageNum: number;
pageSize: number;
total: number;
taskId: number;
taskType: string;
}>({
pageNum: 1,
pageSize: 10,
total: 0,
taskId: 0,
taskType: '0'
pageNum: 1,
pageSize: 10,
total: 0,
taskId: 0,
taskType: '0'
});
const data = ref<feedRecords.TabelList[]>([]);
const columns: Ref<DataTableColumns<feedRecords.TabelList>> = ref([
{
title: '序号',
key: 'index',
align: 'center',
width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '工单类型',
key: 'taskType',
width: 100,
render: row => {
return row.taskType === '0' ? '拉丝' : '漆包';
}
},
{
title: '机台',
key: 'workstationCode',
width: 100
},
{
title: '订单类型',
key: 'orderType',
width: 100,
render: row => {
return row.orderType === '0' ? '客户订单' : '备库订单';
}
},
// {
// title: '',
// key: 'orderSn',
// width: 100
// },
{
title: '客户',
key: 'clientName',
width: 100
},
{
title: '生产工单号',
key: 'taskSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '二维码编号',
key: 'inputSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '产品型号',
key: 'productModel',
width: 100
},
{
title: '产品规格',
key: 'productSpecification',
width: 100
},
{
title: '厂家料号',
key: 'partNumber',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '投料重量',
key: 'inputWeight',
width: 100
},
{
title: '入库批号',
key: 'batchCode',
width: 100
},
{
title: '单位',
key: 'measureName',
width: 100
},
{
title: '投料规格',
key: 'itemSpecification',
width: 100
},
{
title: '投料时间',
key: 'createTime',
width: 180
},
{
title: '操作人',
key: 'createBy',
width: 100
}
{
title: '序号',
key: 'index',
align: 'center',
width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '工单类型',
key: 'taskType',
width: 100,
render: row => {
return row.taskType === '0' ? '拉丝' : '漆包';
}
},
{
title: '机台',
key: 'workstationCode',
width: 100
},
{
title: '订单类型',
key: 'orderType',
width: 100,
render: row => {
return row.orderType === '0' ? '客户订单' : '备库订单';
}
},
// {
// title: '',
// key: 'orderSn',
// width: 100
// },
{
title: '客户',
key: 'clientName',
width: 100
},
{
title: '生产工单号',
key: 'taskSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '二维码编号',
key: 'inputSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '产品型号',
key: 'productModel',
width: 100
},
{
title: '产品规格',
key: 'productSpecification',
width: 100
},
{
title: '厂家料号',
key: 'partNumber',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '投料数量',
key: 'inputWeight',
width: 100
},
{
title: '入库批号',
key: 'batchCode',
width: 100
},
{
title: '单位',
key: 'measureName',
width: 100
},
{
title: '投料规格',
key: 'itemSpecification',
width: 100
},
{
title: '投料时间',
key: 'createTime',
width: 180
},
{
title: '操作人',
key: 'createBy',
width: 100
}
]);
async function init() {
startLoading();
getItputLog({ ...searchForm.value }).then(res => {
if (res.code === 200) {
data.value = res.rows;
searchForm.value.total = res.total;
}
endLoading();
});
startLoading();
getItputLog({ ...searchForm.value }).then(res => {
if (res.code === 200) {
data.value = res.rows;
searchForm.value.total = res.total;
}
endLoading();
});
}
function back() {
router.go(-1);
router.go(-1);
}
onMounted(() => {
title.value = `${route.query.title}-${title.value}`;
searchForm.value.taskId = Number(route.query.id);
if (route.query.title === '漆包') {
searchForm.value.taskType = '1';
columns.value = [
...columns.value,
...[
{
title: '轴号',
key: 'axleNumber',
width: 100
},
{
title: '轴位置数',
key: 'alexPositionNumber',
width: 100
}
]
];
}
init();
title.value = `${route.query.title}-${title.value}`;
searchForm.value.taskId = Number(route.query.id);
if (route.query.title === '漆包') {
searchForm.value.taskType = '1';
columns.value = [
...columns.value,
...[
{
title: '轴号',
key: 'axleNumber',
width: 100
},
{
title: '轴位置数',
key: 'alexPositionNumber',
width: 100
}
]
];
}
init();
});
</script>

@ -1,24 +1,24 @@
<template>
<div>
<my-card :title="title">
<template #right>
<div style="display: flex; align-items: center">
<CxColumns v-model:columns="columns" />
<n-button class="ml-5px" type="primary" size="small" attr-type="button" style="width: 80px" @click="back">
返回
</n-button>
</div>
</template>
<n-data-table
:loading="loading"
:columns="columns"
:data="data"
:max-height="dataTableConfig.maxHeight"
:scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table>
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card>
</div>
<div>
<my-card :title="title">
<template #right>
<div style="display: flex; align-items: center">
<CxColumns v-model:columns="columns" />
<n-button class="ml-5px" type="primary" size="small" attr-type="button" style="width: 80px" @click="back">
返回
</n-button>
</div>
</template>
<n-data-table
:loading="loading"
:columns="columns"
:data="data"
:max-height="dataTableConfig.maxHeight"
:scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table>
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card>
</div>
</template>
<script setup lang="tsx">
@ -32,17 +32,17 @@ import { getOutputLog } from '~/src/service/api/produre/workRecords/index';
const { loading, startLoading, endLoading } = useLoading();
const searchForm = ref<{
taskId: number;
pageNum: number;
pageSize: number;
total: number;
taskType: string;
taskId: number;
pageNum: number;
pageSize: number;
total: number;
taskType: string;
}>({
taskId: 0,
pageNum: 1,
pageSize: 10,
total: 0,
taskType: '0'
taskId: 0,
pageNum: 1,
pageSize: 10,
total: 0,
taskType: '0'
});
const route = useRoute();
@ -54,160 +54,160 @@ const title = ref<string>('报工记录');
const data = ref<workRecords.TabelList[]>([]);
const columns: Ref<DataTableColumns<workRecords.TabelList>> = ref([
{
title: '序号',
key: 'index',
align: 'center',
width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '工单类型',
key: 'taskType',
width: 100,
render: row => {
return row.taskType === '0' ? '拉丝' : '漆包';
}
},
{
title: '机台',
key: 'workstationCode',
width: 100
},
{
title: '序号',
key: 'index',
align: 'center',
width: 70,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
},
{
title: '工单类型',
key: 'taskType',
width: 100,
render: row => {
return row.taskType === '0' ? '拉丝' : '漆包';
}
},
{
title: '机台',
key: 'workstationCode',
width: 100
},
{
title: '订单类型',
key: 'orderType',
width: 100,
render: row => {
return row.orderType === '0' ? '客户订单' : '备库订单';
}
},
// {
// title: '',
// key: 'orderSn',
// width: 100
// },
{
title: '客户',
key: 'clientName',
width: 100
},
{
title: '生产工单号',
key: 'taskSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '二维码编号',
key: 'outputSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '产品型号',
key: 'productModel',
width: 100
},
{
title: '产品规格',
key: 'productSpecification',
width: 100
},
{
title: '报工重量',
key: 'outputWeight',
width: 100
},
{
title: '报工规格',
key: 'itemSpecification',
width: 100
},
{
title: '单位',
key: 'measureName',
width: 100
},
{
title: '报工时间',
key: 'createTime',
width: 180
},
{
title: '报工人',
key: 'createBy',
width: 100
},
{
title: '报工工号',
key: 'jobNumber',
width: 100
},
{
title: '批号',
key: 'batchCode',
width: 100
},
{
title: '贸易商',
key: 'ingredientsName',
width: 100
},
{
title: '材料厂家',
key: 'manufacturerName',
width: 100
},
{
title: '称重时间',
key: 'weightTime',
width: 100
}
{
title: '订单类型',
key: 'orderType',
width: 100,
render: row => {
return row.orderType === '0' ? '客户订单' : '备库订单';
}
},
// {
// title: '',
// key: 'orderSn',
// width: 100
// },
{
title: '客户',
key: 'clientName',
width: 100
},
{
title: '生产工单号',
key: 'taskSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '二维码编号',
key: 'outputSn',
width: 100,
ellipsis: {
tooltip: true
}
},
{
title: '产品型号',
key: 'productModel',
width: 100
},
{
title: '产品规格',
key: 'productSpecification',
width: 100
},
{
title: '报工数量(副)',
key: 'outputWeight',
width: 100
},
{
title: '报工规格',
key: 'itemSpecification',
width: 100
},
{
title: '单位',
key: 'measureName',
width: 100
},
{
title: '报工时间',
key: 'createTime',
width: 180
},
{
title: '报工人',
key: 'createBy',
width: 100
},
{
title: '报工工号',
key: 'jobNumber',
width: 100
},
{
title: '批号',
key: 'batchCode',
width: 100
},
{
title: '贸易商',
key: 'ingredientsName',
width: 100
},
{
title: '材料厂家',
key: 'manufacturerName',
width: 100
},
{
title: '称重时间',
key: 'weightTime',
width: 100
}
]);
function init() {
startLoading();
getOutputLog({ ...searchForm.value }).then(res => {
if (res.code === 200) {
data.value = res.rows;
searchForm.value.total = res.total;
}
endLoading();
});
startLoading();
getOutputLog({ ...searchForm.value }).then(res => {
if (res.code === 200) {
data.value = res.rows;
searchForm.value.total = res.total;
}
endLoading();
});
}
function back() {
router.go(-1);
router.go(-1);
}
onMounted(() => {
title.value = `${route.query.title}-${title.value}`;
searchForm.value.taskId = Number(route.query.id);
if (route.query.title === '漆包') {
searchForm.value.taskType = '1';
columns.value = [
...columns.value,
...[
{
title: '轴位置数',
key: 'alexPositionNumber',
width: 100
},
{
title: '批次',
key: 'alexLot',
width: 100
}
]
];
}
init();
title.value = `${route.query.title}-${title.value}`;
searchForm.value.taskId = Number(route.query.id);
if (route.query.title === '漆包') {
searchForm.value.taskType = '1';
columns.value = [
...columns.value,
...[
{
title: '轴位置数',
key: 'alexPositionNumber',
width: 100
},
{
title: '批次',
key: 'alexLot',
width: 100
}
]
];
}
init();
});
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save