Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
2475b5ace1
  1. 8
      src/api/eam/item/itemApplyMain/index.ts
  2. 13
      src/utils/disposition/defaultButtons.ts
  3. 98
      src/views/eam/item/applicationRecord/applicationRecordMain.data.ts
  4. 9
      src/views/eam/item/applicationRecord/index.vue
  5. 28
      src/views/eam/item/itemApplyMain/index.vue
  6. 80
      src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

8
src/api/eam/item/itemApplyMain/index.ts

@ -46,6 +46,12 @@ export const deleteItemApplyMain = async (id: number) => {
return await request.delete({ url: `/eam/item-apply-main/delete?id=` + id }) return await request.delete({ url: `/eam/item-apply-main/delete?id=` + id })
} }
// 撤销备件申领记录主
export const backoutItemApplyMain = async (id: number) => {
return await request.get({ url: `/eam/item-apply-main/backout?id=` + id })
}
// 导出备件申领记录主 Excel // 导出备件申领记录主 Excel
export const exportItemApplyMain = async (params) => { export const exportItemApplyMain = async (params) => {
return await request.download({ url: `/eam/item-apply-main/export-excel`, params }) return await request.download({ url: `/eam/item-apply-main/export-excel`, params })
@ -54,4 +60,4 @@ export const exportItemApplyMain = async (params) => {
// 下载用户导入模板 // 下载用户导入模板
export const importTemplate = () => { export const importTemplate = () => {
return request.download({ url: '/eam/item-apply-main/get-import-template' }) return request.download({ url: '/eam/item-apply-main/get-import-template' })
} }

13
src/utils/disposition/defaultButtons.ts

@ -801,6 +801,19 @@ export function backoutBtn(option:any) {
}) })
} }
// 主列表-撤销
export function approveBtn(option:any) {
return __defaultBtnOption(option,{
label: '审批',
name: 'approve',
hide: false,
type: 'danger',
color: '',
link: true, // 文本展现按钮
hasPermi: ''
})
}
// 主列表-接单 // 主列表-接单
export function acceptOrderBtn(option:any) { export function acceptOrderBtn(option:any) {
return __defaultBtnOption(option,{ return __defaultBtnOption(option,{

98
src/views/eam/item/applicationRecord/applicationRecordMain.data.ts

@ -1,7 +1,8 @@
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 { Item } from '@/views/eam/basic/item/item.data' import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator' import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
@ -47,28 +48,19 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom', sort: 'custom',
}, },
{ {
label: '是否可用', label: '状态',
field: 'available', field: 'status',
dictType: DICT_TYPE.TRUE_FALSE, sort: 'custom',
dictType: DICT_TYPE.ITEM_APPLY_STATUS,
dictClass: 'string', dictClass: 'string',
isSearch: false, isSearch: true,
isTable: true, isTable: true,
sort: 'custom',
table: { table: {
width: 150 width: 150
}, },
tableForm: { tableForm: {
type: 'Select', type: 'Select',
inactiveValue: 'FALSE',
disabled: true disabled: true
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
} }
}, },
{ {
@ -96,6 +88,30 @@ export const ApplicationRecordMainRules = reactive({
], ],
}) })
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
]))
/** /**
* @returns {Array} * @returns {Array}
*/ */
@ -110,8 +126,8 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择备件编号', searchListPlaceholder: '请选择备件编号',
searchField: 'number', searchField: 'number',
searchTitle: '库区信息', searchTitle: '库区信息',
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
@ -121,7 +137,49 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '数量', label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
},
{
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择单号',
searchField: 'number',
searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "type",
isMainValue: true
}
]
},
},
{
label: '申领数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
@ -160,6 +218,8 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 6 precision: 6
} }
}, },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',

9
src/views/eam/item/applicationRecord/index.vue

@ -163,8 +163,9 @@
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListEditBtn(null), // defaultButtons.approveBtn({ hide: isShowMainButton(row, ['0']) }), //
defaultButtons.mainListDeleteBtn(null), // // defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
] ]
} }
@ -172,6 +173,8 @@
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
}else if (val == 'approve') { //
// handleDelete(row.id)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }
@ -287,4 +290,4 @@
getList() getList()
importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate() importTemplateData.templateUrl = await ApplicationRecordMainApi.importTemplate()
}) })
</script> </script>

