Browse Source

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

master_hella_20240701
liuchen864 7 months ago
parent
commit
22e57871b6
  1. 56
      src/api/mes/dismantlingDetail/index.ts
  2. 8
      src/api/mes/ordermonthplan/index.ts
  3. 4
      src/api/qms/aql/index.ts
  4. 2
      src/api/qms/inspectionRecord/inspectionRecordMain/index.ts
  5. 8
      src/api/qms/samplingProcess/index.ts
  6. 6
      src/api/qms/selectedProject/index.ts
  7. 1
      src/components/Detail/src/Detail.vue
  8. 4
      src/utils/dict.ts
  9. 14
      src/utils/validator.ts
  10. 181
      src/views/mes/dismantlingMain/dismantlingMain.data.ts
  11. 30
      src/views/mes/dismantlingMain/index.vue
  12. 38
      src/views/mes/orderDay/components/orderDetail.vue
  13. 28
      src/views/mes/orderDay/components/processSearch.data.ts
  14. 238
      src/views/mes/orderDay/components/schedule.vue
  15. 22
      src/views/mes/orderDay/index.vue
  16. 86
      src/views/mes/orderDay/orderDay.data.ts
  17. 44
      src/views/mes/ordermonthplan/index.vue
  18. 165
      src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts
  19. 49
      src/views/mes/processroute/components/configDialog.vue
  20. 12
      src/views/mes/processroute/processroute.data.ts
  21. 209
      src/views/qms/aql/aql.data.ts
  22. 3
      src/views/qms/basicDataManage/counter/counter.data.ts
  23. 1
      src/views/qms/basicDataManage/dynamicRule/dynamicRule.data.ts
  24. 170
      src/views/qms/basicDataManage/inspectionScheme/addForm.vue
  25. 50
      src/views/qms/basicDataManage/inspectionTemplate/addForm.vue
  26. 6
      src/views/qms/basicDataManage/selectedProject/index.vue
  27. 9
      src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts
  28. 68
      src/views/qms/basicDataManage/selectedSet/index.vue
  29. 3
      src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts
  30. 89
      src/views/qms/inspection/inspectionJob/inspectionJobMain.data.ts
  31. 19
      src/views/qms/inspection/inspectionRecord/addForm.vue
  32. 70
      src/views/qms/inspection/inspectionRecord/inspectionRecordMain.data.ts
  33. 8
      src/views/qms/inspection/inspectionRequest/index.vue
  34. 109
      src/views/qms/inspection/inspectionRequest/inspectionMain.data.ts
  35. 25
      src/views/qms/inspectionMethod/inspectionMethod.data.ts
  36. 26
      src/views/qms/sampleCode/sampleCode.data.ts
  37. 25
      src/views/qms/samplingProcess/samplingProcess.data.ts
  38. 27
      src/views/qms/samplingScheme/samplingScheme.data.ts
  39. 4
      src/views/system/systemInstallPackage/index.vue
  40. 76
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue
  41. 438
      src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts
  42. 8
      src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/purchasereturnRecordMain.data.ts
  43. 74
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/index.vue
  44. 182
      src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

56
src/api/mes/dismantlingDetail/index.ts

@ -0,0 +1,56 @@
import request from '@/config/axios'
export interface DismantlingDetailVO {
deleteTime: Date
id: number
status: string
concurrencyStamp: number
remark: string
deleter: string
siteId: number
mainBiilno: string
materialCode: string
materialStauts: string
materialProcessstauts: string
}
// 查询报废拆解明细列表
export const getDismantlingDetailPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/dismantling-detail/senior', data })
} else {
return await request.get({ url: `/mes/dismantling-detail/page`, params })
}
}
// 查询报废拆解明细详情
export const getDismantlingDetail = async (id: number) => {
return await request.get({ url: `/mes/dismantling-detail/get?id=` + id })
}
// 新增报废拆解明细
export const createDismantlingDetail = async (data: DismantlingDetailVO) => {
return await request.post({ url: `/mes/dismantling-detail/create`, data })
}
// 修改报废拆解明细
export const updateDismantlingDetail = async (data: DismantlingDetailVO) => {
return await request.put({ url: `/mes/dismantling-detail/update`, data })
}
// 删除报废拆解明细
export const deleteDismantlingDetail = async (id: number) => {
return await request.delete({ url: `/mes/dismantling-detail/delete?id=` + id })
}
// 导出报废拆解明细 Excel
export const exportDismantlingDetail = async (params) => {
return await request.download({ url: `/mes/dismantling-detail/export-excel`, params })
}
// 下载用户导入模板
export const importTemplate = () => {
return request.download({ url: '/mes/dismantling-detail/get-import-template' })
}

8
src/api/mes/ordermonthplan/index.ts

@ -108,3 +108,11 @@ export const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
export const deleteMesOrderMonthSub = async (id: number) => { export const deleteMesOrderMonthSub = async (id: number) => {
return await request.delete({ url: `/plan/mes-order-month-sub/delete?id=` + id }) return await request.delete({ url: `/plan/mes-order-month-sub/delete?id=` + id })
} }
export interface MesOrderMonthSubBreakdownReqVO{
planMasterId: string
id: number
}
// 拆解为日计划
export const breakdown = async (data: MesOrderMonthSubBreakdownReqVO) => {
return await request.post({ url: `/plan/mes-order-month-sub/breakdown`,data})
}

4
src/api/qms/aql/index.ts

@ -101,3 +101,7 @@ export const exportAql = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/aql/get-import-template' }) return request.download({ url: '/qms/aql/get-import-template' })
} }
export const getSamplingScheme = async () => {
return await request.get({ url: `/qms/sampling-scheme/get-available-list`})
}

2
src/api/qms/inspectionRecord/inspectionRecordMain/index.ts

@ -67,7 +67,7 @@ export const importTemplate = () => {
export const publishInspectionRecordMain = async (data ) => { export const publishInspectionRecordMain = async (data ) => {
return await request.put({ url: `/qms/inspection-record-main/publish`, data }) return await request.put({ url: `/qms/inspection-record-main/publish`, data })
} }
//查询检验申请列表 //查询包装列表
export const getInspectionRecordPackageList = async (id: number) => { export const getInspectionRecordPackageList = async (id: number) => {
return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id }) return await request.get({ url: `/qms/inspection-record-package/list?masterId=` + id })
} }

8
src/api/qms/samplingProcess/index.ts

@ -1,4 +1,5 @@
import request from '@/config/axios' import request from '@/config/axios'
import { validatePercent } from '@/utils/validator'
export interface SamplingProcessVO { export interface SamplingProcessVO {
id: number id: number
@ -7,10 +8,15 @@ export interface SamplingProcessVO {
sampleType: string sampleType: string
evaluationMode: string evaluationMode: string
sampleSize: number sampleSize: number
sampleProgCode: number sampleProgCode: String
available: string available: string
} }
const rules = ref({
sampleSize:[
{validator:validatePercent,message:'百分比范围 0 ~ 100', trigger:'blur'}
]
})
// 查询采样过程列表 // 查询采样过程列表
export const getSamplingProcessPage = async (params) => { export const getSamplingProcessPage = async (params) => {
if (params.isSearch) { if (params.isSearch) {

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

@ -55,3 +55,9 @@ export const exportSelectedProject = async (params) => {
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/qms/selected-project/get-import-template' }) return request.download({ url: '/qms/selected-project/get-import-template' })
} }
// 查询选定集项目列表
export const getSelectedProjectNoPage = async (params) => {
return await request.get({ url: `/qms/selected-project/noPage`, params })
}

1
src/components/Detail/src/Detail.vue

@ -713,6 +713,7 @@ const opensearchTable = (
// - // -
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
debugger
if (val == 'edit') { if (val == 'edit') {
// //
if(props.isOpenSearchTable){ if(props.isOpenSearchTable){

4
src/utils/dict.ts

@ -312,6 +312,10 @@ export enum DICT_TYPE {
REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成 REWORK_STATUS='rework_status',//返工返修状态:待返修,返修中,返修完成
REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件 REWORK_REPLACE_FLAG = 'rework_replace_flag',//是否有替换件
DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型 DISMANTLING_BILL_TYPE = 'dismantling_bill_type',//工单类型
DISMANTLING_MATERIAL_STATUS = 'dismantling_material_status',//报废拆解物料状态
DISMANTLING_MATERIAL_HANDLE_STATUS = 'dismantling_material_handle_status',//报废拆解处理状态
SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态 SUPPLIERINVOICE_REQUEST_STATUS = 'supplierinvoice_request_status', //发票申请状态
SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态 SUPPLIERINVOICE_STATUS = 'supplierinvoice_status', //待开票审核状态
} }

14
src/utils/validator.ts

@ -748,6 +748,17 @@ export function validateYS(rule, value, callback) {
callback() callback()
} }
} }
// 校验百分比
export function validatePercent(rule, value, callback){
if (!value) {
return callback(new Error('百分比不能为空'))
} else {
if(value < 0 || value > 100){
return callback(new Error('百分比范围 0 ~ 100'))
}
callback()
}
}
export default { export default {
validateCode, validateCode,
@ -780,5 +791,6 @@ export default {
validateName, validateName,
validateChargeperson, validateChargeperson,
validateYS, validateYS,
validateMaxNumber5 validateMaxNumber5,
validatePercent
} }

181
src/views/mes/dismantlingMain/dismantlingMain.data.ts

@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data"; import {Itembasic} from "@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data";
import * as ItembasicApi from "@/api/wms/itembasic"; import * as ItembasicApi from "@/api/wms/itembasic";
// 表单校验 // 表单校验
export const DismantlingMainRules = reactive({ export const DismantlingMainRules = reactive({
productionCode: [required], productionCode: [required],
workbillType: [required], workbillType: [required],
@ -175,3 +175,182 @@ export const DismantlingMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))
export const DismantlingDetail = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '删除时间',
field: 'deleteTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
form: {
component: 'DatePicker',
componentProps: {
type: 'datetime',
valueFormat: 'x'
}
},
},
{
label: '主键',
field: 'id',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'Radio'
},
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
},
{
label: '删除用户名',
field: 'deleter',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '位置ID',
field: 'siteId',
sort: 'custom',
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
form: {
component: 'InputNumber',
value: 0
},
},
{
label: '单据编码',
field: 'mainBiilno',
sort: 'custom',
isSearch: true,
isForm: false,
isTable: false,
table: {
width: 150,
fixed: 'right'
}
},
{
label: '物料编码',
field: 'materialCode',
sort: 'custom',
isSearch: true,
form: {
componentProps: {
isSearchList: true, // 开启查询弹窗
searchTitle: '物料编码', // 查询弹窗标题
searchAllSchemas: Itembasic.allSchemas, // 查询弹窗所需类
searchField: 'code', // 查询弹窗赋值字段
searchPage: ItembasicApi.getItembasicPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},
{
key: 'type',
action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件
value: 'BCP,CCP',//,SEMI]
isMainValue: false
}]
}
}
},
{
label: '物料状态',
field: 'materialStauts',
sort: 'custom',
dictType: DICT_TYPE.DISMANTLING_MATERIAL_STATUS,
dictClass: 'string',
isSearch: true,
},
{
label: '处理状态',
field: 'materialProcessstauts',
dictType: DICT_TYPE.DISMANTLING_MATERIAL_HANDLE_STATUS,
dictClass: 'string',
sort: 'custom',
isSearch: true,
},
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))
// 子表单校验
export const DismantlingDetailRules = reactive({
materialCode: [required],
materialStauts: [required],
materialProcessstauts: [required],
})

30
src/views/mes/dismantlingMain/index.vue

@ -28,7 +28,7 @@
v-model:sort="tableObject.sort" v-model:sort="tableObject.sort"
> >
<template #dismantlingBillno="{row}"> <template #dismantlingBillno="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.dismantlingBillno)"> <el-button type="primary" link @click="openDetail(row, '单据编号', row.dismantlingBillno)">
<span>{{ row.dismantlingBillno }}</span> <span>{{ row.dismantlingBillno }}</span>
</el-button> </el-button>
</template> </template>
@ -51,7 +51,21 @@
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail ref="detailRef" :isBasic="true" :allSchemas="DismantlingMain.allSchemas" /> <Detail ref="detailRef"
:isBasic="false"
:allSchemas="DismantlingMain.allSchemas"
:detailAllSchemas="DismantlingDetail.allSchemas"
:detailAllSchemasRules="DismantlingDetailRules"
:apiPage="DismantlingDetailApi.getDismantlingDetailPage"
:apiCreate="DismantlingDetailApi.createDismantlingDetail"
:apiUpdate="DismantlingDetailApi.updateDismantlingDetail"
:apiDelete="DismantlingDetailApi.deleteDismantlingDetail"
:detailButtonIsShowAdd="true"
:detailButtonIsShowEdit="true"
:detailButtonIsShowDelete="true"
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/mes/dismantling-main/import" :importTemplateData="importTemplateData" @success="importSuccess" /> <ImportForm ref="importFormRef" url="/mes/dismantling-main/import" :importTemplateData="importTemplateData" @success="importSuccess" />
@ -59,8 +73,9 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { DismantlingMain,DismantlingMainRules } from './dismantlingMain.data' import { DismantlingMain,DismantlingMainRules,DismantlingDetail,DismantlingDetailRules } from './dismantlingMain.data'
import * as DismantlingMainApi from '@/api/mes/dismantlingMain' import * as DismantlingMainApi from '@/api/mes/dismantlingMain'
import * as DismantlingDetailApi from '@/api/mes/dismantlingDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' 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'
@ -85,6 +100,15 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
} }
//
const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
// //
const updataTableColumns = (val) => { const updataTableColumns = (val) => {
tableColumns.value = val tableColumns.value = val

38
src/views/mes/orderDay/components/orderDetail.vue

@ -25,8 +25,8 @@
/> />
</ContentWrap> </ContentWrap>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <el-tabs v-model="activeName" type="card" @tab-click="handleClick" style="margin-top: 5px;height: min-height:240px;">
<el-tab-pane label="工艺路线信息" name="processRouteInfo"> <el-tab-pane label="工艺信息" name="processInfo">
<div class="mt-20px"> <div class="mt-20px">
<el-space :size="10" spacer="|"> <el-space :size="10" spacer="|">
<span>名称<el-tag v-if="processRouteInfoSchema.processrouteInfo!=null">{{ processRouteInfoSchema.processrouteInfo.processName}} </el-tag></span> <span>名称<el-tag v-if="processRouteInfoSchema.processrouteInfo!=null">{{ processRouteInfoSchema.processrouteInfo.processName}} </el-tag></span>
@ -44,7 +44,6 @@
> >
<el-table-column prop="nodeSort" label="序号" align="center"/> <el-table-column prop="nodeSort" label="序号" align="center"/>
<el-table-column prop="preCode" label="前置工序" align="center"> <el-table-column prop="preCode" label="前置工序" align="center">
<template #default="scope"> <template #default="scope">
<div style="display: flex; align-items: center"> <div style="display: flex; align-items: center">
<el-tag <el-tag
@ -88,35 +87,6 @@
<el-table-column prop="version" label="版本" align="center" /> <el-table-column prop="version" label="版本" align="center" />
</el-table> </div </el-table> </div
></el-tab-pane> ></el-tab-pane>
<el-tab-pane label="班组人员信息" name="workTeamInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="workTeamInfoSchema"
style="width: 100%"
>
<el-table-column prop="id" label="ID" align="center" />
<el-table-column prop="userName" label="人员工号" align="center" />
<el-table-column prop="nickeName" label="显示名称" align="center" />
<el-table-column prop="workGroup" label="所属班组" align="center" />
<el-table-column prop="lineCode" label="所属产线" align="center" />
<el-table-column prop="abliity" label="技能岗位" align="center" />
</el-table> </div
></el-tab-pane>
<el-tab-pane label="设备信息" name="deviceInfo"
><div class="mt-20px">
<el-table
ref="tableRoute"
:data="deviceInfoSchema"
style="width: 100%"
>
<el-table-column prop="productItemCode" label="设备编码" align="center" />
<el-table-column prop="componentItemCode" label="设备名称" align="center" />
<el-table-column prop="componentUom" label="所属车间" align="center" />
<el-table-column prop="componentQty" label="所属产线" align="center"/>
<el-table-column prop="status" label="设备状态" align="center" />
</el-table> </div
></el-tab-pane>
</el-tabs> </el-tabs>
</el-drawer> </el-drawer>
</div> </div>
@ -146,13 +116,11 @@ const detailData = ref(props.allSchemas)
componentUom:'----', componentUom:'----',
componentQty:'----', componentQty:'----',
version:'----'}]) version:'----'}])
const workTeamInfoSchema = ref( [] )
const deviceInfoSchema = ref([])
const processRouteInfoSchema = ref({ const processRouteInfoSchema = ref({
processrouteInfo: { processrouteCode: '', processName: '', routeVersion: '' }, processrouteInfo: { processrouteCode: '', processName: '', routeVersion: '' },
processrouteNodeDetailList: [] processrouteNodeDetailList: []
}) })
const isShowDrawer = ref(false) const isShowDrawer = ref(false)
const detailLoading = ref(false) const detailLoading = ref(false)
const nodeColumns = ref([ const nodeColumns = ref([

28
src/views/mes/orderDay/components/processSearch.data.ts

@ -0,0 +1,28 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
export const ProcessSearch = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '代码',
field: 'code',
sort: 'custom',
isSearch: true,
},
{
label: '名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '类型',
field: 'type',
dictType: DICT_TYPE.PROCESS_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
sort: 'custom',
},
]))

