Browse Source

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

master_hella_20240701
yufei0306 5 months ago
parent
commit
d9ec831250
  1. 5
      src/api/eam/equipmentMaintenanceMain/index.ts
  2. 11
      src/api/eam/equipmentRepairJobMain/index.ts
  3. 9
      src/views/eam/equipmentMaintenanceMain/finishForm2.vue
  4. 2
      src/views/eam/equipmentMaintenanceMain/index.vue
  5. 15
      src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts
  6. 262
      src/views/eam/equipmentRepairJobMain/finishForm2.vue
  7. 67
      src/views/eam/equipmentRepairJobMain/index.vue
  8. 25
      src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue
  9. 22
      src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue
  10. 6
      src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/inventorychangeRequestMain.data.ts

5
src/api/eam/equipmentMaintenanceMain/index.ts

@ -70,6 +70,11 @@ export const updateEquipmentMaintenanceMain = async (data: EquipmentMaintenanceM
return await request.put({ url: `/eam/equipment-maintenance-main/update`, data })
}
// 修改设备保养工单主
export const updateEquipmentMaintenance = async (data: EquipmentMaintenanceMainVO) => {
return await request.post({ url: `/eam/equipment-maintenance-main/updateOrders`, data })
}
// 删除设备保养工单主
export const deleteEquipmentMaintenanceMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-maintenance-main/delete?id=` + id })

11
src/api/eam/equipmentRepairJobMain/index.ts

@ -1,5 +1,4 @@
import request from '@/config/axios'
import {EquipmentReportRepairRequestVO} from "@/api/eam/equipmentReportRepairRequest";
export interface EquipmentRepairJobMainVO {
id: number
@ -72,6 +71,16 @@ export const updateEquipmentRepairJobMain = async (data: EquipmentRepairJobMainV
return await request.put({ url: `/eam/equipment-repair-job-main/update`, data })
}
// 修改维修工单主
export const updateEquipmentRepairMain = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/updateRepair`, data })
}
// 完成维修工单主
export const executeEquipmentRepairJobMain = async (data: EquipmentRepairJobMainVO) => {
return await request.post({ url: `/eam/equipment-repair-job-main/execute`, data })
}
// 删除维修工单主
export const deleteEquipmentRepairJobMain = async (id: number) => {
return await request.delete({ url: `/eam/equipment-repair-job-main/delete?id=` + id })

9
src/views/eam/equipmentMaintenanceMain/finishForm2.vue

@ -50,6 +50,7 @@
import * as EquipmentMaintenanceMainApi from '@/api/eam/equipmentMaintenanceMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import {updateEquipmentMaintenance} from "@/api/eam/equipmentMaintenanceMain";
defineOptions({ name: 'TeamForm' })
@ -168,15 +169,17 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
/** 提交表单 */
const submitForm = async (val) => {
//success
emit('success',formData.value.id)
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentMaintenanceMainApi.updateEquipmentMaintenanceMain(formData.value)
await EquipmentMaintenanceMainApi.updateEquipmentMaintenance(formData.value);
//success
emit('success',formData.value.id)
dialogVisible.value = false
}

2
src/views/eam/equipmentMaintenanceMain/index.vue

@ -547,7 +547,7 @@ const getData2=(val)=> {
params.value.status = '5'
//
await EquipmentMaintenanceMainApi.executeMaintenanceOrder(params.value)
message.success(t('工单已完成'))
//message.success(t(''))
//
await getList()
})

15
src/views/eam/equipmentRepairJobMain/equipmentRepairJobMain.data.ts

