Browse Source

Merge branch 'master_hella' of http://dev.ccwin-in.com:3000/sfms3.0/sfms3.0-ui into master_hella

hella_online_20240829
chenfang 3 months ago
parent
commit
7e0fca7bb9
  1. 282
      src/views/qms/inspectionRecordFirst/addForm.vue
  2. 38
      src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue
  3. 23
      src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts

282
src/views/qms/inspectionRecordFirst/addForm.vue

@ -34,9 +34,12 @@
<el-col :span="12">
<el-form-item label="物料编码" prop="itemCode">
<div style="display: flex; width: 100%">
<el-input v-model="data.itemCode" placeholder="请选择物料编码"
@blur="onBlur('item', ItemBasicApi.getItembasicPage)"
@focus="onFocus"/>
<el-input
v-model="data.itemCode"
placeholder="请选择物料编码"
@blur="onItemBlur('itemCode', ItemBasicApi.getItembasicPage)"
@focus="onFocus"
/>
<el-button type="info" plain style="width: 40px" @click="opensearchItemsTable()"
><Icon icon="ep:search" />
</el-button>
@ -45,7 +48,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="物料名称" prop="itemName">
<el-input v-model="data.itemName" placeholder="请填写描述" disabled />
<el-input v-model="data.itemName" placeholder="请填写名称" disabled />
</el-form-item>
</el-col>
<el-col :span="12">
@ -59,8 +62,14 @@
<el-input
v-model="data.inspectionSchemeCode"
placeholder="请选择检验方案"
@blur="onBlur('inspectionScheme', InspectionSchemeApi.InspectionSchemePage)"
@focus="onFocus"/>
@blur="
onInspectionSchemeBlur(
'inspectionSchemeCode',
InspectionSchemeApi.InspectionSchemePage
)
"
@focus="onFocus"
/>
<el-button
type="info"
plain
@ -90,7 +99,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="检验人" prop="creatorName">
<el-input v-model="data.creatorName" placeholder="请填写检验人" disabled/>
<el-input v-model="data.creatorName" placeholder="请填写检验人" disabled />
</el-form-item>
</el-col>
</el-row>
@ -194,7 +203,9 @@
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName"
v-model="
item.inspectionJobCharacteristicsUpdateReqVO.inspectionMethodName
"
disabled
placeholder="请选择检验方法"
/>
@ -208,7 +219,9 @@
>
<div style="display: flex; width: 100%">
<el-input
v-model="item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName"
v-model="
item.inspectionJobCharacteristicsUpdateReqVO.samplingProcessName
"
disabled
placeholder="请选择采样过程编码"
/>
@ -216,10 +229,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="样品份数"
prop="samplingProcessRespVO.sampleQty"
>
<el-form-item label="样品份数" prop="samplingProcessRespVO.sampleQty">
<div style="display: flex; width: 100%">
<el-input
v-model="item.samplingProcessRespVO.sampleQty"
@ -450,7 +460,6 @@
v-for="(cur, i) in item.inspectionJobCharacteristicsUpdateReqVO
.recordInspectionQuantifyList"
:key="i"
>
<div
style="
@ -458,12 +467,15 @@
border-radius: 4px;
padding-top: 16px;
margin-bottom: 10px;
">
"
>
<el-row :gutter="20">
<!-- 汇总录入的时候显示 -->
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
v-if="
item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1
"
>
<el-form-item label="合格数量" required>
<el-input
@ -475,7 +487,9 @@
</el-col>
<el-col
:span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1"
v-if="
item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1
"
>
<el-form-item label="不合格数量" required>
<el-input
@ -517,14 +531,13 @@
</el-select>
</el-form-item>
</el-col>
<el-col
:span="12"
>
<el-col :span="12">
<el-form-item label="备注">
<el-input
v-model="cur.remark"
placeholder="请输入备注"
type="text" maxlength="200"
type="text"
maxlength="200"
/>
</el-form-item>
</el-col>
@ -544,10 +557,9 @@
</div>
</el-tab-pane>
</el-tabs>
</div>
<template #footer>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" :key="count"/>
<ButtonBase :Butttondata="Butttondata" @button-base-click="buttonBaseClick" :key="count" />
</template>
</Dialog>
<Dialog
@ -581,18 +593,16 @@ import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDe
import { SearchTable } from '@/components/SearchTable'
import * as InspectionRecordDetail from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as ItemBasicApi from '@/api/wms/itembasic'
import { InspectionSchemeMain } from '@/views/qms/inspectionScheme/inspectionScheme.data'
import * as InspectionSchemeApi from '@/api/qms/InspectionScheme'
import { formatDate } from '@/utils/formatTime'
import { useUserStore } from '@/store/modules/user'
const userStore = useUserStore()
console.log(3355,userStore.getUser.id)
console.log(3355, userStore.getUser.id)
const { proxy } = getCurrentInstance()
@ -639,7 +649,7 @@ const props = defineProps({
type: Object,
required: true,
default: null
},
}
})
const { t } = useI18n() //
@ -661,7 +671,7 @@ const data = ref({
desc1: '',
inspectionSchemeCode: '',
inspectionBatch: '',
inspectionTime:formatDate(new Date()),
inspectionTime: formatDate(new Date()),
creator: userStore.getUser.id,
creatorName: userStore.getUser.nickname,
subList: []
@ -678,9 +688,7 @@ if (props.basicFormWidth) {
dialogWidth.value = props.isBusiness ? '60%' : '40%'
}
const rules = ref({
'inspectionTime': [
{ required: true, message: '请选择检验时间', trigger: 'blur' }
],
inspectionTime: [{ required: true, message: '请选择检验时间', trigger: 'blur' }],
'inspectionJobCharacteristicsUpdateReqVO.description': [
{ required: true, message: '请填写描述', trigger: ['blur', 'change'] }
],
@ -739,7 +747,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
if (row) {
data.value = JSON.parse(JSON.stringify(row))
let list = await InspectionRecordDetail.getInspectionRecordDetailList(data.value.id)
await processList( data.value,list)
await processList(data.value, list)
} else {
data.value = {
code: '',
@ -749,7 +757,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
desc1: '',
inspectionSchemeCode: '',
inspectionBatch: '',
inspectionTime:formatDate(new Date()),
inspectionTime: formatDate(new Date()),
creator: userStore.getUser.id,
creatorName: userStore.getUser.nickname,
subList: []
@ -760,7 +768,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
}
//
const processList =async (InspectionSchemeObj,list) => {
const processList = async (InspectionSchemeObj, list) => {
editableTabsValue.value = 1
list.forEach((item, index) => {
item.name = index + 1
@ -774,18 +782,17 @@ const processList =async (InspectionSchemeObj,list) => {
).toFixed(6)
)
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1 ? item.inspectionJobCharacteristicsUpdateReqVO.qualitativeRespVOList : item.inspectionJobCharacteristicsUpdateReqVO.quantifyRespVOList
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList =
item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1
? item.inspectionJobCharacteristicsUpdateReqVO.qualitativeRespVOList
: item.inspectionJobCharacteristicsUpdateReqVO.quantifyRespVOList
if (!item?.inspectionJobCharacteristicsUpdateReqVO?.recordInspectionQuantifyList) {
//
if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
for (
let i = 0;
i < parseInt(item.samplingProcessRespVO.sampleQty);
i++
) {
for (let i = 0; i < parseInt(item.samplingProcessRespVO.sampleQty); i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
@ -796,7 +803,7 @@ const processList =async (InspectionSchemeObj,list) => {
}
} else {
//
console.log(2333,item.inspectionJobCharacteristicsUpdateReqVO)
console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
@ -941,7 +948,7 @@ const validateForm = (formRef) => {
}
const submitForm = async () => {
try {
await formMainRef.value.validate()
await formMainRef.value.validate()
const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`)
@ -1092,9 +1099,9 @@ const opensearchItemsTable = () => {
)
}
const opensearchInspectionTable = () => {
if(!data.value.itemCode){
if (!data.value.itemCode) {
message.error(`请选择物料`)
return;
return
}
const _searchCondition = {}
const filters: any[] = []
@ -1183,11 +1190,7 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
for (
let i = 0;
i < parseInt(item.samplingProcessRespVO.sampleQty);
i++
) {
for (let i = 0; i < parseInt(item.samplingProcessRespVO.sampleQty); i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
@ -1198,9 +1201,10 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
}
} else {
//
console.log(2333,item.inspectionJobCharacteristicsUpdateReqVO)
console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required =
false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
@ -1225,7 +1229,8 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required =
false
}
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
@ -1242,7 +1247,7 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
data.value.subList = list
} else if (formField == 'inspectionSchemeCode') {
console.log(val[0])
const InspectionSchemeObj =val[0]
const InspectionSchemeObj = val[0]
data.value.samplePieceSize = InspectionSchemeObj.samplePieceSize
data.value.inspectionSchemeCode = InspectionSchemeObj.code
let list = await InspectionJobDetailApi.getBySchemeCode(data.value.inspectionSchemeCode)
@ -1264,11 +1269,7 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (item?.inspectionJobCharacteristicsUpdateReqVO?.resultEntryMethod == 2) {
// rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = true
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
for (
let i = 0;
i < parseInt(item.samplingProcessRespVO.sampleQty);
i++
) {
for (let i = 0; i < parseInt(item.samplingProcessRespVO.sampleQty); i++) {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
@ -1279,9 +1280,10 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
}
} else {
//
console.log(2333,item.inspectionJobCharacteristicsUpdateReqVO)
console.log(2333, item.inspectionJobCharacteristicsUpdateReqVO)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList = []
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyCapping'][0].required =
false
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', //
qualitativeCode: '', //
@ -1306,7 +1308,8 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required = false
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit'][0].required =
false
}
if (item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget) {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = true
@ -1383,15 +1386,22 @@ const boxList = ref()
// })
// }
const inspectionValueInput = (item, cur) => {
for ( let i = 0;i < item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.length;i++) {
for (
let i = 0;
i < item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.length;
i++
) {
item.isPass = true
// ,
// ,
if (
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue &&
parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue
) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping)
) {
item.isPass = false
return
@ -1401,8 +1411,11 @@ const inspectionValueInput = (item, cur) => {
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue &&
parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue
) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit)
) {
item.isPass = false
return
@ -1412,8 +1425,11 @@ const inspectionValueInput = (item, cur) => {
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue &&
parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue
) != parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)
) {
item.isPass = false
return
@ -1423,9 +1439,15 @@ const inspectionValueInput = (item, cur) => {
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
( parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue &&
(parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue
) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue
) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
item.isPass = false
return
@ -1435,9 +1457,12 @@ const inspectionValueInput = (item, cur) => {
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
(parseFloat(cur.inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping)||
parseFloat(cur.inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget))
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue &&
(parseFloat(cur.inspectionValue) >
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(cur.inspectionValue) <
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget))
) {
item.isPass = false
return
@ -1447,8 +1472,10 @@ const inspectionValueInput = (item, cur) => {
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
!item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
(parseFloat(cur.inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget)||
parseFloat(cur.inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
(parseFloat(cur.inspectionValue) >
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyTarget) ||
parseFloat(cur.inspectionValue) <
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
item.isPass = false
return
@ -1458,19 +1485,80 @@ const inspectionValueInput = (item, cur) => {
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsCapping &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsLowlimit &&
item.inspectionJobCharacteristicsUpdateReqVO.quantifyIsTarget &&
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue&&
(parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue &&
(parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i].inspectionValue
) > parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyCapping) ||
parseFloat(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList[i]
.inspectionValue
) < parseFloat(item.inspectionJobCharacteristicsUpdateReqVO.quantifyLowlimit))
) {
item.isPass = false
return
}
}
}
const onItemBlur = async (field, pageApi) => {
if (data.value[field]) {
const _searchCondition = {}
const filters: any[] = []
filters.push(
{
action: '==',
column: 'available',
value: 'TRUE'
},
{
column: 'type',
action: 'in',
value: 'BCP,CCP'
},
{
column: 'code',
action: '==',
value: data.value[field]?.trim()
}
)
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
_searchCondition.pageNo = 1
_searchCondition.pageSize = 20
_searchCondition.by = 'ASC'
const array = await pageApi(_searchCondition)
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
count.value++
const obj = array.list[0]
if (obj) {
// data.value['itemName'] = obj.name
// data.value['desc1'] = obj.desc1
// const searchTableSuccess = async(formField, searchField, val, type, row)
searchTableSuccess(field,'code',array.list,'main')
} else {
message.alert('暂无数据')
data.value[field] = ''
data.value['itemName'] = ''
data.value['desc1'] = ''
data.value['inspectionSchemeCode'] = ''
data.value.subList =[]
}
} else {
data.value[field] = ''
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
]
count.value++
}
}
//
const onBlur = async (field, pageApi, item) => {
const dataObj = item ? item.inspectionCharacteristicsBaseVO : data.value
if (dataObj[field + 'Code']) {
const onInspectionSchemeBlur = async (field, pageApi) => {
if (data.value[field]) {
const _searchCondition = {}
const filters: any[] = []
filters.push(
@ -1482,12 +1570,25 @@ const onBlur = async (field, pageApi, item) => {
{
column: 'code',
action: '==',
value: dataObj[field + 'Code']?.trim()
value: data.value[field]?.trim()
},
{
column: 'itemCode',
action: '==',
value: data.value.itemCode
},
{
column: 'inspectionType',
action: '==',
value: data.value.inspectionType
}
)
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
_searchCondition.pageNo = 1
_searchCondition.pageSize = 20
_searchCondition.by = 'ASC'
const array = await pageApi(_searchCondition)
Butttondata = [
defaultButtons.formSaveBtn(null), //
@ -1496,14 +1597,15 @@ const onBlur = async (field, pageApi, item) => {
count.value++
const obj = array.list[0]
if (obj) {
dataObj[field + 'Name'] = obj.description
searchTableSuccess(field,'code',array.list,'main')
} else {
message.alert('暂无数据')
dataObj[field + 'Code'] = ''
dataObj[field + 'Name'] = ''
data.value[field] = ''
data.value['inspectionSchemeName'] = ''
data.value.subList =[]
}
} else {
dataObj[field + 'Name'] = ''
data.value['inspectionSchemeName'] = ''
Butttondata = [
defaultButtons.formSaveBtn(null), //
defaultButtons.formCloseBtn(null) //
@ -1528,8 +1630,8 @@ const onFocus = () => {
color: #1a8bfc;
font-size: 16px;
}
.tabs-box{
max-height:calc(80vh - 40px) ;
.tabs-box {
max-height: calc(80vh - 40px);
overflow-x: hidden;
overflow-y: auto;
}

38
src/views/wms/issueManage/productionscrap/productionscrapRecordMain/index.vue

@ -1,7 +1,7 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="[...ProductionreturnRecordMain.allSchemas.searchSchema,...ProductionreturnRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
<Search :schema="[...ProductionscrapRecordMain.allSchemas.searchSchema,...ProductionscrapRecordDetail.allSchemas.searchSchema]" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
@ -11,8 +11,8 @@
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="ProductionreturnRecordMain.allSchemas"
:detailAllSchemas="ProductionreturnRecordDetail.allSchemas"
:allSchemas="ProductionscrapRecordMain.allSchemas"
:detailAllSchemas="ProductionscrapRecordDetail.allSchemas"
/>
<!-- 列表 -->
@ -43,10 +43,10 @@
<BasicForm
ref="formRef"
@success="getList"
:rules="ProductionreturnRecordMainRules"
:formAllSchemas="ProductionreturnRecordMain.allSchemas"
:tableAllSchemas="ProductionreturnRecordDetail.allSchemas"
:tableFormRules="ProductionreturnRecordDetailRules"
:rules="ProductionscrapRecordMainRules"
:formAllSchemas="ProductionscrapRecordMain.allSchemas"
:tableAllSchemas="ProductionscrapRecordDetail.allSchemas"
:tableFormRules="ProductionscrapRecordDetailRules"
:isBusiness="true"
/>
@ -54,18 +54,18 @@
<Detail
ref="detailRef"
:isBasic="false"
:allSchemas="ProductionreturnRecordMain.allSchemas"
:detailAllSchemas="ProductionreturnRecordDetail.allSchemas"
:detailAllSchemasRules="ProductionreturnRecordDetailRules"
:apiPage="ProductionreturnRecordDetailApi.getProductionreturnRecordDetailPage"
:allSchemas="ProductionscrapRecordMain.allSchemas"
:detailAllSchemas="ProductionscrapRecordDetail.allSchemas"
:detailAllSchemasRules="ProductionscrapRecordDetailRules"
:apiPage="ProductionscrapRecordDetailApi.getProductionscrapRecordDetailPage"
/>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { ProductionreturnRecordMain,ProductionreturnRecordMainRules,ProductionreturnRecordDetail,ProductionreturnRecordDetailRules } from './productionscrapRecordMain.data'
import * as ProductionreturnRecordMainApi from '@/api/wms/productionreturnRecordMain'
import * as ProductionreturnRecordDetailApi from '@/api/wms/productionreturnRecordDetail'
import { ProductionscrapRecordMain,ProductionscrapRecordMainRules,ProductionscrapRecordDetail,ProductionscrapRecordDetailRules } from './productionscrapRecordMain.data'
import * as ProductionscrapRecordMainApi from '@/api/wms/productionscrapRecordMain'
import * as ProductionscrapRecordDetailApi from '@/api/wms/productionscrapRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
// 退
@ -77,7 +77,7 @@ const { t } = useI18n() // 国际化
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref([...ProductionreturnRecordMain.allSchemas.tableColumns,...ProductionreturnRecordDetail.allSchemas.tableMainColumns])
const tableColumns = ref([...ProductionscrapRecordMain.allSchemas.tableColumns,...ProductionscrapRecordDetail.allSchemas.tableMainColumns])
//
const updataTableColumns = (val) => {
@ -85,7 +85,7 @@ const updataTableColumns = (val) => {
}
const { tableObject, tableMethods } = useTable({
getListApi: ProductionreturnRecordDetailApi.getProductionreturnRecordDetailPage //
getListApi: ProductionscrapRecordDetailApi.getProductionscrapRecordDetailPage //
})
//
@ -93,7 +93,7 @@ const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultExportBtn({hasPermi:'wms:productionreturn-record-main:export'}), //
defaultButtons.defaultExportBtn({hasPermi:'wms:productionscrap-record-main:export'}), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
@ -155,8 +155,8 @@ const handleExport = async () => {
await message.exportConfirm()
//
exportLoading.value = true
const data = await ProductionreturnRecordMainApi.exportProductionreturnRecordMain(tableObject.params)
download.excel(data, '生产退料记录主.xlsx')
const data = await ProductionscrapRecordMainApi.exportProductionscrapRecordMain(tableObject.params)
download.excel(data, '线标报废记录主.xlsx')
} catch {
} finally {
exportLoading.value = false

23
src/views/wms/issueManage/productionscrap/productionscrapRecordMain/productionscrapRecordMain.data.ts

@ -4,7 +4,7 @@ import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
/**
* @returns {Array} 退
*/
export const ProductionreturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
export const ProductionscrapRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '单据号',
field: 'number',
@ -16,22 +16,21 @@ export const ProductionreturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: true
},
{
label: '车间代码',
field: 'workshopCode',
label: '申请单号',
field: 'requestNumber',
sort: 'custom',
table: {
width: 150
width: 180
},
isSearch: true
},
{
label: '申请单号',
field: 'requestNumber',
label: '车间代码',
field: 'workshopCode',
sort: 'custom',
table: {
width: 180
width: 150
},
isTable: false,
isSearch: true
},
{
label: '出库事务类型',
@ -319,7 +318,7 @@ export const ProductionreturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>(
]))
//表单校验
export const ProductionreturnRecordMainRules = reactive({
export const ProductionscrapRecordMainRules = reactive({
requestNumber: [
{ required: true, message: '请选择申请单号', trigger: 'change' }
],
@ -373,7 +372,7 @@ export const ProductionreturnRecordMainRules = reactive({
/**
* @returns {Array} 退
*/
export const ProductionreturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
export const ProductionscrapRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '生产线代码',
field: 'productionLineCode',
@ -636,7 +635,7 @@ export const ProductionreturnRecordDetail = useCrudSchemas(reactive<CrudSchema[]
]))
//表单校验
export const ProductionreturnRecordDetailRules = reactive({
export const ProductionscrapRecordDetailRules = reactive({
inventoryStatus: [
{ required: true, message: '请选择库存状态', trigger: 'change' }
],

Loading…
Cancel
Save