diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts
index 0d150fc98..b17c3eb2d 100644
--- a/src/utils/disposition/defaultButtons.ts
+++ b/src/utils/disposition/defaultButtons.ts
@@ -896,6 +896,18 @@ export function mainApplyDecisionBtn(option:any) {
hasPermi: ''
})
}
+// 主列表-复制
+export function mainCopyBtn(option:any) {
+ return __defaultBtnOption(option,{
+ label: '复制',
+ name: 'copy',
+ hide: false,
+ type: 'primary',
+ color: '',
+ link: true, // 文本展现按钮
+ hasPermi: ''
+ })
+}
// 默认按钮规则
function __defaultBtnOption(option:any,specific:any){
return {
diff --git a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
index 729e1fcef..aa72e0a49 100644
--- a/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
+++ b/src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
@@ -562,30 +562,99 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
}
formType.value = type
if (row) {
- data.value = JSON.parse(JSON.stringify(row))
- data.value.version = String(data.value.version)
- let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
- list.forEach((item, index) => {
- editableTabsValue.value = index + 1
- item.name = index + 1
- // 编辑判断上限下限目标值是否必填
- if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
- rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
- } else {
- rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
+ console.log(row)
+ // 如果点击复制进入
+ if(formType.value == 'create'){
+ data.value ={
+ code: '',
+ description:row.description,
+ version:String(row.version),
+ dynamicUpdateCode:row.dynamicUpdateCode,
+ dynamicUpdateName:row.dynamicUpdateName,
+ process: []
}
- if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
- rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
- } else {
- rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
- }
- if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
- rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
- } else {
- rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
- }
- })
- data.value.process = list
+ let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
+ let arr = []
+ list.forEach((item, index) => {
+ editableTabsValue.value = index + 1
+ item.name = index + 1
+ console.log(item.inspectionCharacteristicsBaseVO)
+
+ let obj = {
+ description:item.description,
+ inspectionCharCode:item.inspectionCharCode,
+ inspectionCode:item.inspectionCode,
+ sequenceCode:item.sequenceCode,
+ name : index + 1,
+ inspectionCharacteristicsBaseVO:{
+ description:item.inspectionCharacteristicsBaseVO.description,
+ featureType:item.inspectionCharacteristicsBaseVO.featureType,
+ inspectionMethodCode:item.inspectionCharacteristicsBaseVO.inspectionMethodCode,
+ inspectionMethodName:item.inspectionCharacteristicsBaseVO.inspectionMethodName,
+ isCanUpdate:item.inspectionCharacteristicsBaseVO.isCanUpdate,
+ isDestructionInspection:item.inspectionCharacteristicsBaseVO.isDestructionInspection,
+ quantifyCapping:item.inspectionCharacteristicsBaseVO.quantifyCapping,
+ quantifyDecimal:item.inspectionCharacteristicsBaseVO.quantifyDecimal,
+ quantifyIsCapping:item.inspectionCharacteristicsBaseVO.quantifyIsCapping,
+ quantifyIsLowlimit:item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit,
+ quantifyIsTarget:item.inspectionCharacteristicsBaseVO.quantifyIsTarget,
+ quantifyLowlimit:item.inspectionCharacteristicsBaseVO.quantifyLowlimit,
+ quantifyQuantifyCode:item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode,
+ quantifyQuantifyName:item.inspectionCharacteristicsBaseVO.quantifyQuantifyName,
+ quantifyTarget:item.inspectionCharacteristicsBaseVO.quantifyTarget,
+ quantifyUom:item.inspectionCharacteristicsBaseVO.quantifyUom,
+ resultEntryMethod:item.inspectionCharacteristicsBaseVO.resultEntryMethod,
+ samplingProcessCode:item.inspectionCharacteristicsBaseVO.samplingProcessCode,
+ samplingProcessName:item.inspectionCharacteristicsBaseVO.samplingProcessName,
+ }
+ }
+
+ // 编辑判断上限下限目标值是否必填
+ if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
+ } else {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
+ }
+ if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
+ } else {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
+ }
+ if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
+ } else {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
+ }
+ arr.push(obj)
+ })
+ data.value.process = arr
+ }else{
+ data.value = JSON.parse(JSON.stringify(row))
+ data.value.version = String(data.value.version)
+ let list = await InspectionProcessPageApi.getListByTempleteCode(row.code)
+ list.forEach((item, index) => {
+ editableTabsValue.value = index + 1
+ item.name = index + 1
+ // 编辑判断上限下限目标值是否必填
+ if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
+ } else {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
+ }
+ if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
+ } else {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
+ }
+ if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
+ } else {
+ rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
+ }
+ })
+ data.value.process = list
+ }
+
} else {
data.value = {
code: '',
@@ -643,7 +712,6 @@ const buttonBaseClick1 = (val) => {
sequenceCode: '',
inspectionCharCode: '',
inspectionCharacteristicsBaseVO: {
- describe: '',
inspectionMethodCode: '',
samplingProcessCode: '',
isCanUpdate: '',
diff --git a/src/views/qms/basicDataManage/inspectionTemplate/index.vue b/src/views/qms/basicDataManage/inspectionTemplate/index.vue
index c04889e45..dd0a4cea7 100644
--- a/src/views/qms/basicDataManage/inspectionTemplate/index.vue
+++ b/src/views/qms/basicDataManage/inspectionTemplate/index.vue
@@ -138,6 +138,7 @@ const butttondata = (row) => {
defaultButtons.mainListEditBtn({hasPermi: 'qms:programme-template:update'}),
defaultButtons.mainListEnableBtn({hide:isShowMainButton(row,['FALSE']),hasPermi:'qms:programme-template:enable'}),
defaultButtons.mainListDisableBtn({hide:isShowMainButton(row,['TRUE']),hasPermi:'qms:programme-template:disable'}),
+ defaultButtons.mainCopyBtn({hasPermi:'qms:programme-template:copy'}),
]
}
@@ -151,6 +152,8 @@ const buttonTableClick = async (val, row) => {
handleEnable(row.id)
}else if (val == 'disable') {
handleDisable(row.id)
+ }else if (val == 'copy') {
+ openForm('create', row)
}
}
diff --git a/src/views/qms/inspection/inspectionJob/addForm.vue b/src/views/qms/inspection/inspectionJob/addForm.vue
index 300bdc829..8d3704a9a 100644
--- a/src/views/qms/inspection/inspectionJob/addForm.vue
+++ b/src/views/qms/inspection/inspectionJob/addForm.vue
@@ -8,7 +8,7 @@
-
+
检验工序
@@ -64,10 +64,17 @@
-
+
+
+
+
+
+
+
+
@@ -316,7 +323,7 @@ const rules = ref({
],
qualifiedQuantity: [{ required: true, message: '请输入选择结束时间', trigger: 'blur' }]
})
-
+const allSamplePieceSize = ref(0)
/** 打开弹窗 */
let tabIndex = 1
const open = async (type: string, row?: any, masterParmas?: any, titleName?: any) => {
@@ -326,6 +333,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
dialogTitle.value = t('action.' + type)
}
formType.value = type
+ allSamplePieceSize.value =0//打开时候归0
if (row) {
data.value = JSON.parse(JSON.stringify(row))
// console.log(data.value)// 发起承接
@@ -337,6 +345,9 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
editableTabsValue.value = index + 1
item.name = index + 1
item.inspectionJobCharacteristicsUpdateReqVO = item.inspectionJobCharacteristicsRespVO
+
+ // 总数量值是 样品份数 乘 每份样品量
+ allSamplePieceSize.value += parseFloat((parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.sampleQty) * parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.samplePieceSize)).toFixed(2))
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 0) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
@@ -384,8 +395,25 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
rules.value['inspectionJobCharacteristicsUpdateReqVO.estimateCode'][0].required = false
}
})
+ console.log(22,allSamplePieceSize.value )
data.value.subList = list
+ /**
+ 设置采样数量,默认第一个包装采样数量<总数量,显示数量字段,第二个包装和剩下的总数量对比,以此类推,
+ 第一个包装采样数量>总数量 则显示总数量
+ */
+ for(let i = 0; idata.value.packageList[i].amount){
+ data.value.packageList[i].sampleAmount = data.value.packageList[i].amount
+ allSamplePieceSize.value = parseFloat((allSamplePieceSize.value - data.value.packageList[i].amount).toFixed(2))
+ }else{
+ data.value.packageList[i].sampleAmount = allSamplePieceSize.value
+ allSamplePieceSize.value=0
+ // return;
+ }
+ }
+ // data.value.packageList.forEach(item=>{
+ // })
dialogVisible.value = true
nextTick(() => {
formMainRef.value.setValues(row)
@@ -522,7 +550,12 @@ const submitForm = async () => {
console.log(11,data.value.packageList)
if(data.value.packageList?.length>0){
const validateForm1 = await tableFormRef.value.validateForm()
- if (!validateForm1) return
+ if (!validateForm1) return
+ let isPass = data.value.packageList.some(cur=>parseFloat(cur.sampleAmount)>parseFloat(cur.amount))
+ if(isPass){
+ message.error(`采样数量不能大于数量`)
+ return
+ }
// let number = 0
// data.value.packageList.forEach(cur=>{
// number += parseFloat(cur.sampleAmount)
diff --git a/src/views/qms/inspection/inspectionJob/detail.vue b/src/views/qms/inspection/inspectionJob/detail.vue
index 3d93cde1d..a345b6424 100644
--- a/src/views/qms/inspection/inspectionJob/detail.vue
+++ b/src/views/qms/inspection/inspectionJob/detail.vue
@@ -11,7 +11,7 @@
-
+
检验工序
@@ -59,6 +59,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/qms/inspection/inspectionRecord/detail.vue b/src/views/qms/inspection/inspectionRecord/detail.vue
index 2ce5af780..5a8f664d4 100644
--- a/src/views/qms/inspection/inspectionRecord/detail.vue
+++ b/src/views/qms/inspection/inspectionRecord/detail.vue
@@ -76,47 +76,61 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+