28
src/views/eam/item/itemApplyMain/index.vue

@ -75,8 +75,9 @@
if (type == 'tableForm') { if (type == 'tableForm') {
// //
row[formField] = val[0][searchField] row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number'] row['itemNumber'] = val[0]['itemNumber']
row['isRadeIn'] = val[0]['isRadeIn'] row['isRadeIn'] = val[0]['isRadeIn']
row['currentQty'] = val[0]['qty']
row['available'] = val[0]['available'] row['available'] = val[0]['available']
} else { } else {
const setV = {} const setV = {}
@ -158,9 +159,9 @@
// - // -
const butttondata = (row) => { const butttondata = (row) => {
return [ return [
defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['0']) }), // defaultButtons.backoutBtn({ hide: isShowMainButton(row, ['0']) }), //
defaultButtons.mainListEditBtn(null), // // defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), // // defaultButtons.mainListDeleteBtn(null), //
] ]
} }
@ -168,11 +169,28 @@
const buttonTableClick = async (val, row) => { const buttonTableClick = async (val, row) => {
if (val == 'edit') { // if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // }
else if (val == 'backout') { //
backout(row.id)
}
else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }
} }
/** 撤销按钮操作 */
const backout = async (id : number) => {
try {
//
await message.confirm('是否撤销所选中数据?')
//
await ItemApplyMainApi.backoutItemApplyMain(id)
message.success(t('撤销成功!'))
//
await getList()
} catch { }
}
/** 添加/修改操作 */ /** 添加/修改操作 */
const formRef = ref() const formRef = ref()
const openForm = async (type : string, row ?: number) => { const openForm = async (type : string, row ?: number) => {

80
src/views/eam/item/itemApplyMain/itemApplyMain.data.ts

@ -1,7 +1,8 @@
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 { Item } from '@/views/eam/basic/item/item.data' import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemApi from '@/api/eam/basic/item' import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator' import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化 const { t } = useI18n() // 国际化
@ -87,6 +88,31 @@ export const ItemApplyMainRules = reactive({
], ],
}) })
export const DeviceMOLD = useCrudSchemas(reactive<CrudSchema[]>([
{
label: '编号',
field: 'number',
sort: 'custom',
isForm: false,
table: {
width: 180,
fixed: 'left'
},
},
{
label: '名称',
field: 'name',
sort: 'custom',
},
{
label: '规格型号',
field: 'specification',
sort: 'custom',
},
]))
/** /**
* @returns {Array} * @returns {Array}
*/ */
@ -101,8 +127,8 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择备件编号', searchListPlaceholder: '请选择备件编号',
searchField: 'number', searchField: 'number',
searchTitle: '库区信息', searchTitle: '库区信息',
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类 searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法 searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{ searchCondition: [{
key: 'available', key: 'available',
value: 'TRUE', value: 'TRUE',
@ -112,7 +138,49 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
}, },
}, },
{ {
label: '数量', label: '类型',
field: 'type',
sort: 'custom',
dictType: DICT_TYPE.DEVICE_MOLD_TYPE,
dictClass: 'string',
isSearch: true,
isTable: true,
table: {
width: 150
},
tableForm: {
type: 'Select',
disabled: false
}
},
{
label: '设备/模具编号',
field: 'deviceNumber',
sort: 'custom',
isSearch: true,
tableForm: {
isInpuFocusShow: true,
searchListPlaceholder: '请选择单号',
searchField: 'number',
searchTitle: '单号信息',
searchAllSchemas: DeviceMOLD.allSchemas, // 查询弹窗所需类
searchPage: DeviceMoldItemsApi.getNumber, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
value: "TRUE",
isMainValue: false
}, {
key: 'type',
value: "type",
isMainValue: true
}
]
},
},
{
label: '申领数量',
field: 'qty', field: 'qty',
sort: 'custom', sort: 'custom',
table: { table: {
@ -151,6 +219,8 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 6 precision: 6
} }
}, },
{ {
label: '是否可用', label: '是否可用',
field: 'available', field: 'available',

Loading…
Cancel
Save