Browse Source

日计划配置功能

master_hella_20240701
TengXF 5 months ago
parent
commit
eda3c06591
  1. 20
      src/api/mes/orderDayConfig/index.ts
  2. 13
      src/api/wms/team/index.ts
  3. 437
      src/views/mes/orderDay/components/schedule.vue
  4. 55
      src/views/mes/orderDay/orderDay.data.ts
  5. 9
      src/views/wms/basicDataManage/orderManage/team/team.data.ts
  6. 122
      src/views/wms/basicDataManage/orderManage/team/teamForm.vue

20
src/api/mes/orderDayConfig/index.ts

@ -35,3 +35,23 @@ export const getConfigProcessWorker = async (params) => {
export const getConfigProcessEquipment = async (params) => {
return await request.get({ url: `/mes/orderDayequipment/getByOrder`, params })
}
/*批量保存工序人员配置*/
export const saveWorker = async (data: any) => {
return await request.post({ url: `/mes/orderDayWorker/batchCreate`, data })
}
// 查询设备基本信息列表
export const getDeviceInfoPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/mes/device-info/senior', data })
} else {
return await request.get({ url: `/mes/device-info/page`, params })
}
}
/*批量保存工序模具配置*/
export const saveEquipment = async (data: any) => {
return await request.post({ url: `/mes/orderDayequipment/batchCreate`, data })
}

13
src/api/wms/team/index.ts

