SOURCE

/* --------------- 一些默认参数 ------------- */
// 字段名称、标识、必填项、唯一项
const verifyKeys = [
    {
        name: "SerialNumber",
        key: "serialnumber",
        isRequired: false,
        isOnly: false
    },
    {
        name: "AssetTag",
        key: "assettag",
        isRequired: false,
        isOnly: false
    },
    {
        name: "Class",
        key: "class",
        isRequired: false,
        isOnly: false
    },
    {
        name: "Type",
        key: "type",
        isRequired: false,
        isOnly: false
    },
    {
        name: "Model",
        key: "model",
        isRequired: false,
        isOnly: false
    },
    {
        name: "Config",
        key: "config",
        isRequired: false,
        isOnly: false
    },
    {
        name: "PhoneNumber",
        key: "phonenumber",
        isRequired: false,
        isOnly: false
    },
    {
        name: "BU Stock",
        key: "bu_stock",
        isRequired: false,
        isOnly: false
    },
    {
        name: "BU SAP",
        key: "bu_sap",
        isRequired: false,
        isOnly: false
    },

    {
        name: "SAPNumber",
        key: "sapnumber",
        isRequired: false,
        isOnly: false
    },
    {
        name: "Procurement PONumber",
        key: "procurementponumber",
        isRequired: false,
        isOnly: false
    },
    {
        name: "StoreID",
        key: "storeID",
         isRequired: false,
        isOnly: false
    },
    {
        name: "StoreName",
        key: "storeName",
         isRequired: false,
        isOnly: false
    },
    {
        name: "StoreManager",
        key: "storemanager",
         isRequired: false,
        isOnly: false
    },
    {
        name: "CallCenter",
        key: "callcenter",
         isRequired: false,
        isOnly: false
    },
    {
        name: "ChangeReason",
        key: "changereason",
         isRequired: false,
        isOnly: false
    },
    {
        name: "ChangeDate",
        key: "changedate",
         isRequired: false,
        isOnly: false
    },
    {
        name: "DeliveryDate",
        key: "deliverydate",
         isRequired: false,
        isOnly: false
    },
    {
        name: "VendorRole",
        key: "vendorrole",
         isRequired: false,
        isOnly: false
    },
    {
        name: "ApproveID",
        key: "approveid",
         isRequired: false,
        isOnly: false
    },
    {
        name: "RepairVendor",
        key: "repairvendor",
         isRequired: false,
        isOnly: false
    },
    {
        name: "SupplierVendor",
        key: "suppliervendor",
         isRequired: false,
        isOnly: false
    },
    {
        name: "KittingCenter",
        key: "kittingcenter",
         isRequired: false,
        isOnly: false
    },
    {
        name: "On-siteVendor",
        key: "onsitevendor",
         isRequired: false,
        isOnly: false
    }
]

console.log(verifyKeys.length)

const submitObj = {
    assettag: "",
    serialnumber: "",
    class: "",
    type: "",
    model: "",
    config: "",
    phonenumber: "",
    bu_sap: "",
    bu_stock: "",
    sapnumber: "",
    procurementponumber: "",
    changereason: "",
    callcenter: "",
    repairvendor: "",
    suppliervendor: "",
    kittingcenter: "",
    onsitevendor: "",
    devicestatus: "",
    storeID: "",
    storeName: "",
    storemanager: "",
    code: "",
    deliverydate: "",
    changedate: "",
    vendorrole: "",
    approveid: ""
}
console.log(Object.keys(submitObj).length)

const vfKeys = [...new Set(verifyKeys.map(item => item.key))]
const subKeys = Object.keys(submitObj)

let noDup = []
subKeys.map(item =>{
    if(!vfKeys.includes(item)){
        noDup.push(item)
    }
})

console.log(noDup)
console 命令行工具 X clear

                    
>
console