123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325 |
- export default function useColumns() {
- const TableColumns = [
- { item: { key: "code", title: "订单生成单号",width :160 }, attr: {} },
- {
- item: { key: "status", title: "状态" ,width :100},
- attr: {
- is: "el-dict-tag",
- dictName: "purchase_task_status",
- },
- },
- {
- item: { key: "existPrice", title: "是否有价格",width :100 },
- attr: { is: "el-dict-tag", dictName: "sys_true_false" },
- },
- { item: { key: "demandCode", title: "需求单号",width :150 }, attr: {} },
- { item: { key: "materialName", title: "物料",width :150 }, attr: {} },
- {
- item: { key: "materialCode", title: "物料编码",width :150 },
- attr: {},
- },
- {
- item: { key: "materialDesc", title: "物料描述",width :100 },
- attr: {},
- },
- {
- item: { key: "manufacturerName", title: "生产厂家" ,width :100},
- attr: {},
- },
- { item: { key: "puQty", title: "采购数量",width :100 }, attr: {} },
- {
- item: { key: "executeQty", title: "已执行数量" ,width :100},
- attr: {},
- },
- {
- item: { key: "residueQty", title: "未执行数量",width :100 },
- attr: {},
- },
- {
- item: { key: "priceType", title: "价格类型" ,width :100},
- attr: { is: "el-dict-tag", dictName: "sys_price_type" },
- },
- { item: { key: "puUnitName", title: "采购单位",width :100 }, attr: {} },
- { item: { key: "buyerName", title: "采购员",width :100 }, attr: {} },
- {
- item: { key: "supplierName", title: "建议供应商",width :100 },
- attr: {},
- },
- { item: { key: "puOrgName", title: "采购组织",width :100 }, attr: {} },
- { item: { key: "currencyName", title: "币种",width :100 }, attr: {} },
- { item: { key: "source", title: "需求单号" ,width :100}, attr: {} },
- {
- item: { key: "customerName", title: "收货客户",width :100 },
- attr: {},
- },
- {
- item: { key: "assignSupplierName", title: "指定供应商" ,width :100},
- attr: {},
- },
- { item: { key: "demandDate", title: "需求时间",width :100 }, attr: {} },
- { item: { key: "projectName", title: "项目名称",width :100 }, attr: {} },
- {
- item: { key: "demandPersonalName", title: "需求人",width :100 },
- attr: {},
- },
- {
- item: { key: "demandOrgName", title: "需求组织" ,width :100},
- attr: {},
- },
- {
- item: { key: "demandDeptName", title: "需求部门",width :100 },
- attr: {},
- },
- {
- item: { key: "isBack", title: "是否退回",width :100 },
- attr: { is: "el-dict-tag", dictName: "sys_yes_no" ,width :100},
- },
- { item: { key: "baskCause", title: "退回原因" ,width :100}, attr: {} },
- { item: { key: "backDate", title: "退回日期",width :100 }, attr: {} },
- { item: { key: "unitName", title: "单位" ,width :100}, attr: {} },
- ].map(({ item, attr }) => ({
- attr,
- item: {
- ...item,
- sortabled: true,
- fixedabled: true,
- filterabled: true,
- hiddenabled: true,
- },
- }));
- const SearchColumns = [
- {
- item: {
- key: "classIds",
- title: "物料分类",
- },
- attr: {
- is: "el-popover-multiple-tree-select",
- referName: "MATERIALCLASSIFY_PARAM",
- valueKey: "id",
- },
- },
- {
- item: {
- key: "materialCodes",
- title: "物料编码",
- },
- attr: {
- is: "el-popover-multiple-select-v2",
- valueKey: "code",
- referName: "MATERIAL_PARAM",
- },
- },
- {
- item: {
- key: "existPrice",
- title: "是否有价格",
- },
- attr: {
- is: "el-select",
- dictName: "sys_true_false" ,
- clearable: true,
- },
- },
- // {
- // item: {
- // key: "materialDesc",
- // title: "物料描述",
- // },
- // attr: {
- // is: "el-input",
- // },
- // },
- {
- item: {
- key: "code",
- title: "单据号",
- },
- attr: {
- is: "el-input",
- },
- },
- {
- item: {
- key: "puOrgIds",
- title: "采购组织",
- },
- attr: {
- is: "el-popover-multiple-select-v2",
- referName: "ORG_PARAM",
- valueKey: "id",
- },
- },
- {
- item: {
- // key: "status",
- key: "statusList",
- title: "状态",
- },
- attr: {
- is: "el-select",
- multiple:true,
- collapseTags:true,
- dictName: "purchase_task_status",
- clearable: true,
- },
- },
- {
- item: {
- key: "date",
- title: "创建时间",
- },
- attr: {
- is: "el-date-picker",
- type: "daterange",
- unlinkPanels: true,
- rangeSeparator: "至",
- valueFormat: "yyyy-MM-dd",
- endPlaceholder: "结束日期",
- startPlaceholder: "开始日期",
- pickerOptions: pickerOptions,
- value: [],
- },
- },
- {
- item: {
- key: "buyers",
- title: "采购员",
- },
- attr: {
- is: "el-popover-multiple-select-v2",
- referName: "CONTACTS_PARAM",
- valueKey: "code",
- },
- },
- {
- item: {
- key: "manufacturerName",
- title: "生产厂家",
- },
- attr: {
- is: "el-input",
- },
- },
- {
- item: {
- key: "customerName",
- title: "收货客户",
- },
- attr: {
- is: "el-popover-select-v2",
- referName: "CUSTOMERDEPT_PARAM",
- valueKey: "name",
- },
- },
- // {
- // item: {
- // key: "",
- // title: "紧急标识",
- // },
- // attr: {
- // is: "el-select",
- // dictName: "sys_yes_no"
- // },
- // },
- // {
- // item: {
- // key: "",
- // title: "补单标识",
- // },
- // attr: {
- // is: "el-select",
- // dictName: "sys_yes_no"
- // },
- // },
- {
- item: {
- key: "documentsCodes",
- title: "采购需求单号",
- span: 12,
- },
- attr: {
- is: "el-input",
- placeholder: "请输入来源单据号,多个用,分隔",
- },
- },
- {
- item: {
- key: "materialCodes",
- title: "物料编码",
- span: 12,
- },
- attr: {
- is: "el-input",
- placeholder: "请输入物料编码,多个用,分隔",
- },
- },
- ].map(({ item, attr }) => ({
- attr,
- item: { ...item, hidden: true, span: item.span || 6 },
- }));
- const pickerOptions = {
- shortcuts: [
- {
- text: "昨天",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近三天",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 3);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近一周",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近一个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近三个月",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
- picker.$emit("pick", [start, end]);
- },
- },
- {
- text: "最近半年",
- onClick(picker) {
- const end = new Date();
- const start = new Date();
- start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
- picker.$emit("pick", [start, end]);
- },
- },
- ],
- };
- return { TableColumns, SearchColumns };
- }
|