修改前端代码

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

@ -395,8 +395,6 @@ const columns: DataTableColumns<ConcessionApply> = [
{ title: '审批状态', key: 'approveStatus',align:"center",minWidth:"150" }, { title: '审批状态', key: 'approveStatus',align:"center",minWidth:"150" },
{ title: '审批结果', key: 'approveResult',align:"center",minWidth:"150", { title: '审批结果', key: 'approveResult',align:"center",minWidth:"150",
render(row:any){ render(row:any){
console.log(row.approveResult);
if(row.approveResult == '待审批') return h(NTag, { type: 'default', size: 'small' }, { default: () => row.approveResult }) 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: 'error', size: 'small' }, { default: () => row.approveResult })
if(row.approveResult == '已通过') return h(NTag, { type: 'success', size: 'small' }, { default: () => row.approveResult }) if(row.approveResult == '已通过') return h(NTag, { type: 'success', size: 'small' }, { default: () => row.approveResult })
@ -650,25 +648,8 @@ async function loadDictOptions() {
} catch {} } catch {}
} }
const getTimelineType = (type) => {
console.log(type);
const map = { function getApproveResultColor(status:string) {
'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) {
switch(status){ switch(status){
case '已通过': case '已通过':
return "green" return "green"
@ -679,11 +660,6 @@ function getApproveResultColor(status) {
} }
} }
const getRemark=(item) =>{
console.log(item.remark);
}
async function downloadOutline() { async function downloadOutline() {
const model = detailModel.value const model = detailModel.value
if (!model) { if (!model) {
@ -827,7 +803,7 @@ async function downloadOutline() {
} }
async function handleCancel(row) { async function handleCancel(row:any) {
dialog.warning({ dialog.warning({
title: '提示', title: '提示',

View File

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

View File

@ -40,7 +40,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"
@ -54,9 +54,9 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, h, onMounted } from 'vue' import { ref, reactive, onMounted } from 'vue'
import { NButton, NSpace, NIcon, NUpload, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions } from 'naive-ui' import { NButton, NSpace, NIcon, type DataTableColumns} from 'naive-ui'
import { SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline } from '@vicons/ionicons5' import { SearchOutline, RefreshOutline } from '@vicons/ionicons5'
import { qcResultDetailApi, type QcResultDetail } from '@/api/qcResultDetail' import { qcResultDetailApi, type QcResultDetail } from '@/api/qcResultDetail'
import { dictDataApi } from '@/api/org' import { dictDataApi } from '@/api/org'

View File

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

View File

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

View File

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

View File

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

View File

@ -396,13 +396,13 @@ const userStore = useUserStore()
const hasPermission = (permission: string) => userStore.hasPermission(permission) 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) const infoIsCollapse = ref(false)
@ -418,7 +418,7 @@ const submitColumns = ref([
{ title: "提交时间", key: "submitCreateTime" }, { title: "提交时间", key: "submitCreateTime" },
{ title: "提交数量", key: "quantity" }, { title: "提交数量", key: "quantity" },
{ title: "单据状态", key: "submitStatus", { title: "单据状态", key: "submitStatus",
render: (row) => { render: (row:any) => {
const val = row.submitStatus const val = row.submitStatus
const opt = qcResultTypeOptions.value.find(o => o.value === val || String(o.value) === String(val)) const opt = qcResultTypeOptions.value.find(o => o.value === val || String(o.value) === String(val))
if (!opt) return 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({ const searchForm = reactive({