修改派工前端代码
This commit is contained in:
parent
729c76e5ef
commit
1b51d68a25
@ -68,6 +68,10 @@ export const qualityTestingApi = {
|
|||||||
submit(data: QcResultDetail[]) {
|
submit(data: QcResultDetail[]) {
|
||||||
return request({ url: '/mes/qc/judge', method: 'put', data })
|
return request({ url: '/mes/qc/judge', method: 'put', data })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
submitBF(data: QcResultDetail[]) {
|
||||||
|
return request({ url: '/mes/qc/partial', method: 'post', data })
|
||||||
|
},
|
||||||
//质检撤回
|
//质检撤回
|
||||||
cancel(id: number) {
|
cancel(id: number) {
|
||||||
return request({ url: `/mes/dispatch/revoke/${id}`, method: 'put' })
|
return request({ url: `/mes/dispatch/revoke/${id}`, method: 'put' })
|
||||||
|
|||||||
@ -312,12 +312,38 @@
|
|||||||
</n-gi>
|
</n-gi>
|
||||||
</n-grid>
|
</n-grid>
|
||||||
<n-form-item label="备注" >
|
<n-form-item label="备注" >
|
||||||
<n-input
|
<n-input
|
||||||
v-model:value="formDetailConcessionData.remark"
|
v-model:value="formDetailConcessionData.remark"
|
||||||
type="textarea"
|
type="textarea"
|
||||||
placeholder="输入备注原因"
|
placeholder="输入备注原因"
|
||||||
/>
|
/>
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
|
<n-upload
|
||||||
|
multiple
|
||||||
|
directory-dnd
|
||||||
|
:max="5"
|
||||||
|
action=""
|
||||||
|
@change="handleUploadChange"
|
||||||
|
:file-list="fileList"
|
||||||
|
accept=".pdf,.doc,.docx"
|
||||||
|
:max-size="10*1024*1024"
|
||||||
|
>
|
||||||
|
<n-upload-dragger>
|
||||||
|
<div style="margin-bottom: 12px">
|
||||||
|
<n-icon size="48" :depth="3">
|
||||||
|
<ArchiveIcon />
|
||||||
|
</n-icon>
|
||||||
|
</div>
|
||||||
|
<n-text style="font-size: 16px">
|
||||||
|
点击或者拖动文件到该区域来上传
|
||||||
|
</n-text>
|
||||||
|
<n-p depth="3" style="margin: 8px 0 0 0">
|
||||||
|
仅支持 PDF、DOC、DOCX,单文件最大10MB
|
||||||
|
</n-p>
|
||||||
|
</n-upload-dragger>
|
||||||
|
</n-upload>
|
||||||
|
|
||||||
|
|
||||||
</n-form>
|
</n-form>
|
||||||
</n-collapse-item>
|
</n-collapse-item>
|
||||||
</n-collapse>
|
</n-collapse>
|
||||||
@ -339,7 +365,7 @@ import {
|
|||||||
NButton, NSpace, NIcon, NUpload,NTag, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
|
NButton, NSpace, NIcon, NUpload,NTag, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
|
||||||
NDropdown
|
NDropdown
|
||||||
} from 'naive-ui'
|
} from 'naive-ui'
|
||||||
import { } from '@vicons/ionicons5'
|
|
||||||
import {
|
import {
|
||||||
SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline,
|
SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline,
|
||||||
EllipsisHorizontalOutline, ArrowDownOutline, ArrowUpOutline
|
EllipsisHorizontalOutline, ArrowDownOutline, ArrowUpOutline
|
||||||
@ -391,6 +417,9 @@ 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 customOrderKeys = [
|
const customOrderKeys = [
|
||||||
'materialCode',
|
'materialCode',
|
||||||
@ -522,6 +551,11 @@ const defaultFormDetailData:QcResultDetail = {
|
|||||||
handleAction: undefined,
|
handleAction: undefined,
|
||||||
actionStatus: undefined
|
actionStatus: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//提交附件
|
||||||
|
const fileList = ref<any[]>([])
|
||||||
|
const uploadFiles = ref<File[]>([])
|
||||||
|
|
||||||
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 })
|
||||||
@ -567,6 +601,7 @@ const columns: DataTableColumns<QualityTesting> = [
|
|||||||
// { title: '关联工序计划ID', key: 'processId' },
|
// { title: '关联工序计划ID', key: 'processId' },
|
||||||
// { title: '物料ID', key: 'itemId' },
|
// { title: '物料ID', key: 'itemId' },
|
||||||
{ title: '报检总数', key: 'totalQty',align: 'center' },
|
{ title: '报检总数', key: 'totalQty',align: 'center' },
|
||||||
|
{ title: '已检验数量', key: 'inspectQty',align: 'center' },
|
||||||
{ title: '质检状态', key: 'status',align: 'center',
|
{ title: '质检状态', key: 'status',align: 'center',
|
||||||
render(row) {
|
render(row) {
|
||||||
const val = row.status
|
const val = row.status
|
||||||
@ -606,8 +641,10 @@ const columns: DataTableColumns<QualityTesting> = [
|
|||||||
options: [
|
options: [
|
||||||
{ label: '查看详情', key: 'view' },
|
{ label: '查看详情', key: 'view' },
|
||||||
{ type: 'divider' }, // 分割线
|
{ type: 'divider' }, // 分割线
|
||||||
{ label: '提交判定明细', key: 'submitResultDetail' },
|
{ label: '提交判定明细', key: 'submitResultDetail',show:row.status == 1 },
|
||||||
{ type: 'divider' }, // 分割线
|
{ 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' },
|
{ label: '查询判定明细', key: 'queryResultDetail' },
|
||||||
{ type: 'divider' }, // 分割线
|
{ type: 'divider' }, // 分割线
|
||||||
{ label: '质检撤回', key: 'cancelQuality' },
|
{ label: '质检撤回', key: 'cancelQuality' },
|
||||||
@ -621,6 +658,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
|
||||||
@ -930,7 +970,7 @@ async function loadAssignWorkOrder() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//提交判定明细
|
//提交判定明细
|
||||||
async function submitResultDetail(row) {
|
function submitResultDetail(row) {
|
||||||
Object.assign(formDetailOKData, reactive<QcResultDetail>({ ...defaultFormDetailData, resultType: 1,handleAction:'下一道工序',actionStatus:1 }))
|
Object.assign(formDetailOKData, reactive<QcResultDetail>({ ...defaultFormDetailData, resultType: 1,handleAction:'下一道工序',actionStatus:1 }))
|
||||||
Object.assign(formDetailScrapData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 2,handleAction:'报废次品',actionStatus:1 }))
|
Object.assign(formDetailScrapData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 2,handleAction:'报废次品',actionStatus:1 }))
|
||||||
Object.assign(formDetailReworkData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 3,handleAction:'返工',actionStatus:1 }))
|
Object.assign(formDetailReworkData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 3,handleAction:'返工',actionStatus:1 }))
|
||||||
@ -938,6 +978,7 @@ async function submitResultDetail(row) {
|
|||||||
if (row.traceType != 1) {
|
if (row.traceType != 1) {
|
||||||
traceCodeShow.value = true
|
traceCodeShow.value = true
|
||||||
}
|
}
|
||||||
|
submitFlag.value = true
|
||||||
submitDetailModalVisible.value = true
|
submitDetailModalVisible.value = true
|
||||||
formDetailOKData.qcId = row.id
|
formDetailOKData.qcId = row.id
|
||||||
formDetailScrapData.qcId = row.id
|
formDetailScrapData.qcId = row.id
|
||||||
@ -946,18 +987,35 @@ async function submitResultDetail(row) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function handleSubmitResultDetail() {
|
async function handleSubmitResultDetail() {
|
||||||
try {
|
const submitParam = [formDetailOKData,formDetailScrapData,formDetailReworkData,formDetailConcessionData]
|
||||||
const submitParam = [formDetailOKData,formDetailScrapData,formDetailReworkData,formDetailConcessionData]
|
submitFlag.value? await qualityTestingApi.submit(submitParam) : await qualityTestingApi.submitBF(submitParam)
|
||||||
await qualityTestingApi.submit(submitParam)
|
|
||||||
message.success('提交成功')
|
message.success('提交成功')
|
||||||
}catch ( error) {
|
|
||||||
message.error('提交失败'+error)
|
|
||||||
}
|
|
||||||
submitDetailModalVisible.value = false
|
submitDetailModalVisible.value = false
|
||||||
loadData()
|
loadData()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//提交部分判定明细
|
||||||
|
function submitBFResultDetail(row) {
|
||||||
|
Object.assign(formDetailOKData, reactive<QcResultDetail>({ ...defaultFormDetailData, resultType: 1,handleAction:'下一道工序',actionStatus:1 }))
|
||||||
|
Object.assign(formDetailScrapData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 2,handleAction:'报废次品',actionStatus:1 }))
|
||||||
|
Object.assign(formDetailReworkData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 3,handleAction:'返工',actionStatus:1 }))
|
||||||
|
Object.assign(formDetailConcessionData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 4,handleAction:'让步接收',actionStatus:1 }))
|
||||||
|
|
||||||
|
if (row.traceType != 1) {
|
||||||
|
traceCodeShow.value = true
|
||||||
|
}
|
||||||
|
submitFlag.value = false
|
||||||
|
submitDetailModalVisible.value = true
|
||||||
|
formDetailOKData.qcId = row.id
|
||||||
|
formDetailScrapData.qcId = row.id
|
||||||
|
formDetailReworkData.qcId = row.id
|
||||||
|
formDetailConcessionData.qcId = row.id
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//查询判定明细
|
//查询判定明细
|
||||||
function queryResultDetail(row) {
|
function queryResultDetail(row) {
|
||||||
let path = `detail/${row.id}`;
|
let path = `detail/${row.id}`;
|
||||||
@ -983,6 +1041,24 @@ function handleCancelQuality(row) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//上传附件
|
||||||
|
const handleUploadChange = ({ file, fileList: list }: any) => {
|
||||||
|
uploadFiles.value = list.map(item => item.file)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 表单保存时调用
|
||||||
|
const submitUpload = async (billId: number) => {
|
||||||
|
if (!uploadFiles.value.length) return
|
||||||
|
const formData = new FormData()
|
||||||
|
formData.append('billId', String(billId))
|
||||||
|
uploadFiles.value.forEach(file => {
|
||||||
|
formData.append('files', file)
|
||||||
|
})
|
||||||
|
console.log(uploadFiles);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadData()
|
loadData()
|
||||||
loadDictOptions()
|
loadDictOptions()
|
||||||
|
|||||||
@ -508,20 +508,6 @@ const columns = [
|
|||||||
key: 'assingStatus',
|
key: 'assingStatus',
|
||||||
minWidth: 150,
|
minWidth: 150,
|
||||||
render(row:any) {
|
render(row:any) {
|
||||||
// let text = ''
|
|
||||||
// if(row.assingStatus == 1){
|
|
||||||
// text = '待执行'
|
|
||||||
// }else if(row.assingStatus == 2){
|
|
||||||
// text = '执行中'
|
|
||||||
// }else if(row.assingStatus == 3){
|
|
||||||
// text = '质检中'
|
|
||||||
// }else if(row.assingStatus == 4){
|
|
||||||
// text = '已汇报'
|
|
||||||
// }else if(row.assingStatus == 5){
|
|
||||||
// text = '已关闭'
|
|
||||||
// }
|
|
||||||
|
|
||||||
// return text
|
|
||||||
const val = row.assingStatus
|
const val = row.assingStatus
|
||||||
const opt = qcAssingStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
|
const opt = qcAssingStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
|
||||||
if (!opt) return val ?? '-'
|
if (!opt) return val ?? '-'
|
||||||
@ -626,7 +612,7 @@ const columns = [
|
|||||||
}
|
}
|
||||||
if(row.status == 2){
|
if(row.status == 2){
|
||||||
return h(NTag, {
|
return h(NTag, {
|
||||||
type:'warning',
|
type:'error',
|
||||||
size: 'small'
|
size: 'small'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -285,7 +285,7 @@ const columns = [
|
|||||||
{
|
{
|
||||||
align:'center',
|
align:'center',
|
||||||
title: '工人名称',
|
title: '工人名称',
|
||||||
key: 'stringUserName',
|
key: 'userName',
|
||||||
minWidth: 200
|
minWidth: 200
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user