init(projects): 整体修改

master
xushilin 12 months ago
parent 41d147f934
commit 83fd487efb

@ -62,7 +62,10 @@ watch(
async newValue => {
// console.log('newValue ==> ', newValue);
// console.log('JSON.parse(newValue) ==> ', JSON.parse(newValue));
if (!window.hiwebSocket.opened && !window.hiwebSocket.printerList?.length) {
window.$message?.error('打印失败,请连接打印机');
return;
}
if (!newValue) return;
if (isValidJSON(newValue)) {
// const msgData = JSON.parse(JSON.parse(newValue));

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

@ -5,7 +5,7 @@
<!-- <icon-local-ak-logo v-if="fill" />
<icon-local-ak-logo v-else /> -->
<!-- 加载图标 -->
<!-- <img src="../../assets/img/sys.png" alt="" style="width: 65px; height: 65px" /> -->
<img src="../../assets/img/sys.png" alt="" style="width: 64px; height: 34px" />
<div></div>
</template>

@ -1,6 +1,6 @@
<template>
<router-link :to="routeHomePath" class="flex-center w-full nowrap-hidden">
<!-- <system-logo class="text-60px text-primary" /> -->
<system-logo class="text-60px text-primary" />
<h2 v-show="showTitle" class="pl-8px text-16px font-bold text-primary transition duration-300 ease-in-out">
{{ $t('system.title') }}
</h2>

@ -170,6 +170,8 @@ declare namespace PageRoute {
| 'sale_saleOrder'
| 'scm'
| 'scm_accessorySupplier'
| 'scm_linkman'
| 'scm_register'
| 'storage'
| 'storage_auxiliaryProduceinfo'
| 'storage_copperWire'
@ -362,6 +364,8 @@ declare namespace PageRoute {
| 'rapidmining_deviceRealtime'
| 'sale_saleOrder'
| 'scm_accessorySupplier'
| 'scm_linkman'
| 'scm_register'
| 'storage_auxiliaryProduceinfo'
| 'storage_copperWire'
| 'storage_earlyWarning'

@ -137,6 +137,8 @@ export const views: Record<
rapidmining_deviceRealtime: () => import('./rapidmining/deviceRealtime/index.vue'),
sale_saleOrder: () => import('./sale/saleOrder/index.vue'),
scm_accessorySupplier: () => import('./scm/accessorySupplier/index.vue'),
scm_linkman: () => import('./scm/linkman/index.vue'),
scm_register: () => import('./scm/register/index.vue'),
storage_auxiliaryProduceinfo: () => import('./storage/auxiliaryProduceinfo/index.vue'),
storage_copperWire: () => import('./storage/copperWire/index.vue'),
storage_earlyWarning: () => import('./storage/earlyWarning/index.vue'),

File diff suppressed because it is too large Load Diff

@ -130,6 +130,9 @@
<n-form-item-grid-item :span="1" label="单位">
<n-input v-model:value="panel.form.numMeasureName" disabled placeholder="请选择物品单位"></n-input>
</n-form-item-grid-item>
<n-form-item-grid-item :span="1" label="颜色">
<n-input v-model:value="panel.form.color" disabled placeholder="请选择物品颜色"></n-input>
</n-form-item-grid-item>
<n-form-item-grid-item :span="1" label="数量">
<n-input-number v-model:value="panel.form.quantity" class="w-full" :min="0">
<template #suffix>
@ -146,13 +149,13 @@
</template>
</n-input-number>
</n-form-item-grid-item>
<n-form-item-grid-item :span="1" label="数量">
<!-- <n-form-item-grid-item :span="1" label="数量">
<n-input-number v-model:value="panel.form.weight" class="w-full" :min="0">
<template #suffix>
<div>(kg)</div>
</template>
</n-input-number>
</n-form-item-grid-item>
</n-form-item-grid-item> -->
<n-form-item-grid-item :span="1" label="计划交货日期">
<n-date-picker
v-model:value="panel.form.deliveryDate"
@ -226,8 +229,8 @@ import { getMaterialAllAccessory } from '@/service/api/md/itemlist/index';
import { useLoading } from '~/src/hooks';
const rules = {
deptId: createRequiredFormRule('请选择部门'),
vendorId: createRequiredFormRule('请选择供应商'),
planId: createRequiredFormRule('请选择计划')
vendorId: createRequiredFormRule('请选择供应商')
// planId: createRequiredFormRule('')
};
const addFormRef = ref<FormInst | null>(null);
const message = useMessage();
@ -273,11 +276,11 @@ const detailColumns: DataTableColumns<Procure.rawProcureList.listType> = [
key: 'weight',
width: 80
},
{
title: '数量',
key: 'quantity',
width: 80
},
// {
// title: '',
// key: 'quantity',
// width: 80
// },
{
title: '规格型号',
key: 'specification',
@ -750,8 +753,8 @@ function init() {
getPurchaseList(searchForm.value).then(res => {
data.value = res.rows;
searchForm.value.total = res.total;
endLoading();
});
endLoading();
}
const itemOptions = ref<
{
@ -773,7 +776,6 @@ function selectItem(form) {
} else {
form.numMeasureName = item.weightMeasureName;
}
console.log('form.unitType', form.unitType);
}
});
}

@ -1,6 +1,6 @@
<template>
<div>
<my-card :title="title">
<my-card :title="'投料记录列表'">
<template #right>
<div style="display: flex; align-items: center">
<CxColumns v-model:columns="columns" />
@ -34,7 +34,7 @@ const { loading, startLoading, endLoading } = useLoading();
const route = useRoute();
const router = useRouter();
const title = ref<string>('投料记录');
const title = ref<string>('');
const searchForm = ref<{
pageNum: number;
@ -64,8 +64,8 @@ const columns: Ref<DataTableColumns<feedRecords.TabelList>> = ref([
title: '工单类型',
key: 'taskType',
width: 100,
render: row => {
return row.taskType === '0' ? '拉丝' : '漆包';
render: () => {
return title.value;
}
},
{
@ -173,25 +173,25 @@ function back() {
}
onMounted(() => {
title.value = `${route.query.title}-${title.value}`;
title.value = `${route.query.title}`;
searchForm.value.taskId = Number(route.query.id);
if (route.query.title === '漆包') {
if (route.query.title === '板材眼镜') {
searchForm.value.taskType = '1';
columns.value = [
...columns.value,
...[
{
title: '轴号',
key: 'axleNumber',
width: 100
},
{
title: '轴位置数',
key: 'alexPositionNumber',
width: 100
}
]
];
// columns.value = [
// ...columns.value,
// ...[
// {
// title: '',
// key: 'axleNumber',
// width: 100
// },
// {
// title: '',
// key: 'alexPositionNumber',
// width: 100
// }
// ]
// ];
}
init();
});

@ -1,6 +1,6 @@
<template>
<div>
<my-card :title="title">
<my-card :title="'报工记录列表'">
<template #right>
<div style="display: flex; align-items: center">
<CxColumns v-model:columns="columns" />
@ -65,8 +65,8 @@ const columns: Ref<DataTableColumns<workRecords.TabelList>> = ref([
title: '工单类型',
key: 'taskType',
width: 100,
render: row => {
return row.taskType === '0' ? '拉丝' : '漆包';
render: () => {
return title.value;
}
},
{
@ -187,25 +187,25 @@ function back() {
}
onMounted(() => {
title.value = `${route.query.title}-${title.value}`;
title.value = `${route.query.title}`;
searchForm.value.taskId = Number(route.query.id);
if (route.query.title === '漆包') {
if (route.query.title === '板材眼镜') {
searchForm.value.taskType = '1';
columns.value = [
...columns.value,
...[
{
title: '轴位置数',
key: 'alexPositionNumber',
width: 100
},
{
title: '批次',
key: 'alexLot',
width: 100
}
]
];
// columns.value = [
// ...columns.value,
// ...[
// {
// title: '',
// key: 'alexPositionNumber',
// width: 100
// },
// {
// title: '',
// key: 'alexLot',
// width: 100
// }
// ]
// ];
}
init();
});

@ -71,7 +71,7 @@
label-width="120px"
>
<n-grid :cols="2" :x-gap="20">
<n-form-item-grid-item label="QB机台" path="dailyplanDevice">
<n-form-item-grid-item label="机台" path="dailyplanDevice">
<n-space>
<n-select
v-model:value="dailyplanDeviceId"
@ -83,7 +83,7 @@
></n-select>
</n-space>
</n-form-item-grid-item>
<n-form-item-grid-item label="轴号" path="dailyplanAxle">
<!-- <n-form-item-grid-item label="轴号" path="dailyplanAxle">
<n-space vertical>
<n-select
v-model:value="axleNumberId"
@ -96,7 +96,7 @@
}"
></n-select>
</n-space>
</n-form-item-grid-item>
</n-form-item-grid-item> -->
<n-form-item-grid-item label="调换前规格" path="dailyplanBeforeSpec">
<n-space vertical>
<n-input-number
@ -258,17 +258,17 @@ const data = ref<dailyInspectionPlan.TableList[]>([]);
const columns: Ref<DataTableColumns<dailyInspectionPlan.TableList>> = ref([
{
title: 'QB机台',
title: '机台',
key: 'dailyplanDevice',
align: 'center',
width: 100
},
{
title: '轴号',
key: 'dailyplanAxle',
align: 'center',
width: 100
},
// {
// title: '',
// key: 'dailyplanAxle',
// align: 'center',
// width: 100
// },
{
title: '换规前规格',
key: 'dailyplanBeforeSpec',

@ -0,0 +1,404 @@
<template>
<div>
<my-card title="搜索">
<n-form inline>
<n-form-item label="供应商全称">
<n-input v-model:value="searchForm.supplierName" placeholder="请输入供应商全称" />
</n-form-item>
<n-form-item label="名称">
<n-input v-model:value="searchForm.name" 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 type="info" size="small" class="mr-10px" @click="addOrEdit(0)">
<icon-mdi-add />
新增
</n-button>
<CxColumns v-model:columns="columns" />
</div>
</template>
<n-data-table
:data="data"
:loading="loading"
:columns="columns"
:scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table>
</my-card>
<my-dialog
v-model:show="show"
:title="addOrEditForm.id ? '编辑联系人' : '新增联系人'"
width="900px"
@cancel="show = false"
@submit="submit"
>
<template #content>
<div>
<n-form
ref="formModel"
style="width: 800px"
:rules="rules"
:model="addOrEditForm"
label-placement="left"
label-width="120px"
>
<n-grid :cols="2" :x-gap="20">
<n-form-item-grid-item label="供应商全称" path="supplierName">
<n-input v-model:value="addOrEditForm.supplierName" placeholder="请输入供应商全称" />
</n-form-item-grid-item>
<n-form-item-grid-item label="名称" path="name">
<n-input v-model:value="addOrEditForm.name" placeholder="请输入联系人名称" />
</n-form-item-grid-item>
<n-form-item-grid-item label="职位" path="position">
<n-input v-model:value="addOrEditForm.position" placeholder="请输入联系人职位" />
</n-form-item-grid-item>
<n-form-item-grid-item label="电话">
<n-input v-model:value="addOrEditForm.phone" placeholder="请输入职务" />
</n-form-item-grid-item>
<n-form-item-grid-item label="邮箱">
<n-input v-model:value="addOrEditForm.email" placeholder="请输入邮箱" />
</n-form-item-grid-item>
<n-form-item-grid-item label="地址">
<n-input v-model:value="addOrEditForm.address" 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 { ref, onMounted } from 'vue';
import type { FormInst, DataTableColumns } from 'naive-ui';
// import { useDialog } from 'naive-ui';
import { createRequiredFormRule } from '@/utils';
import { dataTableConfig } from '@/config/dataTableConfig';
import { useResetSearch } from '~/src/utils/common/searchReset';
import { useLoading } from '~/src/hooks/index';
const linkmanList = ref<Array<any>>([
{
id: 8,
supplierName: '江西中爱',
name: '吴正爱',
address: '江西省鹰潭市余江区',
phone: '18606617777',
position: '销售',
email: '405871887@qq.com'
},
{
id: 3,
supplierName: '金亮',
name: '刘忠亮',
phone: '18151618656',
position: '销售',
email: '1276085660@qq.com',
address: '安徽省淮南市寿县大顺镇工业集中区'
},
{
id: 4,
supplierName: '金余',
name: '池仁昌',
phone: '13667019229',
position: '销售',
email: '290588860@qq.com',
address: '江西省鹰潭市余江县'
},
{
id: 1,
supplierName: '集美',
name: '李授钱',
position: '销售',
phone: '021-68873368',
email: 'info@gmay.com.cn',
address: '上海市'
},
{
id: 2,
supplierName: '温州启诚',
name: '冯永故',
phone: '15888663672',
position: '销售',
email: '15888663672@qq.com',
address: '浙江省温州市鹿城区'
},
{
id: 5,
supplierName: '华意',
name: '柴茂根',
phone: '15070935774',
position: '销售',
email: '1054894481@qq.com',
address: '浙江省杭州市余杭区'
},
{
id: 6,
supplierName: '中奥',
name: '陆韵',
phone: '13758283096',
position: '销售',
email: 'huangyp@chinaoly.com',
address: '浙江省杭州市拱墅区'
},
{
id: 7,
supplierName: '玉环凯达',
name: '黄德凯',
phone: '0576-89906355',
position: '销售',
email: 'Y033@163.com',
address: '浙江省玉环市'
}
]);
const { searchForm, reset } = useResetSearch({
pageNum: 1,
pageSize: 10,
total: 0,
supplierName: '',
name: ''
});
const addOrEditForm = ref({
id: null,
supplierName: '',
name: '',
position: '',
phone: '',
email: '',
address: ''
});
const rules = {
supplierName: createRequiredFormRule('请输入供应商全称'),
name: createRequiredFormRule('请输入名称')
};
const formModel = ref<FormInst | null>(null);
const addOrEditType = ref<number>(0); // 0 : 1 :
const show = ref<boolean>(false);
const { loading, startLoading, endLoading } = useLoading();
const data = ref<contactPerson.TableList[]>([]);
const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
{
title: '序号',
key: 'index',
align: 'center',
render: (_row, index) => index + 1,
width: 100
},
{
title: '供应商全称',
key: 'supplierName',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
}
},
{
title: '名称',
key: 'name',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
}
},
{
title: '职位',
key: 'position',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
}
},
{
title: '电话',
key: 'phone',
align: 'center',
width: 120
},
{
title: '邮箱',
key: 'email',
align: 'center',
width: 120
},
{
title: '地址',
key: 'address',
align: 'center',
width: 120
},
{
title: '操作',
key: 'actions',
width: 180,
align: 'center',
fixed: 'right',
render: row => {
return (
<n-space justify={'center'}>
<n-button
attr-type="button"
size={'small'}
type="warning"
onClick={() => {
addOrEdit(1, row);
}}
>
<icon-mdi-edit />
编辑
</n-button>
<n-button
type="error"
size={'small'}
onClick={() => {
console.log('1');
}}
>
<icon-mdi-delete />
删除
</n-button>
</n-space>
);
}
}
]);
// function handleUpdateValue(val, option) {
// console.log('val ==>', val);
// addOrEditForm.value.clientName = option.clientName;
// addOrEditForm.value.clientCode = option.clientCode;
// }
function addOrEdit(num: number, row?: contactPerson.TableList) {
addOrEditType.value = num;
show.value = true;
addOrEditForm.value = {
id: null,
supplierName: '',
name: '',
position: '',
phone: '',
email: '',
address: ''
};
if (num === 1) {
if (!row) return;
for (const key in addOrEditForm.value) {
if (row[key] || row[key] === '0') {
addOrEditForm.value[key] = row[key];
}
}
}
}
// function handleDeleteItemType(id: number) {
// const d = dialog.warning({
// title: '',
// content: '?',
// positiveText: '',
// negativeText: '',
// onPositiveClick: () => {
// d.loading = true;
// return new Promise(resolve => {
// deleteCrmContactPerson(id).then(res => {
// if (res.code === 200) {
// init();
// window.$message?.success('');
// }
// resolve(true);
// });
// });
// }
// });
// }
function submitSame(func: any, msg: string): void {
func(addOrEditForm.value).then(res => {
if (res.code === 200) {
linkmanList.value.unshift(addOrEditForm.value);
show.value = false;
window.$message?.success(msg);
init();
}
});
}
function add() {
console.log('add');
return new Promise(reslove => {
reslove({ code: 200 });
});
}
function edit() {
console.log('edit');
}
function submit(): void {
if (!formModel.value) return;
formModel.value.validate(errors => {
if (!errors) {
if (addOrEditType.value === 0) {
submitSame(add, '添加成功');
} else {
submitSame(edit, '编辑成功');
}
}
});
}
function handleSearch() {
init();
}
function handleReset() {
reset();
init();
}
function init() {
startLoading();
setTimeout(() => {
// for (const key in addOrEditForm.value) {
// if (Object.hasOwn(addOrEditForm.value, key)) {
// if ()
// }
// }
data.value = linkmanList.value;
endLoading();
}, 300);
}
onMounted(() => {
init();
});
</script>
<style lang="scss" scoped></style>

@ -0,0 +1,424 @@
<template>
<div>
<my-card title="搜索">
<n-form inline>
<n-form-item label="供应商全称">
<n-input v-model:value="searchForm.supplierName" placeholder="请输入供应商全称" />
</n-form-item>
<n-form-item label="名称">
<n-input v-model:value="searchForm.name" 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 type="info" size="small" class="mr-10px" @click="addOrEdit(0)">
<icon-mdi-add />
新增
</n-button>
<CxColumns v-model:columns="columns" />
</div>
</template>
<n-data-table
:data="data"
:loading="loading"
:columns="columns"
:scroll-x="dataTableConfig.scrollWidth(columns)"
></n-data-table>
</my-card>
<my-dialog
v-model:show="show"
:title="addOrEditForm.id ? '编辑注册' : '新增注册'"
width="900px"
@cancel="show = false"
@submit="submit"
>
<template #content>
<div>
<n-form
ref="formModel"
style="width: 800px"
:rules="rules"
:model="addOrEditForm"
label-placement="left"
label-width="120px"
>
<n-grid :cols="2" :x-gap="20">
<n-form-item-grid-item label="供应商全称" path="supplierName">
<n-input v-model:value="addOrEditForm.supplierName" placeholder="请输入供应商全称" />
</n-form-item-grid-item>
<n-form-item-grid-item label="名称" path="name">
<n-input v-model:value="addOrEditForm.name" placeholder="请输入名称" />
</n-form-item-grid-item>
<n-form-item-grid-item label="开户行" path="bank">
<n-input v-model:value="addOrEditForm.bank" placeholder="请输入开户行" />
</n-form-item-grid-item>
<n-form-item-grid-item label="地址">
<n-input v-model:value="addOrEditForm.address" placeholder="请输入地址" />
</n-form-item-grid-item>
<n-form-item-grid-item label="主要供应产品">
<n-input v-model:value="addOrEditForm.product" placeholder="请输入主要供应产品" />
</n-form-item-grid-item>
<n-form-item-grid-item label="稅种">
<n-input v-model:value="addOrEditForm.totalTax" placeholder="请输入稅种" />
</n-form-item-grid-item>
<n-form-item-grid-item label="税率">
<n-input v-model:value="addOrEditForm.taxRate" 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 { ref, onMounted } from 'vue';
import type { FormInst, DataTableColumns } from 'naive-ui';
// import { useDialog } from 'naive-ui';
import { createRequiredFormRule } from '@/utils';
import { dataTableConfig } from '@/config/dataTableConfig';
import { useResetSearch } from '~/src/utils/common/searchReset';
import { useLoading } from '~/src/hooks/index';
const linkmanList = ref<Array<any>>([
{
id: 1,
supplierName: '江西中爱',
name: '江西中爱',
address: '江西省鹰潭市余江区',
bank: '中国银行',
product: '五金配件',
totalTax: '增值税',
taxRate: '13%'
},
{
id: 2,
supplierName: '金亮',
name: '金亮',
address: '安徽省淮南市寿县大顺镇工业集中区',
bank: '中国建设银行',
product: '汇川变频器',
totalTax: '印花税,增值税',
taxRate: '13%'
},
{
id: 3,
supplierName: '金余',
name: '金余',
address: '江西省鹰潭市',
bank: '中国银行',
product: '拉丝模具、镀锡模、绞线模',
totalTax: '印花税,土地使用税,车船使用税',
taxRate: '13%'
},
{
id: 4,
supplierName: '集美',
name: '集美',
address: '上海市',
bank: '浦发银行',
product: '单孔模具、I型模具维修',
totalTax: '增值税,土地使用税',
taxRate: '13%'
},
{
id: 5,
supplierName: '温州启诚',
name: '温州启诚',
address: '浙江省温州市',
bank: '中国工商银行',
product: '5寸、8寸、9寸线轴',
totalTax: '印花税,土地使用税',
taxRate: '13%'
},
{
id: 6,
supplierName: '华意',
name: '华意',
address: '浙江省杭州市',
bank: '中国银行',
product: '拉丝模具租赁、钻石镀锡模',
totalTax: '印花税,土地使用税,车船使用税',
taxRate: '13%'
},
{
id: 7,
supplierName: '中奥',
name: '中奥',
address: '浙江省杭州市',
bank: '‌中国建设银行',
product: '5寸、8寸、9寸线轴',
totalTax: '增值税普通发票',
taxRate: '9%'
},
{
id: 8,
supplierName: '玉环凯达',
name: '玉环凯达',
address: '浙江省玉环市',
bank: '‌中国建设银行',
product: '5寸、8寸、9寸线轴',
totalTax: '400#线盘',
taxRate: '13%'
}
]);
const { searchForm, reset } = useResetSearch({
pageNum: 1,
pageSize: 10,
total: 0,
supplierName: '',
name: ''
});
const addOrEditForm = ref({
id: null,
supplierName: '',
name: '',
address: '',
bank: '',
product: '',
totalTax: '',
taxRate: ''
});
const rules = {
supplierName: createRequiredFormRule('请输入供应商全称'),
name: createRequiredFormRule('请输入名称')
};
const formModel = ref<FormInst | null>(null);
const addOrEditType = ref<number>(0); // 0 : 1 :
const show = ref<boolean>(false);
const { loading, startLoading, endLoading } = useLoading();
const data = ref<contactPerson.TableList[]>([]);
const columns: Ref<DataTableColumns<contactPerson.TableList>> = ref([
{
title: '序号',
key: 'index',
align: 'center',
render: (_row, index) => index + 1,
width: 100
},
{
title: '供应商全称',
key: 'supplierName',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
}
},
{
title: '简称',
key: 'name',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
}
},
{
title: '开户行',
key: 'bank',
align: 'center',
width: 180,
ellipsis: {
tooltip: true
}
},
{
title: '地址',
key: 'address',
align: 'center',
width: 120
},
{
title: '主要供应产品',
key: 'product',
align: 'center',
width: 120
},
{
title: '稅种',
key: 'totalTax',
align: 'center',
width: 120
},
{
title: '税率',
key: 'taxRate',
align: 'center',
width: 120
},
{
title: '操作',
key: 'actions',
width: 180,
align: 'center',
fixed: 'right',
render: row => {
return (
<n-space justify={'center'}>
<n-button
attr-type="button"
size={'small'}
type="warning"
onClick={() => {
addOrEdit(1, row);
}}
>
<icon-mdi-edit />
编辑
</n-button>
<n-button
type="error"
size={'small'}
onClick={() => {
console.log('1');
}}
>
<icon-mdi-delete />
删除
</n-button>
</n-space>
);
}
}
]);
// function handleUpdateValue(val, option) {
// console.log('val ==>', val);
// addOrEditForm.value.clientName = option.clientName;
// addOrEditForm.value.clientCode = option.clientCode;
// }
function addOrEdit(num: number, row?: contactPerson.TableList) {
addOrEditType.value = num;
show.value = true;
addOrEditForm.value = {
id: null,
supplierName: '',
name: '',
address: '',
bank: '',
product: '',
totalTax: '',
taxRate: ''
};
if (num === 1) {
if (!row) return;
for (const key in addOrEditForm.value) {
if (row[key] || row[key] === '0') {
addOrEditForm.value[key] = row[key];
}
}
}
}
// function handleDeleteItemType(id: number) {
// const d = dialog.warning({
// title: '',
// content: '?',
// positiveText: '',
// negativeText: '',
// onPositiveClick: () => {
// d.loading = true;
// return new Promise(resolve => {
// deleteCrmContactPerson(id).then(res => {
// if (res.code === 200) {
// init();
// window.$message?.success('');
// }
// resolve(true);
// });
// });
// }
// });
// }
function submitSame(func: any, msg: string): void {
func(addOrEditForm.value).then(res => {
if (res.code === 200) {
linkmanList.value.unshift(addOrEditForm.value);
show.value = false;
window.$message?.success(msg);
init();
}
});
}
function add() {
console.log('add');
return new Promise(reslove => {
reslove({ code: 200 });
});
}
function edit() {
console.log('edit');
}
function submit(): void {
if (!formModel.value) return;
formModel.value.validate(errors => {
if (!errors) {
if (addOrEditType.value === 0) {
submitSame(add, '添加成功');
} else {
submitSame(edit, '编辑成功');
}
}
});
}
function handleSearch() {
init();
}
function handleReset() {
reset();
init();
}
function init() {
startLoading();
setTimeout(() => {
// for (const key in addOrEditForm.value) {
// if (Object.hasOwn(addOrEditForm.value, key)) {
// if ()
// }
// }
data.value = linkmanList.value;
endLoading();
}, 300);
}
onMounted(() => {
init();
});
</script>
<style lang="scss" scoped></style>

@ -2,20 +2,20 @@
<div>
<my-card title="搜索条件" search>
<n-form inline>
<n-form-item label="筛选">
<!-- <n-form-item label="筛选">
<n-button class="mr-10px" :type="searchForm.type === '1' ? 'primary' : 'default'" @click="selectCondition()">
线盘
</n-button>
</n-form-item>
</n-form-item> -->
<n-form-item label="型号">
<n-input v-model:value="searchForm.model" placeholder="请输入型号" />
</n-form-item>
<n-form-item label="规格">
<n-input v-model:value="searchForm.specification" placeholder="请输入规格" />
</n-form-item>
<n-form-item v-show="searchForm.type === '1'" label="线盘">
<!-- <n-form-item v-show="searchForm.type === '1'" label="线盘">
<n-input v-model:value="searchForm.wireDisc" placeholder="请输入线盘" />
</n-form-item>
</n-form-item> -->
<n-form-item label="预警状态">
<n-select
v-model:value="searchForm.warningValue"
@ -276,12 +276,12 @@ const columns: Ref<DataTableColumns<finishedProductInventory.tableList>> = ref([
width: 100,
align: 'center'
},
{
title: '线盘',
key: 'wireDisc',
width: 200,
align: 'center'
},
// {
// title: '线',
// key: 'wireDisc',
// width: 200,
// align: 'center'
// },
{
title: '箱数',
key: 'totalNumber',
@ -441,19 +441,19 @@ function warningStatus(status: string) {
}
}
function selectCondition() {
if (!searchRequestComplete.value) {
window.$message?.warning('搜索中请稍等');
return;
}
if (searchForm.value.type === '1') {
searchForm.value.type = '0';
} else {
searchForm.value.type = '1';
}
init();
}
// function selectCondition() {
// if (!searchRequestComplete.value) {
// window.$message?.warning('');
// return;
// }
// if (searchForm.value.type === '1') {
// searchForm.value.type = '0';
// } else {
// searchForm.value.type = '1';
// }
// init();
// }
// function clearData() {
// const d = dialog.warning({

@ -127,6 +127,7 @@ import {
outWmsTakeStock,
deleteWmsTakeStock
} from '@/service/api/storage/stockTaking/index';
import { getDictDataList } from '@/service/api/system/dictData';
import { useLoading } from '~/src/hooks';
import { useResetSearch } from '~/src/utils/common/searchReset';
type DataType = {
@ -155,7 +156,7 @@ type DataType = {
type selectList = {
label: string;
value: number;
value: string;
};
const { loading, startLoading, endLoading } = useLoading();
const { searchForm, reset } = useResetSearch({
@ -169,11 +170,7 @@ const { searchForm, reset } = useResetSearch({
itemName: '',
warehouseName: ''
});
const statusList = ref<Array<selectList>>([
{ label: '拉丝在制品', value: 0 },
{ label: '漆包在制品', value: 1 },
{ label: '油漆', value: 2 }
]);
const statusList = ref<Array<selectList>>([]);
const showDialog = ref<boolean>(false);
const requestMiddle = ref<boolean>(false);
const addForm = ref<{
@ -350,16 +347,18 @@ function handleReset() {
}
function getStatusName(wmsType: string) {
switch (wmsType) {
case '0':
return '拉丝在制品';
case '1':
return '漆包在制品';
case '2':
return '油漆';
default:
return '';
}
return statusList.value.find(item => item.value === wmsType)?.label;
}
async function getList() {
await getDictDataList({ dictType: 'material_type', pageSize: 999 }).then(res => {
if (res.code === 200) {
const resultDat = res?.rows || [];
for (const item of resultDat) {
statusList.value.push({ label: item.dictLabel, value: item.dictValue });
}
}
});
}
function init() {
@ -373,7 +372,8 @@ function init() {
}
});
}
onMounted(() => {
onMounted(async () => {
await getList();
init();
});
</script>

@ -59,13 +59,13 @@
:style="{ width: formItemWidth }"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="关联漆包机机型" path="enanellingWorkbenchId">
<n-form-item-grid-item label="关联机型" path="enanellingWorkbenchId">
<n-space vertical>
<n-select
v-model:value="addForm.enanellingWorkbenchId"
:options="enanellingWorkbenchList"
:style="{ width: formItemWidth }"
placeholder="请选择关联漆包机机型"
placeholder="请选择关联机型"
filterable
@update:value="handleUpdateValue"
></n-select>
@ -87,7 +87,7 @@
:headers="{ Authorization: 'Bearer ' + useAuthStore().token }"
:default-upload="true"
:max="1"
:action="baseurl + '/file/upload'"
:action="baseurl + 'file/upload'"
:on-error="errorFile"
@finish="finish"
@remove="removeFile"
@ -173,7 +173,7 @@ const enanellingWorkbenchList = ref<SelectMixedOption[]>([]);
const rules = {
operationName: createRequiredFormRule('请输入操作规范名称'),
operationCode: createRequiredFormRule('请输入操作规范编码'),
enanellingWorkbenchId: createRequiredFormRule('请选择关联漆包机机型'),
enanellingWorkbenchId: createRequiredFormRule('请选择关联机型'),
ableTime: createRequiredFormRule('请输入生效日期'),
filePath: createRequiredFormRule('请选择上传文件')
};
@ -201,7 +201,7 @@ const columns: Ref<DataTableColumns<operationInstruction.columns>> = ref([
width: 100
},
{
title: '关联漆包机机型',
title: '关联机型',
key: 'enanellingWorkbenchName',
align: 'center',
width: 100

@ -59,13 +59,13 @@
:style="{ width: formItemWidth }"
/>
</n-form-item-grid-item>
<n-form-item-grid-item label="关联漆包机机型" path="enanellingWorkbenchId">
<n-form-item-grid-item label="关联机型" path="enanellingWorkbenchId">
<n-space vertical>
<n-select
v-model:value="addForm.enanellingWorkbenchId"
:options="enanellingWorkbenchList"
:style="{ width: formItemWidth }"
placeholder="请选择关联漆包机机型"
placeholder="请选择关联机型"
filterable
@update:value="handleUpdateValue"
></n-select>
@ -168,7 +168,7 @@ const enanellingWorkbenchList = ref<SelectMixedOption[]>([]);
const rules = {
operationName: createRequiredFormRule('请输入作业指导书名称'),
operationCode: createRequiredFormRule('请输入作业指导书编码'),
enanellingWorkbenchId: createRequiredFormRule('请选择关联漆包机机型'),
enanellingWorkbenchId: createRequiredFormRule('请选择关联机型'),
ableTime: createRequiredFormRule('请输入生效日期'),
filePath: createRequiredFormRule('请选择上传文件')
};
@ -196,7 +196,7 @@ const columns: Ref<DataTableColumns<operationInstruction.columns>> = ref([
width: 100
},
{
title: '关联漆包机机型',
title: '关联机型',
key: 'enanellingWorkbenchName',
align: 'center',
width: 100

Loading…
Cancel
Save