Browse Source

物料管理

master
songguoqiang 1 year ago
parent
commit
edf5c654d1
  1. 1
      src/views/spc/itembasic/index.vue
  2. 150
      src/views/spc/itembasic/itembasic.data.ts

1
src/views/spc/itembasic/index.vue

@ -140,6 +140,7 @@ const butttondata = [
const buttonTableClick = async (val, row) => {
console.info(row)
if (val == 'edit') { //
console.info("编辑",row)
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)

150
src/views/spc/itembasic/itembasic.data.ts

@ -54,10 +54,11 @@ export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
},
},
{
label: '名称',
label: '物料名称',
field: 'name',
sort: 'custom',
isSearch: true,
isTable:true,
},
{
label: '颜色',
@ -66,86 +67,19 @@ export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
dictType: DICT_TYPE.ITEM_COLOR,
dictClass: 'string',
isTable: true,
// table: {
// width: 100
// } ,
form: {
component: 'Select',
componentProps: {
// inactiveValue: 'DISABLE',
// activeValue: 'ENABLE',
}
},
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
dictType: DICT_TYPE.TRUE_FALSE,
dictClass: 'string',
isTable: true,
table: {
width: 120
},
form: {
component: 'Switch',
value: 'TRUE',
componentProps: {
inactiveValue: 'FALSE',
activeValue: 'TRUE'
}
},
},
// {
// label: '生效时间',
// field: 'activeTime',
// sort: 'custom',
// isTable: true,
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// table: {
// width: 180
// } ,
// form: {
// component: 'DatePicker',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// }
// },
// // tableForm:{
// // width: 200,
// // type:'FormDateTime',
// // }
// },
// {
// label: '失效时间',
// field: 'expireTime',
// sort: 'custom',
// isTable: true,
// formatter: dateFormatter,
// detail: {
// dateFormat: 'YYYY-MM-DD HH:mm:ss'
// },
// table: {
// width: 180
// } ,
width: 100
} ,
// form: {
// component: 'DatePicker',
// component: 'Select',
// componentProps: {
// style: {width:'100%'},
// type: 'datetime',
// dateFormat: 'YYYY-MM-DD HH:mm:ss',
// valueFormat: 'x',
// // inactiveValue: 'DISABLE',
// // activeValue: 'ENABLE',
// }
// },
// },
},
{
label: '创建时间',
field: 'createTime',
@ -190,73 +124,13 @@ export const Itembasic = useCrudSchemas(reactive<CrudSchema[]>([
// 表单校验
export const rules = reactive({
code: [
{ required: true, message: '请输入代码', trigger: 'blur' }
{ required: true, message: '请输入物料', trigger: 'blur' }
],
name: [
{ required: true, message: '请输入名称', trigger: 'blur' }
{ required: true, message: '请输入物料', trigger: 'blur' }
],
projcetCode: [
{ required: true, message: '请选择项目编码', trigger: 'change' }
],
// uom: [
// { required: true, message: '请选择计量单位', trigger: 'change' }
// ],
// altUom: [
// { required: true, message: '请选择替代计量单位', trigger: 'change' }
// ],
// isStdPack: [
// { required: true, message: '请选择是否标包', trigger: 'change' }
// ],
// enableBuy: [
// { required: true, message: '请选择是否可采购', trigger: 'change' }
// ],
// enableMake: [
// { required: true, message: '请选择是否可制造', trigger: 'change' }
// ],
// enableOutsourcing: [
// { required: true, message: '请选择是否可委外加工', trigger: 'change' }
// ],
// isRecycled: [
// { required: true, message: '请选择回收件', trigger: 'change' }
// ],
// isPhantom: [
// { required: true, message: '请选择虚零件', trigger: 'change' }
// ],
// abcClass: [
// { required: true, message: '请选择ABC类', trigger: 'change' }
// ],
// type: [
// { required: true, message: '请选择类型', trigger: 'change' }
// ],
// category: [
// { required: true, message: '请选择种类', trigger: 'change' }
// ],
// itemGroup: [
// { required: true, message: '请选择分组', trigger: 'change' }
// ],
// color: [
// { required: true, message: '请选择颜色', trigger: 'change' }
// ],
// configuration: [
// { required: true, message: '请选择配置', trigger: 'change' }
// ],
// project: [
// { required: true, message: '请输入项目', trigger: 'blur' }
// ],
// eqLevel: [
// { required: true, message: '请选择质量等级', trigger: 'change' }
// ],
// validityDays: [
// { required: true, message: '请输入有效天数', trigger: 'change' }
// ],
// available: [
// { required: true, message: '请选择是否可用', trigger: 'change' }
// ],
// activeTime: [
// { required: true, message: '请输入生效时间', trigger: 'change' }
// ],
// expireTime: [
// { required: true, message: '请输入失效时间', trigger: 'change' }
})
Loading…
Cancel
Save