238
src/views/mes/orderDay/components/schedule.vue

@ -17,83 +17,78 @@
width="200px" width="200px"
/> />
</ContentWrap> </ContentWrap>
<div style="height: 480px; overflow-y: auto"> <ContentWrap>
<el-tabs type="border-card" :active-name="activeName"> <el-container>
<el-tab-pane label="调整工艺路线" name="process"> <el-aside width="400px">
<el-container> <el-card>
<el-aside> <template #header>
<el-card style="max-width: 480px"> <div class="card-header">
<template #header> <span>工艺路线</span>
<div class="card-header"> <el-button
<span>原有工序</span> type="text"
</div> icon="el-icon-plus"
@click="opensearchTable"
style="float: right; padding: 3px 0"
>添加工序</el-button>
</div>
</template>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%" @cell-dblclick="userAddNode">
<el-table-column prop="code" label="工序编码" />
<el-table-column prop="name" label="工序名称" />
<el-table-column prop="oper" label="" width="60">
<template #default="scope">
<el-button size="mini" text @click="deleteNode(scope.row)"
>移除</el-button
>
</template>
</el-table-column>
</el-table>
</el-card>
</el-aside>
<el-main style="height: 480px;width: calc(100% - 900px);padding: 0px; margin:0px 20px">
<div ref="graphContainer" ></div
></el-main>
<el-aside width="500px">
<el-tabs v-model="activeName">
<el-tab-pane label="人员配置" name="process">
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%">
<el-table-column prop="name" label="人员">
<template #default="scope">
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button
>
</template> </template>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%"> </el-table-column>
<el-table-column prop="name" label="工序名称"> <el-table-column prop="code" label="工序编码" width="180" v-if="false" />
<template #default="scope"> </el-table>
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%" </el-tab-pane>
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button <el-tab-pane label="工作位置配置" name="ddddd">
> <el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%">
</template> <el-table-column prop="name" label="工作位置">
</el-table-column> <template #default="scope">
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> <el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%"
</el-table> >{{ scope.row.name }}[{{ scope.row.code }}]</el-button
</el-card> >
</el-aside>
<el-main><div ref="graphContainer"></div></el-main>
<!-- <el-aside
><el-card style="max-width: 480px">
<template #header>
<div class="card-header">
<span>可选工序</span>
</div>
</template> </template>
<p v-for="o in 4" :key="o" class="text item">{{ 'List item ' + o }}</p> </el-table-column>
<template #footer>Footer content</template> <el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-card></el-aside </el-table>
> --> </el-tab-pane>
</el-container> </el-tabs>
</el-tab-pane> </el-aside>
<el-tab-pane label="调整临时BOM" name="boms">
<TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/>
</el-tab-pane>
<el-tab-pane label="调整可用设备" name="device" </el-container>
><TableForm </ContentWrap>
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/></el-tab-pane>
<el-tab-pane label="调整班组人员" name="worker"
><TableForm
ref="tableProcess"
:table-data="tableDataProcess"
:table-fields="tableColumnsProcess"
:loading="loading"
@handleAddTable="handleAddTable(tableDataProcess)"
@handle-delete-table="handleDeleteTable(item, index,tableDataProcess)"
/></el-tab-pane>
</el-tabs>
</div>
<template #footer> <template #footer>
<el-button @click="dialogVisible = false">发布计划</el-button> <el-button @click="dialogVisible = false">发布计划</el-button>
</template> </template>
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</Dialog> </Dialog>
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> --> <!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> -->
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
defineOptions({ name: 'sechledDetail' })
//import { dateFormatter } from '@/utils/formatTime' //import { dateFormatter } from '@/utils/formatTime'
import { import {
start_node, start_node,
@ -102,6 +97,9 @@ import {
getNewNode getNewNode
} from '@/views/mes/processroute/components/graphbase.data' } from '@/views/mes/processroute/components/graphbase.data'
import * as ProcessrouteApi from '@/api/mes/processroute' import * as ProcessrouteApi from '@/api/mes/processroute'
import {ProcessSearch} from './processSearch.data'
import * as ProcessApi from '@/api/wms/process'
import { SearchTable } from '@/components/SearchTable'
import { Graph } from '@antv/x6' import { Graph } from '@antv/x6'
const graphContainer = ref<HTMLElement | null>(null) const graphContainer = ref<HTMLElement | null>(null)
const graph = ref<Graph>() const graph = ref<Graph>()
@ -109,7 +107,7 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() // const { t } = useI18n() //
const activeName = ref('process') const activeName = ref('process')
const loading = ref(true) const loading = ref(true)
const processData=ref() const processData = ref([])
const props = defineProps({ const props = defineProps({
// //
isSearchFilterButtonHide: { isSearchFilterButtonHide: {
@ -131,54 +129,6 @@ const props = defineProps({
const detailData = ref(props.allSchemas) const detailData = ref(props.allSchemas)
const route = useRoute() // const route = useRoute() //
const routeName = ref() const routeName = ref()
const tableDataProcess = ref([
{
type: '',
value: ''
}
])
const tableColumnsProcess = ref([
{
label: '结束时间',
field: 'endTime',
sort: 'custom',
isReadonly: true,
form: {
component: 'TimePicker',
componentProps: {
type: 'time',
dateFormat: 'HH:mm'
}
}
},
{
label: '生产模式',
field: 'taskMode',
width: '80px',
sort: 'custom',
dictType: 'mes_task_mode',
dictClass: 'string',
form: {
component: 'Select',
value: 'ASSIGN'
}
}
])
//
const handleAddTable = (name:any) => {
message.success('添加成功')
let tableFormKeys = {
type: '',
value: ''
}
name.push(JSON.parse(JSON.stringify(tableFormKeys)))
}
//
const handleDeleteTable = (item, index,name) => {
console.log(name)
name.splice(index, 1)
}
routeName.value = route.name routeName.value = route.name
routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail' routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'Detail'
@ -279,15 +229,15 @@ const open = async (type: string, row?: any, titleName?: any) => {
dialogVisible.value = true dialogVisible.value = true
detailData.value = row detailData.value = row
dialogWidth.value = props.basicFormWidth + '%' dialogWidth.value = props.basicFormWidth + '%'
//console.log(props.allSchemas) //
//console.log(row) getProcessroute('001')
if (titleName) { if (titleName) {
dialogTitle.value = t('action.' + titleName) dialogTitle.value = t('action.' + titleName)
} else { } else {
dialogTitle.value = t('action.' + type) dialogTitle.value = t('action.' + type)
} }
nextTick(() => { nextTick(() => {
graph.value = createGraph(graphContainer.value as HTMLElement, false, dialogWidth.value-200, 320) graph.value = createGraph(graphContainer.value as HTMLElement, true, 240, 320)
// graph.value.on('node:click', ({ e, x, y, node, view }) => { // graph.value.on('node:click', ({ e, x, y, node, view }) => {
// nodeClick(e, x, y, node, view) // nodeClick(e, x, y, node, view)
// }) // })
@ -318,6 +268,58 @@ const userAddNode = (row) => {
} }
} }
} }
//线
const getProcessroute = async (code: String) => {
let res = await ProcessrouteApi.getProcesInfo(code)
if (res.code == 200) {
processData.value = res.data
}
}
const searchTableRef = ref()
const opensearchTable = (
) => {
console.log("opensearchTable")
const _searchCondition = {}
const _searchTableTitle = "工序查询"
const _searchTableAllSchemas = ProcessSearch.allSchemas
const _searchTablePage = ProcessApi.getProcessPage
searchTableRef.value.open(
_searchTableTitle,
_searchTableAllSchemas,
_searchTablePage,
undefined,
undefined,
true,
undefined,
undefined,
_searchCondition,
false,
true
)
}
//
// val row
const searchTableSuccess = (formField, searchField, val, type, row) => {
//console.log("searchTableSuccess",val)
if(val.length>0){
val.forEach(item=>{
if(processData.value.find(obj=>obj.code==item.code)==undefined){
processData.value.push({code:item.code,name:item.name})}
})
}
//emit('searchTableSuccess', formField, searchField, val, undefined, type, row)
}
const deleteNode=(row)=>{
processData.value.splice(processData.value.indexOf(row),1)
graph.value.removeNode(row.code)
}
defineOptions({ name: 'sechledDetail' })
defineExpose({ open }) // open defineExpose({ open }) // open
</script> </script>
<style lang="scss"> <style lang="scss">

22
src/views/mes/orderDay/index.vue

@ -56,6 +56,7 @@
@searchTableSuccess="searchTableSuccess" @searchTableSuccess="searchTableSuccess"
:isBusiness="false" :isBusiness="false"
:isSearchFilterButtonHide="true" :isSearchFilterButtonHide="true"
@onChange="valueChange"
/> />
<!-- 详情 --> <!-- 详情 -->
@ -80,6 +81,7 @@ 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 orderDetail from './components/orderDetail.vue' import orderDetail from './components/orderDetail.vue'
import scheduleDetail from './components/schedule.vue' import scheduleDetail from './components/schedule.vue'
import { disabledTimeListsProps } from 'node_modules/element-plus/es/components/time-picker/src/props/shared'
defineOptions({ name: 'MesOrderDay' }) defineOptions({ name: 'MesOrderDay' })
const message = useMessage() // const message = useMessage() //
@ -137,6 +139,20 @@ const searchTableSuccess = (formField, searchField, val, formRef) => {
}) })
}
const valueChange=(filed,cur)=>{
if(filed=='noAutoFlag'){
OrderDay.allSchemas.formSchema.forEach(item => {
if (item.field == 'planNoDay') {
item.componentProps.disabled = cur==='ENABLE'?true:false
//console.log("item",OrderDayRules)
OrderDayRules.planNoDay[0].required = cur==='ENABLE'?false:true
//item.componentProps.required = cur==='ENABLE'?false:true
}
})
}
} }
// //
@ -193,13 +209,13 @@ const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:update'}), // defaultButtons.mainListEditBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:update'}), //
defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:delete'}), // defaultButtons.mainListDeleteBtn({ hide: isShowMainButton(row,['1']),hasPermi:'mes:orderDay:delete'}), //
defaultButtons.mainListHandleBtn({label: '发布', defaultButtons.mainListHandleBtn({label: '排产',
name: 'publish', name: 'publish',
hide: isShowMainButton(row,['1']), hide: isShowMainButton(row,['1']),
type: 'warning', type: 'warning',
icon: '', icon: '',
color: '', color: '',
hasPermi: ''}), // hasPermi: 'mes:orderDay:update'}), //
// defaultButtons.mainListHandleBtn({label: '', // defaultButtons.mainListHandleBtn({label: '',
// name: 'publish', // name: 'publish',
// hide: isShowMainButton(row,['2']), // hide: isShowMainButton(row,['2']),
@ -224,7 +240,7 @@ const buttonTableClick = async (val, row) => {
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} else if(val=='schedule'){ // } else if(val=='publish'){ //
openScheduledDetail( '发布计划', row,row.planNoDay) openScheduledDetail( '发布计划', row,row.planNoDay)
} }
} }

86
src/views/mes/orderDay/orderDay.data.ts

@ -4,13 +4,13 @@ import * as ItembasicApi from '@/api/wms/itembasic'
import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data' import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
import * as WorkshopApi from '@/api/wms/workshop' import * as WorkshopApi from '@/api/wms/workshop'
import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data' import { Workshop } from '@/views/wms/basicDataManage/factoryModeling/workshop/workshop.data'
import { on } from '@/utils/domUtils'
// 表单校验 // 表单校验
export const OrderDayRules = reactive({ export const OrderDayRules = reactive({
planNoDay: [ // planNoDay: [
{ required: true, message: '请输入一个日计划编号', trigger: 'blur' } // { required: false, message: '请输入一个日计划编号', trigger: 'blur' }
], // ],
planNoMonth: [ planNoMonth: [
{ required: true, message: '请输入一个月计划编号', trigger: 'blur' } { required: true, message: '请输入一个月计划编号', trigger: 'blur' }
], ],
@ -38,6 +38,9 @@ export const OrderDayRules = reactive({
taskMode: [ taskMode: [
{ required: true, message: '请选择一个生产方式', trigger: 'blur' } { required: true, message: '请选择一个生产方式', trigger: 'blur' }
], ],
processrouteCode: [
{ required: true, message: '请选择一个工艺路线!', trigger: 'blur' }
],
}) })
export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
@ -53,7 +56,34 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
field: 'planNoDay', field: 'planNoDay',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
required: true, required: false,
form: {
component: 'Input',
componentProps: {
disabled: true
}
},
},
{
label: '',
field: 'noAutoFlag',
sort: 'custom',
isForm: true,
isTable: false,
isDetail:false,
isSearch: false,
width: '60px',
dictType: DICT_TYPE.ITEM_STATUS,
dictClass: 'string',
form: {
component: 'Switch',
value: 'ENABLE',
componentProps: {
inactiveValue: 'DISABLE',
activeValue: 'ENABLE'
}
},
}, },
{ {
label: '月计划单号', label: '月计划单号',
@ -102,7 +132,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
key: 'type', key: 'type',
action: 'in', // 查询拼接条件 action: 'in', // 查询拼接条件
isSearch: true, // 使用自定义拼接条件 isSearch: true, // 使用自定义拼接条件
value: 'FG,SEMI',//,SEMI] value: 'CCP,BCP',//,SEMI]
isMainValue: false isMainValue: false
}, },
@ -169,7 +199,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '临时工艺', label: '允许临时工艺',
field: 'tempProcessroute', field: 'tempProcessroute',
sort: 'custom', sort: 'custom',
width: '80px', width: '80px',
@ -185,32 +215,30 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: 'BOM编码', label: 'BOM版本',
field: 'standardBom', field: 'standardBom',
sort: 'custom', sort: 'custom',
form: { form: {
component:'Select', component: 'InputNumber',
componentProps: { value: 1
options: [{lablel:'bom',value:'bom'}] },
}
}
},
{
label: '替代BOM',
field: 'tempBom',
sort: 'custom',
width: '80px',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE',
}
}
}, },
// {
// label: '替代BOM',
// field: 'tempBom',
// sort: 'custom',
// width: '80px',
// dictType: DICT_TYPE.TRUE_FALSE,
// dictClass: 'string',
// form: {
// component: 'Switch',
// value: 'TRUE',
// componentProps: {
// inactiveValue: 'FALSE',
// activeValue: 'TRUE',
// }
// }
// },
{ {
label: '工单模式', label: '工单模式',
field: 'workMode', field: 'workMode',

44
src/views/mes/ordermonthplan/index.vue

@ -65,6 +65,29 @@
:detailButtonIsShowEdit="true" :detailButtonIsShowEdit="true"
:detailButtonIsShowAdd="true" :detailButtonIsShowAdd="true"
@searchTableSuccessDetail="searchTableSuccess" @searchTableSuccessDetail="searchTableSuccess"
:otherHeadButttonData = "[{
label: '全部拆解',
name: 'splitAll',
hide: false,
type: 'primary',
// icon: 'ep:operation',
color: '',
float:'left',
hasPermi: ''
}]"
:buttondataTable = "[{
label: '拆解',
name: 'split',
hide: false,
type: 'primary',
// icon: 'ep:operation',
color: '',
float:'left',
link: true, //
hasPermi: ''
}]"
@buttonBaseClick="detailButtonBaseClick"
@buttondataTable="detailButtonBaseClick"
/> />
<!-- 导入 --> <!-- 导入 -->
<ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import" <ImportForm ref="importFormRef" url="/plan/mes-order-month-main/import"
@ -83,7 +106,7 @@ import {
MesOrderMonthSubRules MesOrderMonthSubRules
} from "@/views/mes/ordermonthplan/mesOrderMonthSub.data"; } from "@/views/mes/ordermonthplan/mesOrderMonthSub.data";
import * as OrderDayApi from "@/api/mes/orderDay"; import * as OrderDayApi from "@/api/mes/orderDay";
import {MesOrderMonthSubVO} from "@/api/mes/ordermonthplan"; import {breakdown, MesOrderMonthSubVO} from "@/api/mes/ordermonthplan";
defineOptions({ name: 'MesOrderMonthMain' }) defineOptions({ name: 'MesOrderMonthMain' })
@ -188,7 +211,9 @@ const formsSuccess = async (formType,data) => {
/** 详情操作 */ /** 详情操作 */
const detailRef = ref() const detailRef = ref()
let mainPlanId
const openDetail = (row: any, titleName: any, titleValue: any) => { const openDetail = (row: any, titleName: any, titleValue: any) => {
mainPlanId = row.id
detailRef.value.openDetail(row, titleName, titleValue, 'basicMesOrderMonthMain') detailRef.value.openDetail(row, titleName, titleValue, 'basicMesOrderMonthMain')
} }
@ -287,4 +312,21 @@ const updateMesOrderMonthSub = async (data: MesOrderMonthSubVO) => {
data.productName = productName data.productName = productName
return await MesOrderMonthApi.updateMesOrderMonthSub(data) return await MesOrderMonthApi.updateMesOrderMonthSub(data)
} }
// --
const detailButtonBaseClick = async (val, item) => {
debugger
try {
//
await message.confirm('确定要拆解成日计划吗?')
//
await MesOrderMonthApi.breakdown({
id : item.id,
planMasterId: mainPlanId
})
message.success(t('common.delSuccess'))
//
await getList()
} catch {
}
}
</script> </script>

