修改派工前端代码
This commit is contained in:
parent
729c76e5ef
commit
1b51d68a25
@ -68,6 +68,10 @@ export const qualityTestingApi = {
|
||||
submit(data: QcResultDetail[]) {
|
||||
return request({ url: '/mes/qc/judge', method: 'put', data })
|
||||
},
|
||||
|
||||
submitBF(data: QcResultDetail[]) {
|
||||
return request({ url: '/mes/qc/partial', method: 'post', data })
|
||||
},
|
||||
//质检撤回
|
||||
cancel(id: number) {
|
||||
return request({ url: `/mes/dispatch/revoke/${id}`, method: 'put' })
|
||||
|
||||
@ -312,12 +312,38 @@
|
||||
</n-gi>
|
||||
</n-grid>
|
||||
<n-form-item label="备注" >
|
||||
<n-input
|
||||
v-model:value="formDetailConcessionData.remark"
|
||||
type="textarea"
|
||||
placeholder="输入备注原因"
|
||||
/>
|
||||
</n-form-item>
|
||||
<n-input
|
||||
v-model:value="formDetailConcessionData.remark"
|
||||
type="textarea"
|
||||
placeholder="输入备注原因"
|
||||
/>
|
||||
</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-collapse-item>
|
||||
</n-collapse>
|
||||
@ -339,7 +365,7 @@ import {
|
||||
NButton, NSpace, NIcon, NUpload,NTag, useMessage, useDialog, type DataTableColumns, type UploadCustomRequestOptions,
|
||||
NDropdown
|
||||
} from 'naive-ui'
|
||||
import { } from '@vicons/ionicons5'
|
||||
|
||||
import {
|
||||
SearchOutline, RefreshOutline, AddOutline, TrashOutline, CreateOutline, CloudUploadOutline, DownloadOutline,
|
||||
EllipsisHorizontalOutline, ArrowDownOutline, ArrowUpOutline
|
||||
@ -391,6 +417,9 @@ const detailIsCollapse = ref(true)
|
||||
//提交判定明细
|
||||
const submitDetailModalVisible = ref(false)
|
||||
const traceCodeShow = ref(false)
|
||||
//提交明细/部分提交明细标识
|
||||
const submitFlag = ref<Boolean>()
|
||||
|
||||
|
||||
const customOrderKeys = [
|
||||
'materialCode',
|
||||
@ -522,6 +551,11 @@ const defaultFormDetailData:QcResultDetail = {
|
||||
handleAction: undefined,
|
||||
actionStatus: undefined
|
||||
}
|
||||
|
||||
//提交附件
|
||||
const fileList = ref<any[]>([])
|
||||
const uploadFiles = ref<File[]>([])
|
||||
|
||||
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 })
|
||||
@ -567,6 +601,7 @@ const columns: DataTableColumns<QualityTesting> = [
|
||||
// { title: '关联工序计划ID', key: 'processId' },
|
||||
// { title: '物料ID', key: 'itemId' },
|
||||
{ title: '报检总数', key: 'totalQty',align: 'center' },
|
||||
{ title: '已检验数量', key: 'inspectQty',align: 'center' },
|
||||
{ title: '质检状态', key: 'status',align: 'center',
|
||||
render(row) {
|
||||
const val = row.status
|
||||
@ -606,8 +641,10 @@ const columns: DataTableColumns<QualityTesting> = [
|
||||
options: [
|
||||
{ label: '查看详情', key: 'view' },
|
||||
{ type: 'divider' }, // 分割线
|
||||
{ label: '提交判定明细', key: 'submitResultDetail' },
|
||||
{ type: 'divider' }, // 分割线
|
||||
{ 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' },
|
||||
@ -621,6 +658,9 @@ const columns: DataTableColumns<QualityTesting> = [
|
||||
case 'submitResultDetail':
|
||||
submitResultDetail(row)
|
||||
break
|
||||
case 'submitBFResultDetail':
|
||||
submitBFResultDetail(row)
|
||||
break
|
||||
case 'queryResultDetail':
|
||||
queryResultDetail(row)
|
||||
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(formDetailScrapData, reactive<QcResultDetail>({ ...defaultFormDetailData,resultType: 2,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) {
|
||||
traceCodeShow.value = true
|
||||
}
|
||||
submitFlag.value = true
|
||||
submitDetailModalVisible.value = true
|
||||
formDetailOKData.qcId = row.id
|
||||
formDetailScrapData.qcId = row.id
|
||||
@ -946,18 +987,35 @@ async function submitResultDetail(row) {
|
||||
}
|
||||
|
||||
async function handleSubmitResultDetail() {
|
||||
try {
|
||||
const submitParam = [formDetailOKData,formDetailScrapData,formDetailReworkData,formDetailConcessionData]
|
||||
await qualityTestingApi.submit(submitParam)
|
||||
message.success('提交成功')
|
||||
}catch ( error) {
|
||||
message.error('提交失败'+error)
|
||||
}
|
||||
const submitParam = [formDetailOKData,formDetailScrapData,formDetailReworkData,formDetailConcessionData]
|
||||
submitFlag.value? await qualityTestingApi.submit(submitParam) : await qualityTestingApi.submitBF(submitParam)
|
||||
|
||||
message.success('提交成功')
|
||||
submitDetailModalVisible.value = false
|
||||
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) {
|
||||
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(() => {
|
||||
loadData()
|
||||
loadDictOptions()
|
||||
|
||||
@ -508,20 +508,6 @@ const columns = [
|
||||
key: 'assingStatus',
|
||||
minWidth: 150,
|
||||
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 opt = qcAssingStatusOptions.value.find(o => o.value === val || String(o.value) === String(val))
|
||||
if (!opt) return val ?? '-'
|
||||
@ -626,7 +612,7 @@ const columns = [
|
||||
}
|
||||
if(row.status == 2){
|
||||
return h(NTag, {
|
||||
type:'warning',
|
||||
type:'error',
|
||||
size: 'small'
|
||||
},
|
||||
{
|
||||
|
||||
@ -285,7 +285,7 @@ const columns = [
|
||||
{
|
||||
align:'center',
|
||||
title: '工人名称',
|
||||
key: 'stringUserName',
|
||||
key: 'userName',
|
||||
minWidth: 200
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user