@ -12,6 +12,8 @@ export interface TeamVO {
teamGroup: string
workshopCode: string
productionLineCode: string
teamMonitorCode: string
teamMonitorName: string
}
// 查询班组列表
@ -25,6 +27,17 @@ export const getTeamPage = async (params) => {
}
}
export const geTeamUserByCode = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return request.post({ url: '/wms/team/queryTeamUserByCode', data })
}
// else {
// return await request.get({ url: `/wms/team/queryTeamUserByCode`, params })
// }
}
// 查询班组详情
export const getTeam = async (id: number) => {
return await request.get({ url: `/wms/team/get?id=` + id })

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

@ -33,12 +33,15 @@
</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="code" label="工序编码" />
<el-table-column prop="name" label="工序名称" />
<el-table-column prop="oper" label="" width="60">
<el-table-column prop="opera" label="" width="60">
<template #header>
<span>操作</span>
</template>
<template #default="scope">
<el-button size="mini" text @click="deleteNode(scope.row)"
>移除</el-button
<el-button type="danger" size="mini" text @click="deleteNode(scope.row)"
>移除</el-button
>
</template>
</el-table-column>
@ -46,69 +49,144 @@
</el-card>
</el-aside>
<el-main style="height: 320px;width: calc(100% - 980px);padding: 0px; margin:0px 20px">
<div ref="graphContainer" ></div
></el-main>
<div ref="graphContainer"></div
></el-main>
<el-aside width="640px">
<el-tabs v-model="activeName">
<el-tabs v-model="activeName">
<el-tab-pane label="工序工位" name="workstation">
<el-table :data="workstationData" ref="tableWorkstations" style="width: 100%; height: 80%">
<el-table-column prop="name" label="工作位置">
<template #default="scope">
<el-button size="mini" text style="width: 100%"
>{{ scope.row.name }}[{{ scope.row.code }}]</el-button
>
</template>
</el-table-column>
<el-table-column prop="code" label="工序编码" width="180" v-if="false" />
</el-table>
<el-table-column prop="stationName" label="工位名称" />
<el-table-column prop="processCode" label="工序编码" />
<!-- <el-table-column prop="stationName" label="工作位置">-->
<!-- <template #default="scope">-->
<!-- <el-button size="mini" text style="width: 100%"-->
<!-- >{{ scope.row.name }}[{{ scope.row.code }}]</el-button-->
<!-- >-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
</el-tab-pane>
<el-tab-pane label="工序物料" name="materials">
<el-table :data="materialsData" ref="tableMaterials" style="width: 100%; height: 80%">
<el-table-column prop="repMaterialCode" label="物料编码"/>
<el-table-column prop="repMaterialCounts" label="物料数量" />
<el-table-column prop="repMaterialModel" label="物料单位" />
<el-table-column prop="sourceMaterialCounts" label="需求物料数" >
<template #default="scope">{{ getTotalcounts(scope.row.repMaterialCounts)}}</template>
</el-table-column>
<el-table-column prop="replaceFlag" label="是否替换" />
</el-table>
</el-tab-pane>
<el-table-column prop="repMaterialCode" label="物料编码" />
<el-table-column prop="repMaterialCounts" label="物料数量" />
<el-table-column prop="repMaterialModel" label="物料单位" />
<el-table-column prop="sourceMaterialCounts" label="需求物料数">
<template #default="scope">{{ getTotalcounts(scope.row.repMaterialCounts) }}</template>
</el-table-column>
<el-table-column prop="replaceFlag" label="是否替换" />
</el-table>
</el-tab-pane>
<el-tab-pane label="工序人员" name="workers">
<el-table :data="workerData" ref="tableWorker" style="width: 100%; height: 80%">
<el-table-column prop="workerCode" label="人员编码"/>
<el-table-column prop="workerName" label="人员昵称" />
<el-table-column prop="workerWorkstation" label="所在工位" />
<el-table-column prop="workerTeam" label="所属班组" />
<el-table-column prop="workerPost" label="岗位" />
<el-table-column prop="abilityLevel" label="能力等级" />
</el-table>
<el-button type="primary" @click="opensearchTableUser">添加人员</el-button>
<el-button type="success" @click="saveUser">保存</el-button>
<el-table :data="workerData" ref="tableWorker" style="width: 100%; height: 233px;overflow: auto;">
<el-table-column prop="groupName" label="所属班组" />
<el-table-column prop="workerMonitor" label="班长" />
<el-table-column prop="workerCode" label="人员编码" />
<el-table-column prop="workerName" label="人员昵称" />
<el-table-column prop="opera" label="" width="70" >
<template #header>
<span>操作</span>
</template>
<template #default="scope">
<el-button type="danger" size="mini" text @click="deleteUser(scope.row)" style="margin-right: 20px">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
<el-tab-pane label="工序设备" name="equipments">
<el-button type="primary" @click="opensearchTableEquipment">添加设备</el-button>
<el-button type="success" @click="saveEquipment">保存</el-button>
<el-table :data="equipmentData" ref="tableEquipment" style="width: 100%; height: 80%">
<el-table-column prop="equipmentCode" label="设备编码"/>
<el-table-column prop="equipmentName" label="设备名称" />
<el-table-column prop="equipmentWorkstation" label="关联工位" />
<el-table-column prop="equipmentOper" label="操作说明" />
</el-table>
<el-table-column prop="equipmentCode" label="设备编码" />
<el-table-column prop="equipmentName" label="设备名称" />
<el-table-column prop="equipmentType" label="设备类型" />
<el-table-column prop="equipmentWorkstation" label="关联工位" />
<!-- <el-table-column prop="equipmentOper" label="操作说明" />-->
<el-table-column prop="opera" label="" width="70" >
<template #header>
<span>操作</span>
</template>
<template #default="scope">
<el-button type="danger" size="mini" text @click="deleteEquipment(scope.row)" style="margin-right: 20px">移除</el-button>
</template>
</el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</el-aside>
</el-container>
<el-dialog v-model="dialogFormVisibleUser" title="请选择班组" width="600" :style="{ 'padding': '15px' }">
<el-row>
<el-col :span="8">
<el-form-item label="班组类型">
<el-select v-model="filterFormTeam.teamGroup" placeholder="请选择类型">
<el-option label="生产班组" value="1" />
<el-option label="维修班组" value="2" />
<el-option label="质检班组" value="3" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="班组名称" style="margin-left: 15px">
<el-input v-model="filterFormTeam.teamName" placeholder="请输入名称" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item>
<el-button type="primary" @click="searchTeamList" style="margin-left: 15px">查询</el-button>
</el-form-item>
</el-col>
</el-row>
<!-- 表格内容 -->
<content-wrap>
<el-table highlight-current-row :data="teamData" style="width: 100%">
<el-table-column prop="code" label="班组编码" />
<el-table-column prop="name" label="班组名称" />
<el-table-column prop="teamGroup" label="班组类型" >
<template #default="scope">
<el-select v-model="scope.row.teamGroup" placeholder="请选择班组类型" disabled="true">
<el-option
v-for="item in teamGroupOptions"
:key="item.value"
:label="item.label"
:value="item.value"/>
</el-select>
</template>
</el-table-column>
<el-table-column prop="name" label="操作" >
<template #default="scope">
<el-button type="text" @click="handleConfirm(scope.row)">选择成员</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination
v-model:current-page="currentPage"
:page-size="5"
layout="total, prev, pager, next"
:total="totalTeam"
@current-change="handleCurrentChange"
/>
</content-wrap>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeTeamUser">关闭</el-button>
</div>
</template>
</el-dialog>
</ContentWrap>
<template #footer>
<el-button @click="publishPlan">发布计划</el-button>
</template>
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
<SearchTable ref="searchTableRef" @search-table-success="searchTableSuccess" />
</Dialog>
<!-- <SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" /> -->
</template>
<script lang="ts" setup>
//import { dateFormatter } from '@/utils/formatTime'
import {
start_node,
end_node,
@ -121,6 +199,12 @@ import {ProcessSearch} from '../../publicUtil/processSearch.data'
import * as ProcessApi from '@/api/wms/process'
import { SearchTable } from '@/components/SearchTable'
import { Graph } from '@antv/x6'
import * as TeamApi from '@/api/wms/team'
import {searchUser} from "@/views/wms/basicDataManage/orderManage/team/team.data";
import {getStrDictOptions} from "@/utils/dict";
import {Equipment} from "@/views/mes/workstation/workstation.data";
import * as WorkstationApi from "@/api/mes/workstation";
import {DeviceInfo, OrderDay} from "@/views/mes/orderDay/orderDay.data";
//import {TableForm} from '@/components/TableForm/src/TableForm.vue' // TableForm.vue
const graphContainer = ref<HTMLElement | null>(null)
const graph = ref<Graph>()
@ -128,7 +212,10 @@ const message = useMessage() // 消息弹窗
const { t } = useI18n() //
const activeName = ref('process')
const loading = ref(true)
const dialogFormVisibleUser = ref(false)
const processData = ref([])
const processCode = ref('')
const queryParams:orderDayconfigApi.OrderDayQueryParamVo=ref()
const props = defineProps({
//
@ -156,15 +243,60 @@ routeName.value = routeName.value.substring(0, routeName.value.length - 4) + 'De
//const updateKey = ref(0)
const dialogWidth = ref()
const materialsData = ref()
const workerData=ref()
const equipmentData=ref()
const workstationData=ref()
const equipmentData=ref([])
const workstationData=ref([])
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const graphJson =ref()
const graphJson =ref()
/*班组数据*/
const teamData = ref([])
/*班组弹窗搜索条件*/
const filterFormTeam = ref({
teamGroup: '',
teamName: '',
})
/*班组信息分页参数*/
const totalTeam = ref(0);
const currentPage =ref(1)
/*关闭班组弹窗*/
const closeTeamUser = () =>{
dialogFormVisibleUser.value = false
filterFormTeam.value ={
teamGroup: '',
teamName: ''
}
}
/*通过班组选择的人员数据集*/
const workerData=ref([])
/*查询班组接口参数*/
const teamParams = ref({
teamGroup: '',
name: '',
pageNo:1,
pageSize:5
});
/*班组类型数据集*/
const teamGroupOptions = ref([])
const getOptions=()=>{
teamGroupOptions.value=getStrDictOptions(DICT_TYPE.BASIC_TEAM_TYPE)
}
/*班组分页调用的接口*/
const handleCurrentChange = (val: number) => {
currentPage.value = val
searchTeamListCommon()
}
const searchTeamList = () => {
currentPage.value = 1
searchTeamListCommon()
}
/** 打开弹窗 */
const open = async (type: string, row?: any, titleName?: any) => {
//
workerData.value = []
equipmentData.value = []
materialsData.value = []
workstationData.value = []
getOptions()
dialogVisible.value = true
detailData.value = row
dialogWidth.value = props.basicFormWidth + '%'
@ -175,21 +307,18 @@ const open = async (type: string, row?: any, titleName?: any) => {
queryParams.processrouteCode=row.processrouteCode
queryParams.batchCode=row.batchCode
//
if (titleName) {
dialogTitle.value = t('action.' + titleName)
} else {
dialogTitle.value = t('action.' + type)
}
nextTick(() => {
nextTick?.(() => {
graph.value = createGraph(graphContainer.value as HTMLElement, true, 240, 320)
graph.value.on('node:click', ({ e, x, y, node, view }) => {
nodeClick(e, x, y, node, view)
})
getProcessroute()
getConfigProcessRouteNode()
})
}
const getTotalcounts=(a:any)=>{
@ -223,7 +352,6 @@ const getProcessBom=async (code:any) => {
queryParams.processCode=code
let res = await orderDayconfigApi.getOrderDayBomByOrder(queryParams)
materialsData.value=res
}
//线
const getProcessroute = async () => {
@ -242,30 +370,26 @@ const getConfigProcessRouteNode= async () => {
const getConfigProcessWorkstation= async (code:any) => {
queryParams.processCode=code
workstationData.value = await orderDayconfigApi.getConfigProcessWorkstation(queryParams)
}
//
const getConfigProcessWorker= async (code:any) => {
queryParams.processCode=code
workerData.value = await orderDayconfigApi.getConfigProcessWorker(queryParams)
}
//
const getConfigProcessEquipment= async (code:any) => {
queryParams.processCode=code
equipmentData.value = await orderDayconfigApi.getConfigProcessEquipment(queryParams)
}
const nodeClick = (e, x, y, node, view) => {
getProcessBom(node.id)
getConfigProcessWorkstation(node.id)
getConfigProcessWorker(node.id)
getConfigProcessEquipment(node.id)
//console.log('nodeClick',detailData.value)
processCode.value = node.id
}
const searchTableRef = ref()
const opensearchTable = (
) => {
//console.log("opensearchTable")
@ -277,8 +401,8 @@ const opensearchTable = (
_searchTableTitle,
_searchTableAllSchemas,
_searchTablePage,
undefined,
undefined,
'process',
'process',
true,
undefined,
undefined,
@ -312,32 +436,199 @@ const publishPlan= async ()=>{
await OrderDayApi.publishPlan(data)
}
//
// 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)
}
nextTick?.(() => {
if (val.length > 0) {
val.forEach(item => {
if (formField === 'team') {
const { username, nickname, groupName, workerMonitor,code} = item;
const existingWorker = workerData.value.find(worker => worker.workerCode === username);
if (!existingWorker) {
let obj={
workerCode: username,
workerName: nickname,
groupName: groupName,
workerMonitor: workerMonitor,
groupCode: code,
planDayCode : detailData.value.planNoDay,
productCode : detailData.value.productCode,
planBatchCode : detailData.value.batchCode,
processCode : processCode.value,
planDayId : detailData.value.id
}
workerData.value.push(obj);
}
}
else if (formField === 'equipment'){
const { deviceCode, deviceName,deviceType, workroomCode, lineCode,deviceGroup} = item;
const existingWorker = equipmentData.value.find(equipment => equipment.equipmentCode === deviceCode);
if (!existingWorker) {
let obj={
equipmentCode: deviceCode,
equipmentName: deviceName,
equipmentType: deviceType,
equipmentGroup: deviceGroup,
equipmentWorkstation: '',
planDayCode : detailData.value.planNoDay,
productCode : detailData.value.productCode,
planBatchCode : detailData.value.batchCode,
processCode : processCode.value,
planDayId : detailData.value.id
}
equipmentData.value.push(obj);
}
}
else if (formField === 'process') {
const { code, name } = item;
const existingProcess = new Set(processData.value.map(e => e.code));
if (!existingProcess.has(code)) {
processData.value.push({ code, name });
}
}
});
}
dialogFormVisibleUser.value = false;
filterFormTeam.value = {
teamGroup: '',
teamName: ''
}
});
};
const deleteNode=(row)=>{
processData.value.splice(processData.value.indexOf(row),1)
graph.value.removeNode(row.code)
}
defineOptions({ name: 'sechledDetail' })
/*点击查询,筛选班组数据*/
const searchTeamListCommon = async () =>{
if (filterFormTeam.value.teamGroup != ''){
teamParams.value.teamGroup = filterFormTeam.value.teamGroup
}
if (filterFormTeam.value.teamName != ''){
teamParams.value.name = filterFormTeam.value.teamName
}
teamParams.value.pageNo = currentPage.value
var teamList = await getTeamList(teamParams.value);
teamData.value = teamList.list
totalTeam.value = teamList.total
}
/*打开班组弹窗*/
const opensearchTableUser = async (
) => {
currentPage.value = 1
filterFormTeam.value ={
teamGroup: '',
teamName: ''
}
teamParams.value.teamGroup = ''
teamParams.value.name = ''
teamParams.value.pageNo = 1
var teamList = await getTeamList(teamParams.value)
teamData.value = teamList.list
totalTeam.value = teamList.total
dialogFormVisibleUser.value = true
}
/*通过班组,打开班组下的人员信息弹窗*/
const handleConfirm = (row)=>{
const _searchCondition = {}
const filters: any[] = []
filters.push({
action: "==",
column: 'available',
value: 'TRUE'
},{
action: "==",
column: 'code',
value: row.code
})
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
searchTableRef.value.open(
'添加人员',//
searchUser.allSchemas,
TeamApi.geTeamUserByCode,
'team',
'team',
true,//
undefined,
undefined,
_searchCondition
)
}
/*选择设备弹窗*/
const opensearchTableEquipment = async (
) => {
const _searchCondition = {}
const filters: any[] = []
filters.push({
action: "==",
column: 'workroomCode',
value: detailData.value.workroomCode
},{
action: "==",
column: 'lineCode',
value: detailData.value.lineCode
})
//
// _searchCondition.isSearch = true
// _searchCondition.filters = filters
searchTableRef.value.open(
'添加设备',//
DeviceInfo.allSchemas,
orderDayconfigApi.getDeviceInfoPage,
'equipment',
'equipment',
true,//
undefined,
undefined,
_searchCondition
)
}
/*设备保存接口*/
const saveEquipment = async () =>{
await orderDayconfigApi.saveEquipment(equipmentData.value)
console.log(equipmentData.value)
message.success("设备配置成功!")
}
/*删除设备标签*/
const deleteEquipment=(row)=>{
equipmentData.value.splice(equipmentData.value.indexOf(row),1)
}
/*删除选择的班组人员*/
const deleteUser=(row)=>{
workerData.value.splice(workerData.value.indexOf(row),1)
}
/*班组人员保存接口*/
const saveUser = async () =>{
await orderDayconfigApi.saveWorker(workerData.value)
message.success("人员配置成功!")
}
/*分页查询班组信息*/
const getTeamList = async (params:any) => {
return TeamApi.getTeamPage(params)
}
defineOptions({ name: 'SechledDetail' })
defineExpose({ open }) // open
</script>
<style lang="scss">
.el-drawer__body {
background: #f5f5f5 !important;
}
::v-deep(.label-class-name) {
color: #dedede;
}
</style>
<style scoped lang="scss"></style>

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

@ -63,7 +63,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
disabled: true
}
},
},
{
label: '',
@ -142,7 +142,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
value: 'CCP,BCP',//,SEMI]
isMainValue: false
},
]
}
}
@ -169,7 +169,7 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
}]
}
},
},
{
label: '产线编码',
@ -360,3 +360,52 @@ export const OrderDay = useCrudSchemas(reactive<CrudSchema[]>([
}
}
]))
export const DeviceInfo = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '设备编码',
field: 'deviceCode',
sort: 'custom',
isSearch: true,
},
{
label: '设备名称',
field: 'deviceName',
sort: 'custom',
isSearch: true,
},
// {
// label: '设备类型',
// field: 'deviceType',
// sort: 'custom',
// isSearch: true,
// form: {
// component: 'SelectV2'
// },
// },
{
label: '所属车间',
field: 'workroomCode',
sort: 'custom',
isSearch: true,
},
{
label: '所属产线',
field: 'lineCode',
sort: 'custom',
isSearch: true,
},
// {
// label: '设备分组',
// field: 'deviceGroup',
// sort: 'custom',
// isSearch: true,
// },
{
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
},
]))