165
src/views/mes/ordermonthplan/mesOrderMonthSub.data.ts

@ -74,14 +74,70 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{
label: '计划开始日期',
field: 'planBegin',
sort: 'custom',
isSearch: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180,
fixed: 'left'
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '计划结束日期',
field: 'planEnd',
sort: 'custom',
isSearch: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180,
fixed: 'left'
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '状态',
field: 'status',
sort: 'custom',
isSearch: true,
isForm: false,
table: {
width: 100,
fixed: 'left'
},
},
{ {
label: '入库仓库编码', label: '入库仓库编码',
field: 'inStoreCode', field: 'inStoreCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {
width: 140, width: 150
fixed: 'left'
}, },
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
@ -108,20 +164,36 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: { table: {
width: 120, width: 120
fixed: 'left'
}, },
}, },
{ {
label: '状态', label: '实际开工日期',
field: 'status', field: 'realStart',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: { table: {
width: 100, width: 180
fixed: 'left' }
},
{
label: '实际完工日期',
field: 'realFinish',
sort: 'custom',
isSearch: true,
isForm: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, },
table: {
width: 180
}
}, },
{ {
label: '是否回冲', label: '是否回冲',
@ -130,8 +202,7 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
isForm: false, isForm: false,
table: { table: {
width: 120, width: 120
fixed: 'left'
}, },
}, },
{ {
@ -198,78 +269,6 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
}, },
isForm: false isForm: false
}, },
{
label: '计划开始日期',
field: 'planBegin',
sort: 'custom',
isSearch: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '计划结束日期',
field: 'planEnd',
sort: 'custom',
isSearch: true,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
},
form: {
component: 'DatePicker',
componentProps: {
style: {width: '100%'},
type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x',
}
},
},
{
label: '实际开工日期',
field: 'realStart',
sort: 'custom',
isSearch: true,
isForm: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
}
},
{
label: '实际完工日期',
field: 'realFinish',
sort: 'custom',
isSearch: true,
isForm: false,
formatter: dateFormatter,
detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss'
},
table: {
width: 180
}
},
{ {
label: '备注', label: '备注',
field: 'remark', field: 'remark',
@ -281,7 +280,7 @@ export const MesOrderMonthSub = useCrudSchemas(reactive<CrudSchema[]>([
field: 'action', field: 'action',
isForm: false, isForm: false,
table: { table: {
width: 150, width: 160,
fixed: 'right' fixed: 'right'
} }
} }

49
src/views/mes/processroute/components/configDialog.vue

@ -24,7 +24,7 @@
</div> </div>
</template> </template>
<el-row :gutter="10" style="height: calc(100vh - 300px)"> <el-row :gutter="10" style="height: 65%">
<el-col :span="6"> <el-col :span="6">
<el-input v-model="processListParmas.name" placeholder="工序名称"> <el-input v-model="processListParmas.name" placeholder="工序名称">
<template #append> <template #append>
@ -32,10 +32,10 @@
</template> </template>
</el-input> </el-input>
<el-table :data="processData" ref="tableProcess" style="width: 100%; height: 80%"> <el-table :data="processData" ref="tableProcess" style="width: 100%; height: 90%">
<el-table-column prop="name" label="工序名称"> <el-table-column prop="name" label="工序名称">
<template #default="scope"> <template #default="scope">
<el-button size="mini" text @click="userAddNode(scope.row)" style="width: 100%" <el-button size="mini" text @click="userAddNode(scope.row)" style="width: 90%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button >{{ scope.row.name }}[{{ scope.row.code }}]</el-button
> >
</template> </template>
@ -43,7 +43,7 @@
<el-table-column prop="code" label="工序编码" width="180" v-if="false" /> <el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table> </el-table>
</el-col> </el-col>
<el-col :span="12"><div ref="graphContainer"></div> <el-col :span="12"><div ref="graphContainer" style="width: 90%; height: 90%"></div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -71,9 +71,11 @@
<el-card class="footer-card"> <el-card class="footer-card">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>产品信息</span> <span>工艺路线基本信息</span>
</div> </div>
</template> </template>
<p >工艺路线名称<span v-if="productData!=null">{{ productData.name }}</span></p>
<p >工艺路线编码<span v-if="productData!=null">{{ productData.name }}</span></p>
<p >产品名称<span v-if="productData!=null">{{ productData.name }}</span></p> <p >产品名称<span v-if="productData!=null">{{ productData.name }}</span></p>
<p>产品编码<span v-if="productData!=null">{{ productData.code }}</span></p> <p>产品编码<span v-if="productData!=null">{{ productData.code }}</span></p>
<p>产品描述<span v-if="productData!=null">{{ productData.desc1 }}</span></p> <p>产品描述<span v-if="productData!=null">{{ productData.desc1 }}</span></p>
@ -83,20 +85,28 @@
><el-card class="footer-card"> ><el-card class="footer-card">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>设备信息</span> <span>物料信息</span>
</div> </div>
</template> </template>
<p v-for="item in deviceList" :key="item" class="text item">{{ item.name }}</p> <el-table :data="materialData" ref="tableMaterial" style="width: 100%; height: 80%">
<el-table-column prop="name" label="物料名称"/>
=
<el-table-column prop="code" label="物料编码"/>
<el-table-column prop="desc1" label="是否替代"/>
</el-table>
</el-card></el-col </el-card></el-col
> >
<el-col :span="6" <el-col :span="6"
><el-card class="footer-card"> ><el-card class="footer-card">
<template #header> <template #header>
<div class="card-header"> <div class="card-header">
<span>人员信息</span> <span>模具信息</span>
</div> </div>
</template> </template>
<p v-for="item in workerList" :key="item" class="text item">{{ item.name }}</p> <el-table :data="mouldData" ref="tableMould" style="width: 100%; height: 80%">
<el-table-column prop="name" label="模具名称"/>
<el-table-column prop="code" label="模具编码"/>
</el-table>
</el-card></el-col </el-card></el-col
> >
<el-col :span="6" <el-col :span="6"
@ -106,8 +116,10 @@
<span>工位信息</span> <span>工位信息</span>
</div> </div>
</template> </template>
<p>工位编码{{ workStationData.name }}</p> <el-table :data="workstationData" ref="tableWorkstation" style="width: 100%; height: 80%">
<p>工位名称{{ workStationData.code }}</p> <el-table-column prop="name" label="工位名称"/>
<el-table-column prop="code" label="工位编码"/>
</el-table>
</el-card></el-col </el-card></el-col
> >
</el-row> </el-row>
@ -142,13 +154,9 @@ const tableProcess = ref()
// const workshopCodeOptions = ref([{ code: '', name: '1' }]) // const workshopCodeOptions = ref([{ code: '', name: '1' }])
// const productionLineCodeOptions = ref([{ code: '', name: '线' }]) // const productionLineCodeOptions = ref([{ code: '', name: '线' }])
const productData = ref({ name: '', code: '', desc1: '--' }) // const productData = ref({ name: '', code: '', desc1: '--' }) //
const deviceList = ref([ const materialData=ref()
{ name: '设备', code: '0000' }, const mouldData = ref()
{ name: '设备', code: '0000' } const workstationData = ref() //
]) //
const workerList = ref([{ name: '--' }, { name: '--' }]) //
const workStationData = ref({ name: '工位', code: '' }) //
// //
const annexData = reactive({ const annexData = reactive({
annexList: [] annexList: []
@ -158,6 +166,7 @@ const remarksData = reactive({
remarksList: [], remarksList: [],
data: {} data: {}
}) })
const routeVersion=ref()
// //
const graph = ref<Graph>() const graph = ref<Graph>()
const openDetail = async (rowData: any) => { const openDetail = async (rowData: any) => {
@ -165,6 +174,7 @@ const openDetail = async (rowData: any) => {
titleNameRef.value = rowData.value.processrouteCode titleNameRef.value = rowData.value.processrouteCode
titleValueRef.value = rowData.value.processName titleValueRef.value = rowData.value.processName
processRouteId.value = rowData.value.id processRouteId.value = rowData.value.id
routeVersion.value=rowData.value.routeVersion
remarksData.data = { remarksData.data = {
tableId: rowData.value.id, tableId: rowData.value.id,
tableName: rowData.value.processrouteCode tableName: rowData.value.processrouteCode
@ -173,7 +183,7 @@ const openDetail = async (rowData: any) => {
let graphJson = JSON.parse(rowData.value.graphJson) let graphJson = JSON.parse(rowData.value.graphJson)
isShowDrawer.value = true isShowDrawer.value = true
nextTick(() => { nextTick(() => {
graph.value = createGraph(graphContainer.value as HTMLElement,true,800,600) graph.value = createGraph(graphContainer.value as HTMLElement,true,640,480)
graph.value.on('node:click', ({ e, x, y, node, view }) => { graph.value.on('node:click', ({ e, x, y, node, view }) => {
nodeClick(e, x, y, node, view) nodeClick(e, x, y, node, view)
}) })
@ -300,6 +310,7 @@ const saveResult = async () => {
} }
let gdata = { let gdata = {
processrouteCode: titleNameRef.value, processrouteCode: titleNameRef.value,
routeVersion:routeVersion.value,
graphJson: graph.value.toJSON(), graphJson: graph.value.toJSON(),
processrouteId: processRouteId.value processrouteId: processRouteId.value
} }

12
src/views/mes/processroute/processroute.data.ts

@ -93,12 +93,12 @@ export const Processroute = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
}, },
{ // {
label: '版本号', // label: '版本号',
field: 'routeVersion', // field: 'routeVersion',
sort: 'custom', // sort: 'custom',
isSearch: true, // isSearch: true,
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

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

@ -1,5 +1,6 @@
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";
// 表单校验 // 表单校验
export const AqlRules = reactive({ export const AqlRules = reactive({
@ -7,9 +8,9 @@ export const AqlRules = reactive({
inspectionQualification: [required], inspectionQualification: [required],
sampleCharacterCode: [required], sampleCharacterCode: [required],
sampleSize: [required], sampleSize: [required],
available: [required], // available: [required],
}) })
const samplingSchemeList = await getSamplingScheme()
export const Aql = useCrudSchemas(reactive<CrudSchema[]>([ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: 'id', label: 'id',
@ -23,6 +24,20 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
form: {
component: 'Select',
componentProps: {
options: samplingSchemeList,
optionsAlias: {
labelField: 'description',
valueField: 'code'
},
}
},
table: {
width: 175,
fixed: 'left'
}
}, },
{ {
label: '检验严格性', label: '检验严格性',
@ -32,296 +47,464 @@ export const Aql = useCrudSchemas(reactive<CrudSchema[]>([
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, isSearch: true,
form: { form: {
component: 'SelectV2' component: 'Select'
}, },
table: {
width: 130
}
}, },
{ {
label: '样本字码', label: '样本字码',
field: 'sampleCharacterCode', field: 'sampleCharacterCode',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table: {
width: 110
}
}, },
{ {
label: '样本量', label: '样本量',
field: 'sampleSize', field: 'sampleSize',
sort: 'custom', sort: 'custom',
table: {
width: 95
}
}, },
{ {
label: 'A0_010', label: 'A0_010',
field: 'a0separator010', field: 'a0separator010',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_010', label: 'R0_010',
field: 'r0separator010', field: 'r0separator010',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_015', label: 'A0_015',
field: 'a0separator015', field: 'a0separator015',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_015', label: 'R0_015',
field: 'r0separator015', field: 'r0separator015',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_025', label: 'A0_025',
field: 'a0separator025', field: 'a0separator025',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_025', label: 'R0_025',
field: 'r0separator025', field: 'r0separator025',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_040', label: 'A0_040',
field: 'a0separator040', field: 'a0separator040',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_040', label: 'R0_040',
field: 'r0separator040', field: 'r0separator040',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_065', label: 'A0_065',
field: 'a0separator065', field: 'a0separator065',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_065', label: 'R0_065',
field: 'r0separator065', field: 'r0separator065',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_10', label: 'A0_10',
field: 'a0separator10', field: 'a0separator10',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_10', label: 'R0_10',
field: 'r0separator10', field: 'r0separator10',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_15', label: 'A0_15',
field: 'a0separator15', field: 'a0separator15',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_15', label: 'R0_15',
field: 'r0separator15', field: 'r0separator15',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_25', label: 'A0_25',
field: 'a0separator25', field: 'a0separator25',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_25', label: 'R0_25',
field: 'r0separator25', field: 'r0separator25',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_40', label: 'A0_40',
field: 'a0separator40', field: 'a0separator40',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_40', label: 'R0_40',
field: 'r0separator40', field: 'r0separator40',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A0_65', label: 'A0_65',
field: 'a0separator65', field: 'a0separator65',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R0_65', label: 'R0_65',
field: 'r0separator65', field: 'r0separator65',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A1_0', label: 'A1_0',
field: 'a1separator0', field: 'a1separator0',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R1_0', label: 'R1_0',
field: 'r1separator0', field: 'r1separator0',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A1_5', label: 'A1_5',
field: 'a1separator5', field: 'a1separator5',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R1_5', label: 'R1_5',
field: 'r1separator5', field: 'r1separator5',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A2_5', label: 'A2_5',
field: 'a2separator5', field: 'a2separator5',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R2_5', label: 'R2_5',
field: 'r2separator5', field: 'r2separator5',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A4_0', label: 'A4_0',
field: 'a4separator0', field: 'a4separator0',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R4_0', label: 'R4_0',
field: 'r4separator0', field: 'r4separator0',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A6_5', label: 'A6_5',
field: 'a6separator5', field: 'a6separator5',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R6_5', label: 'R6_5',
field: 'r6separator5', field: 'r6separator5',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A10', label: 'A10',
field: 'a10', field: 'a10',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R10', label: 'R10',
field: 'r10', field: 'r10',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A15', label: 'A15',
field: 'a15', field: 'a15',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R15', label: 'R15',
field: 'r15', field: 'r15',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A25', label: 'A25',
field: 'a25', field: 'a25',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R25', label: 'R25',
field: 'r25', field: 'r25',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A40', label: 'A40',
field: 'a40', field: 'a40',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R40', label: 'R40',
field: 'r40', field: 'r40',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A65', label: 'A65',
field: 'a65', field: 'a65',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R65', label: 'R65',
field: 'r65', field: 'r65',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A100', label: 'A100',
field: 'a100', field: 'a100',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R100', label: 'R100',
field: 'r100', field: 'r100',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A150', label: 'A150',
field: 'a150', field: 'a150',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R150', label: 'R150',
field: 'r150', field: 'r150',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A250', label: 'A250',
field: 'a250', field: 'a250',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R250', label: 'R250',
field: 'r250', field: 'r250',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A400', label: 'A400',
field: 'a400', field: 'a400',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R400', label: 'R400',
field: 'r400', field: 'r400',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A650', label: 'A650',
field: 'a650', field: 'a650',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R650', label: 'R650',
field: 'r650', field: 'r650',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'A1000', label: 'A1000',
field: 'a1000', field: 'a1000',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ {
label: 'R1000', label: 'R1000',
field: 'r1000', field: 'r1000',
sort: 'custom', sort: 'custom',
table: {
width: 105
}
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { // form: {
component: 'SelectV2' // component: 'SelectV2'
}, // },
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
sort: 'custom', sort: 'custom',
formatter: dateFormatter, formatter: dateFormatter,
isForm: false, isForm: false,
table: {
width: 115
}
}, },
{ {
label: '操作', label: '操作',

3
src/views/qms/basicDataManage/counter/counter.data.ts

@ -18,7 +18,8 @@ export const Counter = useCrudSchemas(reactive<CrudSchema[]>([
label: '物料编码', label: '物料编码',
field: 'itemCode', field: 'itemCode',
sort: 'custom', sort: 'custom',
isSearch: true isSearch: true,
fixed: 'left'
}, },
{ {
label: '检验类型编码', label: '检验类型编码',

1
src/views/qms/basicDataManage/dynamicRule/dynamicRule.data.ts

@ -25,6 +25,7 @@ export const DynamicRule = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
fixed: 'left'
}, },
{ {
label: '描述', label: '描述',

170
src/views/qms/basicDataManage/inspectionScheme/addForm.vue

@ -436,7 +436,7 @@
<el-select <el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType" v-model="item.inspectionCharacteristicsBaseVO.featureType"
placeholder="请选择特征类型" placeholder="请选择特征类型"
@change="changeFeatureType" @change="changeFeatureType($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
> >
<el-option <el-option
@ -450,111 +450,106 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item <el-form-item
label="是否设定上限" label="计量单位"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyUom"
> >
<el-switch <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" v-model="item.inspectionCharacteristicsBaseVO.quantifyUom"
@change="changeIsCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item <el-form-item
label="上限值" label="小数位"
prop="inspectionCharacteristicsBaseVO.quantifyCapping" prop="inspectionCharacteristicsBaseVO.quantifyDecimal"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping" v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item <el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" label="是否设定上限"
label="是否设定下限" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-switch <el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping"
@change="changeLowlimit" @change="changeIsCapping($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item <el-form-item
label="下限值" prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
prop="inspectionCharacteristicsBaseVO.quantifyLowlimit" label="是否设定下限"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
@change="changeLowlimit($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0">
<el-form-item <el-form-item
prop="inspectionCharacteristicsBaseVO.quantifyIsTarget" prop="inspectionCharacteristicsBaseVO.quantifyIsTarget"
label="是否设定目标值" label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-switch <el-switch
v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget"
@change="changeIsTarget" @change="changeIsTarget($event,item)"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO. quantifyIsCapping">
<el-form-item <el-form-item
label="目标值" label="上限值"
prop="inspectionCharacteristicsBaseVO.quantifyTarget" prop="inspectionCharacteristicsBaseVO.quantifyCapping"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget" v-model="item.inspectionCharacteristicsBaseVO.quantifyCapping"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit">
<el-form-item <el-form-item
label="计量单位" label="下限值"
prop="inspectionCharacteristicsBaseVO.quantifyUom" prop="inspectionCharacteristicsBaseVO.quantifyLowlimit"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyUom" v-model="item.inspectionCharacteristicsBaseVO.quantifyLowlimit"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO. quantifyIsTarget">
<el-form-item <el-form-item
label="小数位" label="目标值"
prop="inspectionCharacteristicsBaseVO.quantifyDecimal" prop="inspectionCharacteristicsBaseVO.quantifyTarget"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-input <el-input
v-model="item.inspectionCharacteristicsBaseVO.quantifyDecimal" v-model="item.inspectionCharacteristicsBaseVO.quantifyTarget"
:disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate" :disabled="!item.inspectionCharacteristicsBaseVO.isCanUpdate"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-col :span="12" v-if="item.inspectionCharacteristicsBaseVO.featureType == 1">
<el-form-item <el-form-item
label="选择集" label="选择集"
prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode" prop="inspectionCharacteristicsBaseVO.quantifyQuantifyCode"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 1"
> >
<div style="display: flex; width: 100%"> <div style="display: flex; width: 100%">
<el-input <el-input
@ -751,7 +746,7 @@ const rules = ref({
{ required: true, message: '请输入目标值', trigger: 'blur' } { required: true, message: '请输入目标值', trigger: 'blur' }
], ],
'inspectionCharacteristicsBaseVO.quantifyCapping': [ 'inspectionCharacteristicsBaseVO.quantifyCapping': [
{ required: true, message: '请输入上限值', trigger: 'blur' } { required: true, message: '请输入上限值', trigger: ['blur','change'] }
], ],
'inspectionCharacteristicsBaseVO.quantifyLowlimit': [ 'inspectionCharacteristicsBaseVO.quantifyLowlimit': [
{ required: true, message: '请输入下限值', trigger: 'blur' } { required: true, message: '请输入下限值', trigger: 'blur' }
@ -785,26 +780,24 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode) list = await InspectionProcessPageApi.getListByTempleteCode(row.programmeTemplateCode)
} }
list.forEach((item, index) => { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
editableTabsValue.value = index + 1 rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
item.name = index + 1 rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
// list.forEach((item, index) => {
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { editableTabsValue.value = index+1
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true item.name = index + 1
} else { // rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false //
} if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true }
} else { if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} }
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { }
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false })
}
})
data.value.process = list data.value.process = list
} else { } else {
data.value = { data.value = {
@ -978,13 +971,21 @@ if (props.footButttondata) {
] ]
} }
// //
const changeFeatureType = (e) => { const changeFeatureType = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyIsCapping = false
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit = false
item.inspectionCharacteristicsBaseVO.quantifyIsTarget = false
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
item.inspectionCharacteristicsBaseVO.quantifyTarget= ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode= ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyName= ''
console.log(e) console.log(e)
// if (e) { if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// } else { } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// } }
} }
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = ( const opensearchTable = (
@ -1090,25 +1091,24 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
} }
if (formField == 'programmeTemplateCode') { if (formField == 'programmeTemplateCode') {
let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code) let list = await InspectionProcessPageApi.getListByTempleteCode(val[0].code)
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
list.forEach((item, index) => { list.forEach((item, index) => {
editableTabsValue.value = index + 1 editableTabsValue.value = index+1
item.name = index + 1 item.name = index + 1
// rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
// //
if (item.inspectionCharacteristicsBaseVO.quantifyIsCapping) { if (item.inspectionCharacteristicsBaseVO.featureType == 0 && item.inspectionCharacteristicsBaseVO.quantifyIsCapping) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
} }
if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) { if (item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = false
} }
if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) { if (item.inspectionCharacteristicsBaseVO.quantifyIsTarget) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = false
} }
}) })
data.value.process = list data.value.process = list
@ -1123,15 +1123,18 @@ const searchTableSuccess = async (formField, searchField, val, type, row) => {
// emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row) // emit('searchTableSuccess', formField, searchField, val, formRef.value, type, row)
} }
// //
const changeIsCapping = (e) => { const changeIsCapping = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else { } else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
} }
} }
// //
const changeLowlimit = (e) => { const changeLowlimit = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else { } else {
@ -1139,7 +1142,8 @@ const changeLowlimit = (e) => {
} }
} }
// //
const changeIsTarget = (e) => { const changeIsTarget = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { } else {

50
src/views/qms/basicDataManage/inspectionTemplate/addForm.vue

@ -257,7 +257,7 @@
<el-select <el-select
v-model="item.inspectionCharacteristicsBaseVO.featureType" v-model="item.inspectionCharacteristicsBaseVO.featureType"
placeholder="请选择特征类型" placeholder="请选择特征类型"
@change="changeFeatureType" @change="changeFeatureType($event,item)"
> >
<el-option <el-option
v-for="dict in getStrDictOptions( v-for="dict in getStrDictOptions(
@ -293,7 +293,7 @@
label="是否设定上限" label="是否设定上限"
prop="inspectionCharacteristicsBaseVO.quantifyIsCapping" prop="inspectionCharacteristicsBaseVO.quantifyIsCapping"
> >
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping"/> <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsCapping" @change="changeIsCapping($event,item)"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -302,7 +302,7 @@
prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit" prop="inspectionCharacteristicsBaseVO.quantifyIsLowlimit"
label="是否设定下限" label="是否设定下限"
> >
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit"/> <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit" @change="changeLowlimit($event,item)"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -313,7 +313,7 @@
label="是否设定目标值" label="是否设定目标值"
v-if="item.inspectionCharacteristicsBaseVO.featureType == 0" v-if="item.inspectionCharacteristicsBaseVO.featureType == 0"
> >
<el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget" /> <el-switch v-model="item.inspectionCharacteristicsBaseVO.quantifyIsTarget" @change="changeIsTarget($event,item)" />
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -737,11 +737,16 @@ const submitForm = async () => {
return return
} }
// ,, // ,,
console.log(data.value.process)
const arr1 = data.value.process.filter( const arr1 = data.value.process.filter(
(item) => (item) =>
((item.inspectionCharacteristicsBaseVO.quantifyIsCapping && (String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| // {
(item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && (String(item.inspectionCharacteristicsBaseVO.quantifyLowlimit).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))|| // console.log(String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length)
(item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1].length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))) && // console.log(Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal))
// }
((item.inspectionCharacteristicsBaseVO.quantifyIsCapping && (String(item.inspectionCharacteristicsBaseVO.quantifyCapping).split('.')[1]?.length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))||
(item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && (String(item.inspectionCharacteristicsBaseVO.quantifyLowlimit).split('.')[1]?.length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))||
(item.inspectionCharacteristicsBaseVO.quantifyIsTarget && (String(item.inspectionCharacteristicsBaseVO.quantifyTarget).split('.')[1]?.length>Number(item.inspectionCharacteristicsBaseVO.quantifyDecimal)))) &&
item.inspectionCharacteristicsBaseVO.featureType == 0 item.inspectionCharacteristicsBaseVO.featureType == 0
) )
if (arr1 && arr1.length > 0) { if (arr1 && arr1.length > 0) {
@ -761,6 +766,7 @@ const submitForm = async () => {
// //
(item.inspectionCharacteristicsBaseVO.quantifyIsCapping && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && item.inspectionCharacteristicsBaseVO.quantifyIsTarget && ((item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyLowlimit)||(item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyTarget)||(item.inspectionCharacteristicsBaseVO.quantifyLowlimit >= item.inspectionCharacteristicsBaseVO.quantifyTarget))) (item.inspectionCharacteristicsBaseVO.quantifyIsCapping && item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit && item.inspectionCharacteristicsBaseVO.quantifyIsTarget && ((item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyLowlimit)||(item.inspectionCharacteristicsBaseVO.quantifyCapping <=item.inspectionCharacteristicsBaseVO.quantifyTarget)||(item.inspectionCharacteristicsBaseVO.quantifyLowlimit >= item.inspectionCharacteristicsBaseVO.quantifyTarget)))
) )
console.log(99,arr2)
if (arr2 && arr2.length > 0) { if (arr2 && arr2.length > 0) {
const str = arr2.map((item) => item.description).join(',') const str = arr2.map((item) => item.description).join(',')
message.error(`${str}上限值应大目标值大于下限值`) message.error(`${str}上限值应大目标值大于下限值`)
@ -788,13 +794,21 @@ if (props.footButttondata) {
] ]
} }
// //
const changeFeatureType = (e) => { const changeFeatureType = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyIsCapping = false
item.inspectionCharacteristicsBaseVO.quantifyIsLowlimit = false
item.inspectionCharacteristicsBaseVO.quantifyIsTarget = false
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
item.inspectionCharacteristicsBaseVO.quantifyTarget= ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyCode= ''
item.inspectionCharacteristicsBaseVO.quantifyQuantifyName= ''
console.log(e) console.log(e)
// if (e) { if (e) {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = true
// } else { } else {
// rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyQuantifyCode'][0].required = false
// } }
} }
const searchTableRef = ref() const searchTableRef = ref()
const opensearchTable = ( const opensearchTable = (
@ -894,15 +908,18 @@ const searchTableSuccess = (formField, searchField, val, type, row) => {
} }
// //
const changeIsCapping = (e) => { const changeIsCapping = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyCapping = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = true
} else { } else {
rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false rules.value['inspectionCharacteristicsBaseVO.quantifyCapping'][0].required = false
} }
} }
// //
const changeLowlimit = (e) => { const changeLowlimit = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyLowlimit = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyLowlimit'][0].required = true
} else { } else {
@ -910,7 +927,8 @@ const changeLowlimit = (e) => {
} }
} }
// //
const changeIsTarget = (e) => { const changeIsTarget = (e,item) => {
item.inspectionCharacteristicsBaseVO.quantifyTarget = ''
if (e) { if (e) {
rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true rules.value['inspectionCharacteristicsBaseVO.quantifyTarget'][0].required = true
} else { } else {

6
src/views/qms/basicDataManage/selectedProject/index.vue

@ -62,9 +62,9 @@ import download from '@/utils/download'
import { SelectedProject,SelectedProjectRules } from './selectedProject.data' import { SelectedProject,SelectedProjectRules } from './selectedProject.data'
import * as SelectedProjectApi from '@/api/qms/selectedProject' import * as SelectedProjectApi from '@/api/qms/selectedProject'
import * as defaultButtons from '@/utils/disposition/defaultButtons' 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'
defineOptions({ name: 'SelectedProject' }) defineOptions({ name: 'SelectedProject' })

9
src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts

@ -27,7 +27,8 @@ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isTableForm: false, isTableForm: false,
isSearch: true isSearch: true,
fixed: 'left'
}, },
{ {
label: '字典及字典项', label: '字典及字典项',
@ -42,12 +43,14 @@ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
isForm: true, isForm: true,
tableForm: { tableForm: {
type: 'SelectGroup', type: 'SelectGroup',
initOptions: optionsList initOptions: optionsList,
filterable: true,
}, },
form: { form: {
component: 'Select', component: 'Select',
componentProps: { componentProps: {
options: optionsList options: optionsList,
filterable: true,
} }
}, },

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

@ -111,6 +111,8 @@ routeName.value = route.name
const tableColumns = ref(SelectedSet.allSchemas.tableColumns) const tableColumns = ref(SelectedSet.allSchemas.tableColumns)
// //
const searchTableSuccess = (formField, searchField, val, formRef) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => { nextTick(() => {
@ -290,7 +292,11 @@ const handleDeleteTable = (item, index) => {
// //
const submitForm = async (formType, data) => { const submitForm = async (formType, data) => {
if(!validateNotRepetition(tableData.value)){
message.alertWarning('选定集字典及字典项不能重复')
basicFormRef.value.formLoading = false
return
}
data.selectedProjectDOList = tableData.value// data.selectedProjectDOList = tableData.value//
data.selectedProjectDOList = data.selectedProjectDOList.map(item => { data.selectedProjectDOList = data.selectedProjectDOList.map(item => {
// '-%%%-'' dictionaryCode // '-%%%-'' dictionaryCode
@ -322,18 +328,68 @@ const submitForm = async (formType, data) => {
} }
} }
const updateSelections = async (masterId,row) => {
let param = { masterId: masterId };
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
DictTypeApi.getDictTypeAndData('inspection').then(originalResponse => {
// element
const response = originalResponse.map(element => {
const options = element.dictDataRespVOList.map(item => {
return {
value: element.type + "-%%%-" + item.value,
label: element.name + "-" + item.label
};
}).filter(option => {
// resdictionaryTypeAndCodeoption
return !res.some(resItem => {
if(row != null){
return option.value === resItem.dictionaryTypeAndCode && option.value != row.dictionaryTypeAndCode
}else{
return option.value === resItem.dictionaryTypeAndCode
}
});
});
return { ...element, options }; // elementoptions
}).filter(element => element.options.length > 0); // optionselement
// options
const formSchemaItem = SelectedProject.allSchemas.formSchema.find(item => item.field === 'dictionaryTypeAndCode');
if (formSchemaItem) {
formSchemaItem.componentProps.options = response;
}
});
});
};
const validateNotRepetition = (data) => {
// dictionaryTypeAndCode
const codes = data.map(item => item.dictionaryTypeAndCode);
// Set dictionaryTypeAndCode
const uniqueCodes = new Set(codes);
// Set
if (codes.length > uniqueCodes.size) {
return false; // false
}
return true; // true
};
const detailValidate = (data) => { const detailValidate = (data) => {
let tag = true; let tag = true;
return tag return tag
} }
const detailOpenForm = (type, row, masterParmas) => { const detailOpenForm = (type, row, masterParmas) => {
// if(selectDictType.value){ if(type == 'create'){
updateSelections(masterParmas.masterId,row)
// } }else if('update'){
if(type='create'){ updateSelections(masterParmas.masterId,row)
} }
} }

3
src/views/qms/basicDataManage/selectedSet/selectedSet.data.ts

@ -17,7 +17,8 @@ export const SelectedSet = useCrudSchemas(reactive<CrudSchema[]>([
field: 'code', field: 'code',
sort: 'custom', sort: 'custom',
isForm: false, isForm: false,
isSearch: true isSearch: true,
fixed: 'left'
}, },
{ {
label: '描述', label: '描述',

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

@ -30,7 +30,8 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
table: { table: {
width: 150 width: 150,
fixed: 'left'
} }
}, },
{ {
@ -270,34 +271,6 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
} }
}, },
{
label: '检验任务包装列表',
field: 'inspectionTaskPackageCode',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
},
table: {
width: 150
}
},
{
label: '检验任务工序列表',
field: 'inspectionTaskProcessCode',
sort: 'custom',
isSearch: false,
form:{
componentProps:{
disabled:true
}
},
table: {
width: 150
}
},
{ {
label: '计划开始时间', label: '计划开始时间',
field: 'planStartTime', field: 'planStartTime',
@ -393,26 +366,26 @@ export const InspectionJobMain = useCrudSchemas(reactive<CrudSchema[]>([
// } // }
// } // }
// }, // },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // dictClass: 'string',
isTable: true, // isTable: true,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
component: 'Switch', // component: 'Switch',
value: 'TRUE', // value: 'TRUE',
componentProps: { // componentProps: {
inactiveValue: 'FALSE', // inactiveValue: 'FALSE',
activeValue: 'TRUE', // activeValue: 'TRUE',
disabled:true // disabled:true
} // }
} // }
}, // },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -533,6 +506,9 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -542,6 +518,9 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -551,6 +530,9 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -564,6 +546,9 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
}, },
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -573,6 +558,9 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -580,6 +568,9 @@ export const InspectionJobPackage = useCrudSchemas(reactive<CrudSchema[]>([
field: 'sampleAmount', field: 'sampleAmount',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
table:{
width:150
}
}, },
])) ]))
//表单校验 //表单校验

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

@ -37,25 +37,12 @@
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">44
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { getCurrentInstance } from 'vue' import { getCurrentInstance } from 'vue'
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict' import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import * as InspectionJobDetailPageApi from '@/api/qms/inspectionJob/inspectionJobDetail'
import { SearchTable } from '@/components/SearchTable' import { SearchTable } from '@/components/SearchTable'
import { SamplingProcess } from '@/views/qms/samplingProcess/samplingProcess.data' import * as InspectionRecordMainApi from '@/api/qms/inspectionRecord/inspectionRecordMain'
// import { InspectionTemplateMain } from '@/views/qms/basicDataManage/inspectionTemplate/inspectionTemplate.data'
// import * as InspectionTemplateApi from '@/api/qms/inspectionTemplate'
// import { Itembasic } from '@/views/wms/basicDataManage/itemManage/itembasic/itembasic.data'
// import * as ItemBasicApi from '@/api/wms/itembasic'
import * as SamplingProcessApi from '@/api/qms/samplingProcess' //
import * as InspectionMethodApi from '@/api/qms/inspectionMethod' //
import { InspectionMethod } from '@/views/qms/inspectionMethod/inspectionMethod.data' //
import * as DynamicRuleApi from '@/api/qms/dynamicRule' //
import { DynamicRule } from '@/views/qms/basicDataManage/dynamicRule/dynamicRule.data' //
import * as SelectedSetApi from '@/api/qms/selectedSet' //
import { SelectedSet } from '@/views/qms/basicDataManage/selectedSet/selectedSet.data' //
import * as InspectionJobMainApi from '@/api/qms/inspectionJob/inspectionJobMain'
const { proxy } = getCurrentInstance() const { proxy } = getCurrentInstance()
@ -145,7 +132,7 @@ const open = async (type: string, row?: any, masterParmas?: any, titleName?: any
formType.value = type formType.value = type
if (row) { if (row) {
data.value = JSON.parse(JSON.stringify(row)) data.value = JSON.parse(JSON.stringify(row))
data.value.packageList = await InspectionJobMainApi.getInspectionJobPackageList(row.id) data.value.packageList = await InspectionRecordMainApi.getInspectionRecordPackageList(row.id)
data.value.packageList.forEach(item=>{ data.value.packageList.forEach(item=>{
item.qualifiedAmount =0 item.qualifiedAmount =0
item.noQualifiedAmount =0 item.noQualifiedAmount =0

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

@ -6,17 +6,18 @@ import {validateTwoNum } from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
{ {
label: '记录编', label: '记录编',
field: 'number', field: 'number',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, isForm:false,
table: { table: {
width: 150 width: 150,
fixed: 'left'
} }
}, },
{ {
@ -332,17 +333,17 @@ export const InspectionRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
} }
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
isForm:false, // isForm:false,
table: { // table: {
width: 150 // width: 150
} // }
}, // },
{ {
label: '使用决策', label: '使用决策',
field: 'useDecision', field: 'useDecision',
@ -393,7 +394,7 @@ export const InspectionRecordMainRules = reactive({
}) })
/** /**
* @returns {Array} * @returns {Array}
*/ */
export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
{ {
@ -497,12 +498,12 @@ export const InspectionRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',
@ -562,6 +563,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -571,6 +575,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -584,6 +591,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
}, },
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -593,6 +603,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -602,6 +615,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -611,6 +627,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -620,6 +639,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -629,6 +651,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
}, },
{ {
@ -638,6 +663,9 @@ export const InspectionRecordPackage = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true, isSearch: true,
tableForm:{ tableForm:{
disabled:true disabled:true
},
table:{
width:150
} }
} }
])) ]))

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

@ -43,14 +43,14 @@
<script setup lang="ts"> <script setup lang="ts">
import download from '@/utils/download' import download from '@/utils/download'
import { InspectionMain, InspectionMainRules } 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'
import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data' // import { InspectionJobPackage} from '../inspectionJob/inspectionJobMain.data'
defineOptions({ name: 'InspectionMain' }) defineOptions({ name: 'InspectionMain' })
@ -85,7 +85,7 @@
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionMain:import' }), // defaultButtons.defaultImportBtn({ hasPermi: 'wms:inspectionMain:import' }), //
defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), // defaultButtons.defaultExportBtn({ hasPermi: 'wms:inspectionMain:export' }), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
@ -157,7 +157,7 @@ const listTableRef = ref()
openForm('update', row) openForm('update', row)
}else if (val == 'mainPackage') { // }else if (val == 'mainPackage') { //
const list = await InspectionMainApi.getInspectionRequestPackageList(row.id) const list = await InspectionMainApi.getInspectionRequestPackageList(row.id)
listTableRef.value.openPackage(row,'包装信息',InspectionJobPackage.allSchemas.tableColumns,list) listTableRef.value.openPackage(row,'包装信息',InspectionRequestPackage.allSchemas.tableColumns,list)
} }
} }

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

