master
吴普建 12 months ago
parent c472019cc7
commit b4458abf52

400
src/typings/md.d.ts vendored

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

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

@ -1,100 +1,100 @@
<template> <template>
<my-dialog <my-dialog
v-model:show="modalVisible" v-model:show="modalVisible"
:title="title" :title="title"
:loading="subDialog" :loading="subDialog"
width="1000px" width="1000px"
@submit="submit" @submit="submit"
@cancel="cancel" @cancel="cancel"
> >
<template #content> <template #content>
<div> <div>
<n-form ref="formRef" label-placement="left" :label-width="100" :model="formModel" :rules="rules"> <n-form ref="formRef" label-placement="left" :label-width="100" :model="formModel" :rules="rules">
<n-grid :cols="24" :x-gap="18"> <n-grid :cols="24" :x-gap="18">
<!-- <n-form-item-grid-item :span="8" label="入库单ID" path="recptId"> <!-- <n-form-item-grid-item :span="8" label="入库单ID" path="recptId">
<n-input v-model:value="formModel.recptId" placeholder="请输入入库单ID" /> <n-input v-model:value="formModel.recptId" placeholder="请输入入库单ID" />
</n-form-item-grid-item> --> </n-form-item-grid-item> -->
<!-- <n-form-item-grid-item :span="8" label="产品物料ID" path="itemId"> <!-- <n-form-item-grid-item :span="8" label="产品物料ID" path="itemId">
<n-input v-model:value="formModel.itemId" placeholder="请输入产品物料ID" /> <n-input v-model:value="formModel.itemId" placeholder="请输入产品物料ID" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="产品物料编码" path="itemCode"> <n-form-item-grid-item :span="8" label="产品物料编码" path="itemCode">
<n-input v-model:value="formModel.itemCode" placeholder="请输入产品物料编码" /> <n-input v-model:value="formModel.itemCode" placeholder="请输入产品物料编码" />
</n-form-item-grid-item> --> </n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="产品物料名称" path="itemName"> <n-form-item-grid-item :span="8" label="产品物料名称" path="itemName">
<n-input v-model:value="formModel.itemName" disabled placeholder="请输入产品物料名称" /> <n-input v-model:value="formModel.itemName" disabled placeholder="请输入产品物料名称" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="规格型号" path="specification"> <n-form-item-grid-item :span="8" label="规格型号" path="specification">
<n-input v-model:value="formModel.specification" placeholder="请输入规格型号" /> <n-input v-model:value="formModel.specification" placeholder="请输入规格型号" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="单位" path="unitOfMeasure"> <n-form-item-grid-item :span="8" label="单位" path="unitOfMeasure">
<n-input v-model:value="formModel.unitOfMeasure" placeholder="请输入单位" /> <n-input v-model:value="formModel.unitOfMeasure" placeholder="请输入单位" />
</n-form-item-grid-item> </n-form-item-grid-item>
<!-- <n-form-item-grid-item :span="8" label="应入数量" path="quantityRecived"> <!-- <n-form-item-grid-item :span="8" label="应入数量" path="quantityRecived">
<n-input v-model:value="formModel.quantityRecived" placeholder="请输入应入数量" /> <n-input v-model:value="formModel.quantityRecived" placeholder="请输入应入数量" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="验收数量" path="quantityChecked"> <n-form-item-grid-item :span="8" label="验收数量" path="quantityChecked">
<n-input v-model:value="formModel.quantityChecked" placeholder="请输入验收数量" /> <n-input v-model:value="formModel.quantityChecked" placeholder="请输入验收数量" />
</n-form-item-grid-item> --> </n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="入库数量" path="quantitySaved"> <n-form-item-grid-item :span="8" label="入库数量" path="quantitySaved">
<n-input v-model:value="formModel.quantitySaved" placeholder="请输入上架数量" /> <n-input v-model:value="formModel.quantitySaved" placeholder="请输入上架数量" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="入库批次号" path="batchCode"> <n-form-item-grid-item :span="8" label="入库批次号" path="batchCode">
<n-input v-model:value="formModel.batchCode" placeholder="请输入入库批次号" /> <n-input v-model:value="formModel.batchCode" placeholder="请输入入库批次号" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="仓库名称" path="warehouseName"> <n-form-item-grid-item :span="8" label="仓库名称" path="warehouseName">
<n-input v-model:value="formModel.warehouseName" disabled /> <n-input v-model:value="formModel.warehouseName" disabled />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="库区名称" path="locationName"> <n-form-item-grid-item :span="8" label="库区名称" path="locationName">
<n-select v-model:value="formModel.locationId" :options="locationOptions" @update:value="locationSelect"> <n-select v-model:value="formModel.locationId" :options="locationOptions" @update:value="locationSelect">
<template #empty> <template #empty>
<div> <div>
<n-empty v-if="locationOptions.length === 0" description="暂无数据" /> <n-empty v-if="locationOptions.length === 0" description="暂无数据" />
</div> </div>
</template> </template>
</n-select> </n-select>
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="库位名称" path="locationName"> <n-form-item-grid-item :span="8" label="库位名称" path="locationName">
<n-select v-model:value="formModel.areaId" :options="areaOptions" @update:value="areaSelect"> <n-select v-model:value="formModel.areaId" :options="areaOptions" @update:value="areaSelect">
<template #empty> <template #empty>
<div> <div>
<n-empty v-if="areaOptions.length === 0" description="暂无数据" /> <n-empty v-if="areaOptions.length === 0" description="暂无数据" />
<n-empty v-if="!formModel.locationId && areaOptions.length > 0" description="请选择库区" /> <n-empty v-if="!formModel.locationId && areaOptions.length > 0" description="请选择库区" />
</div> </div>
</template> </template>
</n-select> </n-select>
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="有效期" path="expireDate"> <n-form-item-grid-item :span="8" label="有效期" path="expireDate">
<n-date-picker v-model:value="formModel.expireDate" type="date" placeholder="请选择有效期" /> <n-date-picker v-model:value="formModel.expireDate" type="date" placeholder="请选择有效期" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="备注" path="remark"> <n-form-item-grid-item :span="8" label="备注" path="remark">
<n-input v-model:value="formModel.remark" placeholder="请输入备注" /> <n-input v-model:value="formModel.remark" placeholder="请输入备注" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="来料检验单ID" path="iqcId"> <n-form-item-grid-item :span="8" label="来料检验单ID" path="iqcId">
<n-input v-model:value="formModel.iqcId" placeholder="请输入来料检验单ID" /> <n-input v-model:value="formModel.iqcId" placeholder="请输入来料检验单ID" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="来料检验单编号" path="iqcCode"> <n-form-item-grid-item :span="8" label="来料检验单编号" path="iqcCode">
<n-input v-model:value="formModel.iqcCode" placeholder="请输入来料检验单编号" /> <n-input v-model:value="formModel.iqcCode" placeholder="请输入来料检验单编号" />
</n-form-item-grid-item> </n-form-item-grid-item>
<!-- <n-form-item-grid-item :span="8" label="净重" path="weight"> <!-- <n-form-item-grid-item :span="8" label="净重" path="weight">
<n-input-number v-model:value="formModel.weight" placeholder="请输入净重" /> <n-input-number v-model:value="formModel.weight" placeholder="请输入净重" />
</n-form-item-grid-item> --> </n-form-item-grid-item> -->
<!-- <n-form-item-grid-item :span="8" label="应入重量" path="weightRecived"> <!-- <n-form-item-grid-item :span="8" label="应入重量" path="weightRecived">
<n-input-number v-model:value="formModel.weightRecived" placeholder="请输入应入重量" /> <n-input-number v-model:value="formModel.weightRecived" placeholder="请输入应入重量" />
</n-form-item-grid-item> --> </n-form-item-grid-item> -->
<n-form-item-grid-item :span="8" label="入库重量" path="totalWeight"> <n-form-item-grid-item :span="8" label="入库重量" path="totalWeight">
<n-input-number v-model:value="formModel.totalWeight" placeholder="请输入毛重" /> <n-input-number v-model:value="formModel.totalWeight" placeholder="请输入毛重" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="重量单位" path="weightUnit"> <n-form-item-grid-item :span="8" label="重量单位" path="weightUnit">
<n-input v-model:value="formModel.weightUnit" placeholder="请输入重量单位" /> <n-input v-model:value="formModel.weightUnit" placeholder="请输入重量单位" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item :span="8" label="容器码" path="containerCode"> <n-form-item-grid-item :span="8" label="容器码" path="containerCode">
<n-input v-model:value="formModel.containerCode" placeholder="请输入容器码" /> <n-input v-model:value="formModel.containerCode" placeholder="请输入容器码" />
</n-form-item-grid-item> </n-form-item-grid-item>
</n-grid> </n-grid>
</n-form> </n-form>
</div> </div>
</template> </template>
</my-dialog> </my-dialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -103,22 +103,20 @@ import { useMessage } from 'naive-ui';
import type { FormInst } from 'naive-ui'; import type { FormInst } from 'naive-ui';
// import { createRequiredFormRule } from '@/utils'; // import { createRequiredFormRule } from '@/utils';
import { editWmsItemRecptLine, addWmsItemRecptLine } from '@/service/api/wms/recptLine'; 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 locationOptions = ref<{ value: string; label: string }[]>([]);
const areaOptions = ref<{ value: string; label: string }[]>([]); const areaOptions = ref<{ value: string; label: string }[]>([]);
export interface Props { export interface Props {
/** 弹窗可见性 */ /** 弹窗可见性 */
visible: boolean; visible: boolean;
/** /**
* 弹窗类型 * 弹窗类型
* add: 新增 * add: 新增
* edit: 编辑 * edit: 编辑
*/ */
type?: 'add' | 'edit'; type?: 'add' | 'edit';
/** 编辑的表格行数据 */ /** 编辑的表格行数据 */
editData?: any; editData?: any;
getList; getList;
} }
export type ModalType = NonNullable<Props['type']>; export type ModalType = NonNullable<Props['type']>;
@ -127,224 +125,194 @@ const subDialog = ref<boolean>(false);
defineOptions({ name: 'TableActionModal' }); defineOptions({ name: 'TableActionModal' });
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
type: 'add', type: 'add',
editData: null editData: null
}); });
interface Emits { interface Emits {
(e: 'update:visible', visible: boolean): void; (e: 'update:visible', visible: boolean): void;
} }
const emit = defineEmits<Emits>(); const emit = defineEmits<Emits>();
const message = useMessage(); const message = useMessage();
const modalVisible = computed({ const modalVisible = computed({
get() { get() {
return props.visible; return props.visible;
}, },
set(visible) { set(visible) {
emit('update:visible', visible); emit('update:visible', visible);
} }
}); });
const cancel = () => { const cancel = () => {
modalVisible.value = false; modalVisible.value = false;
}; };
const title = computed(() => { const title = computed(() => {
const titles: Record<ModalType, string> = { const titles: Record<ModalType, string> = {
add: '添加物料入库单行', add: '添加物料入库单行',
edit: '编辑物料入库单行' edit: '编辑物料入库单行'
}; };
return titles[props.type]; return titles[props.type];
}); });
const formRef = ref<HTMLElement & FormInst>(); const formRef = ref<HTMLElement & FormInst>();
const formModel = ref<wms.recptLineRawType.columns>({ const formModel = ref<wms.recptLineRawType.columns>({
lineId: null, lineId: null,
recptId: null, recptId: null,
itemId: null, itemId: null,
itemCode: null, itemCode: null,
itemName: null, itemName: null,
specification: null, specification: null,
unitOfMeasure: null, unitOfMeasure: null,
quantityRecived: null, quantityRecived: null,
quantityChecked: null, quantityChecked: null,
quantitySaved: null, quantitySaved: null,
batchCode: null, batchCode: null,
warehouseId: null, warehouseId: null,
warehouseCode: null, warehouseCode: null,
warehouseName: null, warehouseName: null,
locationId: null, locationId: null,
locationCode: null, locationCode: null,
locationName: null, locationName: null,
areaId: null, areaId: null,
areaCode: null, areaCode: null,
areaName: null, areaName: null,
expireDate: null, expireDate: null,
remark: null, remark: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
attr4: null, attr4: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
iqcId: null, iqcId: null,
iqcCode: null, iqcCode: null,
weight: null, weight: null,
weightRecived: null, weightRecived: null,
totalWeight: null, totalWeight: null,
weightUnit: null, weightUnit: null,
containerCode: null containerCode: null
}); });
const rules = {}; const rules = {};
function handleUpdateFormModelByModalType() { function handleUpdateFormModelByModalType() {
const handlers: Record<ModalType, () => void> = { const handlers: Record<ModalType, () => void> = {
add: () => { add: () => {
reset(); reset();
}, },
edit: () => { edit: () => {
reset(); reset();
if (props.editData) { if (props.editData) {
Object.assign(formModel.value, props.editData); Object.assign(formModel.value, props.editData);
init(); init();
} }
} }
}; };
handlers[props.type](); handlers[props.type]();
} }
async function submit() { async function submit() {
await formRef.value?.validate(vaild => { await formRef.value?.validate(vaild => {
if (!vaild) { if (!vaild) {
if (formModel.value.lineId) { if (formModel.value.lineId) {
editWmsItemRecptLine(formModel.value) editWmsItemRecptLine(formModel.value)
.then(res => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
message.success('修改成功'); message.success('修改成功');
subDialog.value = false; subDialog.value = false;
props.getList(); props.getList();
cancel(); cancel();
} }
}) })
.catch(() => { .catch(() => {
message.success('修改失败'); message.success('修改失败');
}); });
} else { } else {
addWmsItemRecptLine(formModel.value) addWmsItemRecptLine(formModel.value)
.then(res => { .then(res => {
if (res.code === 200) { if (res.code === 200) {
message.success('新增成功'); message.success('新增成功');
props.getList(); props.getList();
subDialog.value = false; subDialog.value = false;
cancel(); cancel();
} }
}) })
.catch(() => { .catch(() => {
message.success('修改失败'); message.success('修改失败');
}); });
} }
} }
}); });
} }
function reset() { function reset() {
formModel.value = { formModel.value = {
lineId: null, lineId: null,
recptId: null, recptId: null,
itemId: null, itemId: null,
itemCode: null, itemCode: null,
itemName: null, itemName: null,
specification: null, specification: null,
unitOfMeasure: null, unitOfMeasure: null,
quantityRecived: null, quantityRecived: null,
quantityChecked: null, quantityChecked: null,
quantitySaved: null, quantitySaved: null,
batchCode: null, batchCode: null,
warehouseId: null, warehouseId: null,
warehouseCode: null, warehouseCode: null,
warehouseName: null, warehouseName: null,
locationId: null, locationId: null,
locationCode: null, locationCode: null,
locationName: null, locationName: null,
areaId: null, areaId: null,
areaCode: null, areaCode: null,
areaName: null, areaName: null,
expireDate: null, expireDate: null,
remark: null, remark: null,
attr1: null, attr1: null,
attr2: null, attr2: null,
attr3: null, attr3: null,
attr4: null, attr4: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,
updateTime: null, updateTime: null,
iqcId: null, iqcId: null,
iqcCode: null, iqcCode: null,
weight: null, weight: null,
weightRecived: null, weightRecived: null,
totalWeight: null, totalWeight: null,
weightUnit: null, weightUnit: null,
containerCode: null containerCode: null
}; };
} }
watch( watch(
() => props.visible, () => props.visible,
newValue => { newValue => {
if (newValue) { if (newValue) {
handleUpdateFormModelByModalType(); handleUpdateFormModelByModalType();
} }
} }
); );
function locationSelect(_val, item) { function locationSelect(_val, item) {
formModel.value.locationId = item.locationId; formModel.value.locationId = item.locationId;
formModel.value.locationCode = item.locationCode; formModel.value.locationCode = item.locationCode;
formModel.value.locationName = item.locationName; formModel.value.locationName = item.locationName;
// console.log(formModel.value, item, '------'); // 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
});
});
});
} }
function areaSelect(_val, item) { function areaSelect(_val, item) {
formModel.value.areaId = item.areaId; formModel.value.areaId = item.areaId;
formModel.value.areaCode = item.areaCode; formModel.value.areaCode = item.areaCode;
formModel.value.areaName = item.areaName; formModel.value.areaName = item.areaName;
// console.log(formModel.value, item, '------'); // console.log(formModel.value, item, '------');
} }
function init() { function init() {
// console.log(formModel.value, '------'); // 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
});
});
});
} }
</script> </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> <template>
<div> <div>
<my-card title="搜索条件" search> <my-card title="搜索条件" search>
<n-form inline> <n-form inline>
<n-form-item label="物料名称"> <n-form-item label="物料名称">
<n-input v-model:value="searchForm.itemName" placeholder="请输入物料名称" /> <n-input v-model:value="searchForm.itemName" placeholder="请输入物料名称" />
</n-form-item> </n-form-item>
<n-form-item label="物料编码"> <n-form-item label="物料编码">
<n-input v-model:value="searchForm.itemCode" placeholder="请输入物料名称" /> <n-input v-model:value="searchForm.itemCode" placeholder="请输入物料名称" />
</n-form-item> </n-form-item>
<n-form-item label="物料类型"> <n-form-item label="物料类型">
<n-tree-select <n-tree-select
v-model:value="searchForm.itemTypeId" v-model:value="searchForm.itemTypeId"
:options="OptionsData" :options="OptionsData"
label-field="itemTypeName" label-field="itemTypeName"
key-field="id" key-field="id"
style="width: 180px" style="width: 180px"
></n-tree-select> ></n-tree-select>
<!-- <n-input v-model:value="searchForm.itemTypeId" placeholder="请输入物料类型" /> --> <!-- <n-input v-model:value="searchForm.itemTypeId" placeholder="请输入物料类型" /> -->
</n-form-item> </n-form-item>
<n-form-item label="单位" style="width: 180px"> <n-form-item label="单位" style="width: 180px">
<n-select v-model:value="searchForm.numMeasureId" :options="primaryOptions" placeholder="请输入单位" /> <n-select v-model:value="searchForm.numMeasureId" :options="primaryOptions" placeholder="请输入单位" />
</n-form-item> </n-form-item>
<n-form-item> <n-form-item>
<n-button type="primary" class="mr-10px" @click="handleSearch"> <n-button type="primary" class="mr-10px" @click="handleSearch">
<icon-ic-round-search class="mr-4px text-20px" /> <icon-ic-round-search class="mr-4px text-20px" />
搜索 搜索
</n-button> </n-button>
<n-button @click="handleReset"> <n-button @click="handleReset">
<icon-ic-round-refresh class="mr-4px text-20px" /> <icon-ic-round-refresh class="mr-4px text-20px" />
重置 重置
</n-button> </n-button>
</n-form-item> </n-form-item>
</n-form> </n-form>
</my-card> </my-card>
<my-card title="物料列表"> <my-card title="物料列表">
<template #right> <template #right>
<div class="flex-center"> <div class="flex-center">
<n-button :loading="exportLoading" size="small" type="warning" @click="exportList"> <n-button :loading="exportLoading" size="small" type="warning" @click="exportList">
<icon-uil:export class="mr-4px text-20px" /> <icon-uil:export class="mr-4px text-20px" />
导出 导出
</n-button> </n-button>
<n-button size="small" type="primary" class="mr-5px ml-5px" @click="setShow"> <n-button size="small" type="primary" class="mr-5px ml-5px" @click="setShow">
<icon-ic-round-plus class="mr-4px text-20px" /> <icon-ic-round-plus class="mr-4px text-20px" />
新增 新增
</n-button> </n-button>
<cx-columns v-model:columns="columns"></cx-columns> <cx-columns v-model:columns="columns"></cx-columns>
</div> </div>
</template> </template>
<n-data-table <n-data-table
:loading="loading" :loading="loading"
:data="data" :data="data"
:columns="columns" :columns="columns"
:max-height="dataTableConfig.maxHeight" :max-height="dataTableConfig.maxHeight"
></n-data-table> ></n-data-table>
<!-- <n-pagination <!-- <n-pagination
:page="searchForm.pageNum" :page="searchForm.pageNum"
:item-count="searchForm.total" :item-count="searchForm.total"
:page-size="searchForm.pageSize" :page-size="searchForm.pageSize"
style="margin-top: 20px; float: right" style="margin-top: 20px; float: right"
@update:page="changePage" @update:page="changePage"
/> --> /> -->
<my-pagination v-model:search-form="searchForm" @init="init"></my-pagination> <my-pagination v-model:search-form="searchForm" @init="init"></my-pagination>
</my-card> </my-card>
<my-dialog <my-dialog
:title="addForm.id ? '编辑物料' : '新增物料'" :title="addForm.id ? '编辑物料' : '新增物料'"
:show="show" :show="show"
width="750px" width="750px"
@cancel="cancel" @cancel="cancel"
@submit="submit" @submit="submit"
> >
<template #content> <template #content>
<div> <div>
<n-form <n-form
ref="addFormRef" ref="addFormRef"
label-placement="left" label-placement="left"
label-align="left" label-align="left"
:label-width="100" :label-width="100"
:model="addForm" :model="addForm"
:rules="rules" :rules="rules"
> >
<n-grid :cols="24" :x-gap="20"> <n-grid :cols="24" :x-gap="20">
<n-form-item-grid-item label="物料类型" :span="11" path="itemTypeName"> <n-form-item-grid-item label="物料类型" :span="11" path="itemTypeName">
<n-tree-select <n-tree-select
v-model:value="addForm.itemTypeId" v-model:value="addForm.itemTypeId"
style="width: 200px" style="width: 200px"
:options="OptionsData" :options="OptionsData"
label-field="itemTypeName" label-field="itemTypeName"
key-field="id" key-field="id"
@update:value="handleChange" @update:value="handleChange"
></n-tree-select> ></n-tree-select>
<!-- <n-input v-model:value="addForm.itemTypeId" placeholder="请输入物料类型" /> --> <!-- <n-input v-model:value="addForm.itemTypeId" placeholder="请输入物料类型" /> -->
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item label="物料名称" :span="11" path="itemName"> <n-form-item-grid-item label="物料名称" :span="11" path="itemName">
<n-input v-model:value="addForm.itemName" placeholder="请输入物料名称" /> <n-input v-model:value="addForm.itemName" placeholder="请输入物料名称" />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item label="规格" :span="11" path="specification"> <n-form-item-grid-item label="规格" :span="11" path="specification">
<n-input <n-input
v-model:value="addForm.specification" v-model:value="addForm.specification"
placeholder="请输入规格" placeholder="请输入规格"
:disabled="addForm.id !== null" :disabled="addForm.id !== null"
></n-input> ></n-input>
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item label="重量单位" :span="11" path="weightMeasureId"> <n-form-item-grid-item label="颜色" :span="11" path="color">
<n-select <n-select v-model:value="addForm.color" class="w-200px" :options="corlor_types" placeholder="请选择颜色" ></n-select>
v-model:value="addForm.weightMeasureId" </n-form-item-grid-item>
class="w-200px" <n-form-item-grid-item label="单位" :span="11" path="weightMeasureId">
:options="primaryOptions" <n-select
placeholder="请输入重量单位" v-model:value="addForm.weightMeasureId"
@update:value="weightHandleChange" class="w-200px"
/> :options="primaryOptions"
</n-form-item-grid-item> placeholder="请输入单位"
<n-form-item-grid-item label="工序名称" :span="11" path="workstageId"> @update:value="weightHandleChange"
<n-select />
v-model:value="addForm.workstageId" </n-form-item-grid-item>
class="w-200px" <n-form-item-grid-item label="工序名称" :span="11" path="workstageId">
:options="workstageOptions" <n-select
placeholder="请选择工序名称" v-model:value="addForm.workstageId"
@update:value="workstageHandleChange" class="w-200px"
/> :options="workstageOptions"
</n-form-item-grid-item> placeholder="请选择工序名称"
<n-form-item-grid-item label="是否启用" :span="11"> @update:value="workstageHandleChange"
<n-switch v-model:value="addForm.ifEnable" :checked-value="1" :unchecked-value="0" /> />
</n-form-item-grid-item> </n-form-item-grid-item>
<n-form-item-grid-item label="备注" :span="25"> <n-form-item-grid-item label="是否启用" :span="11">
<n-input v-model:value="addForm.remark" type="textarea" placeholder="请输入备注" /> <n-switch v-model:value="addForm.ifEnable" :checked-value="1" :unchecked-value="0" />
</n-form-item-grid-item> </n-form-item-grid-item>
</n-grid> <n-form-item-grid-item label="备注" :span="25">
</n-form> <n-input v-model:value="addForm.remark" type="textarea" placeholder="请输入备注" />
</div> </n-form-item-grid-item>
</template> </n-grid>
</my-dialog> </n-form>
</div> </div>
</template>
</my-dialog>
</div>
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
import type { Ref } from 'vue'; import { getCurrentInstance, Ref } from 'vue';
import { ref, onMounted } from 'vue'; import { ref, onMounted } from 'vue';
import { useMessage } from 'naive-ui'; import { useMessage } from 'naive-ui';
import type { DataTableColumns, FormInst } 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 { dataTableConfig } from '@/config/dataTableConfig';
import { useLoading, useWarning, useBoolean } from '~/src/hooks'; import { useLoading, useWarning, useBoolean } from '~/src/hooks';
const { proxy } = getCurrentInstance() as any;
const { corlor_types } = proxy.useDict('corlor_types');
const message = useMessage(); const message = useMessage();
const { bool: show, setTrue: setShow, setFalse: setHide } = useBoolean(); const { bool: show, setTrue: setShow, setFalse: setHide } = useBoolean();
const { loading, startLoading, endLoading } = useLoading(); const { loading, startLoading, endLoading } = useLoading();
@ -155,109 +161,111 @@ const dialog = useWarning();
const addFormRef = ref<FormInst | null>(null); const addFormRef = ref<FormInst | null>(null);
const rules = { const rules = {
itemName: createRequiredFormRule('请输入物料名称'), itemName: createRequiredFormRule('请输入物料名称'),
itemTypeName: createRequiredFormRule('请输入物料类型'), itemTypeName: createRequiredFormRule('请输入物料类型'),
workstageId: createRequiredFormRule('请选择工序'), workstageId: createRequiredFormRule('请选择工序'),
specification: createRequiredFormRule('请输入规格') specification: createRequiredFormRule('请输入规格')
}; };
const addForm = ref<Item.AddForm>({ const addForm = ref<Item.AddForm>({
id: null, id: null,
remark: '', remark: '',
itemName: '', itemName: '',
itemTypeId: null, itemTypeId: null,
itemTypeName: '', itemTypeName: '',
workstageId: null, workstageId: null,
workstageName: '', workstageName: '',
specification: '', specification: '',
weightMeasureId: null, weightMeasureId: null,
weightMeasureName: '', weightMeasureName: '',
ifEnable: 1 color: '',
ifEnable: 1
}); });
function cancel() { function cancel() {
setHide(); setHide();
addForm.value = { addForm.value = {
id: null, id: null,
remark: '', remark: '',
itemName: '', itemName: '',
itemTypeId: null, itemTypeId: null,
itemTypeName: '', itemTypeName: '',
workstageId: null, workstageId: null,
workstageName: '', workstageName: '',
weightMeasureId: null, weightMeasureId: null,
weightMeasureName: '', color: '',
ifEnable: 1 weightMeasureName: '',
}; ifEnable: 1
};
} }
async function changeStatus(row: any, val: number) { async function changeStatus(row: any, val: number) {
row.ifEnable = val; row.ifEnable = val;
await editMaterial(row).then(res => { await editMaterial(row).then(res => {
if (res.code === 200) { if (res.code === 200) {
message.success(res.msg); message.success(res.msg);
cancel(); cancel();
} }
}); });
init(); init();
} }
function handleChange(val, item) { function handleChange(val, item) {
addForm.value.itemTypeId = val; addForm.value.itemTypeId = val;
addForm.value.itemTypeName = item.itemTypeName; addForm.value.itemTypeName = item.itemTypeName;
} }
function weightHandleChange(val, item) { function weightHandleChange(val, item) {
addForm.value.weightMeasureId = val; addForm.value.weightMeasureId = val;
addForm.value.weightMeasureName = item.label; addForm.value.weightMeasureName = item.label;
} }
function workstageHandleChange(val, item) { function workstageHandleChange(val, item) {
addForm.value.workstageId = val; addForm.value.workstageId = val;
addForm.value.workstageName = item.label; addForm.value.workstageName = item.label;
} }
function submit() { function submit() {
if (!addFormRef.value) return; if (!addFormRef.value) return;
addFormRef.value.validate(errors => { addFormRef.value.validate(errors => {
if (!errors) { if (!errors) {
if (!addForm.value.id) { if (!addForm.value.id) {
addMaterial(addForm.value).then(res => { addMaterial(addForm.value).then(res => {
if (res.code === 200) { if (res.code === 200) {
message.success(res.msg); message.success(res.msg);
cancel(); cancel();
init(); init();
} }
}); });
} else { } else {
editMaterial(addForm.value).then(res => { editMaterial(addForm.value).then(res => {
if (res.code === 200) { if (res.code === 200) {
message.success(res.msg); message.success(res.msg);
cancel(); cancel();
init(); init();
} }
}); });
} }
} }
}); });
} }
const searchForm = ref<Item.SearchForm>({ const searchForm = ref<Item.SearchForm>({
itemCode: '', itemCode: '',
itemName: '', itemName: '',
itemTypeId: null, itemTypeId: null,
numMeasureId: null, numMeasureId: null,
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0 total: 0
}); });
function handleSearch() { function handleSearch() {
searchForm.value.pageNum = 1; searchForm.value.pageNum = 1;
init(); init();
} }
function handleReset() { function handleReset() {
searchForm.value = { searchForm.value = {
itemCode: '', itemCode: '',
itemName: '', itemName: '',
itemTypeId: null, itemTypeId: null,
numMeasureId: '', numMeasureId: '',
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
total: 0 total: 0
}; };
init(); init();
} }
// function changePage(page: number) { // function changePage(page: number) {
// searchForm.value.pageNum = page; // searchForm.value.pageNum = page;
@ -265,181 +273,198 @@ function handleReset() {
// } // }
const data = ref<Item.List[]>([]); const data = ref<Item.List[]>([]);
function init() { function init() {
startLoading(); startLoading();
getMaterialList(searchForm.value).then(res => { getMaterialList(searchForm.value).then(res => {
data.value = res.rows; data.value = res.rows;
searchForm.value.total = res.total; searchForm.value.total = res.total;
endLoading(); endLoading();
}); });
} }
const columns: Ref<DataTableColumns<Item.List>> = ref([ const columns: Ref<DataTableColumns<Item.List>> = ref([
{ {
title: '序号', title: '序号',
key: 'index', key: 'index',
align: 'center', align: 'center',
width: 60, width: 60,
render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1 render: (_row, index) => (searchForm.value.pageNum - 1) * searchForm.value.pageSize + index + 1
}, },
{ {
title: '物料编码', title: '物料编码',
key: 'itemCode', key: 'itemCode',
align: 'center', align: 'center',
width: 200 width: 200
}, },
{ {
title: '物料名称', title: '物料名称',
align: 'center', align: 'center',
key: 'itemName' key: 'itemName'
}, },
{ {
title: '类型名称', title: '类型名称',
align: 'center', align: 'center',
key: 'itemTypeName' key: 'itemTypeName'
}, },
{ {
title: '规格', title: '颜色',
align: 'center', align: 'center',
key: 'specification' key: 'color'
}, },
{ {
title: '工序名称', title: '颜色名称',
align: 'center', key: 'status',
key: 'workstageName' align: 'center',
}, render: row => {
{ return <dict-tag options={corlor_types.value} value={row.color}></dict-tag>;
title: '单位', },
align: 'center', width: 110,
key: 'weightMeasureName' ellipsis: {
}, tooltip: true
{ }
title: '是否启用', },
key: 'ifEnable', {
render(row) { title: '规格',
return ( align: 'center',
<my-switch key: 'specification'
v-model:value={row.ifEnable} },
checked={1} {
unchecked={0} title: '工序名称',
onChecked={val => { align: 'center',
changeStatus(row, val); key: 'workstageName'
}} },
onUnchecked={val => { {
changeStatus(row, val); title: '单位',
}} align: 'center',
/> key: 'weightMeasureName'
); },
} {
}, title: '是否启用',
{ key: 'ifEnable',
title: '备注', render(row) {
key: 'remark' return (
}, <my-switch
{ v-model:value={row.ifEnable}
title: '创建时间', checked={1}
key: 'createTime', unchecked={0}
width: 170 onChecked={val => {
}, changeStatus(row, val);
{ }}
title: '操作', onUnchecked={val => {
key: 'action', changeStatus(row, val);
width: 170, }}
render(row) { />
return ( );
<div> }
<n-button },
type="warning" {
size="small" title: '备注',
class="mr-10px" key: 'remark'
onClick={() => { },
addForm.value = deepClone(row); {
setShow(); title: '创建时间',
}} key: 'createTime',
> width: 170
<icon-tdesign-edit class="mr-1px text-15px " /> },
编辑 {
</n-button> title: '操作',
<n-button key: 'action',
type="error" width: 170,
size="small" render(row) {
onClick={() => { return (
dialog.warn(() => { <div>
console.log(row); <n-button
deleteMaterial(row.id).then(res => { type="warning"
if (res.code === 200) { size="small"
message.success(res.msg); class="mr-10px"
init(); onClick={() => {
} addForm.value = deepClone(row);
}); setShow();
}); }}
}} >
> <icon-tdesign-edit class="mr-1px text-15px " />
<icon-tdesign-delete class="mr-1px text-15px " /> 编辑
删除 </n-button>
</n-button> <n-button
</div> 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 workstageOptions = ref<any[]>([]);
const exportLoading = ref<boolean>(false); const exportLoading = ref<boolean>(false);
function exportList() { function exportList() {
exportLoading.value = true; exportLoading.value = true;
download('md/mes/md/mdItem/export', searchForm.value, `itemlist_${new Date().getTime()}.xlsx`, undefined) download('md/mes/md/mdItem/export', searchForm.value, `itemlist_${new Date().getTime()}.xlsx`, undefined)
.then(() => { .then(() => {
exportLoading.value = false; exportLoading.value = false;
}) })
.catch(() => { .catch(() => {
exportLoading.value = false; exportLoading.value = false;
}); });
console.log('导出'); console.log('导出');
} }
const primaryOptions = ref<{ value: string; label: string }[]>([]); const primaryOptions = ref<{ value: string; label: string }[]>([]);
const weightOptions = ref<{ value: string; label: string }[]>([]); const weightOptions = ref<{ value: string; label: string }[]>([]);
const OptionsData = ref<ApiItemTypeManagement.ItemType[]>([]); const OptionsData = ref<ApiItemTypeManagement.ItemType[]>([]);
function setTableData(list: ApiItemTypeManagement.ItemType[]) { function setTableData(list: ApiItemTypeManagement.ItemType[]) {
OptionsData.value = list; OptionsData.value = list;
} }
onMounted(async () => { onMounted(async () => {
const typeData = await fetchItemTypeList({}); const typeData = await fetchItemTypeList({});
if (typeData) { if (typeData) {
setTimeout(() => { setTimeout(() => {
setTableData(typeData.data); setTableData(typeData.data);
console.log(OptionsData.value, '11'); console.log(OptionsData.value, '11');
// endLoading(); // endLoading();
// allRowKeysArr = typeData.allParentIDArr; // allRowKeysArr = typeData.allParentIDArr;
// expandedRows.value = typeData.allParentIDArr; // expandedRows.value = typeData.allParentIDArr;
}, 100); }, 100);
} }
init(); init();
getAllTechnologyList().then(res => { getAllTechnologyList().then(res => {
if (res.code === 200) { if (res.code === 200) {
workstageOptions.value = []; workstageOptions.value = [];
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
workstageOptions.value.push({ workstageOptions.value.push({
label: item.workstageName, label: item.workstageName,
value: item.id value: item.id
}); });
}); });
} }
}); });
getAllUnit().then(res => { getAllUnit().then(res => {
primaryOptions.value = []; primaryOptions.value = [];
weightOptions.value = []; weightOptions.value = [];
if (res.code === 200) { if (res.code === 200) {
res.data.forEach((item: any) => { res.data.forEach((item: any) => {
primaryOptions.value.push({ primaryOptions.value.push({
label: item.measureName, label: item.measureName,
value: item.id value: item.id
}); });
weightOptions.value.push({ weightOptions.value.push({
label: item.measureName, label: item.measureName,
value: item.id value: item.id
}); });
}); });
} }
}); });
}); });
</script> </script>

@ -355,7 +355,7 @@ function getListTotal(total, num, price) {
// } // }
// eslint-disable-next-line no-param-reassign, @typescript-eslint/no-unused-vars // 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 editFlag = ref(false);
const getTotalPric = computed(() => { const getTotalPric = computed(() => {

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

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

File diff suppressed because it is too large Load Diff

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