修改前端代码
This commit is contained in:
parent
7b02625a1c
commit
e6927f4649
@ -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: '提示',
|
||||
|
||||
@ -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 = []
|
||||
|
||||
|
||||
@ -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'
|
||||
|
||||
|
||||
@ -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+'质检记录吗?',
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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()
|
||||
}
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -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 ?? '-'
|
||||
|
||||
@ -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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user