const pickerOptions = { disabledDate(time) { return time.getTime() > Date.now(); }, shortcuts: [ { text: "今天", onClick(picker) { picker.$emit("pick", new Date()); }, }, { text: "昨天", onClick(picker) { const date = new Date(); date.setTime(date.getTime() - 3600 * 1000 * 24); picker.$emit("pick", date); }, }, { text: "一周前", onClick(picker) { const date = new Date(); date.setTime(date.getTime() - 3600 * 1000 * 24 * 7); picker.$emit("pick", date); }, }, ], }; const columns = [ { title: "采购组织", key: "puOrg", type: "InputDialog", value: [], required: true, }, { title: "需求来源", key: "source", type: "Input", value: "采购创建" }, { title: "采购员", key: "buyer", value: [], type: "InputDialog" }, { title: "交易类型", key: "billYpe", value: [], type: "InputDialog" }, { title: "物料编码", key: "material", type: "Input", required: true }, { title: "物料名称", key: "materialName", type: "InputDialog", value: [], required: true, }, { title: "物料/物料描述", key: "materialDesc", type: "InputDialog", value: [], required: true, }, { title: "生产厂家", key: "manufacturer", type: "Input" }, { title: "收货客户", key: "customer", type: "InputDialog", value: [] }, { title: "采购单位", key: "puUnit", type: "InputDialog", value: [], required: true, }, { title: "采购数量", key: "puQty", type: "InputNumber", required: true, }, { title: "需求时间", key: "demandDate", type: "DatePicker", config: { type: "date", pickerOptions: pickerOptions }, }, { title: "项目名称", key: "projectName", type: "InputDialog", value: [] }, { title: "需求人", key: "demandPersonal", type: "InputDialog", value: [] }, { title: "需求组织", key: "demandOrg", type: "InputDialog", value: [], require: true, }, { title: "需求部门", key: "demandDept", type: "InputDialog", value: [] }, { title: "建议供应商", key: "supplier", type: "InputDialog", value: [] }, { title: "收货人", key: "a", type: "InputDialog", value: [] }, { title: "收货组织", key: "b", type: "InputDialog", value: [] }, { title: "收货人联系方式", key: "c", type: "Input" }, { title: "收货地址", key: "d", type: "Input" }, { title: "收货仓库", key: "e", type: "InputDialog", value: [] }, { title: "指定供应商", key: "assignSupplier", type: "InputDialog", value: [], }, { title: "单位", key: "unit", type: "InputDialog", value: [] }, { title: "收货地址", key: "f", type: "InputDialog", value: [] }, ]; export const initColumns = () => columns;