Browse Source

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

master_hella_20240701
zhaoxuebing 7 months ago
parent
commit
d09d904ecd
  1. 37
      src/api/mes/workstation/index.ts
  2. 4
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  3. 6
      src/api/qms/inspectionStage/index.ts
  4. 6
      src/api/wms/purchasereceiptRecordDetail/index.ts
  5. 2
      src/components/BasicForm/src/BasicForm.vue
  6. 2
      src/components/Detail/src/DetailQmsCode.vue
  7. 0
      src/components/ListTable/index.ts
  8. 0
      src/components/ListTable/src/ListTable.vue
  9. 2
      src/components/TableForm/src/TableForm.vue
  10. 10
      src/locales/en-US.ts
  11. 6
      src/locales/zh-CN.ts
  12. 25
      src/utils/disposition/defaultButtons.ts
  13. 18
      src/views/mes/workstation/index.vue
  14. 29
      src/views/mes/workstation/workstation.data.ts
  15. 54
      src/views/qms/aql/aql.data.ts
  16. 41
      src/views/qms/aql/index.vue
  17. 43
      src/views/qms/basicDataManage/dynamicRule/index.vue
  18. 6
      src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts
  19. 4
      src/views/qms/basicDataManage/selectedSet/index.vue
  20. 123
      src/views/qms/inspection/inspectionJob/addForm.vue
  21. 4
      src/views/qms/inspection/inspectionJob/index.vue
  22. 40
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  23. 27
      src/views/qms/inspection/inspectionRecord/addForm.vue
  24. 133
      src/views/qms/inspection/inspectionRecord/index.vue
  25. 60
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
  26. 6
      src/views/qms/inspection/inspectionRequest/index.vue
  27. 7
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts
  28. 12
      src/views/qms/sampleCode/index.vue
  29. 17
      src/views/qms/sampleCode/sampleCode.data.ts
  30. 3
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  31. 8
      src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptJobMain/index.vue
  32. 74
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  33. 206
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

37
src/api/mes/workstation/index.ts

