Browse Source

检验记录自测修改

master_hella_20240701
zhang_li 8 months ago
parent
commit
45aa887908
  1. 4
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  2. 7
      src/locales/en-US.ts
  3. 5
      src/locales/zh-CN.ts
  4. 12
      src/utils/disposition/defaultButtons.ts
  5. 79
      src/views/qms/inspection/inspectionJob/addForm.vue
  6. 34
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  7. 15
      src/views/qms/inspection/inspectionRecord/addForm.vue
  8. 123
      src/views/qms/inspection/inspectionRecord/index.vue
  9. 53
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

4
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -64,8 +64,8 @@ export const importTemplate = () => {
return request.download({ url: '/qms/inspection-record-main/get-import-template' })
}
// 发布
export const publishInspectionRecordMain = async (data ) => {
return await request.put({ url: `/qms/inspection-record-main/publish`, data })
export const publishInspectionRecordMain = async (id) => {
return await request.put({ url: `/qms/inspection-record-main/publish?id=`+id })
}
//查询包装列表
export const getInspectionRecordPackageList = async (id: number) => {

7
src/locales/en-US.ts

@ -61,6 +61,7 @@ export default {
agreeSuccess: 'Agree Success',
refusedSuccess: 'Refused Success',
handleSuccess: 'Handle Success',
publishSuccess: 'Publish Success',
acceptSuccess: 'Accept Success',
giveupSuccess: 'Giveup Success',
dealwithSuccess: 'Dealwith Success',
@ -71,7 +72,8 @@ export default {
confirmHandle: 'Confirm Handle?',
confirmSubmit: 'Confirm Submit?',
confirmAccept: 'Confirm Accept',
confirmGiveup: 'Confirm Giveup'
confirmGiveup: 'Confirm Giveup',
confirmPublish: 'Confirm Publish',
},
error: {
noPermission: `Sorry, you don't have permission to access this page.`,
@ -319,7 +321,8 @@ export default {
fileUpload: 'File Upload',
createLabel: 'create label',
viewDetail:'Detailed list',
updataRecode:'Updata recode'
updataRecode:'Updata recode',
applyDecision:'Apply Decision',
},
dialog: {
dialog: 'Dialog',

5
src/locales/zh-CN.ts

@ -61,6 +61,7 @@ export default {
agreeSuccess: '审批通过成功',
refusedSuccess: '审批驳回成功',
handleSuccess: '执行成功',
publishSuccess: '发布成功',
dealwithSuccess: '处理成功',
acceptSuccess: '承接成功',
giveupSuccess: '放弃成功',
@ -72,6 +73,7 @@ export default {
confirmSubmit: '确认提交吗?',
confirmAccept: '确认承接吗?',
confirmGiveup: '确认放弃吗?',
confirmPublish: '确认发布吗?',
},
error: {
noPermission: `抱歉,您无权访问此页面。`,
@ -318,7 +320,8 @@ export default {
dataUpdate: '字典数据编辑',
createLabel: '创建标签',
viewDetail:'明细列表',
updataRecode:'更新记录'
updataRecode:'更新记录',
applyDecision:'使用决策',
},
dialog: {
dialog: '弹窗',

12
src/utils/disposition/defaultButtons.ts

@ -849,6 +849,18 @@ export function mainUpdataRecodeBtn(option:any) {
hasPermi: ''
})
}
// 主列表-使用决策
export function mainApplyDecisionBtn(option:any) {
return __defaultBtnOption(option,{
label: '使用决策',
name: 'applyDecision',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 默认按钮规则
function __defaultBtnOption(option:any,specific:any){
return {

79
src/views/qms/inspection/inspectionJob/addForm.vue

@ -58,9 +58,9 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检验方案模板编码">
<el-form-item label="检验特性编号">
<el-input
v-model="item.inspectionCode"
v-model="item.inspectionFeatureCode"
placeholder="根据系统生成"
:disabled="true"
/>
@ -76,7 +76,7 @@
<el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item>
</el-col>
<el-col :span="12">
<!-- <el-col :span="12">
<el-form-item label="检验特性编码">
<el-input
v-model="item.inspectionCharCode"
@ -84,7 +84,7 @@
:disabled="true"
/>
</el-form-item>
</el-col>
</el-col> -->
</el-row>
</el-form>
<div class="small-title">检验特性</div>
@ -235,6 +235,23 @@
/>
</el-form-item>
</el-col>
<!-- 手动评估的时候显示 -->
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="评估代码" required>
<el-select
v-model="item.inspectionJobCharacteristicsUpdateReqVO.estimateCode"
placeholder="请选择评估代码"
@change="changeFeatureType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span="24"
style="
@ -268,23 +285,7 @@
/>
</el-form-item>
</el-col>
<!-- 手动评估的时候显示 -->
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1">
<el-form-item label="评估代码" required>
<el-select
v-model="cur.estimateCode"
placeholder="请选择评估代码"
@change="changeFeatureType"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.EVALUATION_CODE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
@ -511,13 +512,16 @@ const rules = ref({
{ required: true, message: '请输入小数位', trigger: 'blur' }
],
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'change' }
{ required: true, message: '请选择集编码', trigger: 'change' }
],
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [
{ required: true, message: '请输入选择开始时间', trigger: 'change' }
{ required: true, message: '请选择开始时间', trigger: 'change' }
],
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [
{ required: true, message: '请输入选择结束时间', trigger: 'blur' }
{ required: true, message: '请选择结束时间', trigger: 'blur' }
],
'inspectionJobCharacteristicsUpdateReqVO.estimateCode': [
{ required: true, message: '请选择评估代码', trigger: 'blur' }
],
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }]
})
@ -549,7 +553,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
@ -561,7 +564,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
@ -584,6 +586,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false
}
if (item.samplingProcessRespVO.evaluationMode == 1) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = true
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false
}
})
data.value.subList = list
@ -752,15 +759,15 @@ const submitForm = async () => {
)
)
}
if (item.samplingProcessRespVO.evaluationMode == 1) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return !cur.estimateCode
}
)
)
}
// if (item.samplingProcessRespVO.evaluationMode == 1) {
// arrBol.push(
// item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
// (cur, key) => {
// return !cur.estimateCode
// }
// )
// )
// }
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
@ -973,7 +980,6 @@ const resultEntryMethodChange = (e, item) => {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //
@ -985,7 +991,6 @@ const resultEntryMethodChange = (e, item) => {
{
inspectionValue: '', //
qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', //
qualifiedQuantity: '', //
unqualifiedQuantity: '' //

34
src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts

@ -221,7 +221,7 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
field: 'sampleTotalAmount',
sort: 'custom',
isSearch: false,
form: {
@ -250,22 +250,22 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
}
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
dictClass: 'string',
form:{
componentProps:{
disabled:true
}
},
table: {
width: 150
}
},
// {
// label: '检验批来源',
// field: 'inspectionBatchSource',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
// dictClass: 'string',
// form:{
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
{
label: '检验阶段',
field: 'inspectionStage',

15
src/views/qms/inspection/inspectionRecord/addForm.vue

@ -111,11 +111,6 @@ const data = ref({
subList: []
})
const dialogVisibleName = ref(false)
const nameForm = ref({
name: ''
})
const nameRef = ref()
if (props.basicFormWidth) {
dialogWidth.value = props.basicFormWidth + '%'
} else {
@ -124,11 +119,7 @@ if (props.basicFormWidth) {
/** 打开弹窗 */
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
dialogTitle.value = t('action.applyDecision')
formType.value = type
if (row) {
data.value = JSON.parse(JSON.stringify(row))
@ -256,8 +247,9 @@ const submitForm = async () => {
const validateForm1 = await tableFormRef.value.validateForm()
if (!validateForm1) return
const data1 = unref(formMainRef)?.formModel
console.log(33,data1)
data.value.useDecision = data1.useDecision
if(data1.useDecision == 2 || data1.useDecision == 6){
if(data.value.packageList.length>0){
let isBol = data.value.packageList.filter(cur=>parseFloat(cur.qualifiedAmount)+parseFloat(cur.noQualifiedAmount)>parseFloat(cur.amount))
console.log(isBol)
if(isBol&&isBol.length>0){
@ -265,6 +257,7 @@ const submitForm = async () => {
return
}
}
}
if (formType.value == 'create') {
//
emit('submitForm', formType.value, data.value)

123
src/views/qms/inspection/inspectionRecord/index.vue

@ -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,20 +113,24 @@
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
if(val){
if(row.useDecision){
return false
}else{
return true
}
}else{
return !row.isPublished
}
}
// -
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 = {

53
src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts

@ -22,7 +22,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '申请编码',
field: 'applicationCode',
field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm:false,
@ -32,7 +32,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '任务编码',
field: 'taskCode',
field: 'jobNumber',
sort: 'custom',
isSearch: false,
isForm:false,
@ -49,17 +49,51 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
table: {
width: 150
}
},{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
isForm:false,
table: {
width: 150
},
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料编码',
field: 'materialCode',
field: 'itemCode',
sort: 'custom',
isSearch: false,
isForm:false,
table: {
width: 150
},
form: {
componentProps:{
disabled:true
}
},
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom',
isSearch: false,
isForm:false,
table: {
width: 150
},
form: {
componentProps:{
disabled:true
}
},
},
{
label: '批次',
field: 'batch',
@ -102,7 +136,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
field: 'sampleTotalAmount',
sort: 'custom',
isSearch: false,
isForm:false,
@ -124,16 +158,6 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
}
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
isForm:false,
table: {
width: 150
}
},
{
label: '参考订单号',
field: 'referenceOrderCode',
@ -169,6 +193,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
}
},
{
// reference_certificate_row
label: '参考凭证行',
field: 'referenceCertificateRow',
sort: 'custom',

Loading…
Cancel
Save