9
src/views/wms/basicDataManage/orderManage/team/team.data.ts

@ -41,6 +41,15 @@ export const Team = useCrudSchemas(reactive<CrudSchema[]>([
width: 120
}
},
{
label: '班组负责人',
field: 'teamMonitorName',
sort: 'custom',
isSearch: true,
table: {
width: 120
}
},
{
label: '班组类型',
field: 'teamGroup',

122
src/views/wms/basicDataManage/orderManage/team/teamForm.vue

@ -33,8 +33,11 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-switch v-model="formData.available" active-value="TRUE" inactive-value="FALSE" />
<el-form-item label="负责人" prop="teamMonitorName">
<div class="input-with-button">
<el-input v-model="formData.teamMonitorName" placeholder="请选择负责人" disabled :style="{ width: '35%' }"/>
<el-button :icon="Search" @click="addMonitor"/>
</div>
</el-form-item>
</el-col>
</el-row>
@ -105,9 +108,14 @@
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-col :span="12">
<el-form-item label="是否可用" prop="available">
<el-switch v-model="formData.available" active-value="TRUE" inactive-value="FALSE" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注" prop="remark">
<el-input v-model="formData.remark" placeholder="请输入内容" type="textarea" />
<el-input v-model="formData.remark" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
@ -166,7 +174,9 @@ const formData = ref({
workshopCode:'',
workshopName:'',
productionLineCode:'',
productionLineName:''
productionLineName:'',
teamMonitorCode:'',
teamMonitorName:''
})
const formRules = reactive({
code: [
@ -184,6 +194,7 @@ const formRules = reactive({
teamGroup: [{ required: true, message: '班组类别不能为空', trigger: 'change' }],
workshopCode: [{ required: true, message: '请选择车间代码', trigger: 'blur' },],
productionLineCode: [{ required: true, message: '请选择产线代码', trigger: 'blur' },],
teamMonitorName: [{ required: true, message: '请选择负责人', trigger: 'blur' },],
})
const basicFormRef = ref() // Ref
const handleClose = (username: string) => {
@ -203,10 +214,19 @@ const _searchField = ref();
const _multiple = ref();
const _type = ref();
const _row = ref();
const _searchCondition = ref({})
/** 选择班组成员弹窗 */
const addUser = () => {
const _searchCondition = {}
const addMonitor = () =>{
addUserCommon(false,'monitor')
}
const addUser = () =>{
addUserCommon(true,'username')
}
/** 选择人员弹窗 */
const addUserCommon = (multiple,field) => {
_searchCondition.value = {}
const filters: any[] = []
filters.push({
action: "==",
@ -214,31 +234,20 @@ const addUser = () => {
value: 'WORKER'
})
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
_searchTableTitle.value = '选择员'
_multiple.value = true
_formField.value = 'username'
_searchField.value = 'username'
_searchCondition.value.isSearch = true
_searchCondition.value.filters = filters
_searchTableTitle.value = '选择员'
_multiple.value = multiple
_formField.value = field
_searchField.value = field
_searchTablePage.value = UserApi.getUserPage
_searchTableAllSchemas.value = searchUser.allSchemas
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type,
_row,
_searchCondition
)
openCommon()
}
/** 选择车间弹窗 */
const addWorkShop = () => {
const _searchCondition = {}
_searchCondition.value = {}
const filters: any[] = []
filters.push({
action: "==",
@ -246,26 +255,15 @@ const addWorkShop = () => {
value: 'TRUE'
})
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
_searchCondition.value.isSearch = true
_searchCondition.value.filters = filters
_searchTableTitle.value = '选择车间'
_multiple.value = false
_formField.value = 'workshop'
_searchField.value = 'workshop'
_searchTablePage.value = WorkshopApi.getWorkshopPage
_searchTableAllSchemas.value = Workshop.allSchemas
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type,
_row,
_searchCondition
)
openCommon()
}
/** 选择产线弹窗 */
@ -274,7 +272,7 @@ const addProductionLine = () => {
message.warning('请先选择车间代码');
return
}
const _searchCondition = {}
_searchCondition.value = {}
const filters: any[] = []
filters.push({
action: "==",
@ -286,26 +284,15 @@ const addProductionLine = () => {
value: formData.value.workshopCode
})
//
_searchCondition.isSearch = true
_searchCondition.filters = filters
_searchCondition.value.isSearch = true
_searchCondition.value.filters = filters
_searchTableTitle.value = '选择产线'
_multiple.value = false
_formField.value = 'productionLine'
_searchField.value = 'productionLine'
_searchTablePage.value = ProductionlineApi.getProductionlinePage
_searchTableAllSchemas.value = Productionline.allSchemas
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type,
_row,
_searchCondition
)
openCommon()
}
/** 弹窗选择之后 回调函数 */
@ -323,6 +310,10 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
formData.value.productionLineCode = val[0].code
formData.value.productionLineName = val[0].name
}
else if (formField === 'monitor'){
formData.value.teamMonitorCode = val[0].username
formData.value.teamMonitorName = val[0].nickname
}
else {
val.forEach(item => {
const isExist = tags.value.some(tag => tag.username === item.username);
@ -338,7 +329,20 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
}
})
}
/*打开弹窗*/
const openCommon = () => {
searchTableRef.value.open(
_searchTableTitle.value,
_searchTableAllSchemas.value,
_searchTablePage.value,
_formField.value,
_searchField.value,
_multiple.value,
_type.value,
_row.value,
_searchCondition.value
)
}
/** 初始化弹窗 */
const open = async (type: string, row?: object) => {
dialogVisible.value = true
@ -409,7 +413,9 @@ const resetForm = () => {
workshopCode:'',
workshopName:'',
productionLineCode:'',
productionLineName:''
productionLineName:'',
teamMonitorCode:'',
teamMonitorName:''
}
basicFormRef.value?.resetFields()
}

Loading…
Cancel
Save