提交代码
This commit is contained in:
parent
f717acb6ec
commit
0ef48c817b
@ -1,5 +1,4 @@
|
|||||||
import { request} from '@/utils/request'
|
import { request} from '@/utils/request'
|
||||||
import { update } from 'three/examples/jsm/libs/tween.module.js'
|
|
||||||
|
|
||||||
export interface Device{
|
export interface Device{
|
||||||
id:number,
|
id:number,
|
||||||
@ -133,6 +132,7 @@ export interface DocumentEntity {
|
|||||||
name?:string,
|
name?:string,
|
||||||
code?:string,
|
code?:string,
|
||||||
fileId?:number,
|
fileId?:number,
|
||||||
|
type?:number
|
||||||
}
|
}
|
||||||
|
|
||||||
export const deviceApi = {
|
export const deviceApi = {
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
|
import {ArrowDown, ArrowUp, RefreshOutline, SearchOutline} from "@vicons/ionicons5";
|
||||||
import {NButton, NIcon, NSpace} from "naive-ui";
|
import {NButton, NIcon, NSpace} from "naive-ui";
|
||||||
import {onMounted, reactive, ref} from "vue";
|
import {onMounted, reactive, ref} from "vue";
|
||||||
import { issueRecordApi,IssueRecord } from '@/api/issuerecord.ts'
|
import { issueRecordApi } from '@/api/issuerecord.ts'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
deviceId:Number
|
deviceId:Number
|
||||||
@ -72,7 +72,7 @@ const columns = [
|
|||||||
{
|
{
|
||||||
title: '下发类型',
|
title: '下发类型',
|
||||||
key: 'issueType',
|
key: 'issueType',
|
||||||
render(row) {
|
render(row:any) {
|
||||||
var opt = row.issueType
|
var opt = row.issueType
|
||||||
if(opt == 0) return '图纸'
|
if(opt == 0) return '图纸'
|
||||||
if(opt == 1) return '文件'
|
if(opt == 1) return '文件'
|
||||||
@ -83,7 +83,7 @@ const columns = [
|
|||||||
{
|
{
|
||||||
title: '下发状态',
|
title: '下发状态',
|
||||||
key: 'status',
|
key: 'status',
|
||||||
render(row) {
|
render(row:any) {
|
||||||
var opt = row.status
|
var opt = row.status
|
||||||
if(opt == 0) return '下发失败'
|
if(opt == 0) return '下发失败'
|
||||||
if(opt == 1) return '下发成功'
|
if(opt == 1) return '下发成功'
|
||||||
@ -93,12 +93,6 @@ const columns = [
|
|||||||
title: '下发时间',
|
title: '下发时间',
|
||||||
key: 'issueTime'
|
key: 'issueTime'
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// title: '下发文件',
|
|
||||||
// render(row) {
|
|
||||||
// return row.
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: '备注',
|
title: '备注',
|
||||||
key: 'remark'
|
key: 'remark'
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import {onMounted, reactive, ref} from "vue";
|
|||||||
import { deviceApi, Device} from '@/api/device.ts'
|
import { deviceApi, Device} from '@/api/device.ts'
|
||||||
import {dictDataApi} from "@/api/org.ts";
|
import {dictDataApi} from "@/api/org.ts";
|
||||||
import {userApi,SysUser} from "@/api/system.ts";
|
import {userApi,SysUser} from "@/api/system.ts";
|
||||||
import { deviceOperationLogApi,type DeviceOperationLog } from '@/api/deviceOperationLog.ts'
|
import { deviceOperationLogApi } from '@/api/deviceOperationLog.ts'
|
||||||
|
|
||||||
const pagination = reactive({
|
const pagination = reactive({
|
||||||
page: 1,
|
page: 1,
|
||||||
@ -121,7 +121,7 @@ const columns = [
|
|||||||
{
|
{
|
||||||
title: '数据来源',
|
title: '数据来源',
|
||||||
key: 'source',
|
key: 'source',
|
||||||
render(row) {
|
render(row:any) {
|
||||||
var opt = row.source
|
var opt = row.source
|
||||||
if(opt == 1) return '终端'
|
if(opt == 1) return '终端'
|
||||||
if(opt == 2) return '后台'
|
if(opt == 2) return '后台'
|
||||||
|
|||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
|
||||||
import { ref, reactive, h, defineProps, onMounted, watch} from 'vue';
|
import { reactive, defineProps, onMounted, watch} from 'vue';
|
||||||
import { info } from '@/api/production'
|
import { info } from '@/api/production'
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|||||||
@ -738,7 +738,7 @@ import {
|
|||||||
type OrderProcessPlanVO,
|
type OrderProcessPlanVO,
|
||||||
type ProcessPlanItemVO,
|
type ProcessPlanItemVO,
|
||||||
type OutsourcingOptions,
|
type OutsourcingOptions,
|
||||||
type OutsourcingProcessOption, OrderProcessPlan,
|
type OutsourcingProcessOption,
|
||||||
} from '@/api/orderProcessPlan'
|
} from '@/api/orderProcessPlan'
|
||||||
import { useUserStore } from '@/stores/user'
|
import { useUserStore } from '@/stores/user'
|
||||||
import { deptApi } from '@/api/org'
|
import { deptApi } from '@/api/org'
|
||||||
@ -881,7 +881,7 @@ const planForm = ref<OrderProcessPlanVO>({})
|
|||||||
async function openLeftoverMaterialModel(order:ProcessPlanItemVO,process?:OrderProcessPlanVO) {
|
async function openLeftoverMaterialModel(order:ProcessPlanItemVO,process?:OrderProcessPlanVO) {
|
||||||
|
|
||||||
//补料记录数量
|
//补料记录数量
|
||||||
const res = await refillRecordApi.getRefillNumByProcessId(process.planId);
|
const res = await refillRecordApi.getRefillNumByProcessId(process?.planId);
|
||||||
leftMaterialVisible.value = true
|
leftMaterialVisible.value = true
|
||||||
leftMaterialOrder.value = order
|
leftMaterialOrder.value = order
|
||||||
leftMaterialPlan.value = process
|
leftMaterialPlan.value = process
|
||||||
@ -1513,7 +1513,7 @@ async function handleImportUpload({ file }: UploadCustomRequestOptions) {
|
|||||||
|
|
||||||
const orderItemId = ref<number>(null)
|
const orderItemId = ref<number>(null)
|
||||||
|
|
||||||
function openReportDetail(order) {
|
function openReportDetail(order:OrderProcessPlanVO) {
|
||||||
submitModalVisible.value = true
|
submitModalVisible.value = true
|
||||||
orderItemId.value = order.orderItemId
|
orderItemId.value = order.orderItemId
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:any) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
@update:page="handlePageChange"
|
@update:page="handlePageChange"
|
||||||
@update:page-size="handlePageSizeChange"
|
@update:page-size="handlePageSizeChange"
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:any) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
@update:page="handlePageChange"
|
@update:page="handlePageChange"
|
||||||
@update:page-size="handlePageSizeChange"
|
@update:page-size="handlePageSizeChange"
|
||||||
@ -135,7 +135,7 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, h, onMounted } from 'vue'
|
import { ref, reactive, h, onMounted } from 'vue'
|
||||||
import { NButton, NSwitch , NSpace, NTag, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
import { NButton, NSwitch , NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
||||||
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
|
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
|
||||||
import { productApi, type Product } from '@/api/product'
|
import { productApi, type Product } from '@/api/product'
|
||||||
import { dictDataApi } from '@/api/org'
|
import { dictDataApi } from '@/api/org'
|
||||||
@ -383,26 +383,6 @@ function handleBatchDelete() {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出
|
|
||||||
async function handleExport() {
|
|
||||||
try {
|
|
||||||
const params: Record<string, any> = {}
|
|
||||||
if (selectedIds.value.length > 0) params.ids = selectedIds.value
|
|
||||||
if (searchForm.id != null) params.id = searchForm.id
|
|
||||||
if (searchForm.name) params.name = searchForm.name
|
|
||||||
if (searchForm.status != null) params.status = searchForm.status
|
|
||||||
const blob = await productApi.export(params)
|
|
||||||
const url = window.URL.createObjectURL(blob)
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = url
|
|
||||||
link.download = 'Product数据.xlsx'
|
|
||||||
link.click()
|
|
||||||
window.URL.revokeObjectURL(url)
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 下载导入模板
|
// 下载导入模板
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
try {
|
try {
|
||||||
@ -418,7 +398,7 @@ async function handleDownloadTemplate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleChangeStatus(row: SysJob, status: number) {
|
async function handleChangeStatus(row: any, status: number) {
|
||||||
row.status = status;
|
row.status = status;
|
||||||
Object.assign(formData, row)
|
Object.assign(formData, row)
|
||||||
handleSubmit();
|
handleSubmit();
|
||||||
|
|||||||
@ -37,10 +37,6 @@
|
|||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
||||||
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
||||||
</n-button>
|
</n-button>
|
||||||
<!-- <n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
|
|
||||||
<template #icon><n-icon><TrashOutline /></n-icon></template>
|
|
||||||
删除
|
|
||||||
</n-button> -->
|
|
||||||
</n-space>
|
</n-space>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -49,7 +45,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:any) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
v-model:checked-row-keys="selectedIds"
|
v-model:checked-row-keys="selectedIds"
|
||||||
/>
|
/>
|
||||||
@ -477,18 +473,12 @@ async function handleEdit(row: QcItem) {
|
|||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
|
|
||||||
let plans = []
|
let plans = []
|
||||||
console.log(fileList.value);
|
|
||||||
|
|
||||||
fileList.value.forEach(item=>{
|
fileList.value.forEach(item=>{
|
||||||
plans.push(item.url)
|
plans.push(item.url)
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log();
|
|
||||||
|
|
||||||
formData.plans = plans.join(",")
|
formData.plans = plans.join(",")
|
||||||
|
|
||||||
console.log(formData);
|
|
||||||
|
|
||||||
await formRef.value?.validate()
|
await formRef.value?.validate()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -621,16 +611,13 @@ const handleRemove = (data: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//显示抽屉
|
//显示抽屉
|
||||||
const handlePlans = async (row) => {
|
const handlePlans = async (row:any) => {
|
||||||
title.value = row.name + "质检方案"
|
title.value = row.name + "质检方案"
|
||||||
plansShow.value = true
|
plansShow.value = true
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 打印入参,确认传给后端的 plans 是否有值
|
|
||||||
console.log('请求参数 plans:', row.plans)
|
|
||||||
const res = await qcItemApi.getPlansFiles({ plans: row.plans })
|
const res = await qcItemApi.getPlansFiles({ plans: row.plans })
|
||||||
sysFileList.value = res
|
sysFileList.value = res
|
||||||
console.log('接口返回成功数据:', res);
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// 打印完整错误,看是401/404/500/参数问题
|
// 打印完整错误,看是401/404/500/参数问题
|
||||||
console.error('请求失败详情:', err)
|
console.error('请求失败详情:', err)
|
||||||
@ -689,7 +676,7 @@ async function downloadPlans(row: any) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//关联工序抽屉
|
//关联工序抽屉
|
||||||
function handleProccess(row) {
|
function handleProccess(row:any) {
|
||||||
relatePagination.page = 1
|
relatePagination.page = 1
|
||||||
relatePagination.pageSize = 10
|
relatePagination.pageSize = 10
|
||||||
relateLoading.value = true
|
relateLoading.value = true
|
||||||
@ -699,7 +686,7 @@ function handleProccess(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async function getProcessList(id) {
|
async function getProcessList(id:number) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await basicProcessPlanApi.list({
|
const res = await basicProcessPlanApi.list({
|
||||||
@ -754,7 +741,6 @@ const loadCreateApi = async ()=>{
|
|||||||
qcProcessRelate.processIds = selectedProcessIds.value
|
qcProcessRelate.processIds = selectedProcessIds.value
|
||||||
qcProcessRelate.page = relatePagination.page
|
qcProcessRelate.page = relatePagination.page
|
||||||
qcProcessRelate.pageSize = relatePagination.pageSize
|
qcProcessRelate.pageSize = relatePagination.pageSize
|
||||||
console.log(qcProcessRelate);
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
await qcitemProcessApi.create(qcProcessRelate);
|
await qcitemProcessApi.create(qcProcessRelate);
|
||||||
|
|||||||
@ -120,22 +120,6 @@ const columns: DataTableColumns<QcResultDetail> = [
|
|||||||
{ title: '备注/原因描述', key: 'remark' },
|
{ title: '备注/原因描述', key: 'remark' },
|
||||||
{ title: '创建时间', key: 'createTime', width: 180 },
|
{ title: '创建时间', key: 'createTime', width: 180 },
|
||||||
{ title: '更新时间', key: 'updateTime', width: 180 },
|
{ title: '更新时间', key: 'updateTime', width: 180 },
|
||||||
// {
|
|
||||||
// title: '操作',
|
|
||||||
// key: 'actions',
|
|
||||||
// width: 140,
|
|
||||||
// fixed: 'right',
|
|
||||||
// render(row) {
|
|
||||||
// return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
|
|
||||||
// h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
|
||||||
// default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
|
||||||
// }),
|
|
||||||
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
|
||||||
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
|
||||||
// })
|
|
||||||
// ])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// 加载数据
|
// 加载数据
|
||||||
|
|||||||
@ -16,6 +16,9 @@
|
|||||||
style="width: 200px"
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
<n-form-item label="派工编号">
|
||||||
|
<n-input v-model:value="searchForm.assingCode" placeholder="请输入派工编号" clearable />
|
||||||
|
</n-form-item>
|
||||||
<n-form-item>
|
<n-form-item>
|
||||||
<n-space>
|
<n-space>
|
||||||
<n-button type="primary" @click="handleSearch">
|
<n-button type="primary" @click="handleSearch">
|
||||||
@ -31,27 +34,6 @@
|
|||||||
</n-form>
|
</n-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 工具栏 -->
|
|
||||||
<!-- <div class="table-toolbar">
|
|
||||||
<n-space>
|
|
||||||
<n-button type="primary" @click="handleAdd">
|
|
||||||
<template #icon><n-icon><AddOutline /></n-icon></template>
|
|
||||||
新增
|
|
||||||
</n-button>
|
|
||||||
<n-button @click="importModalVisible = true">
|
|
||||||
<template #icon><n-icon><CloudUploadOutline /></n-icon></template>
|
|
||||||
导入
|
|
||||||
</n-button>
|
|
||||||
<n-button @click="handleExport">
|
|
||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
|
||||||
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
|
||||||
</n-button>
|
|
||||||
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete">
|
|
||||||
<template #icon><n-icon><TrashOutline /></n-icon></template>
|
|
||||||
删除
|
|
||||||
</n-button>
|
|
||||||
</n-space>
|
|
||||||
</div> -->
|
|
||||||
|
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<n-data-table
|
<n-data-table
|
||||||
@ -220,9 +202,7 @@
|
|||||||
:pagination="{ pageSize:4 }"
|
:pagination="{ pageSize:4 }"
|
||||||
/>
|
/>
|
||||||
</n-card>
|
</n-card>
|
||||||
<!-- <n-card title="追溯码" hoverable>-->
|
|
||||||
<!-- 追溯码:{{}}-->
|
|
||||||
<!-- </n-card>-->
|
|
||||||
</n-drawer>
|
</n-drawer>
|
||||||
|
|
||||||
<!-- 提交判定明细抽屉 -->
|
<!-- 提交判定明细抽屉 -->
|
||||||
@ -239,7 +219,6 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<n-space justify="center" style="width: 100%; margin-top: 16px;">
|
<n-space justify="center" style="width: 100%; margin-top: 16px;">
|
||||||
<!-- <n-button size="small" @click="handleReset">重置</n-button> -->
|
|
||||||
<n-button size="small" @click="showSubmitOuter = false">取消</n-button>
|
<n-button size="small" @click="showSubmitOuter = false">取消</n-button>
|
||||||
<n-button type="primary" size="small" @click="handleSubmitResultDetail">提交</n-button>
|
<n-button type="primary" size="small" @click="handleSubmitResultDetail">提交</n-button>
|
||||||
</n-space>
|
</n-space>
|
||||||
@ -280,14 +259,14 @@ import {
|
|||||||
} from 'naive-ui'
|
} from 'naive-ui'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline,
|
SearchOutline, RefreshOutline, CreateOutline, CloudUploadOutline, DownloadOutline,
|
||||||
EllipsisHorizontalOutline, ArrowDownOutline, ArrowUpOutline,ArchiveOutline as ArchiveIcon
|
EllipsisHorizontalOutline, ArrowDownOutline, ArrowUpOutline
|
||||||
} from '@vicons/ionicons5'
|
} from '@vicons/ionicons5'
|
||||||
import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting'
|
import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting'
|
||||||
import {assingReworkApi} from '@/api/assingRework'
|
import {assingReworkApi} from '@/api/assingRework'
|
||||||
import { dictDataApi } from '@/api/org'
|
import { dictDataApi } from '@/api/org'
|
||||||
|
|
||||||
import {qcResultDetailApi, type QcResultDetail} from "@/api/qcResultDetail.ts";
|
import { type QcResultDetail} from "@/api/qcResultDetail.ts";
|
||||||
import SumbitDetailCard1 from '@/components/SumbitDetailCard1.vue'
|
import SumbitDetailCard1 from '@/components/SumbitDetailCard1.vue'
|
||||||
|
|
||||||
import router from "@/router";
|
import router from "@/router";
|
||||||
@ -317,6 +296,7 @@ const pagination = reactive({
|
|||||||
const searchForm = reactive({
|
const searchForm = reactive({
|
||||||
qcNo: null as string | null,
|
qcNo: null as string | null,
|
||||||
status: null as number | null,
|
status: null as number | null,
|
||||||
|
assingCode: null as string | null
|
||||||
})
|
})
|
||||||
|
|
||||||
// 弹窗
|
// 弹窗
|
||||||
@ -330,13 +310,6 @@ const detailTitle = ref('')
|
|||||||
const infoIsCollapse = ref(false)
|
const infoIsCollapse = ref(false)
|
||||||
const detailIsCollapse = ref(false)
|
const detailIsCollapse = ref(false)
|
||||||
|
|
||||||
//提交判定明细
|
|
||||||
// const submitDetailModalVisible = ref(false)
|
|
||||||
const traceCodeShow = ref(false)
|
|
||||||
//提交明细/部分提交明细标识
|
|
||||||
const showTraceFlag = ref<Boolean>()
|
|
||||||
|
|
||||||
|
|
||||||
const customOrderKeys = [
|
const customOrderKeys = [
|
||||||
'materialCode',
|
'materialCode',
|
||||||
'materialName',
|
'materialName',
|
||||||
@ -503,11 +476,16 @@ const columns: DataTableColumns<QualityTesting> = [
|
|||||||
viewQualityTestingDetail(row)
|
viewQualityTestingDetail(row)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
row.assingCode
|
row.qcNo
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
title: '派工编号',
|
||||||
|
key: 'assingCode',
|
||||||
|
align: 'center',
|
||||||
|
minWidth: 150
|
||||||
|
}, {
|
||||||
title: '物料名称',
|
title: '物料名称',
|
||||||
key: 'materialName',
|
key: 'materialName',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
@ -519,25 +497,12 @@ const columns: DataTableColumns<QualityTesting> = [
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
minWidth: 120
|
minWidth: 120
|
||||||
},
|
},
|
||||||
// { title: '来源类型', key: 'sourceType',align: 'center',
|
|
||||||
// render(row) {
|
|
||||||
// const val = row.sourceType
|
|
||||||
// const opt = qcSourceTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
|
|
||||||
// if (!opt) return val ?? '-'
|
|
||||||
|
|
||||||
// return h(NTag, { type: opt.class, size: 'small' }, { default: () => opt.label })
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: '业务来源',
|
title: '业务来源',
|
||||||
key: 'businessName',
|
key: 'businessName',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
minWidth:100
|
minWidth:100
|
||||||
},
|
},
|
||||||
// { title: '来源业务ID(汇报单/派工单等)', key: 'sourceId' },
|
|
||||||
// { title: '关联生产订单ID', key: 'orderId' },
|
|
||||||
// { title: '关联工序计划ID', key: 'processId' },
|
|
||||||
// { title: '物料ID', key: 'itemId' },
|
|
||||||
{
|
{
|
||||||
title: '追溯码',
|
title: '追溯码',
|
||||||
key: 'traceCode',
|
key: 'traceCode',
|
||||||
@ -611,21 +576,12 @@ const columns: DataTableColumns<QualityTesting> = [
|
|||||||
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
|
||||||
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' 编辑']
|
||||||
}),
|
}),
|
||||||
// h(NButton, { size: 'small', quaternary: true, type: 'error', onClick: () => handleDelete(row) }, {
|
|
||||||
// default: () => [h(NIcon, null, { default: () => h(TrashOutline) }), ' 删除']
|
|
||||||
// }),
|
|
||||||
h(NDropdown, {
|
h(NDropdown, {
|
||||||
trigger: 'click', // 点击展开
|
trigger: 'click', // 点击展开
|
||||||
options: [
|
options: [
|
||||||
{ label: '查看详情', key: 'view' },
|
{ label: '查看详情', key: 'view' },
|
||||||
{ type: 'divider' }, // 分割线
|
{ type: 'divider' }, // 分割线
|
||||||
{ label: '提交判定明细', key: 'submitResultDetail',show:row.status == 1 },
|
{ label: '提交判定明细', key: 'submitResultDetail',show:row.status == 1 },
|
||||||
// { type: 'divider',show:row.status == 1 }, // 分割线
|
|
||||||
// { label: '提交部分判定明细', key: 'submitBFResultDetail',show:(row.status == 1 || row.status == 2) },
|
|
||||||
// { type: 'divider',show:(row.status == 1 || row.status == 2) }, // 分割线
|
|
||||||
// { label: '查询判定明细', key: 'queryResultDetail' },
|
|
||||||
// { type: 'divider' }, // 分割线
|
|
||||||
// { label: '质检撤回', key: 'cancelQuality' },
|
|
||||||
],
|
],
|
||||||
// 下拉菜单项点击事件
|
// 下拉菜单项点击事件
|
||||||
onSelect: (key: string) => {
|
onSelect: (key: string) => {
|
||||||
@ -636,15 +592,9 @@ const columns: DataTableColumns<QualityTesting> = [
|
|||||||
case 'submitResultDetail':
|
case 'submitResultDetail':
|
||||||
submitResultDetail(row)
|
submitResultDetail(row)
|
||||||
break
|
break
|
||||||
// case 'submitBFResultDetail':
|
|
||||||
// submitBFResultDetail(row)
|
|
||||||
// break
|
|
||||||
case 'queryResultDetail':
|
case 'queryResultDetail':
|
||||||
queryResultDetail(row)
|
queryResultDetail(row)
|
||||||
break
|
break
|
||||||
// case 'cancelQuality':
|
|
||||||
// handleCancelQuality(row)
|
|
||||||
// break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
@ -666,7 +616,8 @@ async function loadData() {
|
|||||||
page:pagination.page,
|
page:pagination.page,
|
||||||
pageSize: pagination.pageSize,
|
pageSize: pagination.pageSize,
|
||||||
qcNo:searchForm.qcNo,
|
qcNo:searchForm.qcNo,
|
||||||
status: searchForm.status
|
status: searchForm.status,
|
||||||
|
assingCode: searchForm.assingCode
|
||||||
})
|
})
|
||||||
tableData.value = res.list
|
tableData.value = res.list
|
||||||
pagination.itemCount = res.total
|
pagination.itemCount = res.total
|
||||||
@ -685,6 +636,7 @@ function handleSearch() {
|
|||||||
function handleReset() {
|
function handleReset() {
|
||||||
searchForm.qcNo = null
|
searchForm.qcNo = null
|
||||||
searchForm.status = null
|
searchForm.status = null
|
||||||
|
searchForm.assingCode = null
|
||||||
|
|
||||||
handleSearch()
|
handleSearch()
|
||||||
}
|
}
|
||||||
@ -702,20 +654,6 @@ function handlePageSizeChange(pageSize: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 选择
|
|
||||||
function handleCheck(keys: Array<string | number>) {
|
|
||||||
selectedIds.value = keys as number[]
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
function handleAdd() {
|
|
||||||
modalTitle.value = '新增质检单表'
|
|
||||||
assingWorkDisabled.value = false
|
|
||||||
Object.assign(formData, defaultFormData)
|
|
||||||
modalVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编辑
|
// 编辑
|
||||||
function handleEdit(row: QualityTesting) {
|
function handleEdit(row: QualityTesting) {
|
||||||
modalTitle.value = '编辑质检单表'
|
modalTitle.value = '编辑质检单表'
|
||||||
@ -763,44 +701,6 @@ async function handleSubmit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
function handleDelete(row: QualityTesting) {
|
|
||||||
dialog.warning({
|
|
||||||
title: '提示',
|
|
||||||
content: '确定要删除该记录吗?',
|
|
||||||
positiveText: '确定',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await qualityTestingApi.delete([row.id!])
|
|
||||||
message.success('删除成功')
|
|
||||||
loadData()
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量删除
|
|
||||||
function handleBatchDelete() {
|
|
||||||
dialog.warning({
|
|
||||||
title: '提示',
|
|
||||||
content: `确定要删除选中的 ${selectedIds.value.length} 条记录吗?`,
|
|
||||||
positiveText: '确定',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await qualityTestingApi.delete(selectedIds.value)
|
|
||||||
message.success('删除成功')
|
|
||||||
selectedIds.value = []
|
|
||||||
loadData()
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出
|
// 导出
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
@ -809,6 +709,7 @@ async function handleExport() {
|
|||||||
if (selectedIds.value.length > 0) params.ids = selectedIds.value
|
if (selectedIds.value.length > 0) params.ids = selectedIds.value
|
||||||
if (searchForm.qcNo != null) params.id = searchForm.qcNo
|
if (searchForm.qcNo != null) params.id = searchForm.qcNo
|
||||||
if (searchForm.status != null) params.status = searchForm.status
|
if (searchForm.status != null) params.status = searchForm.status
|
||||||
|
if (searchForm.assingCode != null) params.status = searchForm.status
|
||||||
const blob = await qualityTestingApi.export(params)
|
const blob = await qualityTestingApi.export(params)
|
||||||
const url = window.URL.createObjectURL(blob)
|
const url = window.URL.createObjectURL(blob)
|
||||||
const link = document.createElement('a')
|
const link = document.createElement('a')
|
||||||
@ -892,14 +793,6 @@ async function handleDetail(row: QualityTesting) {
|
|||||||
detailVisible.value = true
|
detailVisible.value = true
|
||||||
const data = await qualityTestingApi.detail(row.id!)
|
const data = await qualityTestingApi.detail(row.id!)
|
||||||
|
|
||||||
// // 映射后的数据
|
|
||||||
// mappedInfoList.value = Object.entries(data.info)
|
|
||||||
// .filter(([key]) => infoDataMap.has(key)) // 只保留配置里有的字段
|
|
||||||
// .map(([key, value]) => ({
|
|
||||||
// label: infoDataMap.get(key) || key, // 中文标签
|
|
||||||
// key, // 原字段名
|
|
||||||
// value // 原始值
|
|
||||||
// }))
|
|
||||||
setMappedInfoList(data.info)
|
setMappedInfoList(data.info)
|
||||||
|
|
||||||
detailTableData.value = data.detail
|
detailTableData.value = data.detail
|
||||||
@ -940,15 +833,6 @@ function formatDisplayValue(key: string, value: any): string {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//加载派工单
|
|
||||||
async function loadAssignWorkOrder() {
|
|
||||||
const data = await assingReworkApi.allList()
|
|
||||||
console.log(data)
|
|
||||||
assingWork.value = data.map((d:any) => ({ label: d.assingCode, value: (Number(d.id) || d.id) }))
|
|
||||||
console.log(assingWork)
|
|
||||||
}
|
|
||||||
|
|
||||||
//提交判定明细
|
//提交判定明细
|
||||||
async function submitResultDetail(row:any) {
|
async function submitResultDetail(row:any) {
|
||||||
showSubmitOuter.value = true
|
showSubmitOuter.value = true
|
||||||
@ -969,13 +853,13 @@ const showQualityTestingDetail = ref<Boolean>(false)
|
|||||||
|
|
||||||
|
|
||||||
//查看质检详情
|
//查看质检详情
|
||||||
const viewQualityTestingDetail = (row)=>{
|
const viewQualityTestingDetail = (row:any)=>{
|
||||||
console.log(row)
|
console.log(row)
|
||||||
showQualityTestingDetail.value = true
|
showQualityTestingDetail.value = true
|
||||||
qualityTestingInfo.value = row
|
qualityTestingInfo.value = row
|
||||||
}
|
}
|
||||||
|
|
||||||
const handlerPatchStatus = (qualityTestingStatus)=>{
|
const handlerPatchStatus = (qualityTestingStatus:any)=>{
|
||||||
const opt = qcStatusOptions.value.find(o => o.value === qualityTestingStatus || String(o.value) === String(qualityTestingStatus))
|
const opt = qcStatusOptions.value.find(o => o.value === qualityTestingStatus || String(o.value) === String(qualityTestingStatus))
|
||||||
if (!opt) return qualityTestingStatus ?? '-'
|
if (!opt) return qualityTestingStatus ?? '-'
|
||||||
return opt.label
|
return opt.label
|
||||||
@ -994,15 +878,12 @@ async function handleSubmitResultDetail() {
|
|||||||
formDetailScrapData,
|
formDetailScrapData,
|
||||||
formDetailReworkData,
|
formDetailReworkData,
|
||||||
formDetailConcessionData]
|
formDetailConcessionData]
|
||||||
|
try {
|
||||||
console.log(submitParam);
|
|
||||||
|
|
||||||
|
|
||||||
await qualityTestingApi.submit(submitParam)
|
await qualityTestingApi.submit(submitParam)
|
||||||
|
|
||||||
message.success('提交成功')
|
message.success('提交成功')
|
||||||
router.go(-1)
|
}catch (error) {
|
||||||
|
message.error("提交异常")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,10 +32,6 @@
|
|||||||
<template #icon><n-icon><AddOutline /></n-icon></template>
|
<template #icon><n-icon><AddOutline /></n-icon></template>
|
||||||
新增
|
新增
|
||||||
</n-button>
|
</n-button>
|
||||||
<!-- <n-button @click="importModalVisible = true">
|
|
||||||
<template #icon><n-icon><CloudUploadOutline /></n-icon></template>
|
|
||||||
导入
|
|
||||||
</n-button> -->
|
|
||||||
<n-button @click="handleExport">
|
<n-button @click="handleExport">
|
||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
||||||
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
||||||
@ -53,7 +49,7 @@
|
|||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:any) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
@update:page="handlePageChange"
|
@update:page="handlePageChange"
|
||||||
@update:page-size="handlePageSizeChange"
|
@update:page-size="handlePageSizeChange"
|
||||||
|
|||||||
@ -29,10 +29,10 @@
|
|||||||
<template #icon><n-icon><AddOutline /></n-icon></template>
|
<template #icon><n-icon><AddOutline /></n-icon></template>
|
||||||
新增工位
|
新增工位
|
||||||
</n-button>
|
</n-button>
|
||||||
<!-- <n-button @click="importModalVisible = true">
|
<n-button @click="importModalVisible = true">
|
||||||
<template #icon><n-icon><CloudUploadOutline /></n-icon></template>
|
<template #icon><n-icon><CloudUploadOutline /></n-icon></template>
|
||||||
导入
|
导入
|
||||||
</n-button> -->
|
</n-button>
|
||||||
<n-button @click="handleExport">
|
<n-button @click="handleExport">
|
||||||
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
<template #icon><n-icon><DownloadOutline /></n-icon></template>
|
||||||
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
|
||||||
@ -49,7 +49,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:any) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
v-model:checked-row-keys="selectedIds"
|
v-model:checked-row-keys="selectedIds"
|
||||||
/>
|
/>
|
||||||
@ -79,13 +79,6 @@
|
|||||||
<n-input v-model:value="formData.deviceName" placeholder="请输入设备名称" />
|
<n-input v-model:value="formData.deviceName" placeholder="请输入设备名称" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item label="所属工段" path="sectionId">
|
<n-form-item label="所属工段" path="sectionId">
|
||||||
<!-- <n-select-->
|
|
||||||
<!-- v-model:value="formData.sectionId"-->
|
|
||||||
<!-- :options="sectionList"-->
|
|
||||||
<!-- placeholder="请选择所属工段"-->
|
|
||||||
<!-- clearable-->
|
|
||||||
<!-- style="width: 200px"-->
|
|
||||||
<!-- />-->
|
|
||||||
<n-tree-select
|
<n-tree-select
|
||||||
v-model:value="formData.sectionId"
|
v-model:value="formData.sectionId"
|
||||||
cascade
|
cascade
|
||||||
@ -153,7 +146,6 @@ import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline,
|
|||||||
import { deviceApi, type Device } from '@/api/device'
|
import { deviceApi, type Device } from '@/api/device'
|
||||||
|
|
||||||
import {deptApi, dictDataApi} from '@/api/org'
|
import {deptApi, dictDataApi} from '@/api/org'
|
||||||
import {sectionApi, type Section} from '@/api/section'
|
|
||||||
import {TreeNode} from "echarts/types/src/data/Tree";
|
import {TreeNode} from "echarts/types/src/data/Tree";
|
||||||
|
|
||||||
|
|
||||||
@ -185,17 +177,17 @@ const modalTitle = ref('')
|
|||||||
const importModalVisible = ref(false)
|
const importModalVisible = ref(false)
|
||||||
const formRef = ref()
|
const formRef = ref()
|
||||||
const defaultFormData: Device = {
|
const defaultFormData: Device = {
|
||||||
id:"",
|
id: Number(''),
|
||||||
deviceCode: '',
|
deviceCode: '',
|
||||||
deviceName: '',
|
deviceName: '',
|
||||||
deviceTypeId: undefined,
|
deviceTypeId: Number(''),
|
||||||
deviceType:"",
|
deviceType:"",
|
||||||
sectionId: "",
|
sectionId: Number(''),
|
||||||
sectionName:"",
|
sectionName:"",
|
||||||
spec: '',
|
spec: '',
|
||||||
manufacturer: '',
|
manufacturer: '',
|
||||||
manufactureDate: undefined,
|
manufactureDate: undefined,
|
||||||
workshopId: '',
|
workshopId: Number(''),
|
||||||
remark: '',
|
remark: '',
|
||||||
status:0,
|
status:0,
|
||||||
deviceFlag:'mes_station'
|
deviceFlag:'mes_station'
|
||||||
|
|||||||
@ -66,7 +66,7 @@
|
|||||||
:columns="columns"
|
:columns="columns"
|
||||||
:data="tableData"
|
:data="tableData"
|
||||||
:loading="loading"
|
:loading="loading"
|
||||||
:row-key="(row) => row.id"
|
:row-key="(row:any) => row.id"
|
||||||
:scroll-x="1200"
|
:scroll-x="1200"
|
||||||
/>
|
/>
|
||||||
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
|
<div class="pagination-container" style="display: flex; justify-content: flex-end; margin-top: 12px">
|
||||||
@ -352,62 +352,9 @@ async function handleSubmit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
function handleDelete(row: StationHandover) {
|
|
||||||
dialog.warning({
|
|
||||||
title: '提示',
|
|
||||||
content: '确定要删除该记录吗?',
|
|
||||||
positiveText: '确定',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await stationHandoverApi.delete([row.id!])
|
|
||||||
message.success('删除成功')
|
|
||||||
loadData()
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量删除
|
|
||||||
function handleBatchDelete() {
|
|
||||||
dialog.warning({
|
|
||||||
title: '提示',
|
|
||||||
content: `确定要删除选中的 ${selectedIds.value.length} 条记录吗?`,
|
|
||||||
positiveText: '确定',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await stationHandoverApi.delete(selectedIds.value)
|
|
||||||
message.success('删除成功')
|
|
||||||
selectedIds.value = []
|
|
||||||
loadData()
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出
|
|
||||||
async function handleExport() {
|
|
||||||
try {
|
|
||||||
const params: Record<string, any> = {}
|
|
||||||
if (selectedIds.value.length > 0) params.ids = selectedIds.value
|
|
||||||
if (searchForm.id != null) params.id = searchForm.id
|
|
||||||
const blob = await stationHandoverApi.export(params)
|
|
||||||
const url = window.URL.createObjectURL(blob)
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = url
|
|
||||||
link.download = '工位交接记录表数据.xlsx'
|
|
||||||
link.click()
|
|
||||||
window.URL.revokeObjectURL(url)
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 下载导入模板
|
// 下载导入模板
|
||||||
async function handleDownloadTemplate() {
|
async function handleDownloadTemplate() {
|
||||||
@ -449,7 +396,6 @@ async function handleImportUpload({file}: UploadCustomRequestOptions) {
|
|||||||
async function loadDictOptions() {
|
async function loadDictOptions() {
|
||||||
}
|
}
|
||||||
|
|
||||||
//加载工段
|
|
||||||
//加载工段
|
//加载工段
|
||||||
async function loadSection() {
|
async function loadSection() {
|
||||||
const data = await deptApi.tree()
|
const data = await deptApi.tree()
|
||||||
@ -457,8 +403,6 @@ async function loadSection() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleUpdateValue(key: any) {
|
function handleUpdateValue(key: any) {
|
||||||
|
|
||||||
console.log(key);
|
|
||||||
loadDevice(key)
|
loadDevice(key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -186,7 +186,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, h, onMounted } from 'vue'
|
import { ref, reactive, h, onMounted } from 'vue'
|
||||||
import { NButton, NSpace, NIcon,NTag, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
import { NButton, NSpace, NIcon,NTag, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
|
||||||
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline, Options } from '@vicons/ionicons5'
|
import { SearchOutline, RefreshOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
|
||||||
import { submitLogApi, type SubmitLog } from '@/api/submitLog'
|
import { submitLogApi, type SubmitLog } from '@/api/submitLog'
|
||||||
import { dictDataApi } from '@/api/org'
|
import { dictDataApi } from '@/api/org'
|
||||||
import router from '@/router'
|
import router from '@/router'
|
||||||
@ -245,17 +245,17 @@ const formRules = {
|
|||||||
// 表格列
|
// 表格列
|
||||||
const columns: DataTableColumns<SubmitLog> = [
|
const columns: DataTableColumns<SubmitLog> = [
|
||||||
{ title: '物料名称', key: 'materialName',align: 'center',
|
{ title: '物料名称', key: 'materialName',align: 'center',
|
||||||
render(rowData, rowIndex) {
|
render(rowData) {
|
||||||
return rowData.materialName? rowData.materialName: '-'
|
return rowData.materialName? rowData.materialName: '-'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ title: '物料编码', key: 'materialCode',align: 'center',
|
{ title: '物料编码', key: 'materialCode',align: 'center',
|
||||||
render(rowData, rowIndex) {
|
render(rowData) {
|
||||||
return rowData.materialCode? rowData.materialCode: '-'
|
return rowData.materialCode? rowData.materialCode: '-'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ title: '物料数量', key: 'materialQty',align: 'center',
|
{ title: '物料数量', key: 'materialQty',align: 'center',
|
||||||
render(rowData, rowIndex) {
|
render(rowData) {
|
||||||
return rowData.materialQty? rowData.materialQty: '-'
|
return rowData.materialQty? rowData.materialQty: '-'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -335,28 +335,6 @@ function handlePageSizeChange(pageSize: number) {
|
|||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 选择
|
|
||||||
function handleCheck(keys: Array<string | number>) {
|
|
||||||
selectedIds.value = keys as number[]
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增
|
|
||||||
function handleAdd() {
|
|
||||||
modalTitle.value = '新增派工工单汇报记录'
|
|
||||||
Object.assign(formData, defaultFormData)
|
|
||||||
modalVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 编辑
|
|
||||||
function handleEdit(row: SubmitLog) {
|
|
||||||
modalTitle.value = '编辑派工工单汇报记录'
|
|
||||||
Object.assign(formData, row)
|
|
||||||
if (formData.createTime && typeof formData.createTime === 'string') {
|
|
||||||
formData.createTime = new Date(formData.createTime.replace(' ', 'T')).getTime()
|
|
||||||
}
|
|
||||||
modalVisible.value = true
|
|
||||||
}
|
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
async function handleSubmit() {
|
async function handleSubmit() {
|
||||||
await formRef.value?.validate()
|
await formRef.value?.validate()
|
||||||
@ -379,45 +357,6 @@ async function handleSubmit() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 删除
|
|
||||||
function handleDelete(row: SubmitLog) {
|
|
||||||
dialog.warning({
|
|
||||||
title: '提示',
|
|
||||||
content: '确定要删除该记录吗?',
|
|
||||||
positiveText: '确定',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await submitLogApi.delete([row.id!])
|
|
||||||
message.success('删除成功')
|
|
||||||
loadData()
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 批量删除
|
|
||||||
function handleBatchDelete() {
|
|
||||||
dialog.warning({
|
|
||||||
title: '提示',
|
|
||||||
content: `确定要删除选中的 ${selectedIds.value.length} 条记录吗?`,
|
|
||||||
positiveText: '确定',
|
|
||||||
negativeText: '取消',
|
|
||||||
onPositiveClick: async () => {
|
|
||||||
try {
|
|
||||||
await submitLogApi.delete(selectedIds.value)
|
|
||||||
message.success('删除成功')
|
|
||||||
selectedIds.value = []
|
|
||||||
loadData()
|
|
||||||
} catch (error) {
|
|
||||||
// 错误已在拦截器处理
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 导出
|
// 导出
|
||||||
async function handleExport() {
|
async function handleExport() {
|
||||||
try {
|
try {
|
||||||
@ -492,16 +431,6 @@ async function loadDictOptions() {
|
|||||||
}catch {}
|
}catch {}
|
||||||
}
|
}
|
||||||
|
|
||||||
//查看汇报信息
|
|
||||||
|
|
||||||
function handleViewReport(row) {
|
|
||||||
reportDetailVisible.value = true
|
|
||||||
|
|
||||||
qualityTestings.value = row.qualityTestings
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function formatDisplayValue(key:string,value: any){
|
function formatDisplayValue(key:string,value: any){
|
||||||
if (value === null || value === undefined) return '-'
|
if (value === null || value === undefined) return '-'
|
||||||
|
|
||||||
|
|||||||
@ -554,13 +554,10 @@ const AssingWorkAllExpanded = computed(()=>{
|
|||||||
})
|
})
|
||||||
|
|
||||||
function AssingWorkToggleExpandAll() {
|
function AssingWorkToggleExpandAll() {
|
||||||
console.log(AssingWorkTableData.value)
|
|
||||||
if(AssingWorkAllExpanded.value) {
|
if(AssingWorkAllExpanded.value) {
|
||||||
console.log(AssingWorkTableData.value)
|
|
||||||
AssingWorkExpandedKeys.value = []
|
AssingWorkExpandedKeys.value = []
|
||||||
}else{
|
}else{
|
||||||
AssingWorkExpandedKeys.value = AssingWorkTableData.value.map(RowKey)
|
AssingWorkExpandedKeys.value = AssingWorkTableData.value.map(RowKey)
|
||||||
console.log(AssingWorkTableData.value)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,14 +589,6 @@ function renderAssingWorkExpand(row: AssingWork) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const state = expandDetailMap.get(rowId)!
|
const state = expandDetailMap.get(rowId)!
|
||||||
console.log(state)
|
|
||||||
console.log(state.list)
|
|
||||||
|
|
||||||
// 加载中提示
|
|
||||||
// if (state.loading) {
|
|
||||||
// return h('div', {style: 'padding:12px'}, '加载中...')
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
return h('div', { style: 'padding: 0 16px 12px' }, [
|
return h('div', { style: 'padding: 0 16px 12px' }, [
|
||||||
h(NDataTable, {
|
h(NDataTable, {
|
||||||
@ -709,7 +698,6 @@ function handleQualityRecords(row:any) {
|
|||||||
const viewAssingWorkDetail= ((row:any)=>{
|
const viewAssingWorkDetail= ((row:any)=>{
|
||||||
showAssingWorkDetail.value = true
|
showAssingWorkDetail.value = true
|
||||||
assingWorkDetail.value = row
|
assingWorkDetail.value = row
|
||||||
console.log(assingWorkDetail.value)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
@ -720,12 +708,10 @@ const handlerReWork = ((row:any)=>{
|
|||||||
|
|
||||||
const handlerPatchStatus = ((row:any)=>{
|
const handlerPatchStatus = ((row:any)=>{
|
||||||
const val = row
|
const val = row
|
||||||
console.log(qcAssingStatusOptions.value)
|
|
||||||
const opt = qcAssingStatusOptions.value.find(
|
const opt = qcAssingStatusOptions.value.find(
|
||||||
o => o.value === val || String(o.value) === String(val)
|
o => o.value === val || String(o.value) === String(val)
|
||||||
)
|
)
|
||||||
if (!opt) return val ?? '-'
|
if (!opt) return val ?? '-'
|
||||||
console.log( opt)
|
|
||||||
return opt.label
|
return opt.label
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user