123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- export default function useColumns() {
- const TableColumns = [
- {
- item: { key: "code", title: "需求单号", width: 150 },
- attr: {}
- },
- {
- item: { key: "demandDate", title: "需求日期", width: 150 },
- attr: {}
- },
- {
- item: { key: "createTime", title: "制单日期", width: 150 },
- attr: {}
- },
- {
- item: { key: "planType", title: "需求计划", width: 150 },
- attr: { is: "el-dict-tag", dictName: "sys_plan_type" }
- },
- {
- item: { key: "approverFinishTime", title: "审批结束日期", width: 150 },
- attr: {}
- },
- {
- item: { key: "status", title: "单据状态", width: 150 },
- attr: { is: "el-dict-tag", dictName: "sys_status" }
- },
- {
- item: { key: "billType", title: "业务类型", width: 150 },
- attr: { is: "el-dict-tag", dictName: "sys_business" }
- },
- {
- item: { key: "demandPersonalName", title: "需求人员", width: 150 },
- attr: {}
- },
- {
- item: { key: "customerName", title: "需求客户", width: 150 },
- attr: {}
- },
- {
- item: { key: "demandDeptName", title: "需求部门", width: 150 },
- attr: {}
- },
- {
- item: { key: "source", title: "单据来源", width: 150 },
- attr: { is: "el-dict-tag", dictName: "sys_bill_source" }
- },
- {
- item: { key: "approveUser", title: "当前审批人", width: 150 },
- attr: {}
- },
- {
- item: { key: "remark", title: "备注", width: 150 },
- attr: {}
- },
- ].map(({ item, attr }) => ({
- attr,
- item: {
- ...item,
- width: item.width || 160,
- sortabled: true,
- fixedabled: true,
- filterabled: true,
- hiddenabled: true,
- },
- }));
- const SearchColumns = [
- {
- item: { key: "code", title: "需求单号" },
- attr: {
- is: "el-input",
- clearable: true,
- },
- },
- {
- item: { key: "customerName", title: "需求客户" },
- attr: {
- is: "el-popover-select-v2",
- referName: "CUSTOMER_PARAM",
- valueKey: "name",
- dataMapping: {
- customer: "id",
- customerName: "name"
- },
- },
- },
- {
- item: { key: "isCustomerSpecified", title: "是否客户指定" },
- attr: {
- is: "el-select",
- dictName: "sys_yes_no",
- clearable: true,
- },
- },
- {
- item: { key: "demandPersonalName", title: "需求人员" },
- attr: {
- is: "el-popover-select-v2",
- referName: "CONTACTS_PARAM",
- valueKey: "name",
- dataMapping: {
- demandPersonal: "code",
- demandPersonalName: "name"
- },
- },
- },
- {
- item: { key: "source", title: "单据来源" },
- attr: {
- is: "el-select",
- dictName: "sys_bill_source",
- clearable: true,
- },
- },
- {
- item: { key: "billType", title: "业务类型" },
- attr: {
- is: "el-select",
- dictName: "sys_business",
- clearable: true,
- },
- },
- {
- item: { key: "demandDeptName", title: "需求部门" },
- attr: {
- is: "el-popover-select-v2",
- referName: "DEPT_PARAM",
- valueKey: "name",
- dataMapping: {
- demandDept: "id",
- demandDeptName: "name"
- },
- },
- },
- {
- item: { width: 100, key: "demandDate", title: "需求日期", },
- attr: {
- clearable: true,
- is: "el-date-picker",
- type: "date",
- valueFormat: "yyyy-MM-dd",
- },
- },
- {
- item: { key: "materialCode", title: "物料编码" },
- attr: {
- is: "el-input",
- clearable: true,
- },
- },
- {
- item: { key: "status", title: "单据状态" },
- attr: {
- is: "el-select",
- dictName: "sys_status",
- clearable: true,
- },
- },
- {
- item: { key: "planType", title: "需求计划" },
- attr: {
- is: "el-select",
- dictName: "sys_plan_type",
- clearable: true,
- },
- },
- {
- item: { width: 100, key: "createTimeString", title: "制单日期", },
- attr: {
- clearable: true,
- is: "el-date-picker",
- type: "date",
- valueFormat: "yyyy-MM-dd",
- },
- },
- {
- item: { key: "additionalSupplierName", title: "补单供应商" },
- attr: {
- is: "el-popover-select-v2",
- referName: "SUPPLIER_PARAM",
- valueKey: "name",
- dataMapping: {
- additionalSupplier: "id",
- additionalSupplierName: "name"
- },
- },
- },
- ];
- return { TableColumns, SearchColumns }
- }
|