Browse Source

BUG修改

master
yejiaxing 10 months ago
parent
commit
2475b5ace1
  1. 6
      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. 7
      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

6
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 })
}
// 撤销备件申领记录主
export const backoutItemApplyMain = async (id: number) => {
return await request.get({ url: `/eam/item-apply-main/backout?id=` + id })
}
// 导出备件申领记录主 Excel
export const exportItemApplyMain = async (params) => {
return await request.download({ url: `/eam/item-apply-main/export-excel`, params })

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) {
return __defaultBtnOption(option,{

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

@ -1,7 +1,8 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator'
const { t } = useI18n() // 国际化
@ -47,28 +48,19 @@ export const ApplicationRecordMain = useCrudSchemas(reactive<CrudSchema[]>([
sort: 'custom',
},
{
label: '是否可用',
field: 'available',
dictType: DICT_TYPE.TRUE_FALSE,
label: '状态',
field: 'status',
sort: 'custom',
dictType: DICT_TYPE.ITEM_APPLY_STATUS,
dictClass: 'string',
isSearch: false,
isSearch: true,
isTable: true,
sort: 'custom',
table: {
width: 150
},
tableForm: {
type: 'Select',
inactiveValue: 'FALSE',
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}
*/
@ -110,8 +126,8 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '库区信息',
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
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',
sort: 'custom',
table: {
@ -160,6 +218,8 @@ export const ApplicationRecordDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 6
}
},
{
label: '是否可用',
field: 'available',

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

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

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

@ -75,8 +75,9 @@
if (type == 'tableForm') {
//
row[formField] = val[0][searchField]
row['itemNumber'] = val[0]['number']
row['itemNumber'] = val[0]['itemNumber']
row['isRadeIn'] = val[0]['isRadeIn']
row['currentQty'] = val[0]['qty']
row['available'] = val[0]['available']
} else {
const setV = {}
@ -158,9 +159,9 @@
// -
const butttondata = (row) => {
return [
defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['0']) }), //
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
defaultButtons.backoutBtn({ hide: isShowMainButton(row, ['0']) }), //
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
}
@ -168,11 +169,28 @@
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
}
else if (val == 'backout') { //
backout(row.id)
}
else if (val == 'delete') { //
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 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 { dateFormatter } from '@/utils/formatTime'
import { Item } from '@/views/eam/basic/item/item.data'
import * as ItemApi from '@/api/eam/basic/item'
import { ItemAccounts } from '@/views/eam/item/itemAccounts/itemAccounts.data'
import * as ItemAccountsApi from '@/api/eam/item/itemAccounts'
import * as DeviceMoldItemsApi from '@/api/eam/basic/deviceMaintenance'
import { validateHanset, validateEmail } from '@/utils/validator'
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}
*/
@ -101,8 +127,8 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
searchListPlaceholder: '请选择备件编号',
searchField: 'number',
searchTitle: '库区信息',
searchAllSchemas: Item.allSchemas, // 查询弹窗所需类
searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法
searchAllSchemas: ItemAccounts.allSchemas, // 查询弹窗所需类
searchPage: ItemAccountsApi.getItemAccountsPage, // 查询弹窗所需分页方法
searchCondition: [{
key: 'available',
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',
sort: 'custom',
table: {
@ -151,6 +219,8 @@ export const ItemApplyDetail = useCrudSchemas(reactive<CrudSchema[]>([
precision: 6
}
},
{
label: '是否可用',
field: 'available',

Loading…
Cancel
Save