diff --git a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts b/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
index aeb223f30..8214ed279 100644
--- a/src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
+++ b/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) => {
diff --git a/src/locales/en-US.ts b/src/locales/en-US.ts
index c59422a44..ae7a3c109 100644
--- a/src/locales/en-US.ts
+++ b/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',
diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts
index 3bea036ee..7ae071d67 100644
--- a/src/locales/zh-CN.ts
+++ b/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: '弹窗',
diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts
index 7e42a749b..36f241725 100644
--- a/src/utils/disposition/defaultButtons.ts
+++ b/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 {
diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue
index e931fdefb..a7b6837fd 100644
--- a/src/views/qms/inspection/inspectionJob/addForm.vue
+++ b/src/views/qms/inspection/inspectionJob/addForm.vue
@@ -58,9 +58,9 @@
-
+
@@ -76,7 +76,7 @@
-
+
检验特性
@@ -235,6 +235,23 @@
/>
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
{
)
)
}
- 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: '' //不合格数量
diff --git a/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts b/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
index 276eb2f50..a9ca2062b 100644
--- a/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
+++ b/src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
@@ -221,7 +221,7 @@ export const InspectionJobMain = useCrudSchemas(reactive([
},
{
label: '采样总数量',
- field: 'sampleTatalAmount',
+ field: 'sampleTotalAmount',
sort: 'custom',
isSearch: false,
form: {
@@ -250,22 +250,22 @@ export const InspectionJobMain = useCrudSchemas(reactive([
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',
diff --git a/src/views/qms/inspection/inspectionRecord/addForm.vue b/src/views/qms/inspection/inspectionRecord/addForm.vue
index 6014f7e97..a426b4e5c 100644
--- a/src/views/qms/inspection/inspectionRecord/addForm.vue
+++ b/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,14 +247,16 @@ 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){
- let isBol = data.value.packageList.filter(cur=>parseFloat(cur.qualifiedAmount)+parseFloat(cur.noQualifiedAmount)>parseFloat(cur.amount))
- console.log(isBol)
- if(isBol&&isBol.length>0){
- message.error(`合格数量和不合格数量总和不可以大于数量`)
- return
- }
+ 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){
+ message.error(`合格数量和不合格数量总和不可以大于数量`)
+ return
+ }
+ }
}
if (formType.value == 'create') {
// 主子表——提交请求
diff --git a/src/views/qms/inspection/inspectionRecord/index.vue b/src/views/qms/inspection/inspectionRecord/index.vue
index 2c20db498..500801013 100644
--- a/src/views/qms/inspection/inspectionRecord/index.vue
+++ b/src/views/qms/inspection/inspectionRecord/index.vue
@@ -27,20 +27,6 @@
-
{
- 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 = {
diff --git a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
index cc63cc7f5..6944be4fc 100644
--- a/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
+++ b/src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
@@ -22,7 +22,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([
},
{
label: '申请编码',
- field: 'applicationCode',
+ field: 'requestNumber',
sort: 'custom',
isSearch: true,
isForm:false,
@@ -32,7 +32,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([
},
{
label: '任务编码',
- field: 'taskCode',
+ field: 'jobNumber',
sort: 'custom',
isSearch: false,
isForm:false,
@@ -49,16 +49,50 @@ export const InspectionRecordMain = useCrudSchemas(reactive([
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: '批次',
@@ -102,7 +136,7 @@ export const InspectionRecordMain = useCrudSchemas(reactive([
},
{
label: '采样总数量',
- field: 'sampleTatalAmount',
+ field: 'sampleTotalAmount',
sort: 'custom',
isSearch: false,
isForm:false,
@@ -124,16 +158,6 @@ export const InspectionRecordMain = useCrudSchemas(reactive([
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([
}
},
{
+ // reference_certificate_row
label: '参考凭证行',
field: 'referenceCertificateRow',
sort: 'custom',