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. 41
      src/views/qms/basicDataManage/dynamicRule/index.vue
  18. 6
      src/views/qms/basicDataManage/inspectionStage/inspectionStage.data.ts
  19. 111
      src/views/qms/inspection/inspectionJob/addForm.vue
  20. 4
      src/views/qms/inspection/inspectionJob/index.vue
  21. 40
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  22. 15
      src/views/qms/inspection/inspectionRecord/addForm.vue
  23. 129
      src/views/qms/inspection/inspectionRecord/index.vue
  24. 56
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
  25. 6
      src/views/qms/inspection/inspectionRequest/index.vue
  26. 7
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts
  27. 12
      src/views/qms/sampleCode/index.vue
  28. 17
      src/views/qms/sampleCode/sampleCode.data.ts
  29. 3
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRequestMain/index.vue
  30. 8
      src/views/wms/purchasereceiptManage/sparereceipt/sparereceiptJobMain/index.vue
  31. 74
      src/views/wms/purchasereceiptManage/supplierdeliver/supplierdeliverRequestMain/index.vue
  32. 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 = () => {
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) => {
params.workstationCode = goalParams.workstationCode
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' })
}
// 发布
export const publishInspectionRecordMain = async (data ) => {
return await request.put({ url: `/qms/inspection-record-main/publish`, data })
export const publishInspectionRecordMain = async (id) => {
return await request.put({ url: `/qms/inspection-record-main/publish?id=`+id })
}
//查询包装列表
export const getInspectionRecordPackageList = async (id: number) => {

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

@ -61,3 +61,9 @@ export const exportInspectionStage = async (params) => {
export const importTemplate = () => {
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) => {
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) => {
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 改变后值
*/
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) => {
try {
// 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 (formType === 'create') {
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"
:align="headerItem?.tableForm?.align || 'center'"
:sortable="headerItem?.tableForm?.sortable || false"
:width="headerItem?.tableForm?.width || '200'"
:width="headerItem?.tableForm?.width || '200px'"
:min-width="headerItem?.tableForm?.minWidth || 'auto'">
<el-form
ref="TableBaseForm_Ref"

10
src/locales/en-US.ts

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

6
src/locales/zh-CN.ts

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

25
src/utils/disposition/defaultButtons.ts

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

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

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

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

@ -16,10 +16,6 @@ export const WorkstationRules = reactive({
productionLineCode: [required]
})
export const TabsList = [{
label: "班组",
prop: 'Team',
},
{
label: "设备",
prop: 'Equipment',
},
@ -280,30 +276,7 @@ export const Opersteps = useCrudSchemas(reactive<CrudSchema[]>([
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[]>([
{
label: '选择设备',

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

@ -1,6 +1,7 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from "@/api/qms/aql";
import {validateNum} from "@/utils/validator";
// 表单校验
export const AqlRules = reactive({
@ -8,7 +9,58 @@ export const AqlRules = reactive({
inspectionQualification: [required],
sampleCharacterCode: [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()
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([

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

@ -48,6 +48,7 @@
:apiCreate="AqlApi.createAql"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
@ -235,6 +236,46 @@ const searchFormClick = (searchData) => {
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 () => {
getList()

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

@ -105,6 +105,8 @@ const routeName = ref()
const tableData = ref([])
routeName.value = route.name
const tableColumns = ref(DynamicRule.allSchemas.tableColumns)
const detailMasterId = ref()
const detailList = ref([])
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -210,6 +212,10 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */
const detailRef = ref()
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')
}
@ -283,6 +289,12 @@ const handleDeleteTable = (item, index) => {
//
const submitForm = async (formType, data) => {
const flag = validateNotRepetition(tableData.value);
if(!flag){
message.alertWarning('动态规则阶段不能重复')
basicFormRef.value.formLoading = false
return
}
data.inspectionStageDOList = tableData.value//
console.log(data.subList)
try {
@ -301,17 +313,42 @@ const submitForm = async (formType, data) => {
}
}
const detailValidate = (data) => {
const detailValidate = (type,data) => {
let tag = true;
if(!validateIfRepeat(type,data)){
tag = false
message.alertWarning('动态规则阶段不能重复')
}
return tag
}
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 () => {
getList()

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

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

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

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

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

@ -51,7 +51,7 @@
:isShowAddBtn="false" :detailButtonIsShow="true"
/>
<!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/>
<ListTable ref="listTableRef" titleName="包装信息"/>
</template>
<script setup lang="ts">
@ -62,7 +62,7 @@
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
import * as InspectionJobDetailApi from '@/api/qms/inspectionJob/inspectionJobDetail'
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 AddForm from './addForm.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
}
},
// {
// label: '检验方案Json',
// field: 'inspectionSchemeJson',
// sort: 'custom',
// isSearch: false,
// },
{
label: '检验批次',
field: 'inspectionBatch',
@ -227,7 +221,7 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
},
{
label: '采样总数量',
field: 'sampleTatalAmount',
field: 'sampleTotalAmount',
sort: 'custom',
isSearch: false,
form: {
@ -256,22 +250,22 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150
}
},
{
label: '检验批来源',
field: 'inspectionBatchSource',
sort: 'custom',
isSearch: false,
dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
dictClass: 'string',
form:{
componentProps:{
disabled:true
}
},
table: {
width: 150
}
},
// {
// label: '检验批来源',
// field: 'inspectionBatchSource',
// sort: 'custom',
// isSearch: false,
// dictType: DICT_TYPE.INSPECTION_BATCH_SOURCE,
// dictClass: 'string',
// form:{
// componentProps:{
// disabled:true
// }
// },
// table: {
// width: 150
// }
// },
{
label: '检验阶段',
field: 'inspectionStage',

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

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

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

@ -27,20 +27,6 @@
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<!-- <BasicForm ref="formRef"
@success="getList"
:rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas"
:tableData="tableData"
:tableAllSchemas="InspectionJobPackage.allSchemas"
:tableFormRules="InspectionJobPackageRules"
:apiUpdate="InspectionRecordMainApi.updateInspectionRecordMain"
:apiCreate="InspectionRecordMainApi.createInspectionRecordMain"
@handleAddTable="handleAddTable"
@handleDeleteTable="handleDeleteTable"
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm" /> -->
<AddForm
ref="formRef"
basicFormWidth="80"
@ -49,7 +35,6 @@
:rules="InspectionRecordMainRules"
:formAllSchemas="InspectionRecordMain.allSchemas"
@submitForm="submitForm"
@onChange='onChange'
/>
<Detail
ref="detailRef" :isBasic="false" :allSchemas="InspectionRecordMain.allSchemas"
@ -61,7 +46,7 @@
:isShowAddBtn="false" :detailButtonIsShow="true"
/>
<!-- 包装信息 -->
<listTable ref="listTableRef" titleName="包装信息"/>
<ListTable ref="listTableRef" titleName="包装信息"/>
</template>
<script setup lang="ts">
@ -71,7 +56,7 @@
import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
import * as InspectionRecordDetailApi from '@/api/qms/inspectionRecord/inspectionRecordDetail'
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 AddForm from './addForm.vue'
import Detail from './detail.vue'
@ -91,42 +76,9 @@
tableColumns.value = val
}
//
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
nextTick(async () => {
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
// row['itemNumber'] = val[0]['number']
// row['itemName'] = val[0]['name']
// row['uom'] = val[0]['uom']
// row['isRadeIn'] = val[0]['isRadeIn']
// row['available'] = val[0]['available']
} else {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
}
})
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => {
const setV = {}
// if(formField == 'itemCode'){
// await ItembasicApi.getItembasicPage({
// code: setV['itemCode']
// }).then(res => {
// setV['uom'] = res.list[0].uom
// setV[formField] = val[0][searchField]
// })
// }
formRef.setValues(setV)
})
}
//
const Echo = []
const { tableObject, tableMethods } = useTable({
getListApi: InspectionRecordMainApi.getInspectionRecordMainPage //
})
@ -141,14 +93,6 @@
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
@ -169,20 +113,24 @@
//
const isShowMainButton = (row, val) => {
if (val.indexOf(row.status) > -1) {
if(val){
if(row.useDecision){
return false
} else {
}else{
return true
}
}else{
return !row.isPublished
}
}
// -
const butttondata = (row) => {
return [
// defaultButtons.mainListOrderCOMPLETEBtn({ hide: isShowMainButton(row, ['INCOMPLETE']) }), //
defaultButtons.mainListEditBtn({hasPermi:'qms:inspection-recode-main:edit'}), //
defaultButtons.mainApplyDecisionBtn({ hide: isShowMainButton(row, null),hasPermi:'qms:inspection-recode-main:edit'}), // 使
// defaultButtons.mainListDeleteBtn(null), //
defaultButtons.mainListOrderPubBtn({hasPermi:'qms:inspection-recode-main:pub'}), //
defaultButtons.mainListOrderPubBtn({ hide: isShowMainButton(row,'pub'),hasPermi:'qms:inspection-recode-main:pub'}), //
defaultButtons.mainListPackageBtn(null), //
]
}
@ -190,7 +138,7 @@
const listTableRef = ref()
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
if (val == 'applyDecision') { //
// 1使
if(row.estimateCode == 1){
InspectionRecordMain.allSchemas.formSchema.forEach((itemColumn) =>{
@ -208,6 +156,12 @@
openForm('update', row)
}else if (val == 'mainPackage') { //
const list = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id)
list.forEach(item=>{
item.qualifiedAmount = item.qualifiedAmount ?item.qualifiedAmount :0
item.noQualifiedAmount = item.noQualifiedAmount ?item.noQualifiedAmount :0
item.destroyAmount = item.destroyAmount ?item.destroyAmount :0
item.frozenAmount = item.frozenAmount ?item.frozenAmount :0
})
listTableRef.value.openPackage(row,'包装信息',InspectionRecordPackage.allSchemas.tableColumns,list)
}else if (val == 'delete') { //
handleDelete(row.id)
@ -245,10 +199,10 @@
const handleOrderPub = async (row : object) => {
try {
//
await message.confirm('是否发布所选数据')
await message.confirm(t('common.confirmPublish'))
//
await InspectionRecordMainApi.publishInspectionRecordMain(row)
message.success('发布成功')
await InspectionRecordMainApi.publishInspectionRecordMain(row.id)
message.success(t('common.publishSuccess'))
//
await getList()
} catch { }
@ -281,30 +235,6 @@
})
const tableData = ref([])
//
const handleAddTable = () => {
tableData.value.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index) => {
tableData.value.splice(index, 1)
}
const count = ref(0)
const onChange = (field, cur)=>{
console.log(field, cur)
// if(field=='useDecision'){
// if(cur == 1){
// InspectionRecordPackage.allSchemas.tableFormColumns.forEach(item=>{
// if(item.field == 'qualifiedAmount'){
// console.log(item.disabled)
// item.disabled = true
// console.log(item.disabled)
// }
// })
// }
// }
console.log(InspectionRecordPackage.allSchemas.tableFormColumns)
}
// //
const submitForm = async (formType, data) => {
data.subList = tableData.value //
@ -324,23 +254,6 @@
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '采购订单主导入模版.xlsx'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {

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

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

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

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

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

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

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

@ -48,6 +48,7 @@
:apiCreate="SampleCodeApi.createSampleCode"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
@onChange="onChange"
/>
<!-- 详情 -->
@ -65,6 +66,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/components/Detail/src/Detail.vue'
import {connection} from "@antv/x6/es/registry/attr/connection";
defineOptions({ name: 'SampleCode' })
@ -234,7 +236,15 @@ const searchFormClick = (searchData) => {
}
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 () => {
getList()

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

@ -1,12 +1,15 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import {getSamplingScheme} from '@/api/qms/sampleCode/index'
import {validateNum} from "@/utils/validator";
// 表单校验
export const SampleCodeRules = reactive({
code: [required],
batchUpperLimiting: [required],
// available: [required],
batchLowLimiting: [{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
batchUpperLimiting: [
{ required:true, message: '该项为必填', trigger: 'blur'},
{ validator:validateNum, message: '请输入整数', trigger: 'blur'}],
})
const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
@ -92,16 +95,6 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
field: 'g3',
sort: 'custom',
},
// {
// label: '是否可用',
// field: 'available',
// sort: 'custom',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string', // 默认都是字符串类型其他暂不考虑
// form: {
// component: 'Select'
// },
// },
{
label: '创建时间',
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']
// getBomDisassemble
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
// PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailList({
PurchasereceiptRecordDetailApi.getPurchasereceiptRecordDetailListToRepeat({
masterId: val[0]['id']
}).then((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) => {
return [
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.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-job-main:abandon'}), //
defaultButtons.mainListJobExeBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-job-main:execute'}), //
// 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.mainListJobAbaBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:purchasereceipt-job-main:abandon'}), //
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
ref="formRef"
:isOpenSearchTable="true"
:indexTableColumn="3"
:indexTableColumn="0"
@success="getList"
:rules="SupplierdeliverRequestMainRules"
:formAllSchemas="SupplierdeliverRequestMain.allSchemas"
@ -61,7 +61,15 @@
@searchTableSuccess="searchTableSuccess"
@submitForm="submitForm"
@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
@ -120,6 +128,7 @@
import download from '@/utils/download'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getAccessToken } from '@/utils/auth'
import { formatDate } from '@/utils/formatTime'
import {
SupplierdeliverRequestMain,
SupplierdeliverRequestMainRules,
@ -131,7 +140,10 @@ import {
import * as SupplierdeliverRequestMainApi from '@/api/wms/supplierdeliverRequestMain'
import * as SupplierdeliverRequestDetailApi from '@/api/wms/supplierdeliverRequestDetail'
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' })
@ -155,6 +167,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
nextTick(() => {
console.log("type:",type)
console.log("formField:",formField)
console.log(formField, searchField, val, formRef, type, row)
if (type == 'tableForm') {
//
// row[formField] = val[0][searchField]
@ -165,7 +178,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
// row['orderQty'] = val[0]['orderQty']
// row['uom'] = val[0]['uom']
// }
//--
const itemCodes = []
val.forEach(item=>{
if(tableData.value.find(item1=>item1['id'] == item['id'])) return
const newRow = {...row}
newRow[formField] = item[searchField]
newRow['poNumber'] = item['poNumber']
@ -173,12 +189,25 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row) =>
newRow['poLine'] = item['poLine']
newRow['orderQty'] = item['orderQty']
newRow['uom'] = item['uom']
itemCodes.push(item['itemCode'])
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 {
const setV = {}
setV[formField] = val[0][searchField]
if(formField == 'ppNumber'){
//--
getSearchTableData(val[0]['number'],formField,searchField)
//
let beginTime = val[0]['endTime']
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) => {
nextTick(() => {
@ -232,6 +298,8 @@ const searchTableSuccessLabel = (formField, searchField, val, formRef, type, row
})
}
const { tableObject, tableMethods } = useTable({
getListApi: SupplierdeliverRequestMainApi.getSupplierdeliverRequestMainPage //
})

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

@ -552,6 +552,102 @@ export const SupplierdeliverRequestMainRules = reactive({
* @returns {Array}
*/
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: '生产日期',
field: 'produceDate',
@ -578,17 +674,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x',
}
},
{
label: '批次',
field: 'batch',
sort: 'custom',
table: {
width: 150
},
tableForm: {
disabled: false
}
},
// {
// label: '替代批次',
// field: 'altBatch',
@ -620,6 +706,7 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x',
}
},
isTableForm: false,
tableForm: {
type: 'FormDate',
@ -647,81 +734,17 @@ export const SupplierdeliverRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x',
}
},
tableForm: {
type: 'FormDate',
dateFormat: 'YYYY-MM-DD',
valueFormat: 'x',
}
},
{
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: {
// tableForm: {
// type: 'FormDate',
// dateFormat: 'YYYY-MM-DD',
// valueFormat: 'x',
// }
tableForm:{
type: 'slot',
disabled: true
}
},
{
label: '订单数量',
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: '计量单位',
field: 'uom',

Loading…
Cancel
Save