@ -48,45 +48,8 @@ export const exportWorkstation = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/mes/workstation/get-import-template' }) return request.download({ url: '/mes/workstation/get-import-template' })
}// 查询班组列表
export const getTeamPage = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/team/senior', data })
} else {
return await request.get({ url: `/mes/team/pageListByWorkstationCode`, params })
}
}
// 查询选择班组列表
export const checkTeamPageList = async (params) => {
params.workstationCode = goalParams.workstationCode
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/team/senior', data })
} else {
return await request.get({ url: `/mes/team/pageCheckListByWorkstationCode`, params })
}
}
// 添加班组关联
export const createTeamRelation = async (teamCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/createRelation`, data })
} }
// 删除班组关联
export const deleteTeamRelation = async (teamCodes:string[]) => {
const data = {
workstationCode : goalParams.workstationCode,
teamCodes : teamCodes
}
return await request.post({ url: `/mes/team/deleteRelation`, data })
}
export const getEquipmentPage = async (params) => { export const getEquipmentPage = async (params) => {
params.workstationCode = goalParams.workstationCode params.workstationCode = goalParams.workstationCode
if (params.isSearch) { if (params.isSearch) {

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

6
src/api/qms/inspectionStage/index.ts

@ -60,4 +60,10 @@ export const exportInspectionStage = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/inspection-stage/get-import-template' }) return request.download({ url: '/qms/inspection-stage/get-import-template' })
}
// 查询检验阶段列表
export const getInspectionStageNoPage = async (params) => {
return await request.get({ url: `/qms/inspection-stage/noPage`, params })
} }

6
src/api/wms/purchasereceiptRecordDetail/index.ts

@ -76,6 +76,12 @@ export const getPurchasereceiptRecordDetailPageBySupplierCode = async (params) =
export const getPurchasereceiptRecordDetailList = async (params) => { export const getPurchasereceiptRecordDetailList = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params }) return await request.get({ url: `/wms/purchasereceipt-record-detail/list`, params })
} }
// 查询采购收货记录子列表
export const getPurchasereceiptRecordDetailListToRepeat = async (params) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/listToRepeat`, params })
}
// 查询采购收货记录子详情 // 查询采购收货记录子详情
export const getPurchasereceiptRecordDetail = async (id: number) => { export const getPurchasereceiptRecordDetail = async (id: number) => {
return await request.get({ url: `/wms/purchasereceipt-record-detail/get?id=` + id }) return await request.get({ url: `/wms/purchasereceipt-record-detail/get?id=` + id })

2
src/components/BasicForm/src/BasicForm.vue

@ -658,7 +658,7 @@ const inpuFocus = (headerItem, row, index) => {
* @param cur 改变后值 * @param cur 改变后值
*/ */
const onChange = (field, cur) => { const onChange = (field, cur) => {
emit('onChange', field, cur) emit('onChange', field, cur, formRef)
} }
/** /**

2
src/components/Detail/src/DetailQmsCode.vue

@ -701,7 +701,7 @@ const openForm = async (type: string, row?: number) => {
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
try { try {
// detailValidate // detailValidate
const rs = (await props.detailValidate) ? await props.detailValidate(data) : true const rs = (await props.detailValidate) ? await props.detailValidate(formType,data) : true
if (!rs) return if (!rs) return
if (formType === 'create') { if (formType === 'create') {
await props.apiCreate(data) await props.apiCreate(data)

0
src/components/listTable/index.ts → src/components/ListTable/index.ts

0
src/components/listTable/src/ListTable.vue → src/components/ListTable/src/ListTable.vue

2
src/components/TableForm/src/TableForm.vue

@ -46,7 +46,7 @@
:label="headerItem.label" :prop="headerItem.field" :label="headerItem.label" :prop="headerItem.field"
:align="headerItem?.tableForm?.align || 'center'" :align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || false" :sortable="headerItem?.tableForm?.sortable || false"
:width="headerItem?.tableForm?.width || '200'" :width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'"> :min-width="headerItem?.tableForm?.minWidth || 'auto'">
<el-form <el-form
ref="TableBaseForm_Ref" ref="TableBaseForm_Ref"

10
src/locales/en-US.ts

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

6
src/locales/zh-CN.ts

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

25
src/utils/disposition/defaultButtons.ts

@ -704,6 +704,19 @@ export function mainListJobExeBtn(option:any) {
hasPermi: '' hasPermi: ''
}) })
} }
// 主列表-任务流程-执行按钮(与执行按钮一致 只是名改叫'收货'而已)
export function mainListJobRecBtn(option:any) {
return __defaultBtnOption(option,{
label: '收货',
name: 'mainJobExe',
hide: false,
type: 'primary',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-包装按钮 // 主列表-包装按钮
export function mainListPackageBtn(option:any) { export function mainListPackageBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{
@ -836,6 +849,18 @@ export function mainUpdataRecodeBtn(option:any) {
hasPermi: '' 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){ function __defaultBtnOption(option:any,specific:any){
return { return {

18
src/views/mes/workstation/index.vue

@ -86,7 +86,7 @@ import {
TabsList, TabsList,
Team, Team,
Workstation, Workstation,
WorkstationRules, teamPopList,equipmentPopList,processPopList,stepPopList WorkstationRules,equipmentPopList,processPopList,stepPopList
} from './workstation.data' } from './workstation.data'
import * as WorkstationApi from '@/api/mes/workstation' import * as WorkstationApi from '@/api/mes/workstation'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
@ -97,8 +97,8 @@ import {
} from "@/api/mes/workstation"; } from "@/api/mes/workstation";
import Detail from './components/Detail.vue' import Detail from './components/Detail.vue'
defineOptions({ name: 'Workstation' }) defineOptions({ name: 'Workstation' })
let tabsDeleteApi = WorkstationApi.deleteTeamRelation let tabsDeleteApi = WorkstationApi.deleteEquipmentRelation
let tabsCreateApi = WorkstationApi.createTeamRelation let tabsCreateApi = WorkstationApi.createEquipmentRelation
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const route = useRoute() // const route = useRoute() //
@ -271,19 +271,13 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
} }
// //
const detailAllSchemas = ref(Team.allSchemas) const detailAllSchemas = ref(Team.allSchemas)
const apiPage = ref(WorkstationApi.getTeamPage) const apiPage = ref(WorkstationApi.getEquipmentPage)
const tableKey = ref("Team"); const tableKey = ref("Team");
let tmpPopList = teamPopList.allSchemas let tmpPopList = equipmentPopList.allSchemas
// tabs // tabs
const changeTabs = (data) =>{ const changeTabs = (data) =>{
tableKey.value = data.prop tableKey.value = data.prop
if(data.prop == 'Team'){ if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getTeamPage
detailAllSchemas.value = Team.allSchemas
tabsDeleteApi = WorkstationApi.deleteTeamRelation
tabsCreateApi = WorkstationApi.createTeamRelation
tmpPopList = teamPopList.allSchemas
}else if(data.prop == 'Equipment'){
apiPage.value = WorkstationApi.getEquipmentPage apiPage.value = WorkstationApi.getEquipmentPage
detailAllSchemas.value = Equipment.allSchemas detailAllSchemas.value = Equipment.allSchemas
tabsDeleteApi = WorkstationApi.deleteEquipmentRelation tabsDeleteApi = WorkstationApi.deleteEquipmentRelation

29
src/views/mes/workstation/workstation.data.ts

@ -16,10 +16,6 @@ export const WorkstationRules = reactive({
productionLineCode: [required] productionLineCode: [required]
}) })
export const TabsList = [{ export const TabsList = [{
label: "班组",
prop: 'Team',
},
{
label: "设备", label: "设备",
prop: 'Equipment', prop: 'Equipment',
}, },
@ -280,30 +276,7 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
isTableForm:true, isTableForm:true,
} }
])) ]))
export const teamPopList = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '选择班组',
field: 'list',
sort: 'custom',
isSearch: false,
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择选择班组', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段
searchTitle: '选择班组', // 查询弹窗标题
searchAllSchemas: Team.allSchemas, // 查询弹窗所需类
searchPage: WorkstationApi.checkTeamPageList, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
}
}
]))
export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([ export const equipmentPopList = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '选择设备', label: '选择设备',

54
src/views/qms/aql/aql.data.ts

@ -1,6 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from "@/api/qms/aql"; import {getSamplingScheme} from "@/api/qms/aql";
import {validateNum} from "@/utils/validator";
// 表单校验 // 表单校验
export const AqlRules = reactive({ export const AqlRules = reactive({
@ -8,7 +9,58 @@ export const AqlRules = reactive({
inspectionQualification: [required], inspectionQualification: [required],
sampleCharacterCode: [required], sampleCharacterCode: [required],
sampleSize: [required], sampleSize: [required],
// available: [required], a0separator010: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator010: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator015: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator015: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator025: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator025: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator040: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator040: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator065: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator065: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a0separator65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r0separator65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a1separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r1separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a1separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r1separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a2separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r2separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a4separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r4separator0: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a6separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r6separator5: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r10: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r15: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r25: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r40: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r65: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a100: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r100: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a150: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r150: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a250: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r250: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a400: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r400: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a650: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r650: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
a1000: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
r1000: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
}) })
const samplingSchemeList = await getSamplingScheme() const samplingSchemeList = await getSamplingScheme()
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([

41
src/views/qms/aql/index.vue

@ -48,6 +48,7 @@
:apiCreate="AqlApi.createAql" :apiCreate="AqlApi.createAql"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
@onChange="onChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -235,6 +236,46 @@ const searchFormClick = (searchData) => {
getList() // getList() //
} }
const onChange = async (field, value, formRef) => {
// "a"
if (field.startsWith("a") || field.startsWith("r")) {
// "a"
const suffix = field.slice(1);
// "r"
const correspondingField = field.startsWith("a") ? "r" + suffix : "a" + suffix ;
// "r"
if (value) {
// "r"
Aql.allSchemas.formSchema.forEach(item => {
if (item.field === correspondingField) {
const setV = {};
if(correspondingField.startsWith("r")){
setV[correspondingField] = parseInt(value) + 1;
}else {
setV[correspondingField] = parseInt(value) - 1;
}
item.componentProps.disabled = true;
// 使 Vue nextTick DOM
nextTick(() => {
formRef.value.setValues(setV);
});
}
});
}else{
Aql.allSchemas.formSchema.forEach(item => {
if (item.field === correspondingField || item.field === field) {
item.componentProps.disabled = false;
const setV = {};
setV[correspondingField] = ''
nextTick(() => {
formRef.value.setValues(setV);
});
}
});
}
}
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

43
src/views/qms/basicDataManage/dynamicRule/index.vue

@ -105,6 +105,8 @@ const routeName = ref()
const tableData = ref([]) const tableData = ref([])
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(DynamicRule.allSchemas.tableColumns) const tableColumns = ref(DynamicRule.allSchemas.tableColumns)
const detailMasterId = ref()
const detailList = ref([])
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -210,6 +212,10 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
detailMasterId.value = row.id
InspectionStageApi.getInspectionStageNoPage({masterId:row.id}).then(res=>{
detailList.value = res
})
detailRef.value.openDetail(row, titleName, titleValue, 'basicDynamicRule') detailRef.value.openDetail(row, titleName, titleValue, 'basicDynamicRule')
} }
@ -283,6 +289,12 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
const flag = validateNotRepetition(tableData.value);
if(!flag){
message.alertWarning('动态规则阶段不能重复')
basicFormRef.value.formLoading = false
return
}
data.inspectionStageDOList = tableData.value// data.inspectionStageDOList = tableData.value//
console.log(data.subList) console.log(data.subList)
try { try {
@ -301,17 +313,42 @@ const submitForm = async (formType, data) => {
} }
} }
const detailValidate = (data) => { const detailValidate = (type,data) => {
let tag = true; let tag = true;
if(!validateIfRepeat(type,data)){
tag = false
message.alertWarning('动态规则阶段不能重复')
}
return tag return tag
} }
const detailOpenForm = (type, row, masterParmas) => { const detailOpenForm = (type, row, masterParmas) => {
if(type='create'){
}
const validateIfRepeat = (type,data) => {
let mergedArray: any[] = [];
if(type == 'create'){
mergedArray = [data, ...detailList.value];
}else if(type == 'update'){
mergedArray = [...detailList.value];
} }
const stageSet = new Set(mergedArray.map(item => item.stage));
return stageSet.size === mergedArray.length;
} }
const validateNotRepetition = (data) => {
// dictionaryTypeAndCode
const codes = data.map(item => item.stage);
// Set dictionaryTypeAndCode
const uniqueCodes = new Set(codes);
// Set
if (codes.length > uniqueCodes.size) {
return false; // false
}
return true; // true
};
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

6
src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts

@ -11,8 +11,10 @@ const trueFalse = [{
// 表单校验 // 表单校验
export const InspectionStageRules = reactive({ export const InspectionStageRules = reactive({
description: [required], description: [
dynamicModifyCode: [required], required,
{ max: 1024, message: '不得超过1024个字符', trigger: 'blur' },
],
okTimes: [required], okTimes: [required],
okTimeStage: [required], okTimeStage: [required],
noOkTimes: [required], noOkTimes: [required],

4
src/views/qms/basicDataManage/selectedSet/index.vue

@ -407,8 +407,8 @@ const detailBasiFormOnChange = (field,val,detailFormRef) => {
setV['dictionaryCode'] = dictionaryCode setV['dictionaryCode'] = dictionaryCode
setV['dictionaryValue'] = dictionaryValue setV['dictionaryValue'] = dictionaryValue
nextTick(() => { nextTick(() => {
detailFormRef.setValues(setV) detailFormRef.setValues(setV)
}) })
} }
} }

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

@ -58,9 +58,9 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="检验方案模板编码"> <el-form-item label="检验特性编号">
<el-input <el-input
v-model="item.inspectionCode" v-model="item.inspectionFeatureCode"
placeholder="根据系统生成" placeholder="根据系统生成"
:disabled="true" :disabled="true"
/> />
@ -76,7 +76,7 @@
<el-input v-model="item.sequenceCode" :disabled="true" /> <el-input v-model="item.sequenceCode" :disabled="true" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <!-- <el-col :span="12">
<el-form-item label="检验特性编码"> <el-form-item label="检验特性编码">
<el-input <el-input
v-model="item.inspectionCharCode" v-model="item.inspectionCharCode"
@ -84,7 +84,7 @@
:disabled="true" :disabled="true"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col> -->
</el-row> </el-row>
</el-form> </el-form>
<div class="small-title">检验特性</div> <div class="small-title">检验特性</div>
@ -235,6 +235,23 @@
/> />
</el-form-item> </el-form-item>
</el-col> </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 <el-col
:span="24" :span="24"
style=" style="
@ -268,23 +285,7 @@
/> />
</el-form-item> </el-form-item>
</el-col> </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 <el-col
:span="12" :span="12"
v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0"
@ -312,7 +313,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.samplingProcessRespVO.evaluationMode == 1" > <el-col :span="12" v-if="item.inspectionJobCharacteristicsUpdateReqVO.featureType == 1" >
<el-form-item label="缺陷级别" required> <el-form-item label="缺陷级别" required>
<el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled> <el-select v-model="cur.defectLevel" placeholder="请选择缺陷级别" disabled>
<el-option <el-option
@ -511,13 +512,16 @@ const rules = ref({
{ required: true, message: '请输入小数位', trigger: 'blur' } { required: true, message: '请输入小数位', trigger: 'blur' }
], ],
'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [ 'inspectionJobCharacteristicsUpdateReqVO.quantifyQuantifyCode': [
{ required: true, message: '请输入选择集编码', trigger: 'change' } { required: true, message: '请选择集编码', trigger: 'change' }
], ],
'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [ 'inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime': [
{ required: true, message: '请输入选择开始时间', trigger: 'change' } { required: true, message: '请选择开始时间', trigger: 'change' }
], ],
'inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime': [ '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' }] 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({ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', // defectLevel: '', //
qualifiedQuantity: '', // qualifiedQuantity: '', //
unqualifiedQuantity: '' // unqualifiedQuantity: '' //
@ -561,7 +564,6 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', // defectLevel: '', //
qualifiedQuantity: '', // qualifiedQuantity: '', //
unqualifiedQuantity: '' // unqualifiedQuantity: '' //
@ -584,6 +586,11 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
} else { } else {
rules.value['inspectionJobCharacteristicsUpdateReqVO.quantifyTarget'][0].required = false 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 data.value.subList = list
@ -718,24 +725,30 @@ const submitForm = async () => {
const valid = await elForm.validate() const valid = await elForm.validate()
if (!valid) return if (!valid) return
// //
const validateForm1 = await tableFormRef.value.validateForm()
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 number = 0 let number = 0
data.value.packageList.forEach(cur=>{ data.value.packageList.forEach(cur=>{
number += parseFloat(cur.sampleAmount) number += parseFloat(cur.sampleAmount)
}) })
if(number > data.value.sampleTotalAmount){ if(number != data.value.sampleTotalAmount){
message.error(`采样数量之和不可以大于总数量`) message.error(`采样数量之和不等于总数量`)
return return
}
} }
const bol2 = await validateForm(formFeaturesRef.value) const bol2 = await validateForm(formFeaturesRef.value)
if (!bol2) { if (!bol2) {
message.error(`模板中有检验工序和检验特性未填写完全`) message.error(`模板中有检验工序和检验特性未填写完全`)
return return
} }
// //
let arrBol = [] let arrBol = []
let isOutweigh = []// let isOutweigh = []//
let numberList = []//
data.value.subList.forEach((item, index) => { data.value.subList.forEach((item, index) => {
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) { if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
arrBol.push( arrBol.push(
@ -746,15 +759,15 @@ const submitForm = async () => {
) )
) )
} }
if (item.samplingProcessRespVO.evaluationMode == 1) { // if (item.samplingProcessRespVO.evaluationMode == 1) {
arrBol.push( // arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( // item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => { // (cur, key) => {
return !cur.estimateCode || !cur.defectLevel // return !cur.estimateCode
} // }
) // )
) // )
} // }
if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) { if (item.inspectionJobCharacteristicsUpdateReqVO.featureType == 0) {
arrBol.push( arrBol.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some( item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
@ -777,16 +790,32 @@ const submitForm = async () => {
if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) { if (item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime >item.inspectionJobCharacteristicsUpdateReqVO.inspectionEndTime) {
isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime) isOutweigh.push(item.inspectionJobCharacteristicsUpdateReqVO.inspectionStartTime)
} }
//
if (item.inspectionJobCharacteristicsUpdateReqVO.resultEntryMethod == 1) {
numberList.push(
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.some(
(cur, key) => {
return parseFloat(cur.qualifiedQuantity) + parseFloat(cur.unqualifiedQuantity) != data.value.sampleTotalAmount
}
)
)
}
}) })
let isEmpty1 = arrBol.some(item=>item == true) let isEmpty1 = arrBol.some(item=>item == true)
let isEmptyNumberList = numberList.some(item=>item == true)
if(isEmpty1){ if(isEmpty1){
message.error('检验工序和检验特性有字段未填写完全') message.error('检验工序和检验特性有字段未填写完全')
return; return;
} }
if(isOutweigh.length>0){ if(isOutweigh?.length>0){
message.error('检验特性中有开始时间大于结束时间') message.error('检验特性中有开始时间大于结束时间')
return; return;
} }
console.log(44,numberList)
if(isEmptyNumberList){
message.error('合格数量和不合格数量之和不等于总数量')
return;
}
if (formType.value == 'create') { if (formType.value == 'create') {
// //
emit('submitForm', formType.value, data.value) emit('submitForm', formType.value, data.value)
@ -951,7 +980,6 @@ const resultEntryMethodChange = (e, item) => {
item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({ item.inspectionJobCharacteristicsUpdateReqVO.recordInspectionQuantifyList.push({
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', // defectLevel: '', //
qualifiedQuantity: '', // qualifiedQuantity: '', //
unqualifiedQuantity: '' // unqualifiedQuantity: '' //
@ -963,7 +991,6 @@ const resultEntryMethodChange = (e, item) => {
{ {
inspectionValue: '', // inspectionValue: '', //
qualitativeCode: '', // qualitativeCode: '', //
estimateCode: '', //
defectLevel: '', // defectLevel: '', //
qualifiedQuantity: '', // qualifiedQuantity: '', //
unqualifiedQuantity: '' // unqualifiedQuantity: '' //

4
src/views/qms/inspection/inspectionJob/index.vue

@ -51,7 +51,7 @@
:isShowAddBtn="false" :detailButtonIsShow="true" :isShowAddBtn="false" :detailButtonIsShow="true"
/> />
<!-- 包装信息 --> <!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/> <ListTable ref="listTableRef" titleName="包装信息"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -62,7 +62,7 @@
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain' import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail' import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue' import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import Detail from './detail.vue' import Detail from './detail.vue'

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

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

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

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

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

@ -27,20 +27,6 @@
</ContentWrap> </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 <AddForm
ref="formRef" ref="formRef"
basicFormWidth="80" basicFormWidth="80"
@ -49,7 +35,6 @@
:rules="InspectionRecordMainRules" :rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas" :formAllSchemas="InspectionRecordMain.allSchemas"
@submitForm="submitForm" @submitForm="submitForm"
@onChange='onChange'
/> />
<Detail <Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas" ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
@ -61,7 +46,7 @@
:isShowAddBtn="false" :detailButtonIsShow="true" :isShowAddBtn="false" :detailButtonIsShow="true"
/> />
<!-- 包装信息 --> <!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/> <ListTable ref="listTableRef" titleName="包装信息"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -71,7 +56,7 @@
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain' import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail' import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue' import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import AddForm from './addForm.vue' import AddForm from './addForm.vue'
import Detail from './detail.vue' import Detail from './detail.vue'
@ -91,42 +76,9 @@
tableColumns.value = val 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({ const { tableObject, tableMethods } = useTable({
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage // getListApi: InspectionRecordMainApi.getInspectionRecordMainPage //
}) })
@ -141,14 +93,6 @@
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), // defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
] ]
// //
@ -169,10 +113,14 @@
// //
const isShowMainButton = (row, val) => { const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) { if(val){
return false if(row.useDecision){
} else { return false
return true }else{
return true
}
}else{
return !row.isPublished
} }
} }
@ -180,9 +128,9 @@
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), // // 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.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), // defaultButtons.mainListPackageBtn(null), //
] ]
} }
@ -190,7 +138,7 @@
const listTableRef = ref() const listTableRef = ref()
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'applyDecision') { //
// 1使 // 1使
if(row.estimateCode == 1){ if(row.estimateCode == 1){
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) =>{ InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) =>{
@ -208,6 +156,12 @@
openForm('update', row) openForm('update', row)
}else if (val == 'mainPackage') { // }else if (val == 'mainPackage') { //
const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id) 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) listTableRef.value.openPackage(row,'包装信息',InspectionRecordPackage.allSchemas.tableColumns,list)
}else if (val == 'delete') { // }else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
@ -245,10 +199,10 @@
const handleOrderPub = async (row : object) => { const handleOrderPub = async (row : object) => {
try { try {
// //
await message.confirm('是否发布所选数据') await message.confirm(t('common.confirmPublish'))
// //
await InspectionRecordMainApi.publishInspectionRecordMain(row) await InspectionRecordMainApi.publishInspectionRecordMain(row.id)
message.success('发布成功') message.success(t('common.publishSuccess'))
// //
await getList() await getList()
} catch { } } catch { }
@ -281,30 +235,6 @@
}) })
const tableData = ref([]) 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) => { const submitForm = async (formType, data) => {
data.subList = tableData.value // 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) => { const searchFormClick = (searchData) => {
tableObject.params = { tableObject.params = {

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

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

6
src/views/qms/inspection/inspectionRequest/index.vue

@ -38,7 +38,7 @@
<ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData" <ImportForm ref="importFormRef" url="/request/inspection-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" /> @success="importSuccess" />
<!-- 包装信息 --> <!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/> <ListTable ref="listTableRef" titleName="包装信息"/>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@ -46,7 +46,7 @@
import { InspectionMain, InspectionMainRules,InspectionRequestPackage } from './inspectionMain.data' import { InspectionMain, InspectionMainRules,InspectionRequestPackage } from './inspectionMain.data'
import * as InspectionMainApi from '@/api/qms/inspectionRequest' import * as InspectionMainApi from '@/api/qms/inspectionRequest'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import listTable from '@/components/listTable/src/listTable.vue' import ListTable from '@/components/ListTable/src/ListTable.vue'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
@ -220,7 +220,7 @@ const listTableRef = ref()
await message.confirm(t('common.confirmHandle')) await message.confirm(t('common.confirmHandle'))
tableObject.loading = true tableObject.loading = true
await InspectionMainApi.handleInspectRequestMain(id) await InspectionMainApi.handleInspectRequestMain(id)
message.success(t('common.handleSuccess')) message.success(t('common.dealwithSuccess'))
await getList() await getList()
}catch{}finally{ }catch{}finally{
tableObject.loading = false tableObject.loading = false

7
src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts

@ -365,11 +365,10 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
width:500,
disabled:true disabled:true
}, },
table:{ table:{
width:150 width:200
} }
}, },
{ {
@ -381,7 +380,7 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
disabled:true disabled:true
}, },
table:{ table:{
width:150 width:200
} }
}, },
{ {
@ -393,7 +392,7 @@ export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
disabled:true disabled:true
}, },
table:{ table:{
width:150 width:180
} }
}, },
{ {

12
src/views/qms/sampleCode/index.vue

@ -48,6 +48,7 @@
:apiCreate="SampleCodeApi.createSampleCode" :apiCreate="SampleCodeApi.createSampleCode"
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
@onChange="onChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -65,6 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue' import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue' import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue' import Detail from '@/components/Detail/src/Detail.vue'
import {connection} from "@antv/x6/es/registry/attr/connection";
defineOptions({ name: 'SampleCode' }) defineOptions({ name: 'SampleCode' })
@ -234,7 +236,15 @@ const searchFormClick = (searchData) => {
} }
getList() // getList() //
} }
const onChange = async (field, value, formRef) => {
if(field == "batchLowLimiting" || field == "batchUpperLimiting"){
var upperLimit = formRef.value.formModel.batchUpperLimiting
var lowLimit = formRef.value.formModel.batchLowLimiting
if(parseInt(upperLimit) <= parseInt(lowLimit)){
message.warning("批量上限须大于批量下限")
}
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
getList() getList()

17
src/views/qms/sampleCode/sampleCode.data.ts

@ -1,12 +1,15 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime' import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from '@/api/qms/sampleCode/index' import {getSamplingScheme} from '@/api/qms/sampleCode/index'
import {validateNum} from "@/utils/validator";
// 表单校验 // 表单校验
export const SampleCodeRules = reactive({ export const SampleCodeRules = reactive({
code: [required], code: [required],
batchUpperLimiting: [required], batchLowLimiting: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
// available: [required], batchUpperLimiting: [
{ required:true, message: '该项为必填', trigger: 'blur'},
{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
}) })
const samplingSchemeList = await getSamplingScheme() const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
@ -92,16 +95,6 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
field: 'g3', field: 'g3',
sort: 'custom', sort: 'custom',
}, },
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'Select'
// },
// },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

3
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue

@ -191,7 +191,8 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
setV['ppNumber'] = val[0]['ppNumber'] setV['ppNumber'] = val[0]['ppNumber']
// getBomDisassemble // getBomDisassemble
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({ // PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({
masterId: val[0]['id'] masterId: val[0]['id']
}).then((res) => { }).then((res) => {
if (res) tableData.value = res if (res) tableData.value = res

8
src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptJobMain/index.vue

@ -172,10 +172,10 @@ const isShowMainButton = (row,val) => {
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:accept'}), // // defaultButtons.mainListJobAccBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:accept'}), //
defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), // // defaultButtons.mainListJobCloBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:close'}), //
defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-job-main:abandon'}), // // defaultButtons.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-job-main:abandon'}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-job-main:execute'}), // defaultButtons.mainListJobRecBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:purchasereceipt-job-main:execute'}), //
] ]
} }

74
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue

@ -46,7 +46,7 @@
<BasicForm <BasicForm
ref="formRef" ref="formRef"
:isOpenSearchTable="true" :isOpenSearchTable="true"
:indexTableColumn="3" :indexTableColumn="0"
@success="getList" @success="getList"
:rules="SupplierdeliverRequestMainRules" :rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas" :formAllSchemas="SupplierdeliverRequestMain.allSchemas"
@ -61,7 +61,15 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" @submitForm="submitForm"
@formFormDateChange="formFormDateChange" @formFormDateChange="formFormDateChange"
/> >
<template v-slot="{row}">
<el-date-picker v-bind:modelValue="row['expireTime']?addDay(row['produceDate'],row['expireTime']).format('YYYY-MM-DD'):'2099-12-31'"
:clearable="true"
style="width: 100%"
:disabled="true"
placeholder="选择日期"/>
</template>
</BasicForm>
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
@ -120,6 +128,7 @@
import download from '@/utils/download' import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import { formatDate } from '@/utils/formatTime'
import { import {
SupplierdeliverRequestMain, SupplierdeliverRequestMain,
SupplierdeliverRequestMainRules, SupplierdeliverRequestMainRules,
@ -131,7 +140,10 @@ import {
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain' import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail' import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime' import * as PurchasePlanDetailApi from '@/api/wms/purchasePlanDetail'
import * as ItembasicApi from '@/api/wms/itembasic'
import { PurchasePlanDetail } from '../purchasePlanMain/purchasePlanMain.data'
import { addDay } from '@/utils/formatTime'
// //
defineOptions({ name: 'SupplierdeliverRequestMain' }) defineOptions({ name: 'SupplierdeliverRequestMain' })
@ -155,6 +167,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
nextTick(() => { nextTick(() => {
console.log("type:",type) console.log("type:",type)
console.log("formField:",formField) console.log("formField:",formField)
console.log(formField, searchField, val, formRef, type, row)
if (type == 'tableForm') { if (type == 'tableForm') {
// //
// row[formField] = val[0][searchField] // row[formField] = val[0][searchField]
@ -165,7 +178,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// row['orderQty'] = val[0]['orderQty'] // row['orderQty'] = val[0]['orderQty']
// row['uom'] = val[0]['uom'] // row['uom'] = val[0]['uom']
// } // }
//--
const itemCodes = []
val.forEach(item=>{ val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
const newRow = {...row} const newRow = {...row}
newRow[formField] = item[searchField] newRow[formField] = item[searchField]
newRow['poNumber'] = item['poNumber'] newRow['poNumber'] = item['poNumber']
@ -173,12 +189,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['poLine'] = item['poLine'] newRow['poLine'] = item['poLine']
newRow['orderQty'] = item['orderQty'] newRow['orderQty'] = item['orderQty']
newRow['uom'] = item['uom'] newRow['uom'] = item['uom']
itemCodes.push(item['itemCode'])
tableData.value.push(newRow) tableData.value.push(newRow)
}) })
//
ItembasicApi.getItembasicPage({
code:itemCodes.join(',')
}).then((res)=>{
res.list.forEach((item,index)=>{
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code'])
findItem['expireTime'] = findItem['expireTime']
})
})
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
if(formField == 'ppNumber'){ if(formField == 'ppNumber'){
//--
getSearchTableData(val[0]['number'],formField,searchField)
// //
let beginTime = val[0]['endTime'] let beginTime = val[0]['endTime']
let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD') let deliveryDate = formatDate(val[0]['deliveryDate'],'YYYY-MM-DD')
@ -196,6 +225,43 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
} }
}) })
} }
const getSearchTableData = async (number,formField,searchField)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
getListApi: PurchasePlanDetailApi.getPurchasePlanDetailPage //
})
//
const { getList:getList1 } = tableMethods
await getList1()
const tableColumns = PurchasePlanDetail.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
tableData.value = []
const itemCodes = []
tableObject.tableList.forEach(row=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow[formField] = row[searchField]
newRow['poNumber'] = row['poNumber']
newRow['itemCode'] = row['itemCode']
newRow['poLine'] = row['poLine']
newRow['orderQty'] = row['orderQty']
newRow['uom'] = row['uom']
tableData.value.push(newRow)
itemCodes.push(row['itemCode'])
})
//
ItembasicApi.getItembasicPage({
code:itemCodes.join(',')
}).then((res)=>{
res.list.forEach((item,index)=>{
const findItem = tableData.value.find(item1=>item1['itemCode']==item['code'])
findItem['expireTime'] = findItem['expireTime']
})
})
}
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
@ -232,6 +298,8 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
}) })
} }
const { tableObject, tableMethods } = useTable({ const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage // getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
}) })

206
src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/supplierdeliverRequestMain.data.ts

@ -552,6 +552,102 @@ export const SupplierdeliverRequestMainRules = reactive({
* @returns {Array} * @returns {Array}
*/ */
export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: false
}
},
{ {
label: '生产日期', label: '生产日期',
field: 'produceDate', field: 'produceDate',
@ -578,17 +674,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x', valueFormat: 'x',
} }
}, },
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: false
}
},
// { // {
// label: '替代批次', // label: '替代批次',
// field: 'altBatch', // field: 'altBatch',
@ -620,6 +706,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x', valueFormat: 'x',
} }
}, },
isTableForm: false, isTableForm: false,
tableForm: { tableForm: {
type: 'FormDate', type: 'FormDate',
@ -647,81 +734,17 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x', valueFormat: 'x',
} }
}, },
tableForm: { // tableForm: {
type: 'FormDate', // type: 'FormDate',
dateFormat: 'YYYY-MM-DD', // dateFormat: 'YYYY-MM-DD',
valueFormat: 'x', // valueFormat: 'x',
} // }
}, tableForm:{
{ type: 'slot',
label: '订单号',
field: 'poNumber',
sort: 'custom',
table: {
width: 150
},
form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择订单号',
searchField: 'number',
searchTitle: '要货计划信息',
searchAllSchemas: PurchasePlanDetail.allSchemas,
searchPage: PurchasePlanDetailApi.getPurchasePlanDetailPage,
searchCondition: [
{
key: 'number',
value: 'ppNumber',
message: '请填写要货计划单号!',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
}
},
{
label: '订单行',
field: 'poLine',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true disabled: true
} }
}, },
{ {
label: '订单数量', label: '订单数量',
field: 'orderQty', field: 'orderQty',
@ -816,22 +839,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
} }
}, },
{
label: '物料代码',
field: 'itemCode',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
disabled: true
}
},
tableForm: {
disabled: true
}
},
{ {
label: '计量单位', label: '计量单位',
field: 'uom', field: 'uom',

Loading…
Cancel
Save