|
|
@ -27,20 +27,6 @@ |
|
|
|
</ContentWrap> |
|
|
|
|
|
|
|
<!-- 表单弹窗:添加/修改 --> |
|
|
|
<!-- <BasicForm ref="formRef" |
|
|
|
@success="getList" |
|
|
|
:rules="InspectionRecordMainRules" |
|
|
|
:formAllSchemas="InspectionRecordMain.allSchemas" |
|
|
|
:tableData="tableData" |
|
|
|
:tableAllSchemas="InspectionJobPackage.allSchemas" |
|
|
|
:tableFormRules="InspectionJobPackageRules" |
|
|
|
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain" |
|
|
|
:apiCreate="InspectionRecordMainApi.createInspectionRecordMain" |
|
|
|
|
|
|
|
@handleAddTable="handleAddTable" |
|
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
|
@submitForm="submitForm" /> --> |
|
|
|
<AddForm |
|
|
|
ref="formRef" |
|
|
|
basicFormWidth="80" |
|
|
@ -49,7 +35,6 @@ |
|
|
|
:rules="InspectionRecordMainRules" |
|
|
|
:formAllSchemas="InspectionRecordMain.allSchemas" |
|
|
|
@submitForm="submitForm" |
|
|
|
@onChange='onChange' |
|
|
|
/> |
|
|
|
<Detail |
|
|
|
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" |
|
|
@ -91,42 +76,9 @@ |
|
|
|
tableColumns.value = val |
|
|
|
} |
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
|
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { |
|
|
|
nextTick(async () => { |
|
|
|
if (type == 'tableForm') { |
|
|
|
// 明细查询页赋值 |
|
|
|
row[formField] = val[0][searchField] |
|
|
|
// row['itemNumber'] = val[0]['number'] |
|
|
|
// row['itemName'] = val[0]['name'] |
|
|
|
// row['uom'] = val[0]['uom'] |
|
|
|
// row['isRadeIn'] = val[0]['isRadeIn'] |
|
|
|
// row['available'] = val[0]['available'] |
|
|
|
} else { |
|
|
|
const setV = {} |
|
|
|
setV[formField] = val[0][searchField] |
|
|
|
formRef.setValues(setV) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// 查询页面返回——详情 |
|
|
|
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { |
|
|
|
nextTick(async () => { |
|
|
|
const setV = {} |
|
|
|
// if(formField == 'itemCode'){ |
|
|
|
// await ItembasicApi.getItembasicPage({ |
|
|
|
// code: setV['itemCode'] |
|
|
|
// }).then(res => { |
|
|
|
// setV['uom'] = res.list[0].uom |
|
|
|
// setV[formField] = val[0][searchField] |
|
|
|
// }) |
|
|
|
// } |
|
|
|
formRef.setValues(setV) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 子表新增的时候选择表格之后需要会显得字段 |
|
|
|
const Echo = [] |
|
|
|
const { tableObject, tableMethods } = useTable({ |
|
|
|
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage // 分页接口 |
|
|
|
}) |
|
|
@ -141,14 +93,6 @@ |
|
|
|
defaultButtons.defaultFreshBtn(null), // 刷新 |
|
|
|
defaultButtons.defaultFilterBtn(null), // 筛选 |
|
|
|
defaultButtons.defaultSetBtn(null), // 设置 |
|
|
|
// { |
|
|
|
// label: '自定义扩展按钮', |
|
|
|
// name: 'zdy', |
|
|
|
// hide: false, |
|
|
|
// type: 'primary', |
|
|
|
// icon: 'Select', |
|
|
|
// color: '' |
|
|
|
// }, |
|
|
|
] |
|
|
|
|
|
|
|
// 头部按钮事件 |
|
|
@ -169,10 +113,14 @@ |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isShowMainButton = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
return false |
|
|
|
} else { |
|
|
|
return true |
|
|
|
if(val){ |
|
|
|
if(row.useDecision){ |
|
|
|
return false |
|
|
|
}else{ |
|
|
|
return true |
|
|
|
} |
|
|
|
}else{ |
|
|
|
return !row.isPublished |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -180,9 +128,9 @@ |
|
|
|
const butttondata = (row) => { |
|
|
|
return [ |
|
|
|
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // 完成 |
|
|
|
defaultButtons.mainListEditBtn({hasPermi:'qms:inspection-recode-main:edit'}), // 编辑 |
|
|
|
defaultButtons.mainApplyDecisionBtn({ hide: isShowMainButton(row, null),hasPermi:'qms:inspection-recode-main:edit'}), // 使用决策 |
|
|
|
// defaultButtons.mainListDeleteBtn(null), // 删除 |
|
|
|
defaultButtons.mainListOrderPubBtn({hasPermi:'qms:inspection-recode-main:pub'}), // 发布 |
|
|
|
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row,'pub'),hasPermi:'qms:inspection-recode-main:pub'}), // 发布 |
|
|
|
defaultButtons.mainListPackageBtn(null), // 包装 |
|
|
|
] |
|
|
|
} |
|
|
@ -190,7 +138,7 @@ |
|
|
|
const listTableRef = ref() |
|
|
|
// 列表-操作按钮事件 |
|
|
|
const buttonTableClick = async (val, row) => { |
|
|
|
if (val == 'edit') { // 编辑 |
|
|
|
if (val == 'applyDecision') { // 编辑 |
|
|
|
// 评估代码值是1,接收时候,使用决策下拉列表是全部合格 |
|
|
|
if(row.estimateCode == 1){ |
|
|
|
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) =>{ |
|
|
@ -208,6 +156,12 @@ |
|
|
|
openForm('update', row) |
|
|
|
}else if (val == 'mainPackage') { // 包装 |
|
|
|
const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id) |
|
|
|
list.forEach(item=>{ |
|
|
|
item.qualifiedAmount = item.qualifiedAmount ?item.qualifiedAmount :0 |
|
|
|
item.noQualifiedAmount = item.noQualifiedAmount ?item.noQualifiedAmount :0 |
|
|
|
item.destroyAmount = item.destroyAmount ?item.destroyAmount :0 |
|
|
|
item.frozenAmount = item.frozenAmount ?item.frozenAmount :0 |
|
|
|
}) |
|
|
|
listTableRef.value.openPackage(row,'包装信息',InspectionRecordPackage.allSchemas.tableColumns,list) |
|
|
|
}else if (val == 'delete') { // 删除 |
|
|
|
handleDelete(row.id) |
|
|
@ -245,10 +199,10 @@ |
|
|
|
const handleOrderPub = async (row : object) => { |
|
|
|
try { |
|
|
|
// 删除的二次确认 |
|
|
|
await message.confirm('是否发布所选数据') |
|
|
|
await message.confirm(t('common.confirmPublish')) |
|
|
|
// 发起删除 |
|
|
|
await InspectionRecordMainApi.publishInspectionRecordMain(row) |
|
|
|
message.success('发布成功') |
|
|
|
await InspectionRecordMainApi.publishInspectionRecordMain(row.id) |
|
|
|
message.success(t('common.publishSuccess')) |
|
|
|
// 刷新列表 |
|
|
|
await getList() |
|
|
|
} catch { } |
|
|
@ -281,30 +235,6 @@ |
|
|
|
}) |
|
|
|
const tableData = ref([]) |
|
|
|
|
|
|
|
// 添加明细 |
|
|
|
const handleAddTable = () => { |
|
|
|
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys))) |
|
|
|
} |
|
|
|
// 删除明细 |
|
|
|
const handleDeleteTable = (item, index) => { |
|
|
|
tableData.value.splice(index, 1) |
|
|
|
} |
|
|
|
const count = ref(0) |
|
|
|
const onChange = (field, cur)=>{ |
|
|
|
console.log(field, cur) |
|
|
|
// if(field=='useDecision'){ |
|
|
|
// if(cur == 1){ |
|
|
|
// InspectionRecordPackage.allSchemas.tableFormColumns.forEach(item=>{ |
|
|
|
// if(item.field == 'qualifiedAmount'){ |
|
|
|
// console.log(item.disabled) |
|
|
|
// item.disabled = true |
|
|
|
// console.log(item.disabled) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// } |
|
|
|
// } |
|
|
|
console.log(InspectionRecordPackage.allSchemas.tableFormColumns) |
|
|
|
} |
|
|
|
// // 主子数据 提交 |
|
|
|
const submitForm = async (formType, data) => { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
@ -324,23 +254,6 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** 导入 */ |
|
|
|
const importFormRef = ref() |
|
|
|
const handleImport = () => { |
|
|
|
importFormRef.value.open() |
|
|
|
} |
|
|
|
|
|
|
|
// 导入附件弹窗所需的参数 |
|
|
|
const importTemplateData = reactive({ |
|
|
|
templateUrl: '', |
|
|
|
templateTitle: '采购订单主导入模版.xlsx' |
|
|
|
}) |
|
|
|
|
|
|
|
// 导入成功之后 |
|
|
|
const importSuccess = () => { |
|
|
|
getList() |
|
|
|
} |
|
|
|
|
|
|
|
// 筛选提交 |
|
|
|
const searchFormClick = (searchData) => { |
|
|
|
tableObject.params = { |
|
|
|