@ -245,6 +245,9 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
formatter: dateFormatter,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
search: {
component: 'DatePicker',
componentProps: {
@ -481,7 +484,10 @@ export const EquipmentRepairJobMain = useCrudSchemas(reactive<CrudSchema[]>([
export const EquipmentRepairJobDetailRules = reactive({
number: [required],
masterId: [required],
concurrencyStamp: [required],
describing:[required],
faultCause:[required],
workOut:[required],
maintenances:[required],
})
export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
@ -552,7 +558,7 @@ export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
isSearch: true,
},
{
label: '维修人员字符串多个',
label: '维修人员',
field: 'maintenances',
sort: 'custom',
isSearch: true,
@ -589,7 +595,10 @@ export const EquipmentRepairJobDetail = useCrudSchemas(reactive<CrudSchema[]>([
label: '备注',
field: 'remark',
sort: 'custom',
isSearch: true,
isSearch: false,
isTable: false,
isForm: false,
isDetail:false,
},
{
label: '地点ID',

262
src/views/eam/equipmentRepairJobMain/finishForm2.vue

@ -0,0 +1,262 @@
<template>
<Dialog v-model="dialogVisible" :title="dialogTitle" :close-on-click-modal="false">
<el-form ref="basicFormRef" v-loading="formLoading" :model="formData" :rules="formRules" label-width="100px">
<el-row>
<el-col :span="12">
<el-form-item label="维修描述" prop="maintenanceDesc">
<el-input v-model="formData.maintenanceDesc" placeholder="请输入维修描述" :disabled="isDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修级别" prop="level">
<el-select v-model="formData.level" placeholder="请选择维修级别" style="width: 150px">
<el-option label="大修" value="0"></el-option>
<el-option label="中修" value="1"></el-option>
<el-option label="小修" value="2"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="维修开始时间" prop="startTime">
<el-date-picker
v-model="formData.startTime"
type="datetime"
value-format="x"
placeholder="选择维修开始时间">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修结束时间" prop="endTime">
<el-date-picker
v-model="formData.endTime"
type="datetime"
value-format="x"
placeholder="选择维修结束时间">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="执行人" prop="maintenancer">
<el-input v-model="formData.maintenancer" placeholder="请输入执行人"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="维修人电话" prop="maintenancePhone">
<el-input v-model="formData.maintenancePhone" placeholder="请输入维修人电话" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="结果" prop="completeResult">
<el-select v-model="formData.completeResult" placeholder="请选择结果" style="width: 150px">
<el-option label="完成" value="0"></el-option>
<el-option label="临时措施" value="1"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button :disabled="formLoading" type="primary" @click="submitForm('success')"> </el-button>
<el-button @click="handleClose('close')"> </el-button>
</template>
</Dialog>
<!--添加巡检项弹窗-->
<SearchTable ref="searchTableRef" @searchTableSuccess="searchTableSuccess" />
</template>
<script lang="ts" setup>
import * as EquipmentRepairJobMainApi from '@/api/eam/equipmentRepairJobMain'
import { SearchTable } from '@/components/SearchTable'
import {ElInput} from "element-plus";
import {updateEquipmentRepairMain} from "@/api/eam/equipmentRepairJobMain";
defineOptions({ name: 'TeamForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const tags=ref([])
const inputValue = ref('')
const inputVisible = ref(false)
const isDisabled = ref(false)
const InputRef = ref<InstanceType<typeof ElInput>>()
const formData = ref({
id:'',
number:'',
maintenanceDesc: '',
level: '',
startTime:'',
endTime:'',
maintenancer:'',
maintenancePhone:'',
completeResult:'',
})
const formRules = reactive({
maintenanceDesc: [
{ required: true, message: '维修描述不能为空', trigger: 'blur' },
],
level: [
{ required: true, message: '维修等级不能为空', trigger: 'blur' },
],
startTime: [
{ required: true, message: '开始时间不能为空', trigger: 'blur' },
],
endTime: [
{ required: true, message: '结束时间不能为空', trigger: 'blur' },
],
maintenancer: [
{ required: true, message: '维修人ID不能为空', trigger: 'blur' },
],
maintenancePhone: [
{ required: true, message: '维修人电话不能为空', trigger: 'blur' },
],
completeResult: [
{ required: true, message: '结果不能为空', trigger: 'blur' },
],
})
const basicFormRef = ref() // Ref
// /** */
// const searchTableRef = ref();
// const _searchTableTitle = ref();
// const _searchTableAllSchemas = ref();
// const _searchTablePage = ref();
// const _formField = ref();
// const _searchField = ref();
// const _multiple = ref();
// const _type = ref();
// const _row = ref();
// const _searchCondition = ref({})
//
//
// const addItem = () =>{
// addItemCommon(true,'xunJianItem')
// }
//
// /** */
// const addItemCommon = (multiple,field) => {
// _searchCondition.value = {}
// const filters: any[] = []
// filters.push({
// action: "==",
// column: 'available',
// value: 'TRUE'
// })
// //
// _searchCondition.value.isSearch = true
// _searchCondition.value.filters = filters
// _searchTableTitle.value = ''
// _multiple.value = multiple
// _formField.value = field
// _searchField.value = field
// _searchTablePage.value = inspectionItemApi.getInspectionItemPage
// _searchTableAllSchemas.value = InspectionItem.allSchemas
// openCommon()
// }
//
// /** */
// const searchTableSuccess = (formField, searchField, val, formRef, type, row ) => {
// nextTick?.(() => {
// if (formField === 'xunJianItem') {
// val.forEach(item => {
// const isExist = tags.value.some(tag => tag.content === item.content);
// if (!isExist){
// const newItem = {};
// newItem['content'] = item.content;
// newItem['id'] = item.id;
// tags.value.push(newItem);
// }
// });
// }
// })
// }
// /**/
// 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
dialogTitle.value = t('action.' + type)
formType.value = type
//
formData.value.id = row.id
formData.value.number = row.number
}
defineExpose({ open }) // open
/** 提交表单 */
const submitForm = async (val) => {
//
if (!basicFormRef) return
const valid = await basicFormRef.value.validate()
if (!valid) return
//
await EquipmentRepairJobMainApi.updateEquipmentRepairMain(formData.value);
//success
emit('success',formData.value.id)
dialogVisible.value = false
}
const handleClose=(val)=>{
dialogVisible.value = false
emit('close',val)
}
//
const emit = defineEmits(['close','success'])
</script>
<style scoped>
.tag-container {
margin-top: 10px; /* 可根据需要调整标签容器与表单项之间的间距 */
border: 1px solid #ccc; /* 添加边框样式 */
padding: 10px; /* 可根据需要调整容器内边距 */
width: 950px; /* 设置固定宽度为 950px */
overflow-y: auto; /* 当内容溢出容器高度时显示滚动条 */
word-wrap: break-word; /* 使用 word-wrap 属性实现超出范围换行 */
overflow-wrap: break-word; /* 兼容性更好的写法 */
flex-wrap: wrap;
}
.input-with-button {
display: flex;
align-items: center;
width: 100%;
}
.input-with-button > .el-input {
flex: 1;
/*margin-right: 10px;*/
}
</style>

67
src/views/eam/equipmentRepairJobMain/index.vue

@ -50,6 +50,8 @@
:isBusiness="false"
/>
<FinishForm2 ref="finishForm2Ref" @success="getData2" @close="getClosed2"/>
<!-- 详情 -->
<Detail ref="detailRef"
:isBasic="false"
@ -63,6 +65,9 @@
:detailButtonIsShowAdd=statusBtn
:detailButtonIsShowEdit=statusBtn
:detailButtonIsShowDelete=statusBtn
@handleMainFefresh="handleMainFefresh"
@searchTableSuccessDetail="searchTableSuccessDetail"
:key="count"
/>
<!-- 导入 -->
@ -78,6 +83,7 @@ import * as defaultButtons from '@/utils/disposition/defaultButtons'
import TableHead from '@/components/TableHead/src/TableHead.vue'
import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
import Detail from '@/views/eam/equipmentRepairJobMain/EquipmentRepairJobDetail.vue'
import FinishForm2 from '@/views/eam/equipmentRepairJobMain/finishForm2.vue'
defineOptions({ name: 'EquipmentRepairJobMain' })
@ -174,6 +180,8 @@ const buttonTableClick = async (val, row) => {
handleReceive(row.id)
} else if (val == 'execute') { //
handleExecute(row.id)
} else if (val == 'finish') { //
handleFinish(row)
}
@ -220,6 +228,39 @@ const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicEquipmentRepairJobMain')
}
/** 页面操作 */
let count = ref(0)
const handleMainFefresh = async()=>{
count.value++
getList()
}
//
const searchTableSuccessDetail = (formField, searchField, val, formRef ) => {
nextTick(() => {
const setV = {}
let result = '';
for (var i = 0; i < val.length; i++) {
result += val[i].code + ',';
}
if(result.endsWith(',')){
result = result.substring(0,result.length -1)
}
setV[formField] = result;
formRef.setValues(setV)
})
}
/** 完成按钮操作 */
const finishForm2Ref = ref()
const handleFinish = async (row) => {
//
await message.delConfirm('是否完成所选中工单?');
//
finishForm2Ref.value.open('update', row);
}
/** 接单按钮操作 */
const handleReceive = async (id: number) => {
try {
@ -271,6 +312,32 @@ const handleDelete = async (id: number) => {
} catch {}
}
//finishForm2
const getClosed2=(val)=> {
nextTick?.(() => {
getList()
})
}
//finishForm2
const getData2=(val)=> {
nextTick?.(async () => {
const params = ref({
id: '',
status: '',
})
params.value.id = val
params.value.status = '5'
//
await EquipmentRepairJobMainApi.executeEquipmentRepairJobMain(params.value)
message.success(t('工单已完成'))
//
await getList()
})
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {

25
src/views/wms/issueManage/productionreturn/productionreturnRequestMain/index.vue

@ -89,7 +89,7 @@
@searchTableSuccess="searchTableSuccess"
@submitForm="submitFormLabel"
/>
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/wms/productionreturn-request-main/import" :importTemplateData="importTemplateData"
@success="importSuccess" :updateIsDisable="true" :coverIsDisable="true" :mode="2" />
@ -123,7 +123,7 @@ const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns
const detailListTableColumns = ProductionreturnRequestDetailLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const labelType = ref('') //
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailApi.getProductionreturnRequestDetailPage
})
@ -199,7 +199,7 @@ const searchTableSuccess = (formField, searchField, val, formRef, type, row ) =>
} else {
row['batch'] = '000000'
}
// tableform
// tableform
// TODO: tableFormColumns 10 20 20
ProductionreturnRequestDetail.allSchemas.tableFormColumns.map(item => {
if(item.field == 'qty' && val[0]['qty'] > 0) {
@ -278,7 +278,7 @@ const HeadButttondata = [
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
@ -492,7 +492,7 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
@ -750,10 +750,19 @@ const labelPrint = async (row) => {
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
tableObject.params.isSearch = true
if(!searchData.filters){//
searchData.filters = []
}
let filters = [...searchData.filters]
if(!filters.find(item=>item.column=='business_type')) {
filters = [...filters,{
action:'==',
column:'business_type',
value:'ReturnToStore',
}]
}
tableObject.params.filters = filters
getList() //
}

22
src/views/wms/issueManage/productionreturn/productionreturnRequestMainNo/index.vue

@ -120,7 +120,7 @@ const tableColumns = ref([...ProductionreturnRequestMain.allSchemas.tableColumns
const detailListTableColumns = ProductionreturnRequestDetailNoLabel.allSchemas
const isCreateLabel = ref(false)
const formLabelRef = ref()
const labelType = ref('') //
const labelType = ref('') //
const { tableObject: detatableData, tableMethods: detatableMethods } =useTable({
getListApi: ProductionreturnRequestDetailNoApi.getProductionreturnRequestDetailPage
})
@ -254,7 +254,7 @@ const HeadButttondata = [
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
]
//
@ -468,7 +468,7 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.masterId)
@ -659,13 +659,23 @@ const importFormRef = ref()
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
tableObject.params.isSearch = true
if(!searchData.filters){//
searchData.filters = []
}
let filters = [...searchData.filters]
if(!filters.find(item=>item.column=='business_type')) {
filters = [...filters,{
action:'==',
column:'business_type',
value:'ReturnToHold',
}]
}
tableObject.params.filters = filters
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()

6
src/views/wms/moveManage/inventorychange/inventorychangeRequestMain/inventorychangeRequestMain.data.ts

@ -19,15 +19,19 @@ const queryParams = {
const businessTypeQueryParams = {
pageSize:10,
pageNo:1,
code:'Change'
code:'Change',
name:'库存修改'
}
const data = await getRequestsettingApi.getRequestsettingPage(queryParams)
const requestsettingData =data?.list[0]||{}
const businessTypeValue = await getBusinessTypeApi.getBusinesstypePage(businessTypeQueryParams)
const businessTypeData =businessTypeValue?.list[0]||{}
console.log(businessTypeData.code);
// 获取当前操作人的部门
import { useUserStore } from '@/store/modules/user'
import { TableColumn } from '@/types/table'
import { log } from 'console'
const userStore = useUserStore()
const userDept = userStore.userSelfInfo.dept
// id 转str 否则form回显匹配不到

Loading…
Cancel
Save