123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819 |
- import CONFIG from "@/config";
- import { iunitprice } from "@/utils/expression";
- export default function useColumns() {
- const TableColumns = [
- {
- item: { key: "puOrgName", title: "采购组织", required: true, width: 150 },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "ORG_PARAM",
- dataMapping: {
- puOrg: "code",
- puOrgName: "name",
- },
- },
- },
- {
- item: { key: "code", title: "合同编码", width: 150 },
- attr: { is: "el-input" },
- },
- {
- item: { key: "lastPuMoney",
- title: "年度采购额", width: 100 ,required: true,},
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: { key: "buyerName", title: "采购员", width: 100 },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "CONTACTS_PARAM",
- dataMapping: {
- buyer: "code",
- buyerName: "name",
- puDept: "deptId",
- puDeptName: "deptName",
- },
- },
- },
- {
- item: {
- key: "isPartya",
- title: "采购是否甲方",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-select",
- dictName: "sys_yes_no",
- },
- },
- {
- item: {
- key: "contractType",
- title: "合同类型",
- required: true,
- width: 100,
- },
- attr: { is: "el-select", dictName: "puarchase_contract_contract_type" },
- },
- {
- item: { key: "puMoneyYear", title: "合同总金额", width: 100 ,required: true,},
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: {
- key: "puDeptName",
- title: "采购部门",
- width: 100,
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "DEPT_PARAM",
- dataMapping: {
- puDept: "code",
- puDeptName: "name",
- },
- },
- },
- {
- item: {
- key: "supplierName",
- title: "供应商",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "SUPPLIER_PARAM",
- dataMapping: {
- supplier: "code",
- supplierName: "name",
- },
- },
- },
- {
- item: {
- key: "contractName",
- title: "合同名称",
- required: true,
- width: 100,
- },
- attr: { is: "el-input" },
- },
- {
- item: {
- key: "grossRateAverage",
- title: "平均毛利率 (%)",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-input-number",
- precision: 2,
- },
- },
- {
- item: {
- key: "approveFlow",
- title: "审批流程",
- required: true,
- width: 100,
- },
- attr: { is: "el-select", dictName: "puarchase_contract_approve_flow" },
- },
- {
- item: {
- key: "supplierTier",
- title: "供应商层级",
- required: true,
- width: 100,
- },
- attr: { is: "el-select", dictName: "puarchase_contract_supplier_tier" },
- },
- {
- item: {
- key: "effectiveDate",
- title: "合同生效日期",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-date-picker",
- valueFormat: "yyyy-MM-dd",
- },
- },
- {
- item: {
- key: "brandGrossRate",
- title: "同类品牌及毛利率 (%)",
- required: true,
- },
- // attr: {
- // is: "el-input-number",
- // precision: 2,
- // },
- attr: { is: "el-input", },
- },
- {
- item: {
- key: "contractFormat",
- title: "合同格式",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-select",
- dictName: "puarchase_contract_contract_format",
- },
- },
- {
- item: {
- key: "consumableClass",
- title: "耗材类别",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-select",
- dictName: "puarchase_contract_consumable_class",
- },
- },
- {
- item: {
- key: "endDate",
- title: "合同终止日期",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-date-picker",
- valueFormat: "yyyy-MM-dd",
- disabled: (prop) => !prop.effectiveDate,
- },
- },
- {
- item: {
- key: "invoiceTax",
- title: "发票税率 (%)",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "ntaxrate",
- referName: "TAX_RATE_PARAM",
- dataMapping: {
- invoiceTax: "ntaxrate",
- },
- },
- },
- {
- item: {
- key: "emergencyDegree",
- title: "紧急程度",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-select",
- dictName: "puarchase_contract_emergency_degree",
- },
- },
- {
- item: {
- key: "productName",
- title: "产品类别&名称",
- required: true,
- width: 100,
- },
- attr: { is: "el-input" },
- },
- {
- item: { key: "signDate", title: "合同签订日期", width: 100 ,required: true,},
- attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd" },
- },
- {
- item: {
- key: "deliveryType",
- title: "交货方式",
- required: true,
- width: 100,
- },
- attr: { is: "el-select", dictName: "puarchase_contract_delivery_type" },
- },
- {
- item: { key: "source", title: "合同来源", width: 100 },
- attr: { is: "el-input", value: "自制", disabled: true },
- },
- {
- item: { key: "principalManufacturers",
- title: "主要厂家", width: 100,
- required: true,
- },
- attr: { is: "el-input", },
- },
- {
- item: {
- key: "guaranteePeriodEnd",
- title: "质保期限",
- required: true,
- width: 100,
- },
- // attr: { is: "el-input-number", precision: 2 },
- attr: { is: "el-input", },
- },
- {
- item: { key: "freightMethods",
- title: "运费承担方式", width: 100 ,required: true,
- },
- attr: {
- is: "el-select",
- dictName: "puarchase_contract_freight_methods",
- },
- },
- {
- item: { key: "createTime", title: "合同创建时间", width: 100 },
- attr: { is: "el-date-picker", valueFormat: "yyyy-MM-dd",disabled:true,},
- },
- {
- item: { key: "project", title: "项目医院", required: true, width: 100 },
- attr: { is: "el-input" },
- },
- {
- item: { key: "contractPartycName", title: "合同丙方", width: 100 },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "SUPPLIER_PARAM",
- dataMapping: {
- contractPartyc: "code",
- contractPartycName: "name",
- },
- },
- },
- {
- item: {
- key: "exemptionPostageCondtion",
- title: "包邮条件",
- span: 12,
- width: 100,
- },
- attr: {
- is: "el-input",
- placeholder:
- "当运费承担方式为供应商有条件承担时,该字段必填,填写要求,写明什么条件下供应商承担全部,什么条件下我方承担,什么条件下分别承担",
- },
- },
- {
- item: {
- key: "isTarget",
- title: "是否有指标",
- required: true,
- width: 100,
- },
- attr: { is: "el-select", dictName: "sys_yes_no" },
- },
- {
- item: {
- key: "contractTarget",
- title: "合同指标",
- width: 100,
- required: (prop) => prop.isTarget === "Y",
- },
- attr: { is: "el-input", placeholder: '当【是否有指标】="有"时,必填' },
- },
- // {
- // item: { key: "", title: "交易类型", required: true, span: 12,},
- // attr: { is: "el-input" },
- // },
- {
- item: {
- key: "rollbackPolicy",
- title: "退换货政策",
- required: true,
- span: 12,
- },
- attr: { is: "el-input" },
- },
- {
- item: {
- key: "isRebate",
- title: "是否有返利",
- required: true,
- width: 100,
- },
- attr: { is: "el-select", dictName: "sys_yes_no" },
- },
- {
- item: {
- key: "rebatePolicy",
- title: "返利政策",
- span: 18,
- width: 100,
- required: (prop) => prop.isRebate === "Y",
- },
- attr: {
- is: "el-input",
- placeholder: '当【是否有返利】="有"时,必填',
- },
- },
-
- {
- item: {
- key: "contractContent",
- title: "合同主要内容",
- required: true,
- span: 24,
- width: 100,
- },
- attr: { is: "el-input", type: "textarea",rows:3, },
- },
- {
- item: { key: "enquiryCode", title: "询价单号", width: 100 },
- attr: { is: "el-input" },
- },
-
- {
- item: { key: "electronicContract", title: "电子合同", span: 6, width: 100 },
- attr: { is: "el-input" },
- },
-
- {
- item: { key: "refusalReasons", title: "拒绝理由", span: 6, width: 100 },
- attr: { is: "el-input" },
- },
- {
- item: { key: "status", title: "状态" },
- attr: {
- is: "el-select",
- dictName: "documents_status",
- disabled: true,
- value: "0",
- },
- },
-
- {
- item: { key: "externalFile", title: "附件", span: 12, width: 100 },
- attr: { is: "el-file-upload", fileType: ["pdf","doc","docx","png","jpg","xls","xlsx"] },
- },
- {
- item: {
- key: "puFile",
- title: "盖章合同附件",
- span: 12,
- width: 100,
- },
- attr: { is: "el-file-upload", fileType: ["pdf"] },
- },
- // {
- // item: {
- // key: "supplierFile",
- // title: "供应商盖章合同附件",
- // span:12,
- // width: 100,
- // },
- // attr: { is: "el-file-upload", fileType: ["pdf"] },
- // },
- // {
- // item: {
- // key: "",
- // title: "电子合同供应商附件",
- // span: 12,
- // width: 100,
- // },
- // attr: { is: "el-file-upload", fileType: ["pdf"] },
- // },
- {
- item: {
- key: "paymentAgreement",
- title: "付款协议",
- required: true,
- width: 100,
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "PAYAGREEMENT_PARAM",
- dataMapping: {
- paymentAgreement: "code",
- paymentAgreementName: "name",
- },
- },
- },
- {
- item: { key: "taxPrice", title: "价税合计", width: 100 },
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: { key: "currencyName", title: "币种", required: true, width: 100 },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "CURRENCY_PARAM",
- dataMapping: {
- currency: "code",
- currencyName: "name",
- },
- },
- },
- {
- item: { key: "guaranteePeriod", title: "质保期", width: 100 },
- attr: {
- is: "el-input-number",
- },
- },
-
-
-
- // {
- // item: { key: "externalContract", title: "外部合同号", width: 100 },
- // attr: { is: "el-input" },
- // },
-
- // {
- // item: { key: "projectCode", title: "项目编号", width: 100 },
- // attr: { is: "el-input" },
- // },
- // {
- // item: { key: "projectName", title: "项目名称", width: 100 },
- // attr: { is: "el-input" },
- // },
- // { item: { key: "area", title: "区域" }, attr: { is: "el-input" } },
- // {
- // item: { key: "consigneePhone", title: "收货人联系方式", width: 100 },
- // attr: { is: "el-input" },
- // },
-
- ].map(({ item, attr }) => ({
- attr,
- item: { ...item, hidden: true, span: item.span || 6 },
- }));
- const TabColumns = [
- {
- item: { title: "物料基本信息", key: "contractItemList" },
- attr: { value: [] },
- TableColumns: [
- {
- item: {
- title: "物料名称",
- key: "materialName",
- require: true,
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "MATERIAL_PARAM",
- dataMapping: {
- material: "code",
- materialName: "name",
- puUnit: "unitIdName",
- registration: "registrationNo",
- specification: "specification",
- manufacturer: "manufacturerIdName",
- rateCode: "materialRateName",
- },
- },
- },
- {
- item: {
- title: "物料编码",
- key: "material",
-
- },
- attr: {},
- },
- {
- item: {
- title: "规格",
- key: "specification",
- },
- attr: {},
- },
- {
- item: {
- title: "生产厂家",
- key: "manufacturer",
- },
- attr: {
- is: "el-input",
- },
- },
- {
- item: { title: "采购单位", key: "puUnit" },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "UNIT_PARAM",
- dataMapping: {
- puUnit: "name",
- },
- },
- },
- {
- item: { title: "税率%", key: "tax", require: true },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "ntaxrate",
- referName: "TAX_RATE_PARAM",
- dataMapping: {
- tax: "ntaxrate",
- },
- },
- },
- {
- item: { title: "采购数量", key: "qty" },
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: { title: "含税单价", key: "taxPrice", require: true },
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: { title: "含税金额合计", key: "taxMoney" },
- attr: {
- formatter: (prop) => {
- const { qty = 0, taxPrice = 0 } = prop;
- prop.taxMoney = qty * taxPrice * 1;
- return prop.taxMoney;
- },
- },
- },
- {
- item: { title: "无税单价", key: "taxFreePrice", require: true },
- attr: {
- formatter: (prop) => {
- const { tax = 0, taxPrice = 0 } = prop;
- return (prop.taxFreePrice = iunitprice(tax, taxPrice));
- },
- },
- },
- {
- item: { title: "无税金额合计", key: "taxFreeMoney" },
- attr: {
- formatter: (prop) => {
- const { qty = 0, tax = 0, taxPrice = 0 } = prop;
- return (prop.taxFreeMoney = qty * iunitprice(tax, taxPrice));
- },
- },
- },
- {
- item: { title: "注册证号及备案凭证号", key: "registration" },
- attr: {
- is: "el-input",
- },
- },
- {
- item: { title: "收货客户", key: "customerName" },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "CUSTOMER_PARAM",
- dataMapping: {
- customer: "code",
- customerName: "name",
- },
- },
- },
- ],
- },
- {
- item: { title: "合同条款", key: "contractClauseList" },
- attr: {
- value: [],
- },
- TableColumns: [
- {
- item: { title: "条款编码", key: "code", width: "auto" },
- attr: { is: "el-input" },
- },
- {
- item: { title: "条款名称", key: "name", width: "auto" },
- attr: { is: "el-input" },
- },
- {
- item: { title: "条款内容", key: "content", width: "auto" },
- attr: { is: "el-input" },
- },
- {
- item: { title: "变量序号", key: "variableRowno", width: "auto" },
- attr: { is: "el-input" },
- },
- {
- item: { title: "变量内容", key: "variableContent", width: "auto" },
- attr: { is: "el-input" },
- },
- ],
- },
- {
- item: { title: "合同费用", key: "contractExpenseList" },
- attr: {
- value: [],
- },
- TableColumns: [
- {
- item: { title: "费用编码", key: "code", width: "auto" },
- attr: { is: "el-input" },
- },
- {
- item: { title: "费用名称", key: "name", width: "auto" },
- attr: { is: "el-input" },
- },
- {
- item: { title: "费用金额", key: "money", width: "auto" },
- attr: { is: "el-input-number" },
- },
- ],
- },
- {
- item: { title: "付款协议信息", key: "contractAgreementList" },
- attr: {
- value: [],
- },
- TableColumns: [
- {
- item: { title: "付款阶段", key: "satge" },
- attr: { is: "el-input-number" },
- },
- {
- item: {
- title: "付款起点",
- key: "origin",
- require: true,
- },
- attr: {
- is: "el-select",
- dictName: "puarchase_contract_origin",
- },
- },
- {
- item: { title: "账期天数", key: "paymetDays", require: true },
- attr: {
- is: "el-input-number",
- precision: 2,
- },
- },
- {
- item: { title: "付款比例%", key: "ratio", require: true },
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: { title: "付款金额", key: "money" },
- attr: {
- is: "el-input-number",
- },
- },
- {
- item: {
- title: "是否预付款",
- key: "isAdvance",
- },
- attr: {
- is: "el-select",
- dictName: "sys_yes_no",
- },
- },
- {
- item: {
- title: "是否质保金",
- key: "isQuality",
- },
- attr: {
- is: "el-select",
- dictName: "sys_yes_no",
- },
- },
- {
- item: {
- title: "结算方式",
- key: "paymentMeans",
- require: true,
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "BALATYPE_PARAM",
- dataMapping: {
- paymentMeans: "name",
- },
- },
- },
- {
- item: {
- title: "需进度确认",
- key: "schedule",
- },
- attr: {
- is: "el-select",
- dictName: "sys_yes_no",
- },
- },
- ],
- },
- {
- item: { title: "合同执行组织范围", key: "contractApplyOrgList" },
- attr: { value: [] },
- TableColumns: [
- {
- item: {
- title: "组织名称",
- key: "orgName",
- width: "auto",
- },
- attr: {
- is: "el-popover-select-v2",
- valueKey: "name",
- referName: "ORG_PARAM",
- dataMapping: {
- org: "code",
- orgName: "name",
- },
- },
- },
- { item: { title: "组织编码", key: "org", width: "auto" }, attr: {} },
- ],
- },
- ].map(({ item, attr, TableColumns }) => ({
- attr,
- item,
- TableColumns: TableColumns.map(({ item, attr }) => ({
- attr,
- item: { ...item, hidden: true },
- })),
- }));
- return { TableColumns, TabColumns };
- }
|