Browse Source

缺陷修复

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

3
src/utils/disposition/tabsList.ts

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

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

@ -67,6 +67,7 @@
:detailAllSchemas="detailAllSchemas" :detailAllSchemas="detailAllSchemas"
:apiPage="apiPage" :apiPage="apiPage"
:tabsExtend="tabsExtend" :tabsExtend="tabsExtend"
:tabName="tabName"
:tableObjectExtend="tableObjectExtend" :tableObjectExtend="tableObjectExtend"
:getImageApi="uploadApi.getImage" :getImageApi="uploadApi.getImage"
:uploadImage="uploadApi.uploadImage" :uploadImage="uploadApi.uploadImage"
@ -331,21 +332,25 @@ const searchFormClick = (searchData) => {
const DeviceLedgerSubTabsList = getStrDictOptions(DICT_TYPE.DEVICE_DOC_TYPE) const DeviceLedgerSubTabsList = getStrDictOptions(DICT_TYPE.DEVICE_DOC_TYPE)
const tabsExtend = ref() const tabsExtend = ref()
const tabName = ref()
const funcCode = ref('device_mould_picture') const funcCode = ref('device_mould_picture')
// tabs // tabs
const changeTabs = (item) => { const changeTabs = (item) => {
if (item.prop == 'Image') { if (item.prop == 'Image') {
tabsExtend.value = 1 tabsExtend.value = 1
tabName.value = item.label
funcCode.value = 'device_mould_picture' funcCode.value = 'device_mould_picture'
// apiPage.value = CustomeritemApi.getCustomeritemPage // apiPage.value = CustomeritemApi.getCustomeritemPage
// detailAllSchemas.value = Customeritem.allSchemas // detailAllSchemas.value = Customeritem.allSchemas
} else if (item.prop == 'Word') { } else if (item.prop == 'Word') {
tabsExtend.value = 2 tabsExtend.value = 2
tabName.value = item.label
funcCode.value = 'device_mould_attachment' funcCode.value = 'device_mould_attachment'
// apiPage.value = PurchaseDetailApi.getPurchaseDetailPage // apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
// detailAllSchemas.value = PurchaseMain.allSchemas // detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') { } else if (item.prop == 'Part') {
tabsExtend.value = 4 tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -353,6 +358,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = DeviceItem.allSchemas detailAllSchemas.value = DeviceItem.allSchemas
} else if (item.prop == 'DeviceReportRecord') { } else if (item.prop == 'DeviceReportRecord') {
tabsExtend.value = 4 tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -360,6 +366,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = DeviceRepair.allSchemas detailAllSchemas.value = DeviceRepair.allSchemas
} else if (item.prop == 'RepairRecord') { } else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -369,6 +376,7 @@ const changeTabs = (item) => {
dialogAllSchemas.value = DeviceMaintenanceDetail.allSchemas dialogAllSchemas.value = DeviceMaintenanceDetail.allSchemas
} else if (item.prop == 'MaintenanceRecord') { } else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -426,7 +434,7 @@ const openItem = async (number: String) => {
searchTableRef.value.open( searchTableRef.value.open(
'选择备件', '选择备件',
Item.allSchemas, Item.allSchemas,
getDeviceItemList, ItemApi.getItemPage,
null, null,
Item.allSchemas.searchSchema, Item.allSchemas.searchSchema,
true, true,
@ -448,45 +456,6 @@ const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, row
console.log('deviceItemRelList', deviceItemRelList) 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 getDeviceItemBindData = async (params) => {
const response = await getDeviceItemPage(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: '维修状态', label: '维修状态',
field: 'result', field: 'result',

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

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

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

@ -67,6 +67,7 @@
:detailAllSchemas="detailAllSchemas" :detailAllSchemas="detailAllSchemas"
:apiPage="apiPage" :apiPage="apiPage"
:tabsExtend="tabsExtend" :tabsExtend="tabsExtend"
:tabName="tabName"
:tableObjectExtend="tableObjectExtend" :tableObjectExtend="tableObjectExtend"
:getImageApi="uploadApi.getImage" :getImageApi="uploadApi.getImage"
:uploadImage="uploadApi.uploadImage" :uploadImage="uploadApi.uploadImage"
@ -150,7 +151,7 @@ const dialogAllSchemas = ref()
const dialogAllSchemasRules = ref() const dialogAllSchemasRules = ref()
const milestone = ref("milestone") const milestone = ref("milestone")
const BASE_URL = import.meta.env.VITE_JMREPORT_BASE_URL 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) => { const searchTableSuccess = (formField, searchField, val, formRef) => {
@ -330,21 +331,25 @@ const searchFormClick = (searchData) => {
const MoldLedgerSubTabsList = getStrDictOptions(DICT_TYPE.MOLD_DOC_TYPE) const MoldLedgerSubTabsList = getStrDictOptions(DICT_TYPE.MOLD_DOC_TYPE)
const tabsExtend = ref() const tabsExtend = ref()
const tabName = ref()
const funcCode = ref('mold_mould_picture') const funcCode = ref('mold_mould_picture')
// tabs // tabs
const changeTabs = (item) => { const changeTabs = (item) => {
if (item.prop == 'Image') { if (item.prop == 'Image') {
tabsExtend.value = 1 tabsExtend.value = 1
tabName.value = item.label
funcCode.value = 'mold_mould_picture' funcCode.value = 'mold_mould_picture'
// apiPage.value = CustomeritemApi.getCustomeritemPage // apiPage.value = CustomeritemApi.getCustomeritemPage
// detailAllSchemas.value = Customeritem.allSchemas // detailAllSchemas.value = Customeritem.allSchemas
} else if (item.prop == 'Word') { } else if (item.prop == 'Word') {
tabsExtend.value = 2 tabsExtend.value = 2
tabName.value = item.label
funcCode.value = 'mold_mould_attachment' funcCode.value = 'mold_mould_attachment'
// apiPage.value = PurchaseDetailApi.getPurchaseDetailPage // apiPage.value = PurchaseDetailApi.getPurchaseDetailPage
// detailAllSchemas.value = PurchaseMain.allSchemas // detailAllSchemas.value = PurchaseMain.allSchemas
} else if (item.prop == 'Part') { } else if (item.prop == 'Part') {
tabsExtend.value = 4 tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -352,6 +357,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = DeviceItem.allSchemas detailAllSchemas.value = DeviceItem.allSchemas
} else if (item.prop == 'MoldReportRecord') { } else if (item.prop == 'MoldReportRecord') {
tabsExtend.value = 4 tabsExtend.value = 4
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -359,6 +365,7 @@ const changeTabs = (item) => {
detailAllSchemas.value = MoldRepair.allSchemas detailAllSchemas.value = MoldRepair.allSchemas
} else if (item.prop == 'RepairRecord') { } else if (item.prop == 'RepairRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -368,6 +375,7 @@ const changeTabs = (item) => {
dialogAllSchemas.value = MoldMaintenanceDetail.allSchemas dialogAllSchemas.value = MoldMaintenanceDetail.allSchemas
} else if (item.prop == 'MaintenanceRecord') { } else if (item.prop == 'MaintenanceRecord') {
tabsExtend.value = 3 tabsExtend.value = 3
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
deviceNumber: itemCodeRow deviceNumber: itemCodeRow
} }
@ -377,6 +385,7 @@ const changeTabs = (item) => {
dialogAllSchemas.value = MoldMaintainOrderDetail.allSchemas dialogAllSchemas.value = MoldMaintainOrderDetail.allSchemas
} else if (item.prop == 'Milestone') { } else if (item.prop == 'Milestone') {
tabsExtend.value = 5 tabsExtend.value = 5
tabName.value = item.label
defaultParams.value = { defaultParams.value = {
moldNumber: itemCodeRow moldNumber: itemCodeRow
} }
@ -429,7 +438,7 @@ const openItem = async (number: String) => {
searchTableRef.value.open( searchTableRef.value.open(
'选择备件', '选择备件',
Item.allSchemas, Item.allSchemas,
getDeviceItemList, ItemApi.getItemPage,
null, null,
Item.allSchemas.searchSchema, Item.allSchemas.searchSchema,
true, true,
@ -451,47 +460,6 @@ const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, row
console.log('deviceItemRelList', deviceItemRelList) 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 qrCodeBatch = async (val,item) => {
const qrCodeList = tableObject.tableList.map(item => `'${item?.number}'`).join(', ') const qrCodeList = tableObject.tableList.map(item => `'${item?.number}'`).join(', ')
window.open(src.value + "&number=" + qrCodeList) 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: '维修状态', label: '维修状态',
field: 'result', field: 'result',

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

@ -83,6 +83,8 @@
:detailValidate="detailValidate" :detailValidate="detailValidate"
@detailSubmitForm="detailSubmitForm" @detailSubmitForm="detailSubmitForm"
:isSearchTableItem="true" :isSearchTableItem="true"
:buttonControllFunction="buttonControllFunction"
@detailOnChange="detailOnChange"
/> />
<!-- 导入 --> <!-- 导入 -->
@ -226,7 +228,8 @@ const butttondata = (row) => {
hide: !( hide: !(
row.status == 'PENDING' && row.status == 'PENDING' &&
(userStore?.userSelfInfo?.posts?.some((item) => item.code == 'engineer') || (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({ // 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 () => { onMounted(async () => {
getList() getList()

Loading…
Cancel
Save