Browse Source

缺陷修复

master
ljlong_2630 9 months ago
parent
commit
38b5a3b86d
  1. 6
      src/components/Detail/src/DetailDeviceLedger.vue
  2. 3
      src/utils/disposition/tabsList.ts
  3. 49
      src/views/eam/device/deviceAccounts/index.vue
  4. 18
      src/views/eam/device/deviceRepair/deviceRepair.data.ts
  5. 6
      src/views/eam/device/devicemaintainjob/index.vue
  6. 54
      src/views/eam/mold/moldAccounts/index.vue
  7. 18
      src/views/eam/mold/moldRepair/moldRepair.data.ts
  8. 33
      src/views/eam/mold/moldmaintainjob/index.vue

6
src/components/Detail/src/DetailDeviceLedger.vue

@ -354,6 +354,11 @@ const props = defineProps({
required: false,
default: 1
},
tabName: {
type: String,
required: false,
default: ''
},
// tableObject
tableObjectExtend: {
type: Array,
@ -843,6 +848,7 @@ const openDialog = async(row: any, titleName: any, titleValue: any) => {
defaultParams: getDialogParams(row)
})
dialogVisible.value = true
dialogTitle.value = props.tabName
dialogAllSchemasRef.value = props.dialogAllSchemas
dialogTableObjectRef.value = tableObject
dialogTableMethodsRef.value = tableMethods

3
src/utils/disposition/tabsList.ts

@ -19,7 +19,8 @@ export const DeviceLedgerTabsList = [
{
label: "维修记录",
prop: 'RepairRecord',
},{
},
{
label: "保养记录",
prop: 'MaintenanceRecord',
},

49
src/views/eam/device/deviceAccounts/index.vue

@ -67,6 +67,7 @@
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabName="tabName"
:tableObjectExtend="tableObjectExtend"
:getImageApi="uploadApi.getImage"
:uploadImage="uploadApi.uploadImage"
@ -331,21 +332,25 @@ const searchFormClick = (searchData) => {
const DeviceLedgerSubTabsList = getStrDictOptions(DICT_TYPE.DEVICE_DOC_TYPE)
const tabsExtend = ref()
const tabName = ref()
const funcCode = ref('device_mould_picture')
// tabs
const changeTabs = (item) => {
if (item.prop == 'Image') {
tabsExtend.value = 1
tabName.value = item.label
funcCode.value = 'device_mould_picture'
// apiPage.value = CustomeritemApi.getCustomeritemPage
// detailAllSchemas.value = Customeritem.allSchemas
} else if (item.prop == 'Word') {
tabsExtend.value = 2
tabName.value = item.label
funcCode.value = 'device_mould_attachment'
// apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
// detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -353,6 +358,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = DeviceItem.allSchemas
} else if (item.prop == 'DeviceReportRecord') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -360,6 +366,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -369,6 +376,7 @@ const changeTabs = (item) => {
dialogAllSchemas.value = DeviceMaintenanceDetail.allSchemas
} else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -426,7 +434,7 @@ const openItem = async (number: String) => {
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
getDeviceItemList,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
@ -448,45 +456,6 @@ const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, row
console.log('deviceItemRelList', deviceItemRelList)
}
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(DeviceAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => {
// return !response.list?.some(element => {
// return item.number === element.itemNumber
// });
// });
// console.log('filteredList',filteredList);
const filteredList = res.list
return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
}
}
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
tableObject.loading = true
try {
const res = await getItemWithOutBind()
let result = {
list: res,
total: res.length
}
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
}
}
const getDeviceItemBindData = async (params) => {
const response = await getDeviceItemPage(params);

18
src/views/eam/device/deviceRepair/deviceRepair.data.ts

@ -185,24 +185,6 @@ export const DeviceRepair = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
table: {
width: '150',
},
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '维修状态',
field: 'result',

6
src/views/eam/device/devicemaintainjob/index.vue

@ -498,6 +498,12 @@ onMounted(async () => {
function buttonControllFunction(row, val) {
if (val == 'delete') {
return false
} else if (val == 'edit') {
if (row.status == 'COMPLETED') {
return false
} else {
return true
}
} else {
return true
}

54
src/views/eam/mold/moldAccounts/index.vue

@ -67,6 +67,7 @@
:detailAllSchemas="detailAllSchemas"
:apiPage="apiPage"
:tabsExtend="tabsExtend"
:tabName="tabName"
:tableObjectExtend="tableObjectExtend"
:getImageApi="uploadApi.getImage"
:uploadImage="uploadApi.uploadImage"
@ -150,7 +151,7 @@ const dialogAllSchemas = ref()
const dialogAllSchemasRules = ref()
const milestone = ref("milestone")
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL
const src = ref(BASE_URL + '/jmreport/view/924987924638945280?token=' + getAccessToken())
const src = ref(BASE_URL + '/jmreport/view/928216752216293376?token=' + getAccessToken())
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -330,21 +331,25 @@ const searchFormClick = (searchData) => {
const MoldLedgerSubTabsList = getStrDictOptions(DICT_TYPE.MOLD_DOC_TYPE)
const tabsExtend = ref()
const tabName = ref()
const funcCode = ref('mold_mould_picture')
// tabs
const changeTabs = (item) => {
if (item.prop == 'Image') {
tabsExtend.value = 1
tabName.value = item.label
funcCode.value = 'mold_mould_picture'
// apiPage.value = CustomeritemApi.getCustomeritemPage
// detailAllSchemas.value = Customeritem.allSchemas
} else if (item.prop == 'Word') {
tabsExtend.value = 2
tabName.value = item.label
funcCode.value = 'mold_mould_attachment'
// apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
// detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -352,6 +357,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = DeviceItem.allSchemas
} else if (item.prop == 'MoldReportRecord') {
tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -359,6 +365,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = MoldRepair.allSchemas
} else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -368,6 +375,7 @@ const changeTabs = (item) => {
dialogAllSchemas.value = MoldMaintenanceDetail.allSchemas
} else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = {
deviceNumber: itemCodeRow
}
@ -377,6 +385,7 @@ const changeTabs = (item) => {
dialogAllSchemas.value = MoldMaintainOrderDetail.allSchemas
} else if (item.prop == 'Milestone') {
tabsExtend.value = 5
tabName.value = item.label
defaultParams.value = {
moldNumber: itemCodeRow
}
@ -429,7 +438,7 @@ const openItem = async (number: String) => {
searchTableRef.value.open(
'选择备件',
Item.allSchemas,
getDeviceItemList,
ItemApi.getItemPage,
null,
Item.allSchemas.searchSchema,
true,
@ -451,47 +460,6 @@ const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, row
console.log('deviceItemRelList', deviceItemRelList)
}
const getItemWithOutBind = async () => {
try {
const res = await ItemApi.getItemPage({
...Item.allSchemas.searchSchema
})
if (res.list?.length > 0) {
// const response = await getDeviceItemPage(MoldAccounts.allSchemas.searchSchema);
// const filteredList = res.list.filter(item => {
// return !response.list?.some(element => {
// return item.number === element.itemNumber
// });
// });
// console.log('filteredList',filteredList);
const filteredList = res.list
return filteredList //
}
return [] //
} catch (error) {
console.error(error)
throw error //
}
}
// getListApi getItemWithOutBind
const getDeviceItemList = async () => {
tableObject.loading = true
try {
const res = await getItemWithOutBind()
let result = {
list: res,
total: res.length
}
return result
} catch (error) {
console.error(error)
} finally {
tableObject.loading = false
}
}
const qrCodeBatch = async (val,item) => {
const qrCodeList = tableObject.tableList.map(item => `'${item?.number}'`).join(', ')
window.open(src.value + "&number=" + qrCodeList)

18
src/views/eam/mold/moldRepair/moldRepair.data.ts

@ -148,24 +148,6 @@ export const MoldRepair = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
table: {
width: '150',
},
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
{
label: '维修状态',
field: 'result',

33
src/views/eam/mold/moldmaintainjob/index.vue

@ -83,6 +83,8 @@
:detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true"
:buttonControllFunction="buttonControllFunction"
@detailOnChange="detailOnChange"
/>
<!-- 导入 -->
@ -226,7 +228,8 @@ const butttondata = (row) => {
hide: !(
row.status == 'PENDING' &&
(userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer') ||
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker'))
userStore?.userSelfInfo?.posts?.some((item) => item.code == 'worker')) ||
row.status == 1
)
}), //
// defaultButtons.turnOrderBtn({
@ -485,6 +488,34 @@ const detailSubmitForm= async (formType,data,getList,formRef,tableList) => {
}
}
function buttonControllFunction(row, val) {
if (val == 'delete') {
return false
} else if (val == 'edit') {
if (row.status == 'COMPLETED') {
return false
} else {
return true
}
} else {
return true
}
}
function detailOnChange(field, cur, item) {
if (field == 'status') {
if (cur == '1') {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = false
DeviceMaintainOrderDetailRules.uncompleted = [required]
} else {
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.disabled = true
DeviceMaintainOrderDetail.allSchemas.formSchema.find(item => item.field == 'uncompleted').componentProps.value = ''
delete DeviceMaintainOrderDetailRules.uncompleted;
}
}
}
/** 初始化 **/
onMounted(async () => {
getList()

Loading…
Cancel
Save