@ -163,9 +163,27 @@ export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
} }
}, },
{
label: '供应商名称',
field: 'supplierName',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{ {
label: '物料编码', label: '物料编码',
field: 'materialCode', field: 'itemCode',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '物料名称',
field: 'itemName',
sort: 'custom', sort: 'custom',
isSearch: false, isSearch: false,
table: { table: {
@ -317,16 +335,16 @@ export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 150 width: 150
} }
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
isSearch: false, // isSearch: false,
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
table: { // table: {
width: 150 // width: 150
} // }
}, // },
{ {
label: '操作', label: '操作',
field: 'action', field: 'action',
@ -337,3 +355,72 @@ export const InspectionMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
} }
])) ]))
/**
* @returns {Array}
*/
export const InspectionRequestPackage = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编码',
field: 'number',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
},
table:{
width:150
}
},
{
label: '包装号',
field: 'packageCode',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
},
table:{
width:150
}
},
{
label: '包装规格',
field: 'packageSpecificationCode',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
},
table:{
width:150
}
},
{
label: '数量',
field: 'amount',
sort: 'custom',
isSearch: true,
form: {
component: 'InputNumber',
value: 0
},
tableForm:{
disabled:true
},
table:{
width:150
}
},
{
label: '计量单位',
field: 'measuringUnit',
sort: 'custom',
isSearch: true,
tableForm:{
disabled:true
},
table:{
width:150
}
},
]))

