修改前端代码

This commit is contained in:
shaoleiliu-netizen123 2026-06-12 10:09:04 +08:00
parent 7b02625a1c
commit e6927f4649
9 changed files with 65 additions and 117 deletions

View File

@ -394,9 +394,7 @@ const columns: DataTableColumns<ConcessionApply> = [
{ title: '审批完成时间', key: 'approveTime',align:"center",minWidth:"250" },
{ title: '审批状态', key: 'approveStatus',align:"center",minWidth:"150" },
{ title: '审批结果', key: 'approveResult',align:"center",minWidth:"150",
render(row:any){
console.log(row.approveResult);
render(row:any){
if(row.approveResult == '待审批') return h(NTag, { type: 'default', size: 'small' }, { default: () => row.approveResult })
if(row.approveResult == '已驳回') return h(NTag, { type: 'error', size: 'small' }, { default: () => row.approveResult })
if(row.approveResult == '已通过') return h(NTag, { type: 'success', size: 'small' }, { default: () => row.approveResult })
@ -649,26 +647,9 @@ async function loadDictOptions() {
approveStatusOptions.value = data.map(d => ({ label: d.dictLabel, value: (Number(d.dictValue) || d.dictValue),class: d.listClass }))
} catch {}
}
const getTimelineType = (type) => {
console.log(type);
const map = {
'START_PROCESS_INSTANCE': 'info', //-
'AGREE': 'success',//-绿
'REFUSE': 'error',//-
'TERMINATE_PROCESS_INSTANCE':'warning',//-
'grey':'default', //grey
'info':'default'
}
return map[type] || 'default'
}
const getTitleAttribute = (item) =>{
return item.username +" "+item.operationResult
}
function getApproveResultColor(status) {
function getApproveResultColor(status:string) {
switch(status){
case '已通过':
return "green"
@ -679,11 +660,6 @@ function getApproveResultColor(status) {
}
}
const getRemark=(item) =>{
console.log(item.remark);
}
async function downloadOutline() {
const model = detailModel.value
if (!model) {
@ -827,7 +803,7 @@ async function downloadOutline() {
}
async function handleCancel(row) {
async function handleCancel(row:any) {
dialog.warning({
title: '提示',

View File

@ -502,7 +502,7 @@ const columns = [
minWidth: 150,
title: '是否采购',
key: 'procurement',
render(row) {
render(row:any) {
const val = row.procurement
const opt = procurementOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
@ -513,7 +513,7 @@ const columns = [
minWidth: 150,
title: '是否委外',
key: 'outsource',
render(row) {
render(row:any) {
const val = row.outsource
const opt = outsourceOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
@ -542,7 +542,7 @@ const columns = [
minWidth: 150,
title: '是否质检',
key: 'qualityInspection',
render(row) {
render(row:any) {
const val = row.qualityInspection
const opt = qualityInspectionOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
@ -553,7 +553,7 @@ const columns = [
minWidth: 150,
title: '是否直接入库',
key: 'storageEntry',
render(row) {
render(row:any) {
const val = row.storageEntry
const opt = storageEntryOptions.value.find(o => o.value === val || String(o.value) === String(val))
return opt ? opt.label : (val ?? '-')
@ -565,7 +565,7 @@ const columns = [
key: 'actions',
width: 140,
fixed: 'right',
render(row) {
render(row:any) {
const buttons:any = []

View File

@ -40,7 +40,7 @@
:data="tableData"
:loading="loading"
:pagination="pagination"
:row-key="(row) => row.id"
:row-key="(row:any) => row.id"
:scroll-x="1200"
@update:page="handlePageChange"
@update:page-size="handlePageSizeChange"
@ -54,9 +54,9 @@
</template>
<script setup lang="ts">
import { ref, reactive, h, onMounted } from 'vue'
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5'
import { ref, reactive, onMounted } from 'vue'
import { NButton, NSpace, NIcon, type DataTableColumns} from 'naive-ui'
import { SearchOutline, RefreshOutline } from '@vicons/ionicons5'
import { qcResultDetailApi, type QcResultDetail } from '@/api/qcResultDetail'
import { dictDataApi } from '@/api/org'

View File

@ -213,7 +213,7 @@
:columns="detailColumns"
:data="detailTableData"
:loading="loading"
:row-key="(row) => row.id"
:row-key="(row:any) => row.id"
:scroll-x="700"
max-height="320"
:pagination="{ pageSize:4 }"
@ -245,15 +245,9 @@ import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting'
import {assingReworkApi} from '@/api/assingRework'
import { dictDataApi } from '@/api/org'
import {Language} from "@xterm/xterm/src/vs/base/common/platform.ts";
import {fileApi} from '@/api/system1'
import value = Language.value;
import {QcResultDetail} from "@/api/qcResultDetail.ts";
import router from "@/router";
import dd from 'dingtalk-jsapi'
import { env } from 'echarts'
const message = useMessage()
const dialog = useDialog()
@ -274,7 +268,7 @@ const pagination = reactive({
//
const searchForm = reactive({
qcNo: null as number | null,
qcNo: null as string | null,
status: null as number | null,
})
@ -290,7 +284,7 @@ const infoIsCollapse = ref(false)
const detailIsCollapse = ref(true)
//
const submitDetailModalVisible = ref(false)
// const submitDetailModalVisible = ref(false)
const traceCodeShow = ref(false)
///
const submitFlag = ref<Boolean>()
@ -334,10 +328,10 @@ const infoDataMapping = {
inspectTime: '质检时间',
traceType: '追溯类型'
}
const infoDataMap = new Map(Object.entries(infoDataMapping))
const mappedInfoList = ref<Array<{ label: string; key: string; value: any }>>([])
//
const detailColumns: DataTableColumns<Object> = [
const detailColumns: DataTableColumns<QcResultDetail> = [
{
title: '判定类型',
key: 'resultType',
@ -403,7 +397,7 @@ const detailTableData = ref<Object[]>([])
const formRef = ref()
const defaultFormData: QualityTesting = {
qcNo: '',
qcNo: undefined,
sourceType: undefined,
sourceId: undefined,
orderId: undefined,
@ -417,38 +411,38 @@ const defaultFormData: QualityTesting = {
}
const formData = reactive<QualityTesting>({ ...defaultFormData })
const defaultFormDetailData:QcResultDetail = {
qcId: undefined,
resultType: undefined,
qty: 0,
traceCode: undefined,
defectCode: undefined,
handleAction: undefined,
actionStatus: undefined
}
// const defaultFormDetailData:QcResultDetail = {
// qcId: undefined,
// resultType: undefined,
// qty: 0,
// traceCode: undefined,
// defectCode: undefined,
// handleAction: undefined,
// actionStatus: undefined
// }
const formDetailOKData = reactive<QcResultDetail>({ ...defaultFormDetailData, resultType: 1,handleAction:'下一道工序',actionStatus:1 })
const formDetailScrapData = reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 2,handleAction:'报废次品',actionStatus:1 })
const formDetailReworkData = reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 3,handleAction:'返工',actionStatus:1 })
const formDetailConcessionData = reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 4,handleAction:'让步接收',actionStatus:1 })
// const formDetailOKData = reactive<QcResultDetail>({ ...defaultFormDetailData, resultType: 1,handleAction:'',actionStatus:1 })
// const formDetailScrapData = reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 2,handleAction:'',actionStatus:1 })
// const formDetailReworkData = reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 3,handleAction:'',actionStatus:1 })
// const formDetailConcessionData = reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 4,handleAction:'',actionStatus:1 })
const assingWorkDisabled = ref(true)
const assingWork = ref<{ label: string; value: any }[]>([])
// //使
const statusOptions = ref<{ label: string; value: any }[]>([])
const statusOptions = ref<{ label: string; value: any;class:any}[]>([])
//
const qcStatusOptions = ref<{ label: string; value: any }[]>([])
const qcStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcSourceTypeOptions = ref<{ label: string; value: any }[]>([])
const qcSourceTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcTraceTypeOptions = ref<{ label: string; value: any }[]>([])
const qcTraceTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcResultTypeOptions = ref<{ label: string; value: any }[]>([])
const qcResultTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcActionStatusOptions = ref<{ label: string; value: any }[]>([])
const qcActionStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const formRules = {
sourceType: [{ required: true, type: 'number', message: '请选择来源类型:1工序汇报/2委外/3手工', trigger: 'change' }],
@ -577,7 +571,7 @@ function handleSearch() {
//
function handleReset() {
searchForm.id = null
searchForm.qcNo = null
searchForm.status = null
handleSearch()
@ -699,7 +693,7 @@ 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.qcNo != null) params.id = searchForm.qcNo
if (searchForm.status != null) params.status = searchForm.status
const blob = await qualityTestingApi.export(params)
const url = window.URL.createObjectURL(blob)
@ -837,12 +831,12 @@ function formatDisplayValue(key: string, value: any): string {
async function loadAssignWorkOrder() {
const data = await assingReworkApi.allList()
console.log(data)
assingWork.value = data.map(d => ({ label: d.assingCode, value: (Number(d.id) || d.id) }))
assingWork.value = data.map((d:any) => ({ label: d.assingCode, value: (Number(d.id) || d.id) }))
console.log(assingWork)
}
//
function submitResultDetail(row) {
function submitResultDetail(row:any) {
if (row.traceType != 1) {
traceCodeShow.value = true
@ -856,36 +850,14 @@ function submitResultDetail(row) {
async function handleSubmitResultDetail() {
formDetailConcessionData.files = uploadFiles.value
const submitParam = [
formDetailOKData,
formDetailScrapData,
formDetailReworkData,
formDetailConcessionData]
console.log(submitParam);
submitFlag.value? await qualityTestingApi.submit(submitParam) : await qualityTestingApi.submitBF(submitParam)
message.success('提交成功')
submitDetailModalVisible.value = false
loadData()
}
//
function submitBFResultDetail(row) {
function submitBFResultDetail(row:any) {
if (row.traceType != 1) {
traceCodeShow.value = true
}
submitFlag.value = false
//version-2
let path = `/qc/submitDetail/${row.qcNo}/${row.id}/${submitFlag.value}/${traceCodeShow.value}`
router.push(path)
@ -893,13 +865,13 @@ function submitBFResultDetail(row) {
//
function queryResultDetail(row) {
function queryResultDetail(row:any) {
let path = `detail/${row.id}`;
router.push(path)
}
//
function handleCancelQuality(row) {
function handleCancelQuality(row:any) {
dialog.warning({
title: '提示',
content: '确定要撤回ID:'+row.id+'质检记录吗?',

View File

@ -134,7 +134,6 @@
multiple
directory-dnd
:max="5"
:action="null"
:custom-request="()=>{}"
@change="handleUploadChange"
v-model:file-list="fileList"
@ -173,19 +172,19 @@
</div>
</template>
<script setup lang="ts">
import { ref, reactive, h, onMounted } from 'vue'
import { ref, reactive, onMounted } from 'vue'
import {
NButton, NSpace, NIcon, NUpload,NTag, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
NDropdown
NButton, NSpace, NIcon, NUpload, useMessage
} from 'naive-ui'
import {useRoute} from "vue-router";
import {QcResultDetail} from "@/api/qcResultDetail.ts";
import {fileApi} from '@/api/system1'
import { qualityTestingApi, type QualityTesting } from '@/api/qualityTesting'
import { qualityTestingApi} from '@/api/qualityTesting'
import router from '@/router';
const message = useMessage()
const route = useRoute()
const qcId =ref( Number(route.params.id))

View File

@ -211,6 +211,7 @@ const pagination = reactive({
//
const searchForm = reactive({
page:pagination.page as number,
assingStatus:undefined
})
//
@ -229,13 +230,13 @@ const reportDetailVisible = ref(false)
// //使
//
const qcResultTypeOptions = ref<{ label: string; value: any }[]>([])
const qcResultTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcSourceTypeOptions = ref<{ label: string; value: any }[]>([])
const qcSourceTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcStatusOptions = ref<{ label: string; value: any }[]>([])
const qcStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcAssingStatusOptions = ref<{ label: string; value: any }[]>([])
const qcAssingStatusOptions = ref<{ label: string; value: any ;class:any}[]>([])
//
const formRules = {
}
@ -280,7 +281,7 @@ const columns: DataTableColumns<SubmitLog> = [
render(row) {
return h('div', { style: { display: 'flex', alignItems: 'center', gap: '8px', flexWrap: 'nowrap' } }, [
h(NButton, { size: 'small', quaternary: true, onClick: () => handleViewReport(row) }, {
default: () => [h(NIcon, null, { default: () => h(null) }), ' 汇报信息']
default: () => ['汇报信息']
}),
// h(NButton, { size: 'small', quaternary: true, onClick: () => handleEdit(row) }, {
// default: () => [h(NIcon, null, { default: () => h(CreateOutline) }), ' ']
@ -300,7 +301,7 @@ const submitColumns = ref([
{ title: "提交时间", key: "submitCreateTime" },
{ title: "提交数量", key: "quantity" },
{ title: "单据状态", key: "submitStatus",
render: (row) => {
render: (row:any) => {
const val = row.submitStatus
const opt = qcResultTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'
@ -335,7 +336,7 @@ function handleSearch() {
//
function handleReset() {
searchForm.assingStatus = null
searchForm.assingStatus = undefined
handleSearch()
}

View File

@ -92,8 +92,8 @@ const statisticTypeOptions = ref<{ label: string; value: any }[]>([])
//
const searchForm =reactive({
type: null as string,
timestamp: null as string
type:undefined as any,
timestamp: undefined as any
})
const stats = reactive({

View File

@ -396,13 +396,13 @@ const userStore = useUserStore()
const hasPermission = (permission: string) => userStore.hasPermission(permission)
//
const qcResultTypeOptions = ref<{ label: string; value: any }[]>([])
const qcResultTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcSourceTypeOptions = ref<{ label: string; value: any }[]>([])
const qcSourceTypeOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcStatusOptions = ref<{ label: string; value: any }[]>([])
const qcStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const qcAssingStatusOptions = ref<{ label: string; value: any }[]>([])
const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
//
const infoIsCollapse = ref(false)
@ -418,7 +418,7 @@ const submitColumns = ref([
{ title: "提交时间", key: "submitCreateTime" },
{ title: "提交数量", key: "quantity" },
{ title: "单据状态", key: "submitStatus",
render: (row) => {
render: (row:any) => {
const val = row.submitStatus
const opt = qcResultTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return val ?? '-'

View File

@ -199,7 +199,7 @@ const hasPermission = (permission: string) => userStore.hasPermission(permission
//
const qcAssingStatusOptions = ref<{ label: string; value: any }[]>([])
const qcAssingStatusOptions = ref<{ label: string; value: any;class:any }[]>([])
// ==================== ====================
const searchForm = reactive({