export const setDetailsData = (dataStore: any, data: any) => {
    //组织
    if (data?.orgs?.length) {
        data?.orgs?.forEach((item: any) => {
            dataStore.ruleForm.org_number.push(item.org_number);
        });
    }
    //客户
    let customers_names: any = [];
    if (data?.customers?.length) {
        data?.customers?.forEach((item: any) => {
            //客户编码
            dataStore.ruleForm.customers.push(item.customer_number);
            //客户名称下拉框数据初始化
            customers_names.push({
                value: item.customer_number,
                label: item.customer_name,
                org_number: "100"
            });
        });
        //客户名称值回填
        dataStore.ruleForm.customer_number = dataStore.ruleForm.customers;
        //客户名称下拉框数据
        dataStore.formData[1].options = customers_names;
    }
    let productLines: any[] = [];
    //品线
    if (data?.product_lines?.length) {
        data?.product_lines?.forEach((item: any) => {
            productLines.push({
                value: item,
                label: item
            });
        });
        //客户名称值回填
        dataStore.ruleForm.product_lines = data?.product_lines;
        //客户名称下拉框数据
        dataStore.formData[3].options = productLines;
    }
    //订阅账号
    if (data?.subscriber_dduid && data?.subscriber_name) {
        //订阅账号下拉框数据
        dataStore.formData[4].options = [
            {
                value: data?.subscriber_dduid,
                label: data?.subscriber_mobile ? data?.subscriber_name + " " + data?.subscriber_mobile : data?.subscriber_name
            }
        ];
        dataStore.ruleForm.subscriber_dduid = data?.subscriber_dduid;
    }
};