25
src/views/qms/inspectionMethod/inspectionMethod.data.ts

@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const InspectionMethodRules = reactive({ export const InspectionMethodRules = reactive({
available: [required], // available: [required],
description: [required], description: [required],
}) })
@ -21,6 +21,9 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm:false, isForm:false,
table: {
fixed: 'left'
}
}, },
{ {
label: '描述', label: '描述',
@ -37,16 +40,16 @@ export const InspectionMethod = useCrudSchemas(reactive<CrudSchema[]>([
field: 'operationGuidance', field: 'operationGuidance',
sort: 'custom', sort: 'custom',
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { // form: {
component: 'SelectV2' // component: 'SelectV2'
}, // },
}, // },
{ {
label: '文件', label: '文件',
field: 'videoAddress', field: 'videoAddress',

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

@ -6,7 +6,7 @@ import {getSamplingScheme} from '@/api/qms/sampleCode/index'
export const SampleCodeRules = reactive({ export const SampleCodeRules = reactive({
code: [required], code: [required],
batchUpperLimiting: [required], batchUpperLimiting: [required],
available: [required], // available: [required],
}) })
const samplingSchemeList = await getSamplingScheme() const samplingSchemeList = await getSamplingScheme()
export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
@ -31,6 +31,10 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
valueField: 'code' valueField: 'code'
}, },
} }
},
table: {
width: 175,
fixed: 'left'
} }
}, },
{ {
@ -88,16 +92,16 @@ export const SampleCode = useCrudSchemas(reactive<CrudSchema[]>([
field: 'g3', field: 'g3',
sort: 'custom', sort: 'custom',
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { // form: {
component: 'Select' // component: 'Select'
}, // },
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

25
src/views/qms/samplingProcess/samplingProcess.data.ts

@ -5,7 +5,7 @@ import { dateFormatter } from '@/utils/formatTime'
export const SamplingProcessRules = reactive({ export const SamplingProcessRules = reactive({
sampleType: [required], sampleType: [required],
evaluationMode: [required], evaluationMode: [required],
available: [required], // available: [required],
description: [required], description: [required],
}) })
@ -23,6 +23,9 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
table: {
fixed: 'left'
}
}, },
{ {
label: '描述', label: '描述',
@ -64,16 +67,16 @@ export const SamplingProcess = useCrudSchemas(reactive<CrudSchema[]>([
component: 'Select' component: 'Select'
}, },
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // dictClass: 'string', // 默认都是字符串类型其他暂不考虑
form: { // form: {
component: 'Select' // component: 'Select'
}, // },
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

27
src/views/qms/samplingScheme/samplingScheme.data.ts

@ -3,7 +3,7 @@ import { dateFormatter } from '@/utils/formatTime'
// 表单校验 // 表单校验
export const SamplingSchemeRules = reactive({ export const SamplingSchemeRules = reactive({
available: [required], // available: [required],
description: [required], description: [required],
}) })
@ -21,6 +21,9 @@ export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
isForm: false, isForm: false,
table: {
fixed: 'left'
}
}, },
{ {
label: '描述', label: '描述',
@ -28,17 +31,17 @@ export const SamplingScheme = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,
}, },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
sort: 'custom', // sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // 默认都是字符串类型其他暂不考虑 // dictClass: 'string', // 默认都是字符串类型其他暂不考虑
isSearch: true, // isSearch: true,
form: { // form: {
component: 'SelectV2' // component: 'SelectV2'
}, // },
}, // },
{ {
label: '创建时间', label: '创建时间',
field: 'createTime', field: 'createTime',

4
src/views/system/systemInstallPackage/index.vue

@ -148,6 +148,8 @@ const openForm = (type: string, row?: any) => {
if(uploadFile){ if(uploadFile){
uploadFile['componentProps']['upData']['tableId'] = currentTime uploadFile['componentProps']['upData']['tableId'] = currentTime
uploadFile['componentProps']['modelValue']= [] uploadFile['componentProps']['modelValue']= []
uploadFile['value'] = ''
} }
}else if(type=='update'){ }else if(type=='update'){
const uploadFile = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='uploadFile') const uploadFile = SystemInstallPackage.allSchemas.formSchema.find(item=>item.field=='uploadFile')
@ -163,7 +165,7 @@ const openForm = (type: string, row?: any) => {
// form // form
const formsSuccess = async (formType,data) => { const formsSuccess = async (formType,data) => {
if (formType === 'create') { if (formType === 'create') {
delete data['uploadFile'] // delete data['uploadFile']
await SystemInstallPackageApi.createSystemInstallPackage(data) await SystemInstallPackageApi.createSystemInstallPackage(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
} else { } else {

76
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/index.vue

@ -42,6 +42,8 @@
<BasicForm <BasicForm
ref="formRef" ref="formRef"
@success="getList" @success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="PurchasereceiptRequestMainRules" :rules="PurchasereceiptRequestMainRules"
:formAllSchemas="PurchasereceiptRequestMain.allSchemas" :formAllSchemas="PurchasereceiptRequestMain.allSchemas"
:tableAllSchemas="PurchasereceiptRequestDetail.allSchemas" :tableAllSchemas="PurchasereceiptRequestDetail.allSchemas"
@ -56,7 +58,6 @@
@submitForm="submitForm" @submitForm="submitForm"
@formFormDateChange="formFormDateChange" @formFormDateChange="formFormDateChange"
/> />
<!-- 详情 --> <!-- 详情 -->
<Detail <Detail
ref="detailRef" ref="detailRef"
@ -124,14 +125,18 @@ import {
PurchasereceiptRequestDetail, PurchasereceiptRequestDetail,
PurchasereceiptRequestDetailRules, PurchasereceiptRequestDetailRules,
PurchasereceiptRequestDetailLabel, PurchasereceiptRequestDetailLabel,
PurchasereceiptRequestDetailPackingNumber PurchasereceiptRequestDetailPackingNumber,
} from './purchasereceiptRequestMain.data' } from './purchasereceiptRequestMain.data'
import { PurchaseDetail } from '../../supplierdeliver/purchaseMain/purchaseMain.data'
import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain' import * as PurchasereceiptRequestMainApi from '@/api/wms/purchasereceiptRequestMain'
import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail' import * as PurchasereceiptRequestDetailApi from '@/api/wms/purchasereceiptRequestDetail'
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import { formatDate } from '@/utils/formatTime' import { formatDate } from '@/utils/formatTime'
import * as SupplieritemApi from '@/api/wms/supplieritem' import * as SupplieritemApi from '@/api/wms/supplieritem'
import { getAccessToken } from '@/utils/auth' import { getAccessToken } from '@/utils/auth'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
// //
defineOptions({ name: 'PurchasereceiptRequestMain' }) defineOptions({ name: 'PurchasereceiptRequestMain' })
@ -166,17 +171,23 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else if(formField == 'poNumber') { } else if(formField == 'poNumber') {
row['poNumber'] = val[0]['number'] row['poNumber'] = val[0]['number']
} else if(formField == 'poLine'){ } else if(formField == 'poLine'){
row['poLine'] = val[0]['lineNumber'] //--
row['itemCode'] = val[0]['itemCode'] val.forEach(item=>{
row['uom'] = val[0]['uom'] if(tableData.value.find(item1=>item1['id'] == item['id'])) return
let supplierCode = formRef.formModel.supplierCode; const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
let itemCode = val[0]['itemCode'] newRow['poLine'] = item['lineNumber']
let queryData = { newRow['itemCode'] = item['itemCode']
supplierCode:supplierCode, newRow['uom'] = item['uom']
itemCode:itemCode newRow['poNumber'] = item['number']
} let supplierCode = formRef.formModel.supplierCode;
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{ let queryData = {
row['defaultToLocationCode'] = res supplierCode:supplierCode,
itemCode: item['itemCode']
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
newRow['defaultToLocationCode'] = res
tableData.value.push(newRow)
})
}) })
}else if (formField == 'packQty'){ }else if (formField == 'packQty'){
row['packQty'] = val[0]['packQty'] row['packQty'] = val[0]['packQty']
@ -186,6 +197,16 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
const setV = {} const setV = {}
if(formField == 'supplierCode'){ if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code'] setV['supplierCode'] = val[0]['code']
}else if(formField == 'ppNumber') {
//----
setV['supplierCode'] = val[0]['supplierCode']
setV['poNumber'] = val[0]['number']
const newRow = val[0]
newRow['poNumber'] = val[0]['number']
//
getSearchTableData(val[0]['number'],val[0]['supplierCode'])
// tableData.value = [newRow]
// formRef.handleAddTable()
} }
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
formRef.setValues(setV) formRef.setValues(setV)
@ -351,6 +372,35 @@ const labelPrint = async (row) => {
} }
const getSearchTableData = async (number,supplierCode)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPage //
})
//
const { getList:getList1 } = tableMethods
await getList1()
const tableColumns = PurchaseDetail.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
tableData.value = []
tableObject.tableList.forEach(row=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
newRow['poLine'] = row['lineNumber']
newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom']
newRow['poNumber'] =row['number']
let queryData = {
supplierCode,
itemCode:row['itemCode']
}
SupplieritemApi.getDefaultLocationCode(queryData as SupplieritemApi.SupplieritemVO).then(res =>{
newRow['defaultToLocationCode'] = res
tableData.value.push(newRow)
})
})
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm =async (type: string, row?: number) => { const openForm =async (type: string, row?: number) => {

438
src/views/wms/purchasereceiptManage/purchasereceipt/purchasereceiptRequestMain/purchasereceiptRequestMain.data.ts

@ -50,24 +50,24 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isSearch: true, isSearch: true,
}, },
{ {
label: '供应商代码', label: '采购订单',
field: 'supplierCode', field: 'ppNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 180
}, },
isSearch: true,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 isSearchList: true, // 开启查询弹窗
searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 searchListPlaceholder: '请选择采购订单', // 输入框占位文本
searchField: 'code', // 查询弹窗赋值字段 searchField: 'number', // 查询弹窗赋值字段
searchTitle: '供应商信息', // 查询弹窗标题 searchTitle: '采购订单信息', // 查询弹窗标题
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 searchAllSchemas: PurchaseMain.allSchemas, // 查询弹窗所需类
searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法 searchPage: PurchaseMainApi.getPurchaseMainPage, // 查询弹窗所需分页方法
} }
} },
isForm: true,
}, },
{ {
label: '发货单号', label: '发货单号',
@ -79,42 +79,63 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
isForm: true, isForm: true,
}, },
{ {
label: '要货计划单号', label: '供应商代码',
field: 'ppNumber', field: 'supplierCode',
sort: 'custom', sort: 'custom',
table: { table: {
width: 180 width: 150
}, },
isSearch: true,
form: { form: {
// labelMessage: '信息提示说明!!!', // labelMessage: '信息提示说明!!!',
componentProps: { componentProps: {
isSearchList: true, // 开启查询弹窗 disabled: true,
searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本 isSearchList: false, // 开启查询弹窗
searchField: 'number', // 查询弹窗赋值字段 searchListPlaceholder: '请选择供应商代码', // 输入框占位文本
searchTitle: '要货计划信息', // 查询弹窗标题 searchField: 'code', // 查询弹窗赋值字段
searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类 searchTitle: '供应商信息', // 查询弹窗标题
searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法 searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
searchCondition: [ searchPage: SupplierApi.getSupplierPage // 查询弹窗所需分页方法
{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},
{
key: 'status',
value: 4,
isMainValue: false
},
{
key: 'available',
value: "TRUE",
isMainValue: false
}]
} }
}, }
isForm: true,
}, },
// {
// label: '要货计划单号',
// field: 'ppNumber',
// sort: 'custom',
// table: {
// width: 180
// },
// form: {
// // labelMessage: '信息提示说明!!!',
// componentProps: {
// isSearchList: true, // 开启查询弹窗
// searchListPlaceholder: '请选择要货计划单号', // 输入框占位文本
// searchField: 'number', // 查询弹窗赋值字段
// searchTitle: '要货计划信息', // 查询弹窗标题
// searchAllSchemas: PurchasePlanMain.allSchemas, // 查询弹窗所需类
// searchPage: PurchasePlanMainApi.getPurchasePlanMainPage, // 查询弹窗所需分页方法
// searchCondition: [
// {
// key: 'supplierCode',
// value: 'supplierCode',
// message: '请填写供应商代码!',
// isMainValue: true
// },
// {
// key: 'status',
// value: 4,
// isMainValue: false
// },
// {
// key: 'available',
// value: "TRUE",
// isMainValue: false
// }]
// }
// },
// isForm: true,
// },
{ {
label: '承运商', label: '承运商',
field: 'carrierCode', field: 'carrierCode',
@ -141,22 +162,22 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
width: 150 width: 150
}, },
}, },
{ // {
label: '数据来源', // label: '数据来源',
field: 'sourceType', // field: 'sourceType',
dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE, // dictType: DICT_TYPE.PURCHASERECEIPT_SOURCE_TYPE,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
value: 'ASN_ExternalReceipt', // value: 'ASN_ExternalReceipt',
componentProps: { // componentProps: {
disabled: true // disabled: true
} // }
}, // },
isSearch: false, // isSearch: false,
}, // },
{ {
label: '从仓库代码', label: '从仓库代码',
field: 'fromWarehouseCode', field: 'fromWarehouseCode',
@ -303,50 +324,50 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
}, },
isForm: false, isForm: false,
}, },
{ // {
label: '截止时间', // label: '截止时间',
field: 'dueTime', // field: 'dueTime',
formatter: dateFormatter, // formatter: dateFormatter,
detail: { // detail: {
dateFormat: 'YYYY-MM-DD HH:mm:ss' // dateFormat: 'YYYY-MM-DD HH:mm:ss'
}, // },
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 180 // width: 180
}, // },
form: { // form: {
component: 'DatePicker', // component: 'DatePicker',
componentProps: { // componentProps: {
style: {width:'100%'}, // style: {width:'100%'},
type: 'datetime', // type: 'datetime',
dateFormat: 'YYYY-MM-DD HH:mm:ss', // dateFormat: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'x', // valueFormat: 'x',
} // }
}, // },
}, // },
{ // {
label: '部门', // label: '部门',
field: 'departmentCode', // field: 'departmentCode',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
formatter: (_: Recordable, __: TableColumn, cellValue: number) => { // formatter: (_: Recordable, __: TableColumn, cellValue: number) => {
return userDeptArray.find((account) => account.id == cellValue)?.name // return userDeptArray.find((account) => account.id == cellValue)?.name
}, // },
form: { // form: {
value: userDept.id, // value: userDept.id,
component: 'Select', // component: 'Select',
api: () => userDeptArray, // api: () => userDeptArray,
componentProps: { // componentProps: {
disabled: true, // disabled: true,
optionsAlias: { // optionsAlias: {
labelField: 'name', // labelField: 'name',
valueField: 'id' // valueField: 'id'
} // }
} // }
} // }
}, // },
{ {
label: '状态', label: '状态',
field: 'status', field: 'status',
@ -476,6 +497,9 @@ export const PurchasereceiptRequestMain = useCrudSchemas(reactive<CrudSchema[]>(
//表单校验 //表单校验
export const PurchasereceiptRequestMainRules = reactive({ export const PurchasereceiptRequestMainRules = reactive({
ppNumber: [
{ required: true, message: '请输入采购订单', trigger: 'blur' }
],
supplierCode: [ supplierCode: [
{ required: true, message: '请输入供应商代码', trigger: 'blur' } { required: true, message: '请输入供应商代码', trigger: 'blur' }
], ],
@ -583,6 +607,7 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
}, },
tableForm:{ tableForm:{
multiple:true,
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择订单行', // 输入框占位文本 searchListPlaceholder: '请选择订单行', // 输入框占位文本
searchField: 'lineNumber', // 查询弹窗赋值字段 searchField: 'lineNumber', // 查询弹窗赋值字段
@ -653,9 +678,49 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
isTableForm: false, isTableForm: false,
isForm: false isForm: false
}, },
// {
// label: '数量',
// field: 'qty',
// sort: 'custom',
// table: {
// width: 150
// },
// form: {
// component: 'InputNumber',
// componentProps: {
// min: 1,
// precision: 6
// },
// },
// tableForm: {
// type: 'InputNumber',
// min: 1,
// precision: 6
// }
// },
{
label: '订单数量',
field: 'orderQty',
sort: 'custom',
table: {
width: 150
},
form: {
component: 'InputNumber',
componentProps: {
min: 1,
precision: 6
},
},
tableForm: {
type: 'InputNumber',
min: 1,
precision: 6
}
},
{ {
label: '数量', label: '收货数量',
field: 'qty', field: 'receivedQty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
@ -689,14 +754,76 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
} }
}, },
{ {
label: '从库位代码', label: '包装规格',
field: 'fromLocationCode', field: 'packUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
},
{
label: '包装数量',
field: 'packQty',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isTableForm: false, form: {
isForm: false componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
}, },
{ {
label: '默认到库位代码', label: '默认到库位代码',
@ -774,16 +901,16 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
disabled: true disabled: true
} }
}, },
{ // {
label: '替代批次', // label: '替代批次',
field: 'altBatch', // field: 'altBatch',
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
isTableForm: false, // isTableForm: false,
isForm: false // isForm: false
}, // },
{ {
label: '到货日期', label: '到货日期',
field: 'arriveDate', field: 'arriveDate',
@ -836,6 +963,17 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
valueFormat: 'x', valueFormat: 'x',
}, },
}, },
{
label: '从库位代码',
field: 'fromLocationCode',
sort: 'custom',
table: {
width: 150
},
isTableForm: false,
isForm: false
},
{ {
label: '库存状态', label: '库存状态',
field: 'inventoryStatus', field: 'inventoryStatus',
@ -852,78 +990,8 @@ export const PurchasereceiptRequestDetail = useCrudSchemas(reactive<CrudSchema[]
type: 'Select' type: 'Select'
} }
}, },
{
label: '包装数量',
field: 'packQty',
sort: 'custom',
table: {
width: 150
},
form: {
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}
]
}
},
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择包装',
searchField: 'packQty',
searchTitle: '物品包装信息',
searchAllSchemas: Itempackaging.allSchemas,
searchPage: ItemPackageApi.getItempackagingPageBySupplierdeliver,
searchCondition: [
{
key: 'itemCode',
value: 'itemCode',
message: '请选择订单行',
isMainValue: true
},
{
key: 'available',
value: 'TRUE',
isMainValue: false
}]
},
isTableForm: true,
isForm: true
},
{
label: '包装规格',
field: 'packUnit',
dictClass: 'string',
isTable: true,
sort: 'custom',
table: {
width: 150,
componentProps: {
disabled: true
}
},
tableForm:{
disabled:true
},
isTableForm: true,
isForm: true
},
{ {
label: '供应商计量数量', label: '供应商计量数量',
field: 'supplierPackQty', field: 'supplierPackQty',

8
src/views/wms/purchasereceiptManage/purchasereturn/purchasereturnRecordMain/purchasereturnRecordMain.data.ts

@ -40,6 +40,14 @@ export const PurchasereturnRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
width: 180 width: 180
}, },
}, },
{
label: 'qad采购退货记录单号',
field: 'qadPurchaseRrturnRecordCode',
sort: 'custom',
table: {
width: 180
},
},
{ {
label: '发货单号', label: '发货单号',
field: 'asnNumber', field: 'asnNumber',

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

@ -28,6 +28,8 @@
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
<BasicForm ref="formRef" @success="getList" <BasicForm ref="formRef" @success="getList"
:isOpenSearchTable="true"
:indexTableColumn="1"
:rules="PurchasePlanMainRules" :rules="PurchasePlanMainRules"
:formAllSchemas="PurchasePlanMain.allSchemas" :formAllSchemas="PurchasePlanMain.allSchemas"
:tableAllSchemas="PurchasePlanDetail.allSchemas" :tableAllSchemas="PurchasePlanDetail.allSchemas"
@ -72,6 +74,7 @@
import * as defaultButtons from '@/utils/disposition/defaultButtons' import * as defaultButtons from '@/utils/disposition/defaultButtons'
import * as PurchaseDetailApi from '@/api/wms/purchaseDetail' import * as PurchaseDetailApi from '@/api/wms/purchaseDetail'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { PurchaseDetail } from '../purchaseMain/purchaseMain.data'
// //
defineOptions({ name: 'PurchasePlanMain' }) defineOptions({ name: 'PurchasePlanMain' })
@ -91,28 +94,39 @@
// //
const searchTableSuccess = (formField, searchField, val, formRef, type, row) => { const searchTableSuccess = (formField, searchField, val, formRef, type, row) => {
console.log('searchTableSuccess', formField, searchField, val, formRef, type, row)
nextTick(async () => { nextTick(async () => {
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] val.forEach(item=>{
row['itemCode'] = val[0]['code'] if(tableData.value.find(item1=>item1['id'] == item['id'])) return
row['poNumber'] = val[0]['number'] const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
row['poLine'] = val[0]['lineNumber']
if (formField == 'poLine') { newRow[formField] = item[searchField]
row['itemCode'] = val[0]['itemCode'] newRow['itemCode'] = item['code']
row['uom'] = val[0]['uom'] newRow['poNumber'] = item['number']
row['orderQty'] = val[0]['orderQty'] newRow['poLine'] = item['lineNumber']
row['planQty'] = val[0]['orderQty']-val[0]['plannedQty'] if (formField == 'poLine') {
row['available'] = val[0]['available'] //--
} newRow['itemCode'] = item['itemCode']
newRow['uom'] = item['uom']
newRow['orderQty'] = item['orderQty']
newRow['planQty'] = item['orderQty']-item['plannedQty']
newRow['available'] = item['available']
}
tableData.value.push(newRow)
})
} else { } else {
const setV = {} const setV = {}
setV[formField] = val[0][searchField] setV[formField] = val[0][searchField]
setV['itemCode'] = val[0]['code'] setV['itemCode'] = val[0]['code']
setV['poNumber'] = val[0]['number'] setV['poNumber'] = val[0]['number']
setV['poLine'] = val[0]['lineNumber'] setV['poLine'] = val[0]['lineNumber']
if(formField == 'supplierCode'){ if(formField == 'supplierCode'){
setV['supplierCode'] = val[0]['code'] setV['supplierCode'] = val[0]['code']
setV['contacts'] = val[0]['contacts']
setV['phone'] = val[0]['phone']
await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => { await PurchasePlanMainApi.queryPurchasePlan(val[0]['code']).then(res => {
let beginTime = res.beginTime let beginTime = res.beginTime
var ms = beginTime.substring(0, 2) var ms = beginTime.substring(0, 2)
@ -123,6 +137,7 @@
var me = endTime.substring(3) var me = endTime.substring(3)
setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me)) setV['endTime'] = new Date(2024, 1, 1, Number(ms), Number(me))
}) })
tableData.value = []
} }
if (formField == 'poLine') { if (formField == 'poLine') {
setV['itemCode'] = val[0]['itemCode'] setV['itemCode'] = val[0]['itemCode']
@ -132,9 +147,46 @@
setV['available'] = val[0]['available'] setV['available'] = val[0]['available']
} }
formRef.setValues(setV) formRef.setValues(setV)
console.log('formModel',formRef.formModel)
if(formField == 'poNumber') {
//----
//
getSearchTableData(val[0]['number'],formField,searchField)
}
} }
}) })
} }
const getSearchTableData = async (number,formField,searchField)=>{
const {tableObject ,tableMethods} = useTable({
defaultParams:{number},
getListApi: PurchaseDetailApi.getPurchaseDetailPagePoNumber //
})
//
const { getList:getList1 } = tableMethods
await getList1()
const tableColumns = PurchaseDetail.allSchemas.tableFormColumns
tableColumns.forEach((item) => {
item.width = item.table?.width || 150
})
tableData.value = []
tableObject.tableList.forEach(row=>{
const newRow = JSON.parse(JSON.stringify({...tableFormKeys,...row}))
//
newRow[formField] = row[searchField]
newRow['itemCode'] = row['itemCode']
newRow['poNumber'] = row['number']
newRow['poLine'] = row['lineNumber']
if (formField == 'poLine') {
newRow['itemCode'] = row['itemCode']
newRow['uom'] = row['uom']
newRow['orderQty'] = row['orderQty']
newRow['planQty'] = row['orderQty']-row['plannedQty']
newRow['available'] = row['available']
}
tableData.value.push(newRow)
})
}
// //
const searchTableSuccessDetail = (formField, searchField, val, formRef) => { const searchTableSuccessDetail = (formField, searchField, val, formRef) => {
nextTick(async () => { nextTick(async () => {

182
src/views/wms/purchasereceiptManage/supplierdeliver/purchasePlanMain/purchasePlanMain.data.ts

@ -49,13 +49,61 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '订单', label: '采购订单',
field: 'poNumber', field: 'poNumber',
sort: 'custom', sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
isForm: false, form: {
// labelMessage: '信息提示说明!!!',
componentProps: {
isSearchList: true,
searchListPlaceholder: '请选择采购订单',
searchField: 'number',
searchTitle: '采购订单信息',
searchAllSchemas: PurchaseMain.allSchemas,
searchPage: PurchaseMainApi.getPurchaseMainPage,
searchCondition: [{
key: 'available',
value: 'TRUE',
isMainValue: false
},{
key: 'supplierCode',
value: 'supplierCode',
message: '请填写供应商代码!',
isMainValue: true
},{
key: 'status',
value: 2,
isMainValue: false
}]
}
}
},
{
label: '收货人',
field: 'contacts',
table: {
width: 150
},
form: {
componentProps: {
disabled: false
}
}
},
{
label: '联系电话',
field: 'phone',
table: {
width: 150
},
form: {
componentProps: {
disabled: false
}
}
}, },
{ {
label: '送达日期', label: '送达日期',
@ -166,65 +214,65 @@ export const PurchasePlanMain = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ // {
label: '自动发布', // label: '自动发布',
field: 'autoPublish', // field: 'autoPublish',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // dictClass: 'string',
isTable: true, // isTable: true,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
component: 'Switch', // component: 'Switch',
value: "TRUE", // value: "TRUE",
componentProps: { // componentProps: {
inactiveValue: 'FALSE', // inactiveValue: 'FALSE',
activeValue: 'TRUE' // activeValue: 'TRUE'
} // }
} // }
}, // },
{ // {
label: '自动接收', // label: '自动接收',
field: 'autoAccept', // field: 'autoAccept',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // dictClass: 'string',
isTable: true, // isTable: true,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
component: 'Switch', // component: 'Switch',
value: "TRUE", // value: "TRUE",
componentProps: { // componentProps: {
inactiveValue: 'FALSE', // inactiveValue: 'FALSE',
activeValue: 'TRUE' // activeValue: 'TRUE'
} // }
} // }
}, // },
{ // {
label: '是否可用', // label: '是否可用',
field: 'available', // field: 'available',
dictType: DICT_TYPE.TRUE_FALSE, // dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string', // dictClass: 'string',
isTable: true, // isTable: true,
sort: 'custom', // sort: 'custom',
table: { // table: {
width: 150 // width: 150
}, // },
form: { // form: {
component: 'Switch', // component: 'Switch',
value: 'TRUE', // value: 'TRUE',
componentProps: { // componentProps: {
inactiveValue: 'FALSE', // inactiveValue: 'FALSE',
activeValue: 'TRUE', // activeValue: 'TRUE',
disabled: true // disabled: true
} // }
}, // },
isSearch: true, // isSearch: true,
}, // },
{ {
label: '创建者', label: '创建者',
field: 'creator', field: 'creator',
@ -315,6 +363,12 @@ export const PurchasePlanMainRules = reactive({
available: [ available: [
{ required: true, message: '请选择是否可用', trigger: 'change' } { required: true, message: '请选择是否可用', trigger: 'change' }
], ],
supplierCode: [
{ required: true, message: '请选择供应商代码', trigger: 'change' }
],
poNumber: [
{ required: true, message: '请选择采购订单号', trigger: 'change' }
],
deliveryDate: [ deliveryDate: [
{ required: true, message: '请选择送达时间', trigger: 'change' } { required: true, message: '请选择送达时间', trigger: 'change' }
], ],
@ -435,6 +489,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
tableForm: { tableForm: {
multiple:true,
isInpuFocusShow: true, isInpuFocusShow: true,
searchListPlaceholder: '请选择订单行', searchListPlaceholder: '请选择订单行',
searchField: 'lineNumber', searchField: 'lineNumber',
@ -530,7 +585,7 @@ export const PurchasePlanDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
disabled:false, disabled:true,
} }
}, },
{ {
@ -617,9 +672,6 @@ export const PurchasePlanDetailRules = reactive({
// available: [ // available: [
// { required: true, message: '请选择是否可用', trigger: 'change' } // { required: true, message: '请选择是否可用', trigger: 'change' }
// ], // ],
poNumber: [
{ required: true, message: '请选择采购订单号', trigger: 'change' }
],
shippedQty: [ shippedQty: [
{ required: true, message: '请输入已发货数量', trigger: 'blur' } { required: true, message: '请输入已发货数量', trigger: 'blur' }
], ],

Loading…
